[SR-Users] Apply changes made to sip reply in onreply_route

Grant Bagdasarian GB at cm.nl
Tue Oct 8 12:14:14 CEST 2013


Hello,

I've setup two Kamailio machines, one which does all the processing and the second one which always replies with a 500 Server Internal Error, to test my Dispatcher fail-over.
When routing a call, the call is always routed to the second Kamailio first, to test the fail-over.

What happens in this scenario is the 500 is received by the main Kamailio and the 500 message is duplicated to the capture server. After this the failure_route kicks in and the 500 is obviously never sent back to the initiator.
The changes made to the 500 message  (adding a new header), in onreply_route, aren't present when the message is duplicated to the capture server, because the original 500 message is duplicated instead of the modified one.

I tried the following things, but none of them worked:

-          Adding the header and calling sip_trace();, but this doesn't work since sip_trace() duplicated the message prior to changes made to it.

-          Msg_apply_changes(), doesn't work either, since I can't use it in onreply_route

-          Append_to_reply(), cannot be used from onreply_route

Appending new headers to replies works, but only when the reply is also sent back to the initiator, since I have the setflag(22) set. This makes sure the processed messages are also duplicated.
In this case the 500 is never sent back.

Anyone have an idea how to solve this?

Regards,

Grant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20131008/3ff846df/attachment.html>


More information about the sr-users mailing list