summaryrefslogtreecommitdiff
path: root/res/res_stasis.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2014-09-01 14:15:32 +0000
committerMatthew Jordan <mjordan@digium.com>2014-09-01 14:15:32 +0000
commitdf5dbbd878fa5304b3ca64ac65ac9774731453d2 (patch)
tree5e7f61d88c6a9fe4935f51c3c78b94a20ebb9f14 /res/res_stasis.c
parent5aefecd81e38623c8d55e79e6afbae47a561bc62 (diff)
res_stasis: Don't play MoH to channels by default when added to holding bridges
When ARI manipulates a bridge, it generally doesn't care what the mixing technology is. Operations on a bridge initiated through ARI should perform their action in generally the same way, regardless of the bridge's mixing technology. While the mixing technology may determine how media flows to channels, the actual operations on a bridge themselves should be the same. Currently, this isn't the case with holding bridges. When a channel joins without a role, MoH is started on that channel automatically. Subsequent bridge operations that would stop MoH would fail (as there is no Announcer channel playing MoH to the bridge). Starting MoH on the bridge will also create two MoH streams: one from the MoH being played on the participant channel, and one from the announcer channel. From the perspective of ARI users, this is counter-intuitive - I would not expect MoH to be started for me. The mixing technology determines how media is shared between participants, not the application experience. This patch does the following: * The Stasis bridge class now inspects channels as they are going into a bridge. If the bridge has a holding capability, and the channel has no roles, we give it a participant role and mark the default behaviour to have no entertainment. This allows addChannel operations to continue to set a participant role with an entertainment option if it felt like it (or could do it). * The music on hold channel is now Stasis approved (tm) Review: https://reviewboard.asterisk.org/r/3929/ ASTERISK-24264 #close Reported by: Samuel Galarneau Tested by: Samuel Galarneau ........ Merged revisions 422503 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 422504 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_stasis.c')
-rw-r--r--res/res_stasis.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/res/res_stasis.c b/res/res_stasis.c
index f2abaf770..c11f82976 100644
--- a/res/res_stasis.c
+++ b/res/res_stasis.c
@@ -513,6 +513,11 @@ static struct ast_channel *bridge_moh_create(struct ast_bridge *bridge)
return NULL;
}
+ if (stasis_app_channel_unreal_set_internal(chan)) {
+ ast_hangup(chan);
+ return NULL;
+ }
+
/* The after bridge callback assumes responsibility of the bridge_id. */
if (ast_bridge_set_after_callback(chan,
moh_after_bridge_cb, moh_after_bridge_cb_failed, bridge_id)) {