Hi all, 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. However, in all cases, GotoIf seems to always result in "true". This happens to me in both ABE and V1.2 my extensions.conf : [globals] Music=123 [default] exten => ${Music},1,Answer exten => ${Music},2,SetVar(t=1) exten => ${Music},3,NoOp(${TIMESTAMP} - ${T}) exten => ${Music},4,MP3Player(/var/lib/asterisk/mohmp3/deck.mp3) exten => ${Music},5,SetVar(t=$[${T} + 1]) exten => ${Music},6,GotoIf(${T}<3?3:7) exten => ${Music},7,Hangup CLI> output : *CLI> -- Executing Answer("SIP/100-274e", "") in new stack -- Executing Set("SIP/100-274e", "t=1") in new stack -- Executing NoOp("SIP/100-274e", "20051118-153136 - 1") in new stack -- Executing MP3Player("SIP/100-274e", "/var/lib/asterisk/mohmp3/deck.mp3") in new stack Nov 18 15:31:39 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed out/errored o ut with 0 -- Executing Set("SIP/100-274e", "t=2") in new stack -- Executing GotoIf("SIP/100-274e", "2<3?3:7") in new stack -- Goto (default,123,3) -- Executing NoOp("SIP/100-274e", "20051118-153139 - 2") in new stack -- Executing MP3Player("SIP/100-274e", "/var/lib/asterisk/mohmp3/deck.mp3") in new stack Nov 18 15:31:42 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed out/errored o ut with 0 -- Executing Set("SIP/100-274e", "t=3") in new stack -- Executing GotoIf("SIP/100-274e", "3<3?3:7") in new stack -- Goto (default,123,3) -- Executing NoOp("SIP/100-274e", "20051118-153142 - 3") in new stack -- Executing MP3Player("SIP/100-274e", "/var/lib/asterisk/mohmp3/deck.mp3") in new stack Nov 18 15:31:45 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed out/errored o ut with 0 -- Executing Set("SIP/100-274e", "t=4") in new stack -- Executing GotoIf("SIP/100-274e", "4<3?3:7") in new stack -- Goto (default,123,3) -- Executing NoOp("SIP/100-274e", "20051118-153145 - 4") in new stack -- Executing MP3Player("SIP/100-274e", "/var/lib/asterisk/mohmp3/deck.mp3") in new stack Nov 18 15:31:48 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed out/errored o ut with 0 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. Please help. Thank you very much. Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20051118/5bd994e5/attachment.htm
Andy Kuo wrote:> exten => ${Music},6,GotoIf(${T}<3?3:7)exten => ${Music},6,GotoIf($[${T}<3]?3:7) -- Christopher L. Wade, CCNA, CCDA, CQS-CIPCES, CQS-CWLSS
Try some spaces: GotoIf(${T} < 3?3:7) On Nov 18, 2005, at 3:39 PM, Andy Kuo wrote:> Hi all, > ? > 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. > However, in all cases, GotoIf seems to always result in "true".? This > happens to me in both ABE and V1.2 > ? > my extensions.conf : > [globals] > Music=123 > [default] > exten => ${Music},1,Answer > exten => ${Music},2,SetVar(t=1) > exten => ${Music},3,NoOp(${TIMESTAMP} - ${T}) > exten => ${Music},4,MP3Player(/var/lib/asterisk/mohmp3/deck.mp3) > exten => ${Music},5,SetVar(t=$[${T} + 1]) > exten => ${Music},6,GotoIf(${T}<3?3:7) > exten => ${Music},7,Hangup > ? > CLI> output : > *CLI>???? -- Executing Answer("SIP/100-274e", "") in new stack > ??? -- Executing Set("SIP/100-274e", "t=1") in new stack > ??? -- Executing NoOp("SIP/100-274e", "20051118-153136 - 1") in new > stack > ??? -- Executing MP3Player("SIP/100-274e", > "/var/lib/asterisk/mohmp3/deck.mp3") > in new stack > Nov 18 15:31:39 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed > out/errored o > ut with 0 > ??? -- Executing Set("SIP/100-274e", "t=2") in new stack > ??? -- Executing GotoIf("SIP/100-274e", "2<3?3:7") in new stack > ??? -- Goto (default,123,3) > ??? -- Executing NoOp("SIP/100-274e", "20051118-153139 - 2") in new > stack > ??? -- Executing MP3Player("SIP/100-274e", > "/var/lib/asterisk/mohmp3/deck.mp3") > in new stack > Nov 18 15:31:42 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed > out/errored o > ut with 0 > ??? -- Executing Set("SIP/100-274e", "t=3") in new stack > ??? -- Executing GotoIf("SIP/100-274e", "3<3?3:7") in new stack > ??? -- Goto (default,123,3) > ??? -- Executing NoOp("SIP/100-274e", "20051118-153142 - 3") in new > stack > ??? -- Executing MP3Player("SIP/100-274e", > "/var/lib/asterisk/mohmp3/deck.mp3") > in new stack > Nov 18 15:31:45 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed > out/errored o > ut with 0 > ??? -- Executing Set("SIP/100-274e", "t=4") in new stack > ??? -- Executing GotoIf("SIP/100-274e", "4<3?3:7") in new stack > ??? -- Goto (default,123,3) > ??? -- Executing NoOp("SIP/100-274e", "20051118-153145 - 4") in new > stack > ??? -- Executing MP3Player("SIP/100-274e", > "/var/lib/asterisk/mohmp3/deck.mp3") > in new stack > Nov 18 15:31:48 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed > out/errored o > ut with 0 > ? > ? > 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. > ? > Please help. > Thank you very much. > Andy_______________________________________________ > --Bandwidth and Colocation sponsored by Easynews.com -- > > Asterisk-Users mailing list > Asterisk-Users@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
Shouldn't the expression be GotoIf($[${T}<3]?3:7) On Fri, 2005-11-18 at 15:39 -0800, Andy Kuo wrote:> Hi all, > > 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. > However, in all cases, GotoIf seems to always result in "true". This > happens to me in both ABE and V1.2 > > my extensions.conf : > [globals] > Music=123 > [default] > exten => ${Music},1,Answer > exten => ${Music},2,SetVar(t=1) > exten => ${Music},3,NoOp(${TIMESTAMP} - ${T}) > exten => ${Music},4,MP3Player(/var/lib/asterisk/mohmp3/deck.mp3) > exten => ${Music},5,SetVar(t=$[${T} + 1]) > exten => ${Music},6,GotoIf(${T}<3?3:7) > exten => ${Music},7,Hangup > > CLI> output : > *CLI> -- Executing Answer("SIP/100-274e", "") in new stack > -- Executing Set("SIP/100-274e", "t=1") in new stack > -- Executing NoOp("SIP/100-274e", "20051118-153136 - 1") in new > stack > -- Executing MP3Player("SIP/100-274e", > "/var/lib/asterisk/mohmp3/deck.mp3") > in new stack > Nov 18 15:31:39 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed > out/errored o > ut with 0 > -- Executing Set("SIP/100-274e", "t=2") in new stack > -- Executing GotoIf("SIP/100-274e", "2<3?3:7") in new stack > -- Goto (default,123,3) > -- Executing NoOp("SIP/100-274e", "20051118-153139 - 2") in new > stack > -- Executing MP3Player("SIP/100-274e", > "/var/lib/asterisk/mohmp3/deck.mp3") > in new stack > Nov 18 15:31:42 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed > out/errored o > ut with 0 > -- Executing Set("SIP/100-274e", "t=3") in new stack > -- Executing GotoIf("SIP/100-274e", "3<3?3:7") in new stack > -- Goto (default,123,3) > -- Executing NoOp("SIP/100-274e", "20051118-153142 - 3") in new > stack > -- Executing MP3Player("SIP/100-274e", > "/var/lib/asterisk/mohmp3/deck.mp3") > in new stack > Nov 18 15:31:45 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed > out/errored o > ut with 0 > -- Executing Set("SIP/100-274e", "t=4") in new stack > -- Executing GotoIf("SIP/100-274e", "4<3?3:7") in new stack > -- Goto (default,123,3) > -- Executing NoOp("SIP/100-274e", "20051118-153145 - 4") in new > stack > -- Executing MP3Player("SIP/100-274e", > "/var/lib/asterisk/mohmp3/deck.mp3") > in new stack > Nov 18 15:31:48 NOTICE[5414]: app_mp3.c:108 timed_read: Poll timed > out/errored o > ut with 0 > > > 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. > > Please help. > Thank you very much. > Andy > > _______________________________________________ > --Bandwidth and Colocation sponsored by Easynews.com -- > > Asterisk-Users mailing list > Asterisk-Users@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-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20051118/3f5a44af/attachment.htm