[asterisk-users] Problems Overwriting CallerID with True ANI

Kevin Bockman asterisk at wunderkin.com
Sat Nov 4 08:05:41 MST 2006


Response inline.

Steve Totaro wrote:
> I receive calls over a T1 with callerid and then *ani*dnis*.  I am able 
> to strip out the ani and the dnis in the dialplan but when I try to set 
> the caller ID to be the ani, it looks ok but then if I do a NoOp 
> callerid on the next line, I get unknown.
> 
> Here is the section of my dialplan:
> exten => _*NXXNXXXXXX*NXXNXXXXXX*,1,Set(ANI=${EXTEN})
> exten => _*NXXNXXXXXX*NXXNXXXXXX*,2,Set(__ANI=${CUT(ANI,*,2)})
Why don't you just do that in one line?

> exten => _*NXXNXXXXXX*NXXNXXXXXX*,3,Set(DNIS=${EXTEN})
> exten => _*NXXNXXXXXX*NXXNXXXXXX*,4,Set(__DNIS=${CUT(EXTEN,*,3)})
And this?

> exten => _*NXXNXXXXXX*NXXNXXXXXX*,5,SetVar(__TransferToExt=6101)
Use Set.

> exten => _*NXXNXXXXXX*NXXNXXXXXX*,6,Set(__CALLERID(name)=${ANI})
> exten => _*NXXNXXXXXX*NXXNXXXXXX*,7,Set(__CALLERID(number)=${ANI})
I'm not sure what would actually be getting set here.  CALLERID() is a 
function, not a variable (which you use the _s for).

Set(CALLERID(name)=${ANI})
Set(CALLERID(num)=${ANI)} num, not number.

> exten => _*NXXNXXXXXX*NXXNXXXXXX*,8,NoOP(${CALLERID})
You need to do NoOp(${CALLERID(all)}) or CALLERID(num) or CALLERID(name) 
or something.  'show function CALLERID'.

> exten => _*NXXNXXXXXX*NXXNXXXXXX*,9,Goto(DNIS,${DNIS},1)
> 
> [DNIS]
> exten => _NXXNXXXXXX,1,AGI(agi://172.16.1.135)
> exten => _NXXNXXXXXX,2,Setvar(__ActiveCallID=${ActiveCallID})
Use Set instead of SetVar.  You can probably get rid of this line anyway 
by setting the variable in your AGI itself to __ActiveCallID.

> exten => _NXXNXXXXXX,3,Goto(ext-queues,${TransferToExt},1)
> exten => _NXXNXXXXXX,104,Goto(ext-queues,6004,1)
> exten => h,1,DeadAGI(agi://172.16.1.135:4574)


Kevin


More information about the asterisk-users mailing list