Hello,
I need help with modifying the "To" header in the
"failure_route[ID]{...}". Specifically, I want to add the "to tag"
parameter from the previous SIP messages of the current dialog(e.g., 180 Ringing, PRACK or
final responses).
Here's the scenario:
1. Kamailio receives and relays the SIP messages: INVITE, 180 Ringing, PRACK, 200 OK, 486
Busy Here.
2. In my case, the 180 Ringing includes the "to tag" parameter.
3. When Kamailio receives the 486 response, it triggers "failure_route[ID]"
using "t_on_failure(ID)" method.
4. I extract the SIP response code and reason from the final response of the INVITE
transcation in this failure_route.
5. After processing and applying some instructions, I send a reply using
"t_send_reply" with the code and reason extracted.
The problem:
- The failure_route[ID] holds the initial INVITE, which has no "to tag"
parameter.
- When I send a reply using "t_send_reply()", Kamailio generates a random
"to tag" different from the previous SIP messages, which confuses my UAC.
I think adding the "to tag" parameter manually might be a solution, but I'm
not sure if I'm doing it correctly or if there is a better approach. I also tried
using uac_replace_to() method, but it doesn't work in the failure_route[ID].
How can I make sure the reply in failure_route[ID] uses the correct "to tag"
from the previous SIP messages? Are there any other possibilities to achieve this?
Any assistance would be appreciated.
Thank you!