]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Properly handle channel allocation failures duing invites with replaces.
authorMatthew Nicholson <mnicholson@digium.com>
Thu, 30 Sep 2010 19:51:27 +0000 (19:51 +0000)
committerMatthew Nicholson <mnicholson@digium.com>
Thu, 30 Sep 2010 19:51:27 +0000 (19:51 +0000)
ABE-2588

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

channels/chan_sip.c

index 5f523f0a88d434abbb7ab5e16077caa19dfa5741..eedac8f0482ed42102b24d9efb6235b1a4a03938 100644 (file)
@@ -20252,7 +20252,8 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
                        /* Initialize our tag */
 
                        make_our_tag(p->tag, sizeof(p->tag));
-                       /* First invitation - create the channel */
+                       /* First invitation - create the channel.  Allocation
+                        * failures are handled below. */
                        c = sip_new(p, AST_STATE_DOWN, S_OR(p->peername, NULL));
                        *recount = 1;
 
@@ -20412,7 +20413,7 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
        if (!req->ignore && p)
                p->lastinvite = seqno;
 
-       if (replace_id) {       /* Attended transfer or call pickup - we're the target */
+       if (c && replace_id) {  /* Attended transfer or call pickup - we're the target */
                if (!ast_strlen_zero(pickup.exten)) {
                        append_history(p, "Xfer", "INVITE/Replace received");