[Asterisk-Users] how to set caller id?

bbench at mail.bg bbench at mail.bg
Mon Jan 23 00:24:13 MST 2006


On Monday 23 January 2006 06:03, Ronald Wiplinger wrote:
> C F wrote:
> > The one you demonstrate should have *never* worked.
>
> well, it did,  ....
>
> > Pre 1.2 you do:
> > exten => s,1,SetCIDNUM(12345789)
> > Post 1.2 you do:
> > exten => s,1,Set(CALLERID(num)=123456789)
>
> I need to get the callers phone number there!
> How can I do it now?
>
> exten => _91NXXNXXXXXX,3,NoOp(SetCallerID(${username}))
>
> exten =>
> _91NXXNXXXXXX,4,DeadAGI(astcc.agi,${CALLERIDNUM},${EXTEN:${TRUNKMSD}},${TAR
>IFF})
Hi, I had similar problem and Tony Mountifield gave me the idea 
"If you want your script to be compatible with both 1.0 and 1.2, try
something like this:
$calleridname = $input{calleridname} || (($input{callerid} =~ /"(.*)"/) ? $1
: "unknown");
$callerid = ($input{callerid} =~ /<(.*)>/) ? $1 : $input{callerid};"

So I did put the first line in astcc.agi as:
my $callerid = $input{calleridname} || (($input{callerid} =~ /"(.*)"/) ? $1 : 
"unknown");
and then:
exten => _1NXXNXXXXXX,1,Set(CALLERID(all)="${CALLERIDNAME}" - ${CALLERIDNUM})
exten => _1NXXNXXXXXX,2,DeadAGI(astcc.agi,${CALLERIDNUM},${EXTEN},4)
.......
Worked for me, hope it gives you a clue.
benchev



More information about the asterisk-users mailing list