Hi folks,
I have a problem with a scenario where an incoming INVITE is forwarded to a redirect server which responds with 302 and a new target in the Contact header (B). The call is being forwarded to the new contact correctly. All responses from B that are either provisional or a 200 OK are being routed back to the caller. If B responds with any code >=400 the 302 from the redirect server is being returned to the caller instead of the received code.
A B C |--INVITE->| | | |--INVITE->| | |<---302---| D | |----INVITE--->| | |<-----404-----| |<---302---|
Is this intended? And if so, is there any way to change this behaviour so the latest received response is returned?
I tested using the version from repository from 13.01.2011
My reduced config looks like this:
route{ if (@to.tag != "") { if (loose_route()) { record_route(); t_relay(); } else { if ( is_method("ACK") ) { if ( t_check_trans() ) { t_relay(); exit; } else { # ACK without matching transaction ... ignore and discard.\n"); exit; } } record_route(); } exit; } else { record_route(); }
t_on_failure("REDIRECT_REPLY"); if (!t_relay_to_udp("192.168.0.10","5060")) { sl_reply_error(); }; exit; }
failure_route[REDIRECT_REPLY] { if (t_check_status("3[0-9][0-9]")) { get_redirects("*:1"); t_relay(); exit; } }
Regards, Stefan
Am 14.01.2011 16:52, schrieb Prelle, Stefan:
Hi folks,
I have a problem with a scenario where an incoming INVITE is forwarded to a redirect server which responds with 302 and a new target in the Contact header (B). The call is being forwarded to the new contact correctly. All responses from B that are either provisional or a 200 OK are being routed back to the caller. If B responds with any code>=400 the 302 from the redirect server is being returned to the caller instead of the received code.
A B C |--INVITE->| | | |--INVITE->| | |<---302---| D | |----INVITE--->| | |<-----404-----| |<---302---|
Is this intended? And if so, is there any way to change this behaviour so the latest received response is returned?
Yes - it is intended. The lowest response code of all branches will used (RFC conform).
You can change this behavior by either (I think b is what you look for).
a) load another failure route in the existing failure route. in the new failure route use t_reply() to set a proper failure route
b) play around with tm module parameters, especially failure_reply_mode(): http://www.kamailio.org/docs/modules/3.1.x/modules/tm.html#failure_reply_mod...
regards klaus
Hi Klaus,
thank you for your prompt reply. Yes, that is exactly what I was looking for. I wonder why I did not notice the parameter myself.
Cheers, Stefan
-----Original Message----- From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at] Sent: Friday, January 14, 2011 4:58 PM To: Prelle, Stefan Cc: sr-users@lists.sip-router.org Subject: Re: [SR-Users] tm module question
Am 14.01.2011 16:52, schrieb Prelle, Stefan:
Hi folks,
I have a problem with a scenario where an incoming INVITE is forwarded to a redirect server which responds with 302 and a new target in the Contact header (B). The call is being forwarded to the new contact correctly. All responses from B that are either provisional or a 200 OK are being routed back to the caller. If B responds with any code>=400 the 302 from the redirect server is being returned to the caller instead of the received code.
A B C |--INVITE->| | | |--INVITE->| | |<---302---| D | |----INVITE--->| | |<-----404-----| |<---302---|
Is this intended? And if so, is there any way to change this behaviour so the latest received response is returned?
Yes - it is intended. The lowest response code of all branches will used (RFC conform).
You can change this behavior by either (I think b is what you look for).
a) load another failure route in the existing failure route. in the new failure route use t_reply() to set a proper failure route
b) play around with tm module parameters, especially failure_reply_mode(): http://www.kamailio.org/docs/modules/3.1.x/modules/tm.html#failure_reply_mod...
regards klaus