[Freeswitch-users] ESL and application "break" (to stop file playback) - timing issues.

Anthony Minessale anthony.minessale at gmail.com
Mon Mar 15 08:31:03 PDT 2010


you could wait for the execute_complete event for your break command.


On Mon, Mar 15, 2010 at 3:20 AM, Peter Olsson <
peter.olsson at visionutveckling.se> wrote:

>  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 :)
>
>
>
> 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.
>
>
>
> 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.
>
>
>
> 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.
>
>
>
> I guess I could wait 50ms before sending the new playback message, but I
> can really never be sure that it was handled properly.
>
>
>
> 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.
>
>
>
> These are the messages I’m sending;
>
>
>
> SendMsg <uuid>
>
> call-command: execute
>
> execute-app-name: playback
>
> execute-app-arg: tone_stream://%(1500, 3500, 440.0, 0.0);loops=100
>
>
>
> When I don’t want this to play anymore I send a break;
>
>
>
> SendMsg <uuid>
>
> call-command: execute
>
> execute-app-name: break
>
>
>
> And immediately after this I want to play another file;
>
>
>
> SendMsg <uuid>
>
> call-command: execute
>
> execute-app-name: playback
>
> execute-app-arg: file/to/play.wav
>
>
>
>
>
> Regards,
>
>
>
> Peter Olsson
>
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>


-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
pstn:+19193869900
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100315/424d72b0/attachment-0002.html 


More information about the FreeSWITCH-users mailing list