<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Does anyone have any idea about this?<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 7 Jul 2021, at 15:04, Ivan Ribakov <<a href="mailto:i.ribakov@zaleos.net" class="">i.ribakov@zaleos.net</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Daniel,<div class=""><br class=""></div><div class="">According to textops module documentation, use of “set_body_multipart” requires the execution of “msg_apply_changes()” (tested) - <a href="https://kamailio.org/docs/modules/5.2.x/modules/textops.html#textops.f.set_body_multipart" class="">https://kamailio.org/docs/modules/5.2.x/modules/textops.html#textops.f.set_body_multipart</a></div><div class=""><br class=""></div><div class="">Also tested patching Kamailio to allow execution of “<span style="caret-color: rgb(0, 0, 0);" class="">msg_apply_changes()</span>” from branch route but that caused a core dump so didn’t look further in that direction. </div><div class=""><br class=""></div><div class="">Can you recommend a way to add different body parts to egress INVITEs depending on the branch?</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Ivan</div><div class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 7 Jul 2021, at 08:10, Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" class="">miconda@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hello,<br class=""><br class="">you do not need to use explicitly msg_apply_changes(), the modifications<br class="">done to sip message are applied when it is sent out.<br class=""><br class="">The restriction to use msg_apply_changes() after transaction is created<br class="">comes from the complexity of transaction structure and its states. There<br class="">can be retransmissions at various stages for outgoing branches, internal<br class="">callbacks executed, timer checks, ... referencing to the message that<br class="">created the transaction. msg_apply_changes() will change it, impacting<br class="">everything.<br class=""><br class="">But again, you can add/remove headers, etc ... in branch routes and<br class="">changes will be applied when sending out.<br class=""><br class="">Cheers,<br class="">Daniel<br class=""><br class="">On 06.07.21 15:34, Ivan Ribakov wrote:<br class=""><blockquote type="cite" class="">Hi all, <br class=""><br class="">I need to modify headers and body of the ingress INVITE in the BRANCH_FAILURE_ROUTE block to reflect failure to deliver message to the first destination and include some additional information. However checking the documentation of the “sip_msg_apply_changes” (<a href="https://github.com/kamailio/kamailio/blob/master/src/core/msg_translator.c#L3342-L3345" class="">https://github.com/kamailio/kamailio/blob/master/src/core/msg_translator.c#L3342-L3345</a>) I can see that it can only be executed from request and reply routes. That seems overly restrictive. Can someone shine some light on why is that and whether it’s safe to patch this part of the code to allow function execution from  BRANCH_FAILURE_ROUTE as well?<br class=""><br class="">Thanks in advance,<br class="">Ivan<br class="">_______________________________________________<br class="">Kamailio (SER) - Development Mailing List<br class=""><a href="mailto:sr-dev@lists.kamailio.org" class="">sr-dev@lists.kamailio.org</a><br class=""><a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev" class="">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev</a><br class=""></blockquote><br class="">-- <br class="">Daniel-Constantin Mierla -- <a href="http://www.asipto.com/" class="">www.asipto.com</a><br class=""><a href="http://www.twitter.com/miconda" class="">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" class="">www.linkedin.com/in/miconda</a><br class=""><br class=""></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></body></html>