diff options
author | tringenbach <tringenbach@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-07-16 22:43:39 +0000 |
---|---|---|
committer | tringenbach <tringenbach@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-07-16 22:43:39 +0000 |
commit | 79ae3cff0b445aa7f94cefe498d3d0163a491770 (patch) | |
tree | 0e43555e56340d40bc04a2710047124e493fda99 /res | |
parent | ee699a2067fcdb943560b6ba9f2b74c5e32886b1 (diff) |
Save and restore AST_FLAG_BRIDGE_HANGUP_DONT on attended transfer.
ast_bridge_call() clears AST_FLAG_BRIDGE_HANGUP_DONT. But during an attended
transfer, ast_bridge_call() is called for a second bridge on the same channel,
and it clears that flag, which still needs to get set for when the original
ast_bridge_call() gets control back and checks it.
Review: https://reviewboard.asterisk.org/r/741
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@277625 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_features.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/res/res_features.c b/res/res_features.c index 11e4fa5ed..286620729 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -970,6 +970,8 @@ static int builtin_atxfer(struct ast_channel *chan, struct ast_channel *peer, st } if (!ast_check_hangup(transferer)) { + int hangup_dont = 0; + if (check_compat(transferer, newchan)) { /* we do mean transferee here, NOT transferer */ finishup(transferee); @@ -978,7 +980,18 @@ static int builtin_atxfer(struct ast_channel *chan, struct ast_channel *peer, st memset(&bconfig,0,sizeof(struct ast_bridge_config)); ast_set_flag(&(bconfig.features_caller), AST_FEATURE_DISCONNECT); ast_set_flag(&(bconfig.features_callee), AST_FEATURE_DISCONNECT); + + /* ast_bridge_call clears AST_FLAG_BRIDGE_HANGUP_DONT, but we don't + want that to happen here because we're also in another bridge already + */ + if (ast_test_flag(chan, AST_FLAG_BRIDGE_HANGUP_DONT)) { + hangup_dont = 1; + } res = ast_bridge_call(transferer, newchan, &bconfig); + if (hangup_dont) { + ast_set_flag(chan, AST_FLAG_BRIDGE_HANGUP_DONT); + } + if (newchan->_softhangup || !transferer->_softhangup) { ast_hangup(newchan); if (ast_stream_and_wait(transferer, xfersound, transferer->language, "")) |