Merged revisions 74955 via svnmerge from
authorSteve Murphy <murf@digium.com>
Thu, 12 Jul 2007 20:46:32 +0000 (20:46 +0000)
committerSteve Murphy <murf@digium.com>
Thu, 12 Jul 2007 20:46:32 +0000 (20:46 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r74955 | murf | 2007-07-12 14:42:08 -0600 (Thu, 12 Jul 2007) | 1 line

This patch resolves 10143; thanks to irroot for the patch; looked acceptable. Let the community decide if it messes things up
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@74956 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 9cebd9d..18cb4aa 100644 (file)
@@ -13992,7 +13992,8 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, in
        sip_pvt_unlock(p->refer->refer_call);
 
        /* 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))
@@ -14202,7 +14203,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;