Module: kamailio Branch: 5.5 Commit: 992c5a349454e40c87c8918283ffde7302da9d8e URL: https://github.com/kamailio/kamailio/commit/992c5a349454e40c87c8918283ffde73...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2021-11-05T08:39:39+01: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
(cherry picked from commit d5c1b4693b6e47b4123b5f9417b5fd88d4dafd1f)
---
Modified: src/core/msg_translator.c
---
Diff: https://github.com/kamailio/kamailio/commit/992c5a349454e40c87c8918283ffde73... Patch: https://github.com/kamailio/kamailio/commit/992c5a349454e40c87c8918283ffde73...
---
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; }