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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Keith O'Brien
Sent: Wednesday, June 29, 2005 8:40 AM
To: [email protected]
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/[EMAIL PROTECTED]: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/[EMAIL PROTECTED]:4569-2", "0?3:5") in new stack
    -- Goto (in-out,7326031000,5)

_______________________________________________
Asterisk-Users mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to