[Asterisk-Users] Setting SIP username for CallerID
Joel Newkirk
asterisk-user at newkirk.us
Wed Apr 20 17:45:07 MST 2005
Gavin Hamill wrote:
> Hi :)
>
> When I send an incoming call to a queue, I'm doing this:
>
> exten => 6608140,1,SetCallerID(CCUK)
> exten => 6608140,2,SetCIDName(CCUK)
> exten => 6608140,3,Queue(ccuk,r)
>
> I want the phone to say 'CCUK' - the queue name is more important to know than
> the incoming Caller ID :)
>
> Unfortunately the SIP phone (a cheapy using the PA168S chip and 1.42 firmware)
> displays the caller ID of "asterisk" when I do this, and it's clear why:
I've been successful with the following in a macro:
; our PSTN just gives us single-letter abbrevs for these - so expand
exten => s,1,GotoIf($["${ARG2}" = "P"]?2:3)
exten => s,2,setvar(ORIGCID=ID BLOCKED)
exten => s,3,GotoIf($["${ARG2}" = "O"]?4:5)
exten => s,4,setvar(ORIGCID=OUT OF AREA)
exten => s/8565551212,5,SetCIDName(${ARG1}-Firewalldude)
exten => s/9105551212,5,SetCIDName(${ARG1}-grumpy-sob )
exten => s,5,SetCIDName(${ARG1}-${ORIGCID})
I call the macro like:
exten => line2,1,Answer()
exten => line2,n,SetVar(ORIGCID=${CALLERIDNAME})
exten => line2,n,Macro(CID-mods,DS2,${CALLERIDNAME})
exten => line2,n,goto(DSSmainmenu,s,1)
in the incoming call context when the call first comes in, so that if
they dial straight to an extension, it has prepended an identifier (DS2
in this case) to their name which lets us know which PSTN line they've
called in on. Then, when they reach a point in the menu of being placed
on hold awaiting a pickup, I call the macro again with:
exten => s,1,Macro(CID-mods,DSEC,${ORIGCID})
(just before I call dial()) which then replaces the 'DS2' with 'DSEC'
(if they selected 'security' from the menu). 90% of the CID-mods macro
is actually logic changing to custom CID names for predetermined
callerID numbers, letting me assign CID 'nicknames' to any PSTN phone
numbers.
j
More information about the asterisk-users
mailing list