Browse code

registrar: use core function for parsing all contact headers

Daniel-Constantin Mierla authored on 24/11/2020 12:11:57
Showing 1 changed files
... ...
@@ -86,8 +86,6 @@ static inline int get_expires_hf(struct sip_msg* _m)
86 86
  */
87 87
 int parse_message(struct sip_msg* _m)
88 88
 {
89
-	struct hdr_field* ptr;
90
-
91 89
 	if (parse_headers(_m, HDR_EOH_F, 0) == -1) {
92 90
 		rerrno = R_PARSE;
93 91
 		LM_ERR("failed to parse headers\n");
... ...
@@ -118,18 +116,10 @@ int parse_message(struct sip_msg* _m)
118 116
 		return -5;
119 117
 	}
120 118
 
121
-	if (_m->contact) {
122
-		ptr = _m->contact;
123
-		while(ptr) {
124
-			if (ptr->type == HDR_CONTACT_T) {
125
-				if (!ptr->parsed && (parse_contact(ptr) < 0)) {
126
-					rerrno = R_PARSE_CONT;
127
-					LM_ERR("failed to parse Contact body\n");
128
-					return -6;
129
-				}
130
-			}
131
-			ptr = ptr->next;
132
-		}
119
+	if(parse_contact_headers(_m) < 0) {
120
+		rerrno = R_PARSE_CONT;
121
+		LM_ERR("failed to parse Contact body\n");
122
+		return -6;
133 123
 	}
134 124
 
135 125
 	return 0;