[sr-dev] Why sip_msg_apply_changes can't be executed from BRANCH_FAILURE_ROUTE?

Ivan Ribakov i.ribakov at zaleos.net
Tue Jul 6 15:34:20 CEST 2021

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#L3342-L3345) 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,

More information about the sr-dev mailing list