If somehow we don't have an answer, set need to destroy on CANCEL
[asterisk/asterisk.git] / channels / chan_sip.c
index cf1faa4..52e120c 100755 (executable)
@@ -5111,6 +5111,8 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
                }
                if (p->owner)
                        ast_queue_hangup(p->owner, 0);
                }
                if (p->owner)
                        ast_queue_hangup(p->owner, 0);
+               else
+                       p->needdestroy = 1;
                transmit_response(p, "200 OK", req);
                transmit_response_reliable(p, "487 Request Terminated", &p->initreq);
        } else if (!strcasecmp(cmd, "BYE")) {
                transmit_response(p, "200 OK", req);
                transmit_response_reliable(p, "487 Request Terminated", &p->initreq);
        } else if (!strcasecmp(cmd, "BYE")) {