[Asterisk-Users] How can I eveluate trailing numbers in extensions.conf?

Harald Milz hm at seneca.muc.de
Sun Mar 13 05:54:48 MST 2005


Umar Sear <umarsear at gmail.com> wrote:
> Checkout 

> http://www.voip-info.org/wiki-Asterisk+variables

> I believe that should have the answer for you. 

> furthermore assuming that your number is always going to be 12 digits. 

> exten => _NXX.,1,SetVar(mynumber=${EXTEN:0:12})   - will give you your number.

I'm not sure. I have  

register => NNNNNNN:XXXXXX at sipgate.de/sip

in my sip.conf, and in extensions.conf, the "sip" extension knows nothing
about the called number. 

[incoming]
; exten => sip,1,Goto(isdn,1${CALLEDNUM:-1},1)
exten => sip,1,Goto(isdn,11,1)
exten => sip,2,Voicemail(u100)
exten => sip,102,Voicemail(b100)

How do I set "register" properly to use a simple $EXTEN expression as
above? I did try that before, no luck. (I have some more registrations
in my sip.conf because I want to use a simple LCR strategy).

In any case, I just posted a patch against the CVS to the asterisk-dev
list. This patch gives you a new variable CALLEDNUM that does what I need.
It's used as in the commented example above. 

-- 
Reality is for those who can't face Science Fiction.



More information about the asterisk-users mailing list