From: Mark Spencer Date: Wed, 14 May 2003 19:17:20 +0000 (+0000) Subject: If we receive OPTIONS as the start of a conversation, kill it immediately after givin... X-Git-Tag: 0.5.0~476 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=377303a3910eab30b4023a49caa7c0c3220ae79d;p=thirdparty%2Fasterisk.git If we receive OPTIONS as the start of a conversation, kill it immediately after giving our response git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1020 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 75417c7e79..ead99ec868 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4188,6 +4188,10 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc transmit_response_with_allow(p, "484 Address Incomplete", req); else transmit_response_with_allow(p, "200 OK", req); + /* Destroy if this OPTIONS was the opening request, but not if + it's in the middle of a normal call flow. */ + if (!p->lastinvite) + p->needdestroy = 1; } else if (!strcasecmp(cmd, "INVITE")) { if (p->outgoing && p->owner && (p->owner->_state != AST_STATE_UP)) { /* This is a call to ourself. Send ourselves an error code and stop