[asterisk-users] Help with GotoIf Command

Rodrigo Bastos de Moura rodrigo.tecnologia at yahoo.com.br
Wed Sep 5 08:39:22 CDT 2012


David,
 
I believe there a error of sintax:
 
Wrong:
 
exten => s,1,GotoIf($["${CALLERID(name)}" = "${CALLERID(num)}"]?:3)
 
Correct:
 
exten => s,1,GotoIf($["${CALLERID(name)}" = "${CALLERID(num)}"]?3)
 
Thanks,
 
Rodrigo Bastos de Moura.
 

________________________________
 De: Danny Nicholas <danny at debsinc.com>
Para: 'Asterisk Users Mailing List - Non-Commercial Discussion' <asterisk-users at lists.digium.com> 
Enviadas: Quarta-feira, 5 de Setembro de 2012 10:22
Assunto: Re: [asterisk-users] Help with GotoIf Command
  
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 Klaverstyn
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.
 
Regards
David Klaverstyn 
      
      
  
 --_____________________________________________________________________-- Bandwidth and Colocation Provided by http://www.api-digital.com/ --New to Asterisk? Join us for a live introductory webinar every Thurs:              http://www.asterisk.org/helloasterisk-users mailing listTo UNSUBSCRIBE or update options visit:  http://lists.digium.com/mailman/listinfo/asterisk-users   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120905/4095048c/attachment.htm>


More information about the asterisk-users mailing list