[asterisk-users] GotoIf Problem
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. ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2008 - September 22 - 25 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] GotoIf Problem
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. ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2008 - September 22 - 25 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] GotoIf Problem
Doug Lytle wrote: *snipped exten = _X.,n,GotoIf($[${EXTEN:1} = 9]?not-parked,s,1) ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2008 - September 22 - 25 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] GotoIf Problem
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. ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2008 - September 22 - 25 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] GotoIf Problem
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 ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2008 - September 22 - 25 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] GotoIf Problem
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. ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- AstriCon 2008 - September 22 - 25 Phoenix, Arizona Register Now: http://www.astricon.net asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
SV: [Asterisk-Users] GotoIf problem
-Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:asterisk-users- [EMAIL PROTECTED] På vegne af kurt x Sendt: 9. marts 2005 20:57 Til: Chris Wade Cc: Asterisk Users Mailing List - Non-Commercial Discussion Emne: Re: [Asterisk-Users] GotoIf problem I,ve gotten the GotoIf statement working now. I hard coded the value 10 in place of the ${DIGITS} varible. Worked like a charm. Thanks to everyone who helped. Kurt Hi Kurt, You are writing the ${DIGITS} variable wrong, you are missing a { eg.: you are writing $DIGITS} and it should be ${DIGITS} Thorben ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] GotoIf problem
Removing the quotes and eliminating s,3,gotoif did work but its not what I am looking for. What I want to do is the following: If a ani that comes in has 10 digits I want to change the ${CALLERIDNUM} to unknown. If the ani is 10 digits just goto voicemail. When I set up my [vmail] to look like below, it does not work. When I send a 4 digit ani my e-mail confirmation of the voicemail shows the 4 digit ani and not Unknown. [globals] Setvar(DIGITS=10) [vmail] exten = s,1,Answer exten = s,2,NoOp(${ext}) exten = s,3,GotoIf($[${LEN(${CALLERIDNUM})} != $DIGITS}]?4:5) exten = s,4,Setvar(${CALLERIDNUM}=Unknown) exten = s,5,Voicemail(u${ext}) exten = s,6,Hangup Kurt On Wed, 09 Mar 2005 07:34:24 +1100, Howard Lowndes [EMAIL PROTECTED] wrote: On Wed, 2005-03-09 at 05:29, kurt x wrote: I am trying to test how the GotoIf and $LEN functions work but am not succeeding is this venture. When I dial and access voicemail with an ani of 3000 the gotoif statement does not push the call to s|6. Its goes through each line( 1,2,3,4,5,6,7) . In additon when I dial with a 10 digit ani the s,3,Gotoif does not work. It also goes through each line( 1,2,3,4,5,6,7) Any help is greatly appreciated. Have you tried removing the quotes? Thanks Kurt Asterisk CVS-HEAD-07/14/04-16:28:29 built by [EMAIL PROTECTED] on a i686 running Linux [globals] ${ext}=0 SetGlobalVar(DIGITS=10) [vmail] exten = s,1,Answer exten = s,2,NoOp(${ext}) exten = s,3,GotoIf($[${LEN(${CALLERIDNUM}}) = ${DIGITS}]?s|5) exten = s,4,GotoIf($[${CALLERIDNUM} = 3000]?s|6) exten = s,5,Voicemail(u${ext}) exten = s,6,Background(pbx-invalid) exten = s,7,Hangup ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Howard. LANNet Computing Associates; Your Linux people http://www.lannetlinux.com -- When you just want a system that works, you choose Linux; when you want a system that just works, you choose Microsoft. -- Flatter government, not fatter government; Get rid of the Australian states. ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] GotoIf problem
kurt x wrote: [globals] Setvar(DIGITS=10) Try this instead... [globals] DIGITS=10 -Chris ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] GotoIf problem
To me it looks like the $LEN function is not working. When I do verbose start to * I see that it walks right through every step whether or not the ani is 10 digits or something else. Would it be better to write an AGI script? Kurt On Wed, 09 Mar 2005 11:41:50 -0600, Chris Wade [EMAIL PROTECTED] wrote: kurt x wrote: [globals] Setvar(DIGITS=10) Try this instead... [globals] DIGITS=10 -Chris ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] GotoIf problem
kurt x wrote: To me it looks like the $LEN function is not working. When I do verbose start to * I see that it walks right through every step whether or not the ani is 10 digits or something else. Would it be better to write an AGI script? Kurt I use LEN quite a lot, works perfectly. Go back NoOp EVERYTHING, every single value, variable, etc... Run the logic through your head, if your head says it should work but it doesn't, we'll need to look into it again. Otherwise, NoOp'ing everything will help you and the rest of us debug what is happening. -Chris ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] GotoIf problem
kurt x wrote: [globals] Setvar(DIGITS=10) [vmail] exten = s,1,Answer exten = s,2,NoOp(${ext}) exten = s,3,GotoIf($[${LEN(${CALLERIDNUM})} != $DIGITS}]?4:5) exten = s,4,Setvar(${CALLERIDNUM}=Unknown) exten = s,5,Voicemail(u${ext}) exten = s,6,Hangup Oh, and it should be exten = s,3,GotoIf($[${LEN(${CALLERIDNUM})} != ${DIGITS}]?4:5) -Chris ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] GotoIf problem
I,ve gotten the GotoIf statement working now. I hard coded the value 10 in place of the ${DIGITS} varible. Worked like a charm. Thanks to everyone who helped. Kurt On Wed, 09 Mar 2005 12:07:51 -0600, Chris Wade [EMAIL PROTECTED] wrote: kurt x wrote: [globals] Setvar(DIGITS=10) [vmail] exten = s,1,Answer exten = s,2,NoOp(${ext}) exten = s,3,GotoIf($[${LEN(${CALLERIDNUM})} != $DIGITS}]?4:5) exten = s,4,Setvar(${CALLERIDNUM}=Unknown) exten = s,5,Voicemail(u${ext}) exten = s,6,Hangup Oh, and it should be exten = s,3,GotoIf($[${LEN(${CALLERIDNUM})} != ${DIGITS}]?4:5) -Chris ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[Asterisk-Users] GotoIf problem
I am trying to test how the GotoIf and $LEN functions work but am not succeeding is this venture. When I dial and access voicemail with an ani of 3000 the gotoif statement does not push the call to s|6. Its goes through each line( 1,2,3,4,5,6,7) . In additon when I dial with a 10 digit ani the s,3,Gotoif does not work. It also goes through each line( 1,2,3,4,5,6,7) Any help is greatly appreciated. Thanks Kurt Asterisk CVS-HEAD-07/14/04-16:28:29 built by [EMAIL PROTECTED] on a i686 running Linux [globals] ${ext}=0 SetGlobalVar(DIGITS=10) [vmail] exten = s,1,Answer exten = s,2,NoOp(${ext}) exten = s,3,GotoIf($[${LEN(${CALLERIDNUM}}) = ${DIGITS}]?s|5) exten = s,4,GotoIf($[${CALLERIDNUM} = 3000]?s|6) exten = s,5,Voicemail(u${ext}) exten = s,6,Background(pbx-invalid) exten = s,7,Hangup ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] GotoIf problem
Can you post your dialplan for that extension. Also, NoOp works great for debugging these issues. On Tue, 2005-03-08 at 12:29, kurt x wrote: I am trying to test how the GotoIf and $LEN functions work but am not succeeding is this venture. When I dial and access voicemail with an ani of 3000 the gotoif statement does not push the call to s|6. Its goes through each line( 1,2,3,4,5,6,7) . In additon when I dial with a 10 digit ani the s,3,Gotoif does not work. It also goes through each line( 1,2,3,4,5,6,7) Any help is greatly appreciated. Thanks Kurt Asterisk CVS-HEAD-07/14/04-16:28:29 built by [EMAIL PROTECTED] on a i686 running Linux [globals] ${ext}=0 SetGlobalVar(DIGITS=10) [vmail] exten = s,1,Answer exten = s,2,NoOp(${ext}) exten = s,3,GotoIf($[${LEN(${CALLERIDNUM}}) = ${DIGITS}]?s|5) exten = s,4,GotoIf($[${CALLERIDNUM} = 3000]?s|6) exten = s,5,Voicemail(u${ext}) exten = s,6,Background(pbx-invalid) exten = s,7,Hangup ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] GotoIf problem
Will this do. [general] static=yes writeprotect=no [globals] ${ext}=0 SetGlobalVar(DIGITS=4) [attendant] ;Main welcome message exten = xxx2400,1,Answer() exten = xxx2400,2,Wait(1) exten = xxx2400,3,Background(welcome) exten = xxx2400,4,ResponseTimeout,15 ;Used for wrong button press exten = i,1,Goto,invalid|s|1 ;To reach the operator exten = 0,1,Goto,operator|s|1 ;Company directory seach feature exten = 3,1,Directory(local|cme-pbx) exten = 3,2,Hangup ;To access VoiceMailMain exten = 9,1,Goto,voicemail|s|1 ;Need to be able to dial 4 digit extensions include = cme-pbx [voice-mail] include = attendant exten = 3000,1,Answer exten = 3000,2,Dial(SIP/3000) exten = 3000,3,Hangup ;Used in conjuction with ResposeTimeout exten = t,1,Playback(vm-goodbye) exten = t,2,Hangup ;Number that CME dials to forward voice mail to Asterisk exten = _22XXX,1,Setvar(ext=${EXTEN:1}) exten = _22XXX,2,Goto,vmail|s|1 [vmail] exten = s,1,Answer exten = s,2,NoOp(${ext}) exten = s,3,GotoIf($[${LEN(${CALLERIDNUM})} = ${DIGITS}]?s|5) exten = s,4,GotoIf($[${CALLERIDNUM} = 3000]?s|6) exten = s,5,Voicemail(u${ext}) exten = s,6,Background(pbx-invalid) exten = s,7,Hangup ;The below a option triggers on the button ; press * exten = a,1,VoicemailMain exten = a,2,Hangup [cme-pbx] exten = _24XX,1,Dial(SIP/[EMAIL PROTECTED]) exten = _24XX,2,Hangup [operator] exten = s,1,Dial(SIP/[EMAIL PROTECTED]) [voicemail] exten = s,1,VoicemailMain() exten = s,2,Hangup [invalid] exten = s,1,Playback(pbx-invalid) exten = s,2,Goto,attendant|xxx2400|3 On Tue, 08 Mar 2005 12:36:38 -0600, Dennis Webb [EMAIL PROTECTED] wrote: Can you post your dialplan for that extension. Also, NoOp works great for debugging these issues. On Tue, 2005-03-08 at 12:29, kurt x wrote: I am trying to test how the GotoIf and $LEN functions work but am not succeeding is this venture. When I dial and access voicemail with an ani of 3000 the gotoif statement does not push the call to s|6. Its goes through each line( 1,2,3,4,5,6,7) . In additon when I dial with a 10 digit ani the s,3,Gotoif does not work. It also goes through each line( 1,2,3,4,5,6,7) Any help is greatly appreciated. Thanks Kurt Asterisk CVS-HEAD-07/14/04-16:28:29 built by [EMAIL PROTECTED] on a i686 running Linux [globals] ${ext}=0 SetGlobalVar(DIGITS=10) [vmail] exten = s,1,Answer exten = s,2,NoOp(${ext}) exten = s,3,GotoIf($[${LEN(${CALLERIDNUM}}) = ${DIGITS}]?s|5) exten = s,4,GotoIf($[${CALLERIDNUM} = 3000]?s|6) exten = s,5,Voicemail(u${ext}) exten = s,6,Background(pbx-invalid) exten = s,7,Hangup ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] GotoIf problem
On Wed, 2005-03-09 at 05:29, kurt x wrote: I am trying to test how the GotoIf and $LEN functions work but am not succeeding is this venture. When I dial and access voicemail with an ani of 3000 the gotoif statement does not push the call to s|6. Its goes through each line( 1,2,3,4,5,6,7) . In additon when I dial with a 10 digit ani the s,3,Gotoif does not work. It also goes through each line( 1,2,3,4,5,6,7) Any help is greatly appreciated. Have you tried removing the quotes? Thanks Kurt Asterisk CVS-HEAD-07/14/04-16:28:29 built by [EMAIL PROTECTED] on a i686 running Linux [globals] ${ext}=0 SetGlobalVar(DIGITS=10) [vmail] exten = s,1,Answer exten = s,2,NoOp(${ext}) exten = s,3,GotoIf($[${LEN(${CALLERIDNUM}}) = ${DIGITS}]?s|5) exten = s,4,GotoIf($[${CALLERIDNUM} = 3000]?s|6) exten = s,5,Voicemail(u${ext}) exten = s,6,Background(pbx-invalid) exten = s,7,Hangup ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Howard. LANNet Computing Associates; Your Linux people http://www.lannetlinux.com -- When you just want a system that works, you choose Linux; when you want a system that just works, you choose Microsoft. -- Flatter government, not fatter government; Get rid of the Australian states. ___ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users