[asterisk-dev] [Code Review] 3379: ARI: Make bridges/{bridgeId}/play queue sound files if sounds are already playing on the bridge instead of playing them simultaneously as they are called
Jonathan Rose
reviewboard at asterisk.org
Thu Mar 20 14:29:40 CDT 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3379/#review11303
-----------------------------------------------------------
Hmmm, the potential for race conditions here is slightly different from what I'd realized. Basically, there is a short window between the channel hanging up and the bridge<->channel wrapper object being removed that allows for another playback action to be queued. If that happens and a new channel is created, it will be added to the list and take out the existing one. This means the old control won't get removed from the list and then when the old function reaches the point where it does delete the wrapper, it will delete the new wrapper instead meaning that if another playback is queued the wrapper will already be gone and a simultaneous audio channel would be made at that point.
Easy fix to that is to reject duplicates to the playback wrapper container instead of replacing...
- Jonathan Rose
On March 20, 2014, 2:11 p.m., Jonathan Rose wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3379/
> -----------------------------------------------------------
>
> (Updated March 20, 2014, 2:11 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Bugs: ASTERISK-22677
> https://issues.asterisk.org/jira/browse/ASTERISK-22677
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> Previously, if you played an audio file and then played another before the first finished, the second audio file would start playing immediately as it was called overlapping the previous sound. Apparently people don't like that. This patch changes that behavior so that the sound will be queued at the end of any existing controls if they are running.
>
>
> Diffs
> -----
>
> /branches/12/res/res_stasis_playback.c 410875
> /branches/12/res/res_stasis.c 410875
> /branches/12/res/ari/resource_bridges.c 410875
> /branches/12/include/asterisk/stasis_app.h 410875
>
> Diff: https://reviewboard.asterisk.org/r/3379/diff/
>
>
> Testing
> -------
>
> Tested for playback channel wrapper leaks, tested to make sure control objects were being destroyed when they fell out of use. Tested playing of a single file. Tested playing of multiple files in a row. Tested playing of multiple files in a row and then after a sequence finished, playing additional files so that new channels would have to be created. Tested playing sounds right as other sounds were concluding. I wasn't able to break it (although I wouldn't be surprised if there is a possible condition where you can grab a control as it is finishing up its queue and then attempting to add a sound to a finished queue causing the playback to fail. I don't think this would break things in a profound way, it just might possibly make one sound fail to queue under extremely unlikely conditions).
>
>
> Thanks,
>
> Jonathan Rose
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140320/0136645e/attachment.html>
More information about the asterisk-dev
mailing list