[Asterisk-Users] Displaying incoming e.164 callers number - how?

Erik Versaevel erik at infopact.nl
Tue Jan 4 07:34:25 MST 2005


Mark Elkins wrote:

>On Tue, 2005-01-04 at 15:45 +0200, Mark Elkins wrote:
>  
>
>>On Tue, 2005-01-04 at 15:20 +0200, Mark Elkins wrote:
>>    
>>
>>>I've got asterisk able to make and receive calls via the Internet via
>>>E164 lookups. If I get such a call - I'd like to display the original
>>>      
>>>
>
>  
>
>>Playing with myself again.... - that is - I called myself - and
>>got the caller ID of '27128070590'... not quite what I wanted...
>>
>>In my extensions - I have...
>>[fromaix]
>>exten => 27128070590,1,Goto(default,s,1)
>>    
>>
>
>And again - changed the above to...
>[fromaix]
>exten => 27128070590,1,GotoIf($[${CALLERIDNUM:0:2} = 27]?2:4)
>exten => 27128070590,2,SetGlobalVar(CALLERIDNUM=0${CALLERIDNUM:2})
>exten => 27128070590,3,Goto(default,s,1)
>exten => 27128070590,4,SetGlobalVar(CALLERIDNUM=09${CALLERIDNUM})
>exten => 27128070590,5,Goto(default,s,1)
>
>Default section looks like...
>[default]               ; what people will get when they call me.
>exten => s,1,NoOp(CALLER=${CALLERIDNUM})
>exten => s,2,Answer()
>
>Logic flow is meant to be..
>1 - if CallerIDNum starts with '27' - goto line 2 - else goto line 4
>2 - Remove the first two digits off the CallerIDNum, replace with '0'
>3 - Goto my default section - normal processing
>4 - Prepend the CallerIDNum with '09'
>5 - Goto my default section - normal processing
>
>Problems - 
>The callerIDNum variable does not change :-(  I thought that is what
>'SetGlobalVar' was ment to do???  Seems to be ReadOnly or in a local
>context... - how do I 'export' the change?
>
>
>The Console shows...
>    -- Executing GotoIf("IAX2/guest at 160.124.48.1:4569/4", "1?2:4") in
>new stack
>    -- Goto (fromaix,27128070590,2)
>    -- Executing SetGlobalVar("IAX2/guest at 160.124.48.1:4569/4",
>"CALLERIDNUM=0128070590") in new stack
>    -- Setting global variable 'CALLERIDNUM' to '0128070590'
>    -- Executing Goto("IAX2/guest at 160.124.48.1:4569/4", "default|s|1")
>in new stack
>    -- Goto (default,s,1)
>    -- Executing NoOp("IAX2/guest at 160.124.48.1:4569/4",
>"CALLER=27128070590") in new stack
>
>  
>
how about SetCallerId(12345) ;)
ie
exten= 27128070590, 2, setcallerid(0${CALLERIDNUM});

http://www.voip-info.org/tiki-index.php?page=Asterisk%20cmd%20SetCallerID


  SetCallerID


    Synopsis

 Set CallerID


    Description

 SetCallerID(clid[|a])

Set Caller*ID on a call to a new value. Sets ANI <wiki-ANI> as well if a 
flag is used. Note that the variable <wiki-Asterisk+variables> 
*${CALLERID}* contains the current call's Caller ID (name and number).








More information about the asterisk-users mailing list