Module: kamailio
Branch: master
Commit: d35e7c1dd7ee82a470ad31fb2c6901627ad9e499
URL:
https://github.com/kamailio/kamailio/commit/d35e7c1dd7ee82a470ad31fb2c69016…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-06-12T18:44:54+02:00
siputils: ensure that the contact is parsed for param encoding
---
Modified: src/modules/siputils/contact_ops.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d35e7c1dd7ee82a470ad31fb2c69016…
Patch:
https://github.com/kamailio/kamailio/commit/d35e7c1dd7ee82a470ad31fb2c69016…
---
diff --git a/src/modules/siputils/contact_ops.c b/src/modules/siputils/contact_ops.c
index 22d0c31eae..748e703bd4 100644
--- a/src/modules/siputils/contact_ops.c
+++ b/src/modules/siputils/contact_ops.c
@@ -646,6 +646,13 @@ int ki_contact_param_encode(sip_msg_t *msg, str *nparam, str *saddr)
return 1;
}
+ if(msg->contact->parsed == NULL) {
+ if(parse_contact(msg->contact) < 0 || msg->contact->parsed == NULL) {
+ LM_ERR("contact parsing failed\n");
+ return -4;
+ }
+ }
+
cb = (contact_body_t *)msg->contact->parsed;
c = cb->contacts;
/* we visit each contact */