Hello,
you do not need to use explicitly msg_apply_changes(), the modifications done to sip message are applied when it is sent out.
The restriction to use msg_apply_changes() after transaction is created comes from the complexity of transaction structure and its states. There can be retransmissions at various stages for outgoing branches, internal callbacks executed, timer checks, ... referencing to the message that created the transaction. msg_apply_changes() will change it, impacting everything.
But again, you can add/remove headers, etc ... in branch routes and changes will be applied when sending out.
Cheers, Daniel
On 06.07.21 15:34, Ivan Ribakov wrote:
Hi all,
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” (https://github.com/kamailio/kamailio/blob/master/src/core/msg_translator.c#L...) 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?
Thanks in advance, Ivan _______________________________________________ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev