[asterisk-commits] mjordan: trunk r408070 - in /trunk: ./ channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Feb 14 06:41:16 CST 2014
Author: mjordan
Date: Fri Feb 14 06:41:13 2014
New Revision: 408070
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=408070
Log:
chnan_sip: Set SIP_DEFER_BYE_ON_TRANSFER prior to calling bridge blind transfer
This patch moves setting SIP_DEFER_BY_ON_TRANSFER prior to calling
ast_bridge_transfer_blind. This prevents a BYE from being sent prior to the
NOTIFY request that informs the transferor if the transfer succeeded or failed.
This patch also clears said flag from the off nominal NOTIFY paths in the
local_attended_transfer code, as once we've sent the NOTIFY request it is safe
to send by the BYE request.
This was caught by the blind-transfer-accountcode test in the Asterisk Test
Suite.
(closes issue ASTERISK-23290)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3214/
........
Merged revisions 408069 from http://svn.asterisk.org/svn/asterisk/branches/12
Modified:
trunk/ (props changed)
trunk/channels/chan_sip.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.
Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=408070&r1=408069&r2=408070
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Feb 14 06:41:13 2014
@@ -25960,16 +25960,19 @@
transferer->refer->status = REFER_FAILED;
transmit_notify_with_sipfrag(transferer, seqno, "500 Internal Server Error", TRUE);
append_history(transferer, "Xfer", "Refer failed (internal error)");
+ ast_clear_flag(&transferer->flags[0], SIP_DEFER_BYE_ON_TRANSFER);
return -1;
case AST_BRIDGE_TRANSFER_INVALID:
transferer->refer->status = REFER_FAILED;
transmit_notify_with_sipfrag(transferer, seqno, "503 Service Unavailable", TRUE);
append_history(transferer, "Xfer", "Refer failed (invalid bridge state)");
+ ast_clear_flag(&transferer->flags[0], SIP_DEFER_BYE_ON_TRANSFER);
return -1;
case AST_BRIDGE_TRANSFER_NOT_PERMITTED:
transferer->refer->status = REFER_FAILED;
transmit_notify_with_sipfrag(transferer, seqno, "403 Forbidden", TRUE);
append_history(transferer, "Xfer", "Refer failed (operation not permitted)");
+ ast_clear_flag(&transferer->flags[0], SIP_DEFER_BYE_ON_TRANSFER);
return -1;
default:
break;
@@ -26253,6 +26256,7 @@
*nounlock = 1;
}
+ ast_set_flag(&p->flags[0], SIP_DEFER_BYE_ON_TRANSFER);
sip_pvt_unlock(p);
transfer_res = ast_bridge_transfer_blind(1, transferer, refer_to, refer_to_context, blind_transfer_cb, &cb_data);
sip_pvt_lock(p);
@@ -26263,24 +26267,26 @@
p->refer->status = REFER_FAILED;
transmit_notify_with_sipfrag(p, seqno, "503 Service Unavailable (can't handle one-legged xfers)", TRUE);
append_history(p, "Xfer", "Refer failed (only bridged calls).");
+ ast_clear_flag(&p->flags[0], SIP_DEFER_BYE_ON_TRANSFER);
break;
case AST_BRIDGE_TRANSFER_NOT_PERMITTED:
res = -1;
p->refer->status = REFER_FAILED;
transmit_notify_with_sipfrag(p, seqno, "403 Forbidden", TRUE);
append_history(p, "Xfer", "Refer failed (bridge does not permit transfers)");
+ ast_clear_flag(&p->flags[0], SIP_DEFER_BYE_ON_TRANSFER);
break;
case AST_BRIDGE_TRANSFER_FAIL:
res = -1;
p->refer->status = REFER_FAILED;
transmit_notify_with_sipfrag(p, seqno, "500 Internal Server Error", TRUE);
append_history(p, "Xfer", "Refer failed (internal error)");
+ ast_clear_flag(&p->flags[0], SIP_DEFER_BYE_ON_TRANSFER);
break;
case AST_BRIDGE_TRANSFER_SUCCESS:
res = 0;
p->refer->status = REFER_200OK;
transmit_notify_with_sipfrag(p, seqno, "200 OK", TRUE);
- ast_set_flag(&p->flags[0], SIP_DEFER_BYE_ON_TRANSFER);
append_history(p, "Xfer", "Refer succeeded.");
break;
default:
More information about the asterisk-commits
mailing list