<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.6.2">
</HEAD>
<BODY>
Shouldn't the expression be<BR>
<BR>
<FONT COLOR="#000000">GotoIf(</FONT>$[<FONT COLOR="#000000">${T}&lt;3</FONT>]<FONT COLOR="#000000">?3:7)</FONT><BR>
<BR>
On Fri, 2005-11-18 at 15:39 -0800, Andy Kuo wrote:
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">Hi all,</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">I recently found GotoIf not working right in my extensions.conf, so I write a simple test and test it on my newly installed v1.2 box.</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">However, in all cases, GotoIf seems to always result in &quot;true&quot;.&nbsp; This happens to me in both ABE and V1.2</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">my extensions.conf :</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">[globals]</FONT><BR>
    <FONT COLOR="#000000">Music=123</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">[default]</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">exten =&gt; ${Music},1,Answer</FONT><BR>
    <FONT COLOR="#000000">exten =&gt; ${Music},2,SetVar(t=1)</FONT><BR>
    <FONT COLOR="#000000">exten =&gt; ${Music},3,NoOp(${TIMESTAMP} - ${T})</FONT><BR>
    <FONT COLOR="#000000">exten =&gt; ${Music},4,MP3Player(/var/lib/asterisk/mohmp3/deck.mp3)</FONT><BR>
    <FONT COLOR="#000000">exten =&gt; ${Music},5,SetVar(t=$[${T} + 1]) </FONT><BR>
    <FONT COLOR="#000000">exten =&gt; ${Music},6,GotoIf(${T}&lt;3?3:7)</FONT><BR>
    <FONT COLOR="#000000">exten =&gt; ${Music},7,Hangup</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">CLI&gt; output :</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">*CLI&gt;&nbsp;&nbsp;&nbsp;&nbsp; -- Executing Answer(&quot;SIP/100-274e&quot;, &quot;&quot;) in new stack</FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing Set(&quot;SIP/100-274e&quot;, &quot;t=1&quot;) in new stack</FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing NoOp(&quot;SIP/100-274e&quot;, &quot;20051118-153136 - 1&quot;) in new stack </FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing MP3Player(&quot;SIP/100-274e&quot;, &quot;/var/lib/asterisk/mohmp3/deck.mp3&quot;)</FONT><BR>
    <FONT COLOR="#000000">in new stack</FONT><BR>
    <FONT COLOR="#000000">Nov 18 15:31:39 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed out/errored o</FONT><BR>
    <FONT COLOR="#000000">ut with 0</FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing Set(&quot;SIP/100-274e&quot;, &quot;t=2&quot;) in new stack </FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing </FONT><FONT COLOR="#ff0000">GotoIf(&quot;SIP/100-274e&quot;, &quot;2&lt;3?3:7&quot;)</FONT><FONT COLOR="#000000"> in new stack</FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Goto (default,123,3)</FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing NoOp(&quot;SIP/100-274e&quot;, &quot;20051118-153139 - 2&quot;) in new stack </FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing MP3Player(&quot;SIP/100-274e&quot;, &quot;/var/lib/asterisk/mohmp3/deck.mp3&quot;)</FONT><BR>
    <FONT COLOR="#000000">in new stack</FONT><BR>
    <FONT COLOR="#000000">Nov 18 15:31:42 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed out/errored o</FONT><BR>
    <FONT COLOR="#000000">ut with 0</FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing Set(&quot;SIP/100-274e&quot;, &quot;t=3&quot;) in new stack </FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing </FONT><FONT COLOR="#ff0000">GotoIf(&quot;SIP/100-274e&quot;, &quot;3&lt;3?3:7&quot;)</FONT><FONT COLOR="#000000"> in new stack</FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Goto (default,123,</FONT><FONT COLOR="#ff0000">3</FONT><FONT COLOR="#000000">)</FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing NoOp(&quot;SIP/100-274e&quot;, &quot;20051118-153142 - 3&quot;) in new stack </FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing MP3Player(&quot;SIP/100-274e&quot;, &quot;/var/lib/asterisk/mohmp3/deck.mp3&quot;)</FONT><BR>
    <FONT COLOR="#000000">in new stack</FONT><BR>
    <FONT COLOR="#000000">Nov 18 15:31:45 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed out/errored o</FONT><BR>
    <FONT COLOR="#000000">ut with 0</FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing Set(&quot;SIP/100-274e&quot;, &quot;t=4&quot;) in new stack </FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing </FONT><FONT COLOR="#ff0000">GotoIf(&quot;SIP/100-274e&quot;, &quot;4&lt;3?3:7&quot;)</FONT><FONT COLOR="#000000"> in new stack</FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Goto (default,123,</FONT><FONT COLOR="#ff0000">3</FONT><FONT COLOR="#000000">)</FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing NoOp(&quot;SIP/100-274e&quot;, &quot;20051118-153145 - 4&quot;) in new stack </FONT><BR>
    <FONT COLOR="#000000">&nbsp;&nbsp;&nbsp; -- Executing MP3Player(&quot;SIP/100-274e&quot;, &quot;/var/lib/asterisk/mohmp3/deck.mp3&quot;)</FONT><BR>
    <FONT COLOR="#000000">in new stack</FONT><BR>
    <FONT COLOR="#000000">Nov 18 15:31:48 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed out/errored o</FONT><BR>
    <FONT COLOR="#000000">ut with 0</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">I have been trying to figure this out for the past few days.&nbsp; I think it must be some stupid mistake of mine, but just can't figure out what/where.</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">&nbsp;</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">Please help.</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">Thank you very much.</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <FONT COLOR="#000000">Andy</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">_______________________________________________</FONT>
<FONT COLOR="#000000">--Bandwidth and Colocation sponsored by Easynews.com --</FONT>

<FONT COLOR="#000000">Asterisk-Users mailing list</FONT>
<FONT COLOR="#000000"><A HREF="mailto:Asterisk-Users@lists.digium.com">Asterisk-Users@lists.digium.com</A></FONT>
<FONT COLOR="#000000"><A HREF="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</A></FONT>
<FONT COLOR="#000000">To UNSUBSCRIBE or update options visit:</FONT>
<FONT COLOR="#000000">   <A HREF="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</A></FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>