From 46059b071467780e22f7eb515495725a9bcf3bb0 Mon Sep 17 00:00:00 2001
From: Mark Spencer <markster@digium.com>
Date: Fri, 22 Aug 2003 16:27:53 +0000
Subject: [PATCH] Reliably transmit BYE always

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

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 9947f46f09..0d9a0179f0 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1008,7 +1008,7 @@ static int sip_hangup(struct ast_channel *ast)
 		} else {
 			if (!p->pendinginvite) {
 				/* Send a hangup */
-				transmit_request_with_auth(p, "BYE", 0, 0);
+				transmit_request_with_auth(p, "BYE", 0, 1);
 			} else {
 				/* Note we will need a BYE when this all settles out
 				   but we can't send one while we have "INVITE" outstanding. */
@@ -4361,7 +4361,7 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
 				transmit_request(p, "ACK", seqno, 0);
 				/* Go ahead and send bye at this point */
 				if (p->pendingbye) {
-					transmit_request_with_auth(p, "BYE", 0, 0);
+					transmit_request_with_auth(p, "BYE", 0, 1);
 					p->needdestroy = 1;
 				}
 			} else if (!strcasecmp(msg, "REGISTER")) {
@@ -4800,7 +4800,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
 				}
 			}
 			/* Always increment on a BYE */
-			transmit_request_with_auth(p, "BYE", 0, 0);
+			transmit_request_with_auth(p, "BYE", 0, 1);
 			p->alreadygone = 1;
 		}
 	} else if (!strcasecmp(cmd, "CANCEL")) {
-- 
GitLab