Asterisk cmd SetCIDNum
Synopsis:
Set CallerID NumberDescription:
Set(CALLERID(number)=<number>) (for Asterisk >= v1.2.x)SetCIDNum(<number>[|a]) (for Asterisk <= v1.0.x)
Set Caller*ID Number on a call to a new value, while preserving the original Caller*ID name. This is useful for providing additional information to the called party. Sets ANI as well if "a" flag is used. In order to set ANI with Asterisk >= v.1.2.x you will have to use Set(CALLERID(ANI)=<number>).
Examples:
Set(CALLERID(number)=6135551234) (for Asterisk >= v1.2.x)
SetCIDNum(6135551234) (for Asterisk <= v1.0.x)
Any examples would be apreciated:
See also
- Asterisk cmd SetCIDName
- Asterisk cmd SetCallerID: Set both caller ID name and number
- The Caller ID FAQ
Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ

Comments
333SetCIDNum should work as I expected?
I have the following configuration in my extensions.conf.
exten => 1041,1,GotoIf($"${CALLERIDNAME}" == ""?2:3)
exten => 1041,2,SetCIDName(Outside Caller)
exten => 1041,3,GotoIf($"${CALLERIDNUM}" == ""?4:5)
exten => 1041,4,SetCIDNum(Unknown Number)
exten => 1041,5,Dial(SIP/1041,20)
exten => 1041,6,VoiceMail(u1041)
exten => 1041,7,Hangup
exten => 1041,102,VoiceMail(b1041)
exten => 1041,103,Hangup
But when I call this extension 1041 asterisk sends the following SIP packet:
INVITE sip:1041@192.168.0.136 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.101:5060;branch=z9hG4bK647e6a9c;rport
From: "Outside Caller" <sip:asterisk@192.168.0.101>;tag=as6284bafa
To: <sip:1041@192.168.0.136>
Contact: <sip:asterisk@192.168.0.101>
Call-ID: 321917b21ae1f9dd59527a8a5777aee7@192.168.0.101
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Date: Wed, 28 Sep 2005 18:16:58 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Content-Type: application/sdp
Content-Length: 265
v=0
o=root 21488 21488 IN IP4 192.168.0.101
s=session
c=IN IP4 192.168.0.101
t=0 0
m=audio 18178 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
causing the caller's number to display "asterisk" instead. My intention was to display the string "Unknown Number". I am using asterisk from CVS-HEAD-10/07/04-13:01:21. Does anyone have the same problem or know if there was an issue with this version of asterisk? Any help regarding this is really appreciated.
This behaviour also is observed in Asterisk CVS-Nv1-2-0-beta1 version.
Note: From the caller ID FAQ (http://www.ainslie.org.uk/callerid/cli_faq.htm#Q_15) is says that one cannot fake the caller's number.
333Set cid on particular zap channel