Hello All
I am handling 302 response in the failure route and when receiving 302 response in kamailio, it's not going into the failure route , kamailio just executing the onreply route when 302 response are received. A few days ago the same code with failure route worked but now it does not. i dont know why kamailio is not executing a failure route from where we can redirect calls to another server.
code snippet
route[RELAY]{ t_on_reply("MANAGE_REPLY"); t_on_failure("MANAGE_FAILURE"); t_on_branch("MANAGE_BRANCH");
if (!t_relay()) { sl_reply_error(); } exit; } failure_route[MANAGE_FAILURE] { if (t_is_canceled()) { exit; } if (t_check_status("302")){ get_redirects("*"); $ru= $T_rpl($sel(contact.uri)); route(RELAY); } }
kamailio version : 5.6.4 Please suggest if I am doing anything wrong.
Hello,
nothing relevant happened during the past few days (in case you did a kamailio upgrade), so it should be something specific to your environment. I would suggest to run with debug=3 in kamailio.cfg and see what you can get from the debug messages.
Eventually, if it is production, try to add some xlog() lines in config at relevant places in routing blocks to make you understand better what is executed and what is not (debug=3 may become too heavy for production).
Cheers, Daniel
On 03.07.23 08:11, Devang Dhandhalya wrote:
i went through this. It's not that kamailio has changed, kamailio executes one first, then the other. So if you now added some drop() or exit() somewhere on the first route, it won't execute the second.
This is what i found some months ago:
MMM, that's strange, I was using it on failure route and the route was
being executed, but the data wasn't there. I put it on the onreply route and that one is now executed with the data correctly there...
I probably did something wrong.
Regards,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337
On Mon, Jul 3, 2023 at 2:21 PM Daniel-Constantin Mierla miconda@gmail.com wrote:
Thank you Daniel and David for your Response
Yes issue with exit() function and its stopping the script execution for 302 response in failure route.
Regards Devang Dhandhalya
On Mon, Jul 3, 2023 at 7:06 PM David Villasmil < david.villasmil.work@gmail.com> wrote: