diff options
author | Jonathan Rose <jrose@digium.com> | 2013-07-19 19:35:21 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2013-07-19 19:35:21 +0000 |
commit | 17c546173fe1f24749af4643f19b40be180803de (patch) | |
tree | 46d8cf430d12142587196703c732d5e9ce9bba8e /res/res_stasis.c | |
parent | 5a8f32703c445f7d09b5e029e85d76692626a67f (diff) |
ARI: Bridge Playback, Bridge Record
Adds a new channel driver for creating channels for specific purposes
in bridges, primarily to act as either recorders or announcers. Adds
ARI commands for playing announcements to ever participant in a bridge
as well as for recording a bridge. This patch also includes some
documentation/reponse fixes to related ARI models such as playback
controls.
(closes issue ASTERISK-21592)
Reported by: Matt Jordan
(closes issue ASTERISK-21593)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2670/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_stasis.c')
-rw-r--r-- | res/res_stasis.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/res/res_stasis.c b/res/res_stasis.c index ed3823051..a294db915 100644 --- a/res/res_stasis.c +++ b/res/res_stasis.c @@ -146,6 +146,11 @@ static int control_compare(void *lhs, void *rhs, int flags) } } +struct stasis_app_control *stasis_app_control_create(struct ast_channel *chan) +{ + return control_create(chan); +} + struct stasis_app_control *stasis_app_control_find_by_channel( const struct ast_channel *chan) { @@ -531,6 +536,16 @@ int app_send_end_msg(struct app *app, struct ast_channel *chan) return 0; } +void stasis_app_control_execute_until_exhausted(struct ast_channel *chan, struct stasis_app_control *control) +{ + while (!control_is_done(control)) { + int command_count = control_dispatch_all(control, chan); + if (command_count == 0 || ast_channel_fdno(chan) == -1) { + break; + } + } +} + /*! /brief Stasis dialplan application callback */ int stasis_app_exec(struct ast_channel *chan, const char *app_name, int argc, char *argv[]) @@ -750,7 +765,7 @@ static struct ast_json *simple_bridge_channel_event( struct ast_channel_snapshot *channel_snapshot, const struct timeval *tv) { - return ast_json_pack("{s: s, s: o, s: o}", + return ast_json_pack("{s: s, s: o, s: o, s: o}", "type", type, "timestamp", ast_json_timeval(*tv, NULL), "bridge", ast_bridge_snapshot_to_json(bridge_snapshot), |