From 12e8c6e39212b06bcbe0dad55d4adece25112c25 Mon Sep 17 00:00:00 2001 From: murf Date: Thu, 12 Jul 2007 20:42:08 +0000 Subject: This patch resolves 10143; thanks to irroot for the patch; looked acceptable. Let the community decide if it messes things up git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@74955 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_sip.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'channels') diff --git a/channels/chan_sip.c b/channels/chan_sip.c index f0a0c047c..8523888cf 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -13201,7 +13201,8 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, in ast_mutex_unlock(&p->refer->refer_call->lock); /* Make sure that the masq does not free our PVT for the old call */ - ast_set_flag(&p->refer->refer_call->flags[0], SIP_DEFER_BYE_ON_TRANSFER); /* Delay hangup */ + if (! earlyreplace && ! oneleggedreplace ) + ast_set_flag(&p->refer->refer_call->flags[0], SIP_DEFER_BYE_ON_TRANSFER); /* Delay hangup */ /* Prepare the masquerade - if this does not happen, we will be gone */ if(ast_channel_masquerade(replacecall, c)) @@ -13418,7 +13419,7 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int error = 1; } - if (!error && p->refer->refer_call->owner->_state != AST_STATE_RING && p->refer->refer_call->owner->_state != AST_STATE_UP ) { + if (!error && p->refer->refer_call->owner->_state != AST_STATE_RINGING && p->refer->refer_call->owner->_state != AST_STATE_RING && p->refer->refer_call->owner->_state != AST_STATE_UP ) { ast_log(LOG_NOTICE, "Supervised transfer attempted to replace non-ringing or active call id (%s)!\n", replace_id); transmit_response(p, "603 Declined (Replaces)", req); error = 1; -- cgit v1.2.3