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

Mark Elkins mje at posix.co.za
Tue Jan 4 07:21:17 MST 2005


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

-- 
  .  .     ___. .__      Posix Systems - Sth Africa.  e.164 VOIP ready
 /| /|       / /__       mje at posix.co.za  -  Mark J Elkins, Cisco CCIE
/ |/ |ARK \_/ /__ LKINS  Tel: +27 12 807 0590  Cell: +27 82 601 0496




More information about the asterisk-users mailing list