you could also wait for the execute_complete of the file you were playing<br><br><div class="gmail_quote">On Mon, Mar 15, 2010 at 9:40 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; color: rgb(31, 73, 125);" lang="EN-US">Thanks for the reply.</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; color: rgb(31, 73, 125);" lang="EN-US">Yes, I thought of this.</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; color: rgb(31, 73, 125);" lang="EN-US">But that still shouldn’t solve the issue? It will only
tell that the CF_BREAK flag was set on the channel, not that the current
playback detected the flag in the loop (which I guess is done in a different
thread), or is this event sent once the playback really did stop?</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; color: rgb(31, 73, 125);" lang="EN-US">/Peter</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; color: rgb(31, 73, 125);" lang="EN-US"> </span></p>
<div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;" lang="EN-US">Från:</span></b><span style="font-size: 10pt;" lang="EN-US">
<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>
[mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] <b>För </b>Anthony
Minessale<br>
<b>Skickat:</b> den 15 mars 2010 16:31<br>
<b>Till:</b> <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br>
<b>Ämne:</b> Re: [Freeswitch-users] ESL and application "break" (to
stop file playback) - timing issues.</span></p>
</div><div><div></div><div class="h5">
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-bottom: 12pt;">you could wait for the
execute_complete event for your break command.<br>
<br>
</p>
<div>
<p class="MsoNormal">On Mon, Mar 15, 2010 at 3:20 AM, Peter Olsson <<a href="mailto:peter.olsson@visionutveckling.se" target="_blank">peter.olsson@visionutveckling.se</a>>
wrote:</p>
<div>
<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>
<p class="MsoNormal" style="margin-bottom: 12pt;"><br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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></p>
</div>
</div></div><p class="MsoNormal"></p><div><div></div><div class="h5"><br>
<br clear="all">
<br>
-- <br>
Anthony Minessale II<br>
<br>
FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br>
<br>
AIM: anthm<br>
<a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>
GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
<br>
FreeSWITCH Developer Conference<br>
<a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br>
<a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:+19193869900<br></div></div>
!DSPAM:4b9e543132932880416179!
</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>