From c39f887ac8deee8cc56b4db5c601d54780ade1d0 Mon Sep 17 00:00:00 2001
From: Olle Johansson <oej@edvina.net>
Date: Wed, 6 Dec 2006 12:34:58 +0000
Subject: [PATCH] Don't send Contact in SIP Messages (imported from 1.2/1.4).
 Reported by Gunnar at Omnitor.

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

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index e0b4da412f..2e71e7a668 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -5733,9 +5733,10 @@ static int reqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod, in
 		add_header(req, "From", ot);
 		add_header(req, "To", of);
 	}
-	/* Do not add Contact for BYE and Cancel requests */
-	if (sipmethod != SIP_BYE && sipmethod != SIP_CANCEL)
+	/* Do not add Contact for MESSAGE, BYE and Cancel requests */
+	if (sipmethod != SIP_BYE && sipmethod != SIP_CANCEL && sipmethod != SIP_MESSAGE)
 		add_header(req, "Contact", p->our_contact);
+
 	copy_header(req, orig, "Call-ID");
 	add_header(req, "CSeq", tmp);
 
-- 
GitLab