Hello
I have a question. I hope that someone could clarify this to me.
I have the next situation.
I'm using a t_on_failure route along with the LCR module. So I have something like this :
failure_route[1] {
if (t_was_cancelled()) {
xlog("L_INFO", "[$ci] $rm:$ru t_was_cancelled in failure_route\n");
exit;
}
if ( t_check_status("486") ) {
xlog("L_INFO","[$ci] 486 Received\n");
}
if (t_check_status("603")) {
xlog("L_INFO","[$ci] 603 Received\n");
if (!next_gw()) {
t_reply("503", "Service not available, no more gateways");
xlog("L_INFO", "[$ci] No hay mas gateways para $rm:$ou\n");
exit;
} else {
xlog("L_INFO", "[$ci] $rm cambiando $ou por $ru en failure_route");
}
t_on_failure("1");
}
t_relay();
}
Maybe I'm misunderstanding how the failure_route works but with this configuration I was expecting that If I have a 603 from the callee I will do the "next_gateway" configuration. And If I have a 486 I will put a line in the log and then continue with the t_relay. So.. the 486 will be passed to the caller, but with the final answer from the caller ( ACK ) to the 486.. and I'm getting this error...
Sep 2 16:43:41 ERROR:tm:t_forward_nonack: no branch for forwarding
Sep 2 16:43:41 ERROR:tm:w_t_relay: t_forward_nonack failed
So it seems that tries to forward the ACK with t_relay?
Caller Proxy Callee
------>
INVITE
----->
INVITE
<------
486
------->
ACK
<------
486
-----> (error?)
ACK
But...
When I modified the next lines in the failure_route
if ( t_check_status("486") ) {
xlog("L_INFO","[$ci] 486 Received\n");
exit;
}
And add the "exit" parameter, i don't have the above error and the "486" is passed back to the caller as "expected".
Can someone explain me this?
Thanks in advance..
Regards
Ricardo Martinez.-
El Jueves, 3 de Septiembre de 2009, Ricardo Martinez escribió:
Maybe I’m misunderstanding how the failure_route works but with this configuration I was expecting that If I have a 603 from the callee I will do the “next_gateway” configuration. And If I have a 486 I will put a line in the log and then continue with the t_relay. So.. the 486 will be passed to the caller, but with the final answer from the caller ( ACK ) to the 486.. and I’m getting this error… Sep 2 16:43:41 ERROR:tm:t_forward_nonack: no branch for forwarding
According to RFC 3261 a 6XX response terminates ALL the transactions generated by the incoming request. This is, a 6XX response breaks/terminates serial and parallel forking even if there are still more pending branches (those are cancelled automatically).
This is a bad design (IMHO) as it breaks many common scenarios (as forwarding to a voicemail server if the called rejects the call => serial forking).
There is a core option to avoid it:
disable_6xx_block
http://www.kamailio.org/docs/modules/1.5.x/tm.html#id2530547
Hope it helps.
Hello Iñaki. Thanks for your answer. I understand what you're saying about the 6XX responses, but my question is regarding to the 486 response, maybe you misunderstood my question: If you take a look at my failure_ruote block I have :
failure_route[1] { ... if ( t_check_status("486") ) { xlog("L_INFO","[$ci] 486 Received\n");
} ...
t_relay(); }
Under this configuration I have something like this :
Caller Proxy Callee ------> | INVITE | | -----> | INVITE | <------ | 486 | -----> | ACK <------ | 486 | ------> | (error) ACK |
I'm getting an error in the log file :
Sep 2 16:43:41 ERROR:tm:t_forward_nonack: no branch for forwarding Sep 2 16:43:41 ERROR:tm:w_t_relay: t_forward_nonack failed
It seems that Kamailio is trying to forward the last ACK ?
But instead if I have the a failure_route like this (just added a "exit" in the check status):
failure_route[1] { ... if ( t_check_status("486") ) { xlog("L_INFO","[$ci] 486 Received\n"); exit;
} ...
t_relay(); }
I have the same SIP message exchange above but without the error. So, it's working ok but I don't understand why this is happening. I would expect that the "exit" command at the end of the t_check_status would not forward the "486", but it seems that is not forwarding the ACK to the 486.
Hope you could help me to understand this.
Regards, Ricardo.-
-----Mensaje original----- De: users-bounces@lists.kamailio.org [mailto:users-bounces@lists.kamailio.org] En nombre de Iñaki Baz Castillo Enviado el: miércoles, 02 de septiembre de 2009 18:54 Para: users@lists.kamailio.org Asunto: Re: [Kamailio-Users] t_realy in failure_route?
El Jueves, 3 de Septiembre de 2009, Ricardo Martinez escribió:
Maybe I’m misunderstanding how the failure_route works but with this configuration I was expecting that If I have a 603 from the callee I will do the “next_gateway” configuration. And If I have a 486 I will put a line in the log and then continue with the t_relay. So.. the 486 will be passed to the caller, but with the final answer from the caller ( ACK ) to the 486.. and I’m getting this error… Sep 2 16:43:41 ERROR:tm:t_forward_nonack: no branch for forwarding
According to RFC 3261 a 6XX response terminates ALL the transactions generated by the incoming request. This is, a 6XX response breaks/terminates serial and parallel forking even if there are still more pending branches (those are cancelled automatically).
This is a bad design (IMHO) as it breaks many common scenarios (as forwarding to a voicemail server if the called rejects the call => serial forking).
There is a core option to avoid it:
disable_6xx_block
http://www.kamailio.org/docs/modules/1.5.x/tm.html#id2530547
Hope it helps.
El Jueves, 3 de Septiembre de 2009, Ricardo Martinez escribió:
failure_route[1] { ... if ( t_check_status("486") ) { xlog("L_INFO","[$ci] 486 Received\n");
}
...
t_relay();
}
You are calling t_relay without creating a new branch so there is no more branches and the log you get is correct.
You should do something like:
failure_route[1] { ... if ( t_check_status("486") ) { xlog("L_INFO","[$ci] 486 Received\n");
} ... append_branch("sip:XXXX@VOICEMAIL_IP"); t_relay(); }
El Jueves, 3 de Septiembre de 2009, Ricardo Martinez escribió:
And If I have a 486 I will put a line in the log and then continue with the t_relay. So.. the 486 will be passed to the caller,
That's not correct. If you just want that the 486 is forwarded to the user just do nothing (remove the useless t_relay() as there is no more branches).
t_relay() is just for *requests*, not for responses. For responses received upstream (by some called endpoint) you must do nothing to get it arriving to the caller (if the proxy selects that reply as the best response.