[prev in list] [next in list] [prev in thread] [next in thread] 

List:       semsdev
Subject:    [Semsdev] git:master: core: changed WARN messages into DBG (bad/malformed/ missing contact)
From:       Raphael Coeffic <rco () iptel ! org>
Date:       2013-05-23 12:51:39
Message-ID: 20130523125139.BBC98EF8076 () rimmer ! ryngle ! com
[Download RAW message or body]

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


Author: Raphael Coeffic <rco@iptel.org>
Committer: Raphael Coeffic <rco@iptel.org>
Date:   Thu May 23 12:23:49 2013 +0200

core: changed WARN messages into DBG (bad/malformed/missing contact)

Request gets a 400 reply explaining the issue anyway, so that there is no need to \
spoil the logs.

---

 core/SipCtrlInterface.cpp |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/core/SipCtrlInterface.cpp b/core/SipCtrlInterface.cpp
index 39cafce..3c04671 100644
--- a/core/SipCtrlInterface.cpp
+++ b/core/SipCtrlInterface.cpp
@@ -425,9 +425,9 @@ inline bool SipCtrlInterface::sip_msg2am_request(const sip_msg \
*msg,  req.contact = "*";
 	}
 	else if(parse_nameaddr(&na,&c,contact_na.len) < 0){
-	    WARN("Contact parsing failed\n");
-	    WARN("\tcontact = '%.*s'\n",contact_na.len,contact_na.s);
-	    WARN("\trequest = '%.*s'\n",msg->len,msg->buf);
+	    DBG("Contact parsing failed\n");
+	    DBG("\tcontact = '%.*s'\n",contact_na.len,contact_na.s);
+	    DBG("\trequest = '%.*s'\n",msg->len,msg->buf);
 
 	    trans_layer::instance()->
 		send_sf_error_reply(&tt, msg, 400, "Bad Contact");
@@ -436,9 +436,9 @@ inline bool SipCtrlInterface::sip_msg2am_request(const sip_msg \
*msg,  else {
 	    sip_uri u;
 	    if(parse_uri(&u,na.addr.s,na.addr.len)){
-		WARN("'Contact' in new request contains a malformed URI\n");
-		WARN("\tcontact uri = '%.*s'\n",na.addr.len,na.addr.s);
-		WARN("\trequest = '%.*s'\n",msg->len,msg->buf);
+		DBG("'Contact' in new request contains a malformed URI\n");
+		DBG("\tcontact uri = '%.*s'\n",na.addr.len,na.addr.s);
+		DBG("\trequest = '%.*s'\n",msg->len,msg->buf);
 
 		trans_layer::instance()->
 		    send_sf_error_reply(&tt, msg, 400, "Malformed Contact URI");
@@ -458,8 +458,10 @@ inline bool SipCtrlInterface::sip_msg2am_request(const sip_msg \
*msg,  }
     else {
 	if (req.method == SIP_METH_INVITE) {
-	    WARN("Request has no contact header\n");
-	    WARN("\trequest = '%.*s'\n",msg->len,msg->buf);
+	    DBG("Request has no contact header\n");
+	    DBG("\trequest = '%.*s'\n",msg->len,msg->buf);
+	    trans_layer::instance()->
+		send_sf_error_reply(&tt, msg, 400, "Missing Contact-HF");
 	}
     }
     

_______________________________________________
Semsdev mailing list
Semsdev@lists.iptel.org
http://lists.iptel.org/mailman/listinfo/semsdev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic