[sr-dev] git:master: modules_k/msilo: do not include Contact header in msilo generated messages

Juha Heinanen jh at tutpro.com
Wed Jun 30 16:36:44 CEST 2010


Module: sip-router
Branch: master
Commit: 259441d3e4f66f0907e2570809928d30b1527479
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=259441d3e4f66f0907e2570809928d30b1527479

Author: Juha Heinanen <jh at tutpro.com>
Committer: Juha Heinanen <jh at tutpro.com>
Date:   Wed Jun 30 17:15:37 2010 +0300

modules_k/msilo: do not include Contact header in msilo generated messages

---

 modules_k/msilo/msfuncs.c |   24 +++++-------------------
 modules_k/msilo/msfuncs.h |    2 +-
 modules_k/msilo/msilo.c   |    4 ++--
 3 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/modules_k/msilo/msfuncs.c b/modules_k/msilo/msfuncs.c
index ea0c028..735b8d6 100644
--- a/modules_k/msilo/msfuncs.c
+++ b/modules_k/msilo/msfuncs.c
@@ -36,11 +36,6 @@
 #include "../../udp_server.h"
 #include "../../pt.h"
 
-#define CONTACT_PREFIX "Contact: <"
-#define CONTACT_SUFFIX  ">;msilo=yes"CRLF
-#define CONTACT_PREFIX_LEN (sizeof(CONTACT_PREFIX)-1)
-#define CONTACT_SUFFIX_LEN  (sizeof(CONTACT_SUFFIX)-1)
-
 extern int ms_add_date;
 
 /**
@@ -186,21 +181,21 @@ error:
 
 /** build MESSAGE headers 
  *
- * Add Content-Type, Contact, Date, and extra headers if they exist
+ * Add Content-Type, Date, and extra headers if they exist
  * expects - max buf len of the resulted body in body->len
  *         - body->s MUST be allocated
  * return: 0 OK ; -1 error
  * */
-int m_build_headers(str *buf, str ctype, str contact, time_t date, str extra)
+int m_build_headers(str *buf, str ctype, time_t date, str extra)
 {
 	char *p;
 	char strDate[48];
 	int lenDate = 0;
 
-	if(!buf || !buf->s || buf->len <= 0 || ctype.len < 0 || contact.len < 0
-			|| buf->len <= ctype.len+contact.len+extra.len+14
+	if(!buf || !buf->s || buf->len <= 0 || ctype.len < 0 
+			|| buf->len <= ctype.len+extra.len+14
 	   /*Content-Type: */
-				+CRLF_LEN+CONTACT_PREFIX_LEN+CONTACT_SUFFIX_LEN)
+				+CRLF_LEN)
 		goto error;
 
 	p = buf->s;
@@ -220,15 +215,6 @@ int m_build_headers(str *buf, str ctype, str contact, time_t date, str extra)
 		p += CRLF_LEN;
 	
 	}
-	if(contact.len > 0)
-	{
-		strncpy(p, CONTACT_PREFIX, CONTACT_PREFIX_LEN);
-		p += CONTACT_PREFIX_LEN;
-		strncpy(p, contact.s, contact.len);
-		p += contact.len;
-		strncpy(p, CONTACT_SUFFIX, CONTACT_SUFFIX_LEN);
-		p += CONTACT_SUFFIX_LEN;
-	}
 	if (extra.len > 0) {
 	    strncpy(p, extra.s, extra.len);
 	    p += extra.len;
diff --git a/modules_k/msilo/msfuncs.h b/modules_k/msilo/msfuncs.h
index 8a70fc4..79a8fdd 100644
--- a/modules_k/msilo/msfuncs.h
+++ b/modules_k/msilo/msfuncs.h
@@ -49,7 +49,7 @@ int m_apo_escape(char*, int, char*, int);
 int m_extract_content_type(char*, int, content_type_t*, int);
 
 /** build MESSAGE headers */
-int m_build_headers(str *buf, str ctype, str contact, time_t date, str extra);
+int m_build_headers(str *buf, str ctype, time_t date, str extra);
 
 /** build MESSAGE body */
 int m_build_body(str *body, time_t date, str msg, time_t sdate);
diff --git a/modules_k/msilo/msilo.c b/modules_k/msilo/msilo.c
index 8249b43..1c59073 100644
--- a/modules_k/msilo/msilo.c
+++ b/modules_k/msilo/msilo.c
@@ -1030,7 +1030,7 @@ static int m_dump(struct sip_msg* msg, char* owner, char* str2)
 		
 		hdr_str.len = 1024;
 		if(m_build_headers(&hdr_str, str_vals[3] /*ctype*/,
-				   str_vals[0]/*from*/, rtime /*Date*/,
+				   rtime /*Date*/,
 				   extra_hdrs_str /*extra_hdrs*/) < 0)
 		{
 			LM_ERR("headers building failed [%d]\n", mid);
@@ -1297,7 +1297,7 @@ void m_send_ontimer(unsigned int ticks, void *param)
 		extra_hdrs_str.len = 0;
 		hdr_str.len = 1024;
 		if(m_build_headers(&hdr_str, str_vals[3] /*ctype*/,
-				   ms_reminder/*from*/,0/*Date*/,
+				   0/*Date*/,
 				   extra_hdrs_str/*extra*/)
 		   < 0)
 		{




More information about the sr-dev mailing list