Module: kamailio
Branch: master
Commit: 802b80853baf3f9e33f84de79a4473bdf2b4e6df
URL:
https://github.com/kamailio/kamailio/commit/802b80853baf3f9e33f84de79a4473b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)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/802b80853baf3f9e33f84de79a4473b…
Patch:
https://github.com/kamailio/kamailio/commit/802b80853baf3f9e33f84de79a4473b…
---
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;