[Asterisk-Users] Problems with OR Logic in the GotoIf Statement

Damon Estep damon at suburbanbroadband.net
Wed Jun 29 08:16:26 MST 2005


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 at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Keith
O'Brien
Sent: Wednesday, June 29, 2005 8:40 AM
To: Asterisk-Users at 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 at 208.139.204.228:4569-2
<mailto:IAX2/teliax at 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 at 208.139.204.228:4569-2
<mailto:IAX2/teliax at 208.139.204.228:4569-2> ", "0?3:5") in new stack
    -- Goto (in-out,7326031000,5) <mailto:6468723228 at vtext.com> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050629/912f859e/attachment.htm


More information about the asterisk-users mailing list