asterisk/res/ari
Matt Jordan 03d88b5656 ARI: Add the ability to play multiple media URIs in a single operation
Many ARI applications will want to play multiple media files in a row to
a resource. The most common use case is when building long-ish IVR prompts
made up of multiple, smaller sound files. Today, that requires building a
small state machine, listening for each PlaybackFinished event, and triggering
the next sound file to play. While not especially challenging, it is tedious
work. Since requiring developers to write tedious code to do normal activities
stinks, this patch adds the ability to play back a list of media files to a
resource.

Each of the 'play' operations on supported resources (channels and bridges)
now accepts a comma delineated list of media URIs to play. A single Playback
resource is created as a handle to the entire list. The operation of playing
a list is identical to playing a single media URI, save that a new event,
PlaybackContinuing, is raised instead of a PlaybackFinished for each non-final
media URI. When the entire list is finished being played, a PlaybackFinished
event is raised.

In order to help inform applications where they are in the list playback, the
Playback resource now includes a new, optional attribute, 'next_media_uri',
that contains the next URI in the list to be played.

It's important to note the following:
 - If an offset is provided to the 'play' operations, it only applies to the
   first media URI, as it would be weird to skip n seconds forward in every
   media resource.
 - Operations that control the position of the media only affect the current
   media being played. For example, once a media resource in the list
   completes, a 'reverse' operation on a subsequent media resource will not
   start a previously completed media resource at the appropiate offset.
 - This patch does not add any new operations to control the list. Hopefully,
   user feedback and/or future patches would add that if people want it.

ASTERISK-26022 #close

Change-Id: Ie1ea5356573447b8f51f2e7964915ea01792f16f
2016-05-17 14:01:22 -03:00
..
ari_model_validators.c ARI: Add the ability to play multiple media URIs in a single operation 2016-05-17 14:01:22 -03:00
ari_model_validators.h ARI: Add the ability to play multiple media URIs in a single operation 2016-05-17 14:01:22 -03:00
ari_websockets.c ari/ari_websockets.c: Fix ast_debug parameter type mismatch. 2015-08-19 12:10:18 -05:00
cli.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
config.c res/ari/config.c: Fix user sort compare function. 2015-09-29 12:10:45 -05:00
internal.h res_http_websocket: Close websocket correctly and use careful fwrite 2014-06-26 12:21:14 +00:00
resource_applications.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
resource_applications.h ARI: Fix endpoint/channel subscription issues; allow for subscriptions to tech 2014-07-22 16:20:58 +00:00
resource_asterisk.c ARI: Retrieve existing log channels 2015-08-07 14:57:45 -05:00
resource_asterisk.h ARI: Retrieve existing log channels 2015-08-07 14:57:45 -05:00
resource_bridges.c ARI: Add the ability to play multiple media URIs in a single operation 2016-05-17 14:01:22 -03:00
resource_bridges.h ARI: Add the ability to play multiple media URIs in a single operation 2016-05-17 14:01:22 -03:00
resource_channels.c ARI: Add the ability to play multiple media URIs in a single operation 2016-05-17 14:01:22 -03:00
resource_channels.h ARI: Add the ability to play multiple media URIs in a single operation 2016-05-17 14:01:22 -03:00
resource_device_states.c res_ari_device_states: Fix dependency on res_stasis_device_state. 2015-04-30 13:44:57 -05:00
resource_device_states.h ARI: Remove unnecessary \briefs from automatically generated documentation 2014-07-02 21:13:46 +00:00
resource_endpoints.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
resource_endpoints.h Multiple revisions 420089-420090,420097 2014-08-05 21:44:09 +00:00
resource_events.c ARI: Add the ability to subscribe to all events 2015-09-22 09:59:47 -05:00
resource_events.h ARI: Add the ability to subscribe to all events 2015-09-22 09:59:47 -05:00
resource_mailboxes.c ARI: Fix missing dependencies. 2015-04-29 07:46:44 -04:00
resource_mailboxes.h ARI: Remove unnecessary \briefs from automatically generated documentation 2014-07-02 21:13:46 +00:00
resource_playbacks.c ARI: Fix missing dependencies. 2015-04-29 07:46:44 -04:00
resource_playbacks.h ARI: Remove unnecessary \briefs from automatically generated documentation 2014-07-02 21:13:46 +00:00
resource_recordings.c ARI: Fix missing dependencies. 2015-04-29 07:46:44 -04:00
resource_recordings.h ari: Add a copy operation for stored recordings 2014-07-18 21:48:46 +00:00
resource_sounds.c git migration: Refactor the ASTERISK_FILE_VERSION macro 2015-04-13 03:48:57 -04:00
resource_sounds.h ARI: Remove unnecessary \briefs from automatically generated documentation 2014-07-02 21:13:46 +00:00