summaryrefslogtreecommitdiff
path: root/res/res_stasis_recording.c
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-08-13 15:27:32 +0000
committerDavid M. Lee <dlee@digium.com>2013-08-13 15:27:32 +0000
commit987fdfb444aef3eb60041887db60b54e4e382293 (patch)
tree944be36f63794903977a210f530845d230a23f05 /res/res_stasis_recording.c
parent94ee8f2e33f6d6e80c3fc6d64d04883fec9496f1 (diff)
ARI: allow other operations to happen while bridged
This patch changes ARI bridging to allow other channel operations to happen while the channel is bridged. ARI channel operations are designed to queue up and execute sequentially. This meant, though, that while a channel was bridged, any other channel operations would queue up and execute only after the channel left the bridge. This patch changes ARI bridging so that channel commands can execute while the channel is bridged. For most operations, things simply work as expected. The one thing that ended up being a bit odd is recording. The current recording implementation will fail when one attempts to record a channel that's in a bridge. Note that the bridge itself may be recording; it's recording a specific channel in the bridge that fails. While this is an annoying limitation, channel recording is still very useful for use cases such as voice mail, and bridge recording makes up much of the difference for other use cases. (closes issue ASTERISK-22084) Review: https://reviewboard.asterisk.org/r/2726/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_stasis_recording.c')
-rw-r--r--res/res_stasis_recording.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/res/res_stasis_recording.c b/res/res_stasis_recording.c
index 575ccae1e..f62716826 100644
--- a/res/res_stasis_recording.c
+++ b/res/res_stasis_recording.c
@@ -231,10 +231,11 @@ static void *record_file(struct stasis_app_control *control,
recording = data;
ast_assert(recording != NULL);
- ao2_lock(recording);
- recording->state = STASIS_APP_RECORDING_STATE_RECORDING;
- recording_publish(recording);
- ao2_unlock(recording);
+ if (stasis_app_get_bridge(control)) {
+ ast_log(LOG_ERROR, "Cannot record channel while in bridge\n");
+ recording_fail(recording);
+ return NULL;
+ }
switch (recording->options->terminate_on) {
case STASIS_APP_RECORDING_TERMINATE_NONE:
@@ -258,6 +259,11 @@ static void *record_file(struct stasis_app_control *control,
return NULL;
}
+ ao2_lock(recording);
+ recording->state = STASIS_APP_RECORDING_STATE_RECORDING;
+ recording_publish(recording);
+ ao2_unlock(recording);
+
ast_play_and_record_full(chan,
NULL, /* playfile */
recording->absolute_name,