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 -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
Doug Lytle wrote: *snipped exten => _X.,n,GotoIf($["${EXTEN:1}" = "9"]?not-parked,s,1)
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.
Richard Lyman wrote:> Doug Lytle wrote: > *snipped > > exten => _X.,n,GotoIf($["${EXTEN:1}" = "9"]?not-parked,s,1) > >Close: exten => _X.,n,GotoIf($["${EXTEN:0:1}" = "9"]?not-parked,s,1) Doug -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
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 > >How about something like this: exten => _X.,n,GotoIf($["${EXTEN:0:1}" = "9"]?not-parked,s,1) You may need to tweak the extension pattern as this will match anything that begins with 9. -Dave
Eric "ManxPower" Wieling wrote:> How about: > > exten => _9X,n,Goto(not-parked,s,1) >This works quite well, thank you! Doug -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."