From 6ebfac8e70b0863fd96ee4fe6ca4b254696fe9c4 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Fri, 23 Aug 2013 18:33:36 +0000 Subject: Handle DTMF and hold wrapup when a channel leaves the bridging system. DTMF start/end and hold/unhold events have state because a DTMF begin event and hold event must be ended by something. The following cases need to be handled when a channel is moved around in the system. * When a channel leaves a bridge it may owe a DTMF end event to the bridge. * When a channel leaves a bridge it may owe an UNHOLD event to the bridge. (This case is explicitly ignored because things like transfers need explicit control over this.) * When a channel leaves the bridging system it may need to simulate a DTMF end event to the channel. * When a channel leaves the bridging system it may need to simulate an UNHOLD event to the channel. The patch also fixes the following: * Fixes playing a file and restarting MOH using the latest MOH class used. (closes issue ASTERISK-22043) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2791/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397577 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- bridges/bridge_builtin_interval_features.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bridges') diff --git a/bridges/bridge_builtin_interval_features.c b/bridges/bridge_builtin_interval_features.c index e804729bf..bb07e5058 100644 --- a/bridges/bridge_builtin_interval_features.c +++ b/bridges/bridge_builtin_interval_features.c @@ -103,12 +103,14 @@ static void limits_interval_playback(struct ast_bridge_channel *bridge_channel, /* * It may be necessary to resume music on hold after we finish * playing the announcment. - * - * XXX We have no idea what MOH class was in use before playing - * the file. */ if (ast_test_flag(ast_channel_flags(bridge_channel->chan), AST_FLAG_MOH)) { - ast_moh_start(bridge_channel->chan, NULL, NULL); + const char *latest_musicclass; + + ast_channel_lock(bridge_channel->chan); + latest_musicclass = ast_strdupa(ast_channel_latest_musicclass(bridge_channel->chan)); + ast_channel_unlock(bridge_channel->chan); + ast_moh_start(bridge_channel->chan, latest_musicclass, NULL); } } -- cgit v1.2.3