you could wait for the execute_complete event for your break command.<br><br><br><div class="gmail_quote">On Mon, Mar 15, 2010 at 3:20 AM, Peter Olsson <span dir="ltr"><<a href="mailto:peter.olsson@visionutveckling.se">peter.olsson@visionutveckling.se</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div link="blue" vlink="purple" lang="SV">
<div>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">I’m not sure
if this belongs in Jira, or if it’s possible to do it another way –
so I try the list first :)</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">I’m using
ESL to do some IVR functions. Basically I play some sound files, wait for DTMF,
and then do something, like record a message, transfer the call to a mobile
phone etc. Quite basic and simple.</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">I’ve noticed
one problem with this, and it’s when I want to stop playback using
command “break”. In 99% of the time everything works as expected,
but sometimes I get this problem – and the problem is that the current
file doesn’t stop playing. And I think I know why this is happening.</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">Lets say I first
send playback(tone_stream://%(1500, 3500, 440.0, 0.0);loops=100) to the
channel. This will play a ring-tone (swedish) and loop through it 100 times.
When I want to stop this tone I send the break command, and directly after this
a new playback command. Maybe 1 time in 100 tries the tone_stream doesn’t
stop playing. I think this is becuase how break works. From what I understand
from the source it just sets the CF_BREAK flag on the channel, and then the
playback application will detect this and stop the playback. However, when I
send a new playback command immediately after break it will reset the
CF_BREAK-flag again, to make sure it won’t cause any problems for the new
playback. So if the original playback (tone_stream) didn’t check the flag
before it was reset, it won’t known that it was supposed to stop playing.</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">I guess I could
wait 50ms before sending the new playback message, but I can really never be
sure that it was handled properly.</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">Is there any other
way around this? How about “break <uuid> all”, will it make
any difference in this case? Or should this just be treated as a timing bug,
and filed to Jira? Any help on this would be greatly appreciated.</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">These are the
messages I’m sending;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">SendMsg
<uuid></span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">call-command:
execute</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">execute-app-name:
playback</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">execute-app-arg:
tone_stream://%(1500, 3500, 440.0, 0.0);loops=100</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">When I don’t
want this to play anymore I send a break;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">SendMsg
<uuid></span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">call-command:
execute</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">execute-app-name:
break</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">And immediately
after this I want to play another file;</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">SendMsg
<uuid></span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">call-command:
execute</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">execute-app-name:
playback</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US">execute-app-arg:
file/to/play.wav</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;">Regards,</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt;">Peter Olsson</span></p>
<p class="MsoNormal"><span style="font-size: 10pt;"> </span></p>
</div>
</div>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:+19193869900<br>