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

Giorgio Incantalupo gincantalupo at fgasoftware.com
Wed Jun 29 08:33:13 MST 2005


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 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)_
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Asterisk-Users mailing list
>Asterisk-Users at 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
>




More information about the asterisk-users mailing list