Module: kamailio
Branch: master
Commit: d5c1b4693b6e47b4123b5f9417b5fd88d4dafd1f
URL:
https://github.com/kamailio/kamailio/commit/d5c1b4693b6e47b4123b5f9417b5fd8…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-10-13T19:16:06+02:00
core: parse main headers after updating msg buffer
- same group of headers as for the case of receiving the message
- applies for msg_apply_changes() as well
- related to GH #2877
---
Modified: src/core/msg_translator.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d5c1b4693b6e47b4123b5f9417b5fd8…
Patch:
https://github.com/kamailio/kamailio/commit/d5c1b4693b6e47b4123b5f9417b5fd8…
---
diff --git a/src/core/msg_translator.c b/src/core/msg_translator.c
index 9fd5635655..bc1b9736df 100644
--- a/src/core/msg_translator.c
+++ b/src/core/msg_translator.c
@@ -3328,7 +3328,13 @@ int sip_msg_update_buffer(sip_msg_t *msg, str *obuf)
* valid/safe for config */
return 0;
}
-
+ if(parse_headers(msg, HDR_FROM_F|HDR_TO_F|HDR_CALLID_F|HDR_CSEQ_F, 0) < 0) {
+ LM_ERR("parsing main headers of new sip message failed [[%.*s]]\n",
+ msg->len, msg->buf);
+ /* exit config execution - sip_msg_t structure is no longer
+ * valid/safe for config */
+ return 0;
+ }
return 1;
}