From: Richard Mudgett Date: Mon, 24 Nov 2014 20:32:29 +0000 (+0000) Subject: DTMF hooks: Leaving channels need to push any collected digits into the bridge. X-Git-Tag: 14.0.0-beta1~1434 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c38ffca9a180d118a090c1234ca64d811c893713;p=thirdparty%2Fasterisk.git DTMF hooks: Leaving channels need to push any collected digits into the bridge. Any partially collected DTMF digits for a DTMF hook need to be pushed into the bridge when a channel leaves the bridging system as if there were a timeout. Review: https://reviewboard.asterisk.org/r/4199/ ........ Merged revisions 428601 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 428602 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428603 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/bridge.c b/main/bridge.c index f46d314230..1e746a0f05 100644 --- a/main/bridge.c +++ b/main/bridge.c @@ -1764,8 +1764,8 @@ int ast_bridge_depart(struct ast_channel *chan) } /* - * We are claiming the reference held by the depart bridge - * channel thread. + * We are claiming the bridge_channel reference held by + * bridge_channel_depart_thread(). */ ast_bridge_channel_leave_bridge(bridge_channel, diff --git a/main/bridge_channel.c b/main/bridge_channel.c index 60fa03082a..e59d28e172 100644 --- a/main/bridge_channel.c +++ b/main/bridge_channel.c @@ -2564,10 +2564,15 @@ int bridge_channel_internal_join(struct ast_bridge_channel *bridge_channel) ast_bridge_unlock(bridge_channel->bridge); bridge_channel_event_join_leave(bridge_channel, AST_BRIDGE_HOOK_TYPE_JOIN); + while (bridge_channel->state == BRIDGE_CHANNEL_STATE_WAIT) { /* Wait for something to do. */ bridge_channel_wait(bridge_channel); } + + /* Force a timeout on any accumulated DTMF hook digits. */ + ast_bridge_channel_feature_digit(bridge_channel, 0); + bridge_channel_event_join_leave(bridge_channel, AST_BRIDGE_HOOK_TYPE_LEAVE); ast_bridge_channel_lock_bridge(bridge_channel); }