[asterisk-users] GotoIf Problem

Eric "ManxPower" Wieling eric at fnords.org
Fri Jul 18 11:33:42 CDT 2008


How about:

exten => _9X,n,Goto(not-parked,s,1)

Doug Lytle wrote:
> Everybody,
> 
> I have a fall though context that, among other things, tests to see if 
> someone it trying to pick up a non-existent parked call (Defined from 90 
> to 99).  I have the following:
> 
> [not-in-service]
> 
> exten => _X.,1,Wait(1)
> exten => _X.,n,ResetCDR()
> 
> ; **************************************************
> ; Check to see if the mis-dialed number was a parking
> ; slot.  If so, jump to the not-parked context
> ; **************************************************
> 
> exten => _X.,n,GotoIf($["${EXTEN}" = "90"]?not-parked,s,1)
> exten => _X.,n,GotoIf($["${EXTEN}" = "91"]?not-parked,s,1)
> exten => _X.,n,GotoIf($["${EXTEN}" = "92"]?not-parked,s,1)
> exten => _X.,n,GotoIf($["${EXTEN}" = "93"]?not-parked,s,1)
> exten => _X.,n,GotoIf($["${EXTEN}" = "94"]?not-parked,s,1)
> exten => _X.,n,GotoIf($["${EXTEN}" = "95"]?not-parked,s,1)
> exten => _X.,n,GotoIf($["${EXTEN}" = "96"]?not-parked,s,1)
> exten => _X.,n,GotoIf($["${EXTEN}" = "97"]?not-parked,s,1)
> exten => _X.,n,GotoIf($["${EXTEN}" = "98"]?not-parked,s,1)
> exten => _X.,n,GotoIf($["${EXTEN}" = "99"]?not-parked,s,1)
> 
> I'd like to move it to just one line, such as:
> 
> exten => _X.,n,GotoIf($["${EXTEN}" = "9?"]?not-parked,s,1)
> 
> But, I'm not finding a way to do this.  Any suggestions?
> 
> Doug
> 
> 

-- 
Consulting for Asterisk, Polycom, Sangoma, Digium, Cisco, LAN, WAN, QoS, 
T-1, PRI, Frame Relay, Linux, and network design.  Based near 
Birmingham, AL.  Now accepting clients worldwide.



More information about the asterisk-users mailing list