[sr-dev] git:master:802b8085: registrar: use core function for parsing all contact headers

Daniel-Constantin Mierla miconda at gmail.com
Tue Nov 24 13:26:21 CET 2020


Module: kamailio
Branch: master
Commit: 802b80853baf3f9e33f84de79a4473bdf2b4e6df
URL: https://github.com/kamailio/kamailio/commit/802b80853baf3f9e33f84de79a4473bdf2b4e6df

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-11-24T13:11:57+01:00

registrar: use core function for parsing all contact headers

---

Modified: src/modules/registrar/sip_msg.c

---

Diff:  https://github.com/kamailio/kamailio/commit/802b80853baf3f9e33f84de79a4473bdf2b4e6df.diff
Patch: https://github.com/kamailio/kamailio/commit/802b80853baf3f9e33f84de79a4473bdf2b4e6df.patch

---

diff --git a/src/modules/registrar/sip_msg.c b/src/modules/registrar/sip_msg.c
index 802435865f..2b43dd7611 100644
--- a/src/modules/registrar/sip_msg.c
+++ b/src/modules/registrar/sip_msg.c
@@ -86,8 +86,6 @@ static inline int get_expires_hf(struct sip_msg* _m)
  */
 int parse_message(struct sip_msg* _m)
 {
-	struct hdr_field* ptr;
-
 	if (parse_headers(_m, HDR_EOH_F, 0) == -1) {
 		rerrno = R_PARSE;
 		LM_ERR("failed to parse headers\n");
@@ -118,18 +116,10 @@ int parse_message(struct sip_msg* _m)
 		return -5;
 	}
 
-	if (_m->contact) {
-		ptr = _m->contact;
-		while(ptr) {
-			if (ptr->type == HDR_CONTACT_T) {
-				if (!ptr->parsed && (parse_contact(ptr) < 0)) {
-					rerrno = R_PARSE_CONT;
-					LM_ERR("failed to parse Contact body\n");
-					return -6;
-				}
-			}
-			ptr = ptr->next;
-		}
+	if(parse_contact_headers(_m) < 0) {
+		rerrno = R_PARSE_CONT;
+		LM_ERR("failed to parse Contact body\n");
+		return -6;
 	}
 
 	return 0;




More information about the sr-dev mailing list