[asterisk-users] Help with GotoIf Command

Danny Nicholas danny at debsinc.com
Wed Sep 5 08:22:53 CDT 2012

By definition you are doing if not equal go to 3.
Gotoif($[condition]?[true]:false).  Look at your CLI output and you will see
the evaluation of the condition as 1 or 0.


From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of David
Sent: Wednesday, September 05, 2012 4:31 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
(asterisk-users at lists.digium.com)
Subject: [asterisk-users] Help with GotoIf Command


Hi All,


For some reason I can't get this GotoIf statement to work.  Even if the name
and number are the same it jumps to line 3.  I've tried with and without the
quotes around each variable.


exten => s,1,GotoIf($["${CALLERID(name)}" = "${CALLERID(num)}"]?:3)

exten => s,2,NoOp(they are the Same)

exten => s,3,NoOp(they are different)


The wisdom of this group is much appreciated.


This is an example only.  I know the code will display both NoOp lines if
the name and number is the same.


David Klaverstyn









-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120905/27be04c5/attachment.htm>

More information about the asterisk-users mailing list