[Asterisk-Users] Extracting info from the $EXTEN variable

Ira ira at extrasensory.com
Fri Mar 10 09:28:33 MST 2006


At 03:39 PM 03/09/2006, you wrote:
>you will have to do that in the gotoif statement, something like this:
>exten => _X.,1,GotoIf($[${EXTEN:2:1}=1]?20)
>exten => _X.,2,GotoIf($[${EXTEN:2:1}=2]?30)

Close, but it needs spaces around the equal signs, like:

exten => _X.,1,GotoIf($[${EXTEN:2:1} = 1]?20)
exten => _X.,2,GotoIf($[${EXTEN:2:1} = 2]?30)

Or if you want it to not crash if EXTEN is empty:

exten => _X.,1,GotoIf($["${EXTEN:2:1}" = "1"]?20)
exten => _X.,2,GotoIf($["${EXTEN:2:1}" = "2"]?30)

Ira 


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 268.2.1/278 - Release Date: 03/09/2006





More information about the asterisk-users mailing list