]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: No BYE message sent after INVITE with Replaces
authorScott Griepentrog <sgriepentrog@digium.com>
Tue, 14 Jan 2014 18:43:56 +0000 (18:43 +0000)
committerScott Griepentrog <sgriepentrog@digium.com>
Tue, 14 Jan 2014 18:43:56 +0000 (18:43 +0000)
Setting channel state DOWN is an unnecessary step that was
only being done in handle_invite_replaces().  This changes
that by removing the call and reducing locking.

(closes issue ASTERISK-23010)
Reported by: Ryan Tilton
Review: https://reviewboard.asterisk.org/r/3116/
........

Merged revisions 405486 from http://svn.asterisk.org/svn/asterisk/branches/1.8

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

channels/chan_sip.c

index c92055d1f0fecb09db1e81ed71bd639e9505e48c..4d5e33cf472087faf480c38120738e86da67de3d 100644 (file)
@@ -24893,12 +24893,11 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, st
        if (ast_do_masquerade(replacecall)) {
                ast_log(LOG_WARNING, "Failed to perform masquerade with INVITE replaces\n");
        }
-       ast_channel_lock(c);
        if (earlyreplace || oneleggedreplace ) {
+               ast_channel_lock(c);
                ast_channel_hangupcause_set(c, AST_CAUSE_SWITCH_CONGESTION);
+               ast_channel_unlock(c);
        }
-       ast_setstate(c, AST_STATE_DOWN);
-       ast_channel_unlock(c);
 
        /* c and c's tech pvt must be unlocked at this point for ast_hangup */
        ast_hangup(c);