[asterisk-users] Re: strip + sign from incoming ${EXTEN} var?

Benny Amorsen benny+usenet at amorsen.dk
Sat Nov 18 02:21:24 MST 2006


>>>>> "EW" == Eric \"ManxPower\" Wieling <Eric> writes:

EW> exten => _+NXXNXXXXXX,1,Goto(${EXTEN:1},1)

You are assuming a fixed-length number here...

The basic problem is to ensure that the extension gets run first,
since asterisk has its very own ideas about what goes first. So put
the incoming calls in context removeplus instead of incoming, and do:

[removeplus]
_+!,1,Goto(incoming,${EXTEN:1},1)
_X!,1,Goto(incoming,${EXTEN},1)

This assumes that ${EXTEN} starts with either a number or a plus. If
it can start with other things, you can do

_!,1,Goto(incoming,${EXTEN},1)

for the second line, but then you are relying on asterisks extension
ordering again.


/Benny




More information about the asterisk-users mailing list