diff options
author | Jonathan Rose <jrose@digium.com> | 2014-08-13 16:24:37 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2014-08-13 16:24:37 +0000 |
commit | d4695774e7ef3b4699b8283f175d161cd19e3d25 (patch) | |
tree | 4f59a5f5dc0094ffbe928dd21b6095defa056832 /main/channel_internal_api.c | |
parent | 6a6702bb0fff957c0264e872fe0760efe21a1e20 (diff) |
Bridges: Fix feature interruption/unintended kick caused by external actions
If a manager or CLI user attached a mixmonitor to a call running a dynamic
bridge feature while in a bridge, the feature would be interrupted and the
channel would be forcibly kicked out of the bridge (usually ending the call
during a simple 1 to 1 call). This would also occur during any similar action
that could set the unbridge soft hangup flag, so the fix for this was to
remove unbridge from the soft hangup flags and make it a separate thing all
together.
ASTERISK-24027 #close
Reported by: mjordan
Review: https://reviewboard.asterisk.org/r/3900/
........
Merged revisions 420934 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 420940 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel_internal_api.c')
-rw-r--r-- | main/channel_internal_api.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/main/channel_internal_api.c b/main/channel_internal_api.c index 8a9e18eb0..e32a52791 100644 --- a/main/channel_internal_api.c +++ b/main/channel_internal_api.c @@ -173,6 +173,8 @@ struct ast_channel { * See \arg \ref AstFileDesc */ int softhangup; /*!< Whether or not we have been hung up... Do not set this value * directly, use ast_softhangup() */ + int unbridged; /*!< If non-zero, the bridge core needs to re-evaluate the current + bridging technology which is in use by this channel's bridge. */ int fdno; /*!< Which fd had an event detected on */ int streamid; /*!< For streaming playback, the schedule ID */ int vstreamid; /*!< For streaming video playback, the schedule ID */ @@ -377,7 +379,6 @@ int ast_channel_data_add_structure(struct ast_data *tree, ast_data_add_bool(data_softhangup, "timeout", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_TIMEOUT); ast_data_add_bool(data_softhangup, "appunload", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_APPUNLOAD); ast_data_add_bool(data_softhangup, "explicit", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_EXPLICIT); - ast_data_add_bool(data_softhangup, "unbridge", ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_UNBRIDGE); /* channel flags */ data_flags = ast_data_add_node(tree, "flags"); @@ -1141,6 +1142,33 @@ void ast_channel_softhangup_internal_flag_clear(struct ast_channel *chan, int va chan ->softhangup &= ~value; } +int ast_channel_unbridged_nolock(struct ast_channel *chan) +{ + return chan->unbridged; +} + +int ast_channel_unbridged(struct ast_channel *chan) +{ + int res; + ast_channel_lock(chan); + res = ast_channel_unbridged_nolock(chan); + ast_channel_unlock(chan); + return res; +} + +void ast_channel_set_unbridged_nolock(struct ast_channel *chan, int value) +{ + chan->unbridged = value; + ast_queue_frame(chan, &ast_null_frame); +} + +void ast_channel_set_unbridged(struct ast_channel *chan, int value) +{ + ast_channel_lock(chan); + ast_channel_set_unbridged_nolock(chan, value); + ast_channel_unlock(chan); +} + void ast_channel_callid_cleanup(struct ast_channel *chan) { if (chan->callid) { |