Keith O'Brien
2005-Jun-29 07:40 UTC
[Asterisk-Users] Problems with OR Logic in the GotoIf Statement
Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3034 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20050629/596126bc/smime.bin
Damon Estep
2005-Jun-29 08:16 UTC
[Asterisk-Users] Problems with OR Logic in the GotoIf Statement
If you need a fast solution put two gotoif statements in a row, one to check for the first condition, another to check for the next, you can leave out the redirect If the condition is not matched so it just goes to the next priority. ________________________________ From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Keith O'Brien Sent: Wednesday, June 29, 2005 8:40 AM To: Asterisk-Users@lists.digium.com Subject: [Asterisk-Users] Problems with OR Logic in the GotoIf Statement I am having some trouble implementing OR login in the GotoIf statement. I have followed the examples in the Wiki and I still am getting a syntax error. Essentially I want to screen for CallerIDs set for "Anonymous" OR "Unknown Caller". If either of these are true I want to send it to statement 3 which clears the CallerID and proceeds to Privacy Manager. I have also tried removing and adding quotes to no avail. I am running the 6/7/2005 CVS Head. exten => 5000,1,NoOp,${CALLERIDNAME} exten => 5000,2,GotoIf($[$["${CALLERIDNAME}" = "Anonymous"] | $["${CALLERIDNAME}" = "Unknown Caller"]]?3:5) exten => 5000,3,SetCIDNum() exten => 5000,4,SetCIDName() exten => 5000,5,PrivacyManager exten => 5000,6,GotoIfTime(19:00-7:00|*|*|*?afterhours,s,1) exten => 5000,7,agi,astcallerid exten => 5000,8,DIAL(SIP/5001) exten => 5000,9,Voicemail(u5001) exten => 5000,110,Hangup -- Executing NoOp("IAX2/teliax@208.139.204.228:4569-2 <mailto:IAX2/teliax@208.139.204.228:4569-2> ", "Anonymous") in new stack Jun 29 10:34:09 WARNING[3946]: ast_expr.y:486 ast_yyerror: ast_yyerror(): syntax error: syntax error; Input: (Anonymous = "Anonymous")|(Anonymous = "Unknown Caller") ^^^^^^^^^^^^^^^^^^^^^^^ ^ -- Executing GotoIf("IAX2/teliax@208.139.204.228:4569-2 <mailto:IAX2/teliax@208.139.204.228:4569-2> ", "0?3:5") in new stack -- Goto (in-out,7326031000,5) <mailto:6468723228@vtext.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050629/912f859e/attachment.htm
Giorgio Incantalupo
2005-Jun-29 08:33 UTC
[Asterisk-Users] Problems with OR Logic in the GotoIf Statement
Hi! Have you tried exten => 5000,2,GotoIf($[$["${CALLERIDNAME}" = "Anonymous"]|$["${CALLERIDNAME}" = "Unknown Caller"]]?3:5) instead of exten => 5000,2,GotoIf($[$["${CALLERIDNAME}" = "Anonymous"] | $["${CALLERIDNAME}" = "Unknown Caller"]]?3:5) ? Giorgio Keith O'Brien wrote:> I am having some trouble implementing OR login in the GotoIf > statement. I have followed the examples in the Wiki and I still am > getting a syntax error. > > Essentially I want to screen for CallerIDs set for "Anonymous" OR > "Unknown Caller". If either of these are true I want to send it to > statement 3 which clears the CallerID and proceeds to Privacy Manager. > > I have also tried removing and adding quotes to no avail. I am > running the 6/7/2005 CVS Head. > > exten => 5000,1,NoOp,${CALLERIDNAME} > exten => 5000,2,GotoIf($[$["${CALLERIDNAME}" = "Anonymous"] | > $["${CALLERIDNAME}" = "Unknown Caller"]]?3:5) > exten => 5000,3,SetCIDNum() > exten => 5000,4,SetCIDName() > exten => 5000,5,PrivacyManager > exten => 5000,6,GotoIfTime(19:00-7:00|*|*|*?afterhours,s,1) > exten => 5000,7,agi,astcallerid > exten => 5000,8,DIAL(SIP/5001) > exten => 5000,9,Voicemail(u5001) > exten => 5000,110,Hangup > > _ -- Executing NoOp("IAX2/teliax@208.139.204.228:4569-2 > <mailto:IAX2/teliax@208.139.204.228:4569-2>", "Anonymous") in new stack > Jun 29 10:34:09 WARNING[3946]: ast_expr.y:486 ast_yyerror: > ast_yyerror(): syntax error: syntax error; Input: > (Anonymous = "Anonymous")|(Anonymous = "Unknown Caller") > ^^^^^^^^^^^^^^^^^^^^^^^ > ^ > -- Executing GotoIf("IAX2/teliax@208.139.204.228:4569-2 > <mailto:IAX2/teliax@208.139.204.228:4569-2>", "0?3:5") in new stack > -- Goto (in-out,7326031000,5)_ > >------------------------------------------------------------------------ > >_______________________________________________ >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 >
Giorgio Incantalupo
2005-Jun-29 08:35 UTC
[Asterisk-Users] Problems with OR Logic in the GotoIf Statement
Hi! Try exten => 5000,2,GotoIf($[$["${CALLERIDNAME}" = "Anonymous"]|$["${CALLERIDNAME}" = "Unknown Caller"]]?3:5) intead of exten => 5000,2,GotoIf($[$["${CALLERIDNAME}" = "Anonymous"] | $["${CALLERIDNAME}" = "Unknown Caller"]]?3:5) Deleting spaces before and after ANd or OR logic worked for me. Giorgio Keith O'Brien wrote:> I am having some trouble implementing OR login in the GotoIf > statement. I have followed the examples in the Wiki and I still am > getting a syntax error. > > Essentially I want to screen for CallerIDs set for "Anonymous" OR > "Unknown Caller". If either of these are true I want to send it to > statement 3 which clears the CallerID and proceeds to Privacy Manager. > > I have also tried removing and adding quotes to no avail. I am > running the 6/7/2005 CVS Head. > > exten => 5000,1,NoOp,${CALLERIDNAME} > exten => 5000,2,GotoIf($[$["${CALLERIDNAME}" = "Anonymous"] | > $["${CALLERIDNAME}" = "Unknown Caller"]]?3:5) > exten => 5000,3,SetCIDNum() > exten => 5000,4,SetCIDName() > exten => 5000,5,PrivacyManager > exten => 5000,6,GotoIfTime(19:00-7:00|*|*|*?afterhours,s,1) > exten => 5000,7,agi,astcallerid > exten => 5000,8,DIAL(SIP/5001) > exten => 5000,9,Voicemail(u5001) > exten => 5000,110,Hangup > > _ -- Executing NoOp("IAX2/teliax@208.139.204.228:4569-2 > <mailto:IAX2/teliax@208.139.204.228:4569-2>", "Anonymous") in new stack > Jun 29 10:34:09 WARNING[3946]: ast_expr.y:486 ast_yyerror: > ast_yyerror(): syntax error: syntax error; Input: > (Anonymous = "Anonymous")|(Anonymous = "Unknown Caller") > ^^^^^^^^^^^^^^^^^^^^^^^ > ^ > -- Executing GotoIf("IAX2/teliax@208.139.204.228:4569-2 > <mailto:IAX2/teliax@208.139.204.228:4569-2>", "0?3:5") in new stack > -- Goto (in-out,7326031000,5)_ > >------------------------------------------------------------------------ > >_______________________________________________ >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 >
Doug Lytle
2005-Jun-29 08:41 UTC
[Asterisk-Users] Problems with OR Logic in the GotoIf Statement
Keith O'Brien wrote:> exten => 5000,2,GotoIf($[$["${CALLERIDNAME}" = "Anonymous"] | > $["${CALLERIDNAME}" = "Unknown Caller"]]?3:5) >One too many $s? exten => 5000,2,GotoIf($["${CALLERIDNAME}" Doug
Keith O'Brien
2005-Jun-29 17:29 UTC
[Asterisk-Users] Problems with OR Logic in the GotoIf Statement
Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3034 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20050629/5fe09496/smime.bin