From d5243cc7aa84d0f9f5263300491cd5ddeb84e0b2 Mon Sep 17 00:00:00 2001
From: Olle Johansson <oej@edvina.net>
Date: Fri, 10 Nov 2006 20:31:57 +0000
Subject: [PATCH] Make sure we destroy dialog in case of loop

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47468 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 channels/chan_sip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index e97e9010bd..ba0d08ca4e 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13109,7 +13109,7 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
 		/* If pedantic is on, we need to check the tags. If they're different, this is
 	   	in fact a forked call through a SIP proxy somewhere. */
 		transmit_response(p, "482 Loop Detected", req);
-		/* We do NOT destroy p here, so that our response will be accepted */
+		sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
 		return 0;
 	}
 	
@@ -13118,6 +13118,7 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
 		transmit_response(p, "491 Request Pending", req);
 		if (option_debug)
 			ast_log(LOG_DEBUG, "Got INVITE on call where we already have pending INVITE, deferring that - %s\n", p->callid);
+		/* Don't destroy dialog here */
 		return 0;
 	}
 
-- 
GitLab