<!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}<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"> </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 "true". This happens to me in both ABE and V1.2</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000"> </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 => ${Music},1,Answer</FONT><BR>
<FONT COLOR="#000000">exten => ${Music},2,SetVar(t=1)</FONT><BR>
<FONT COLOR="#000000">exten => ${Music},3,NoOp(${TIMESTAMP} - ${T})</FONT><BR>
<FONT COLOR="#000000">exten => ${Music},4,MP3Player(/var/lib/asterisk/mohmp3/deck.mp3)</FONT><BR>
<FONT COLOR="#000000">exten => ${Music},5,SetVar(t=$[${T} + 1]) </FONT><BR>
<FONT COLOR="#000000">exten => ${Music},6,GotoIf(${T}<3?3:7)</FONT><BR>
<FONT COLOR="#000000">exten => ${Music},7,Hangup</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000"> </FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">CLI> output :</FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">*CLI> -- Executing Answer("SIP/100-274e", "") in new stack</FONT><BR>
<FONT COLOR="#000000"> -- Executing Set("SIP/100-274e", "t=1") in new stack</FONT><BR>
<FONT COLOR="#000000"> -- Executing NoOp("SIP/100-274e", "20051118-153136 - 1") in new stack </FONT><BR>
<FONT COLOR="#000000"> -- Executing MP3Player("SIP/100-274e", "/var/lib/asterisk/mohmp3/deck.mp3")</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"> -- Executing Set("SIP/100-274e", "t=2") in new stack </FONT><BR>
<FONT COLOR="#000000"> -- Executing </FONT><FONT COLOR="#ff0000">GotoIf("SIP/100-274e", "2<3?3:7")</FONT><FONT COLOR="#000000"> in new stack</FONT><BR>
<FONT COLOR="#000000"> -- Goto (default,123,3)</FONT><BR>
<FONT COLOR="#000000"> -- Executing NoOp("SIP/100-274e", "20051118-153139 - 2") in new stack </FONT><BR>
<FONT COLOR="#000000"> -- Executing MP3Player("SIP/100-274e", "/var/lib/asterisk/mohmp3/deck.mp3")</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"> -- Executing Set("SIP/100-274e", "t=3") in new stack </FONT><BR>
<FONT COLOR="#000000"> -- Executing </FONT><FONT COLOR="#ff0000">GotoIf("SIP/100-274e", "3<3?3:7")</FONT><FONT COLOR="#000000"> in new stack</FONT><BR>
<FONT COLOR="#000000"> -- Goto (default,123,</FONT><FONT COLOR="#ff0000">3</FONT><FONT COLOR="#000000">)</FONT><BR>
<FONT COLOR="#000000"> -- Executing NoOp("SIP/100-274e", "20051118-153142 - 3") in new stack </FONT><BR>
<FONT COLOR="#000000"> -- Executing MP3Player("SIP/100-274e", "/var/lib/asterisk/mohmp3/deck.mp3")</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"> -- Executing Set("SIP/100-274e", "t=4") in new stack </FONT><BR>
<FONT COLOR="#000000"> -- Executing </FONT><FONT COLOR="#ff0000">GotoIf("SIP/100-274e", "4<3?3:7")</FONT><FONT COLOR="#000000"> in new stack</FONT><BR>
<FONT COLOR="#000000"> -- Goto (default,123,</FONT><FONT COLOR="#ff0000">3</FONT><FONT COLOR="#000000">)</FONT><BR>
<FONT COLOR="#000000"> -- Executing NoOp("SIP/100-274e", "20051118-153145 - 4") in new stack </FONT><BR>
<FONT COLOR="#000000"> -- Executing MP3Player("SIP/100-274e", "/var/lib/asterisk/mohmp3/deck.mp3")</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"> </FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000"> </FONT>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<FONT COLOR="#000000">I have been trying to figure this out for the past few days. 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"> </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>