Hi, I am relaying invites from Kamilio(1.2) to a third proxy, i am receivng Server error occured in SIP messages, I am seeing these messages in log file;
Asterisk--------->Kamilio----------------->third-proxy route{
openser.cfg if(method=="INVITE"){ route(4); exit; }
route[4] { if(!t_relay("udp:third_proxy_1:5060") || !t_relay("udp:third_proxy_2:5060")) {
end_media_session(); sl_reply_error();
} }
DEBUG: RFC3261 transaction matching failed DEBUG: t_lookup_request: no transaction found ERROR:tm:t_forward_nonack: no branch for forwarding ERROR:tm:w_t_relay: t_forward_nonack failed DEBUG:sl:sl_reply_error: error text is Server error occurred (1/SL)
any idea ?
Thanks Asim
El Domingo, 12 de Octubre de 2008, Asim Riaz escribió:
if(!t_relay("udp:third_proxy_1:5060") || !t_relay("udp:third_proxy_2:5060")) {
I think that this is not valid, you can not check the result of sending the request to both destinations.
If the first condition is false (!t_relay("udp:third_proxy_1:5060") this means that a transaction has been correctly created. But after that you do a new comparision: !t_relay("udp:third_proxy_2:5060") The transaction was already created in the first t_realy so you are trying to do it again in a new t_relay, that is illegal.
Yep. What Iñaki said.
In any sort of programming language-like runtime environment, which Kamailio script is, when you evaluate two actual statements in a disjunction rather than values holding return codes, those statements get executed right then and there.
So, whether the first t_relay() ran successfully or not, the second one will be executed. This won't work unless you branch.
Iñaki Baz Castillo wrote:
El Domingo, 12 de Octubre de 2008, Asim Riaz escribió:
if(!t_relay("udp:third_proxy_1:5060") || !t_relay("udp:third_proxy_2:5060")) {
I think that this is not valid, you can not check the result of sending the request to both destinations.
If the first condition is false (!t_relay("udp:third_proxy_1:5060") this means that a transaction has been correctly created. But after that you do a new comparision: !t_relay("udp:third_proxy_2:5060") The transaction was already created in the first t_realy so you are trying to do it again in a new t_relay, that is illegal.
On Sun, Oct 12, 2008 at 3:52 PM, Alex Balashov abalashov@evaristesys.comwrote:
Yep. What Iñaki said.
In any sort of programming language-like runtime environment, which Kamailio script is, when you evaluate two actual statements in a disjunction rather than values holding return codes, those statements get executed right then and there.
So, whether the first t_relay() ran successfully or not, the second one will be executed. This won't work unless you branch.
Iñaki Baz Castillo wrote:
El Domingo, 12 de Octubre de 2008, Asim Riaz escribió:
if(!t_relay("udp:third_proxy_1:5060") || !t_relay("udp:third_proxy_2:5060")) {
I think that this is not valid, you can not check the result of sending
the
request to both destinations.
If the first condition is false (!t_relay("udp:third_proxy_1:5060") this
means
that a transaction has been correctly created. But after that you do a
new
comparision: !t_relay("udp:third_proxy_2:5060") The transaction was already created in the first t_realy so you are
trying to
do it again in a new t_relay, that is illegal.
so then what is the posibility to send calls the first proxy if thats fail route to another one and so on ?
Thanks Asim Riaz
-- Alex Balashov Evariste Systems Web : http://www.evaristesys.com/ Tel : (+1) (678) 954-0670 Direct : (+1) (678) 954-0671 Mobile : (+1) (706) 338-8599
Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
Asim Riaz wrote:
so then what is the posibility to send calls the first proxy if thats fail route to another one and so on ?
The possibility is high. :-)
Here - try something like this:
route {
...
if(is_method("INVITE")) route(1);
... }
# -- Relay INVITE -- #
route[1] { t_on_failure("1");
if(!t_relay("udp:proxy1:5060")) { xlog("L_INFO", "Final relay failure!\n"); t_reply("503", "Service Unavailable"); exit; } }
# -- Backup INVITE route on failure of route(1) -- #
failure_route[1] { if(t_was_cancelled()) { xlog("L_INFO", "Transaction cancelled.\n"); exit; }
append_branch();
if(!t_relay("udp:proxy2:5060")) { xlog("L_INFO", "Relay to proxy2 failed - not so good!\n"); t_reply("503", "Service Unavailable"); exit; } }
Of course, this is the manual approach for two gateways. If you have more than two gateways and need to cycle through a list, you may want to consider the dispatcher module.
Alex Balashov wrote:
Asim Riaz wrote:
so then what is the posibility to send calls the first proxy if thats fail route to another one and so on ?
The possibility is high. :-)
Here - try something like this:
route {
... if(is_method("INVITE")) route(1); ...
}
# -- Relay INVITE -- #
route[1] { t_on_failure("1");
if(!t_relay("udp:proxy1:5060")) { xlog("L_INFO", "Final relay failure!\n"); t_reply("503", "Service Unavailable"); exit; }
}
# -- Backup INVITE route on failure of route(1) -- #
failure_route[1] { if(t_was_cancelled()) { xlog("L_INFO", "Transaction cancelled.\n"); exit; }
append_branch(); if(!t_relay("udp:proxy2:5060")) { xlog("L_INFO", "Relay to proxy2 failed - not so good!\n"); t_reply("503", "Service Unavailable"); exit; }
}
thanks for that, this is incase my first proxy is canceling the request route to second proxy, what about proxy does not reply at all . I can configure the timer using modparam("tm" , "fr_timer", 20) but how to route call to second if first proxy is timedout ?
thanks again
Asim
On Mon, Oct 13, 2008 at 11:59 AM, Alex Balashov abalashov@evaristesys.comwrote:
Of course, this is the manual approach for two gateways. If you have more than two gateways and need to cycle through a list, you may want to consider the dispatcher module. s
Alex Balashov wrote:
Asim Riaz wrote:
so then what is the posibility to send calls the first proxy if
thats fail route to another one and so on ?
The possibility is high. :-)
Here - try something like this:
route {
...
if(is_method("INVITE")) route(1);
... }
# -- Relay INVITE -- #
route[1] { t_on_failure("1");
if(!t_relay("udp:proxy1:5060")) { xlog("L_INFO", "Final relay failure!\n"); t_reply("503", "Service Unavailable"); exit; } }
# -- Backup INVITE route on failure of route(1) -- #
failure_route[1] { if(t_was_cancelled()) { xlog("L_INFO", "Transaction cancelled.\n"); exit; }
append_branch();
if(!t_relay("udp:proxy2:5060")) { xlog("L_INFO", "Relay to proxy2 failed - not so good!\n"); t_reply("503", "Service Unavailable"); exit; } }
-- Alex Balashov Evariste Systems Web : http://www.evaristesys.com/ Tel : (+1) (678) 954-0670 Direct : (+1) (678) 954-0671 Mobile : (+1) (706) 338-8599
The FAILURE-ROUTE is automatically triggered if fr{_inv}_timer expires.
Asim Riaz wrote:
thanks for that, this is incase my first proxy is canceling the request route to second proxy, what about proxy does not reply at all . I can configure the timer using modparam("tm" , "fr_timer", 20) but how to route call to second if first proxy is timedout ?
thanks again
Asim
On Mon, Oct 13, 2008 at 11:59 AM, Alex Balashov <abalashov@evaristesys.com mailto:abalashov@evaristesys.com> wrote:
Of course, this is the manual approach for two gateways. If you have more than two gateways and need to cycle through a list, you may want to consider the dispatcher module. s Alex Balashov wrote: Asim Riaz wrote: so then what is the posibility to send calls the first proxy if thats fail route to another one and so on ? The possibility is high. :-) Here - try something like this: route { ... if(is_method("INVITE")) route(1); ... } # -- Relay INVITE -- # route[1] { t_on_failure("1"); if(!t_relay("udp:proxy1:5060")) { xlog("L_INFO", "Final relay failure!\n"); t_reply("503", "Service Unavailable"); exit; } } # -- Backup INVITE route on failure of route(1) -- # failure_route[1] { if(t_was_cancelled()) { xlog("L_INFO", "Transaction cancelled.\n"); exit; } append_branch(); if(!t_relay("udp:proxy2:5060")) { xlog("L_INFO", "Relay to proxy2 failed - not so good!\n"); t_reply("503", "Service Unavailable"); exit; } } -- Alex Balashov Evariste Systems Web : http://www.evaristesys.com/ Tel : (+1) (678) 954-0670 Direct : (+1) (678) 954-0671 Mobile : (+1) (706) 338-8599