[asterisk-dev] [Code Review] 2531: Implement REST API for playback to chamnel

David Lee reviewboard at asterisk.org
Wed May 15 11:36:26 CDT 2013



> On May 14, 2013, 11:31 a.m., Joshua Colp wrote:
> > /team/dlee/res-stasis-cleanup/res/res_stasis_playback.c, line 224
> > <https://reviewboard.asterisk.org/r/2531/diff/1/?file=37625#file37625line224>
> >
> >     The queueing is nice but do you foresee a developer wanting to explicit play a sound file *now* without putting it in the queue behind others?

Yes.

They could achieve it with the given API by individually canceling all the queued playbacks, then playing what they really wanted to do. Very doable, but a bit of work on their end.

If our event that indicates that the playback has stopped includes the stopped point in the media, and if we added an '?offsetms=' parameter, then they could even resume playing the original media where it was interrupted.

Another alternative would be to add a parameter to the operation, in which we'll pretty much do the same thing for them. Feels like an add-that-later-when-we-need-it sort of thing, though.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2531/#review8595
-----------------------------------------------------------


On May 10, 2013, 1:52 p.m., David Lee wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2531/
> -----------------------------------------------------------
> 
> (Updated May 10, 2013, 1:52 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-21283 and ASTERISK-21586
>     https://issues.asterisk.org/jira/browse/ASTERISK-21283
>     https://issues.asterisk.org/jira/browse/ASTERISK-21586
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> (depends on https://reviewboard.asterisk.org/r/2530)
> 
> This patch implements the REST API's for POST /channels/{channelId}/play
> and GET /playback/{playbackId}.
> 
> This allows an external application to initiate playback of a sound on a
> channel while the channel is in the Stasis application.
> 
> /play commands are issued asynchronously, and return immediately with
> the URL of the associated /playback resource. Playback commands queue up,
> playing in succession. The /playback resource shows the state of a
> playback operation as enqueued, playing or complete. (Although the
> operation will only be in the 'complete' state for a very short time,
> since it is almost immediately freed up).
> 
> (closes issue ASTERISK-21283)
> (closes issue ASTERISK-21586)
> Review: https://reviewboard.asterisk.org/r/2531/
> 
> 
> Diffs
> -----
> 
>   /team/dlee/res-stasis-cleanup/include/asterisk/stasis_app_playback.h PRE-CREATION 
>   /team/dlee/res-stasis-cleanup/include/asterisk/stasis_channels.h 388370 
>   /team/dlee/res-stasis-cleanup/include/asterisk/stasis_http.h 388370 
>   /team/dlee/res-stasis-cleanup/main/channel.c 388370 
>   /team/dlee/res-stasis-cleanup/main/channel_internal_api.c 388370 
>   /team/dlee/res-stasis-cleanup/main/stasis_channels.c 388370 
>   /team/dlee/res-stasis-cleanup/res/res_stasis_http.c 388370 
>   /team/dlee/res-stasis-cleanup/res/res_stasis_http_channels.c 388370 
>   /team/dlee/res-stasis-cleanup/res/res_stasis_http_events.c 388370 
>   /team/dlee/res-stasis-cleanup/res/res_stasis_playback.c PRE-CREATION 
>   /team/dlee/res-stasis-cleanup/res/res_stasis_playback.exports.in PRE-CREATION 
>   /team/dlee/res-stasis-cleanup/res/stasis_http/resource_channels.h 388370 
>   /team/dlee/res-stasis-cleanup/res/stasis_http/resource_channels.c 388370 
>   /team/dlee/res-stasis-cleanup/res/stasis_http/resource_events.h 388370 
>   /team/dlee/res-stasis-cleanup/res/stasis_http/resource_playback.c 388370 
>   /team/dlee/res-stasis-cleanup/rest-api/api-docs/channels.json 388370 
>   /team/dlee/res-stasis-cleanup/rest-api/api-docs/events.json 388370 
> 
> Diff: https://reviewboard.asterisk.org/r/2531/diff/
> 
> 
> Testing
> -------
> 
> Poked the playback API manually.
> 
> 
> Thanks,
> 
> David Lee
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130515/bd064542/attachment.htm>


More information about the asterisk-dev mailing list