Hi,
I ran into an interesting scenario when experimenting with kamailio 3.1
as a stateless proxy (no tm module used):
There is an initial INVITE without to-tag and with pre-loaded Route
header pointing to the external address of the lb. When I call
loose_route for that, it returns false and the Route header is removed.
That's what I expected, and it's documented in
http://www.kamailio.org/docs/modules/3.1.x/modules_k/rr.html#loose-route-id.
However if a 407 is relayed back from the registrar via the lb to the
UA, it sends an ACK, again with pre-loaded Route header like in the
initial INVITE, this time with to-tag. In that case, loose_route()
returns true, but the $du is $null and the R-URI is still the same. So
the Route is consumed, but the URI is not used. Since it's a stateless
proxy, this hop-by-hop ACK needs to be routed the same way as the
initial INVITE, so what I'm doing is something like that:
if(loose_route()) {
if($du == $null && $ru == $ou) {
# skip loose-routing for such a request
}
}
Is this how it's supposed to work? And is there some documentation of
how loose_route() detects whether Route points to itself or not? I'm not
using auto_aliases, nor do I set any aliases manually. Does it determine
internally whether the Route points to its local ip and port? If not,
how come the $du is not set although loose_route returns true?
Andreas
Hi,
I am newly experiencing kamailio 3.2. I have installed kamailio and MySQL
and tried the test call from 1 PC(x-lite) to another PC(x-lite) and ended
successfully.
Now moving further, I have configured dynamic routing module and applied
needed parameters and scripts to finally be able to start kamailio without
any issue. Also I set a testing scenario in the related database tables
BUT my problem is that whenever am trying to call the predefined prefix
(961) from x-lite am getting a 'calling' message on it and then request
timeout where I find that kamailio has stopped running. I kamctrl start
again and call 961 then get calling so I wait and kamailio stps again. Below
is the script used in the routing logic and database record.
Any help to achieve a successful call is highly appreciated.
dr_gatways: 3, 1, '192.168.111.15', 0, '', '', 2, 'PC1'
dr_groups: 2, '.*', '.*', 0, 'Anyone'
dr_gw_lists: 2, '3', 'Test Call'
dr_rules: 2, '0', '961', '', 0, '1', '#2', 'Lebanon Fix'
####### Routing Logic ########
# main request routing logic
route{
if (is_method("INVITE")) {
setflag(1); # do accounting
route(4); # Call our dynamic route.
}
}
..
..
..
route[4] {
if (!do_routing("0")) {
send_reply("503", "No Rules matching the URI");
exit;
}
if (is_method("INVITE")) {
t_on_failure("4");
}
route(RELAY);
}
..
..
..
failure_route[4] {
if (use_next_gw()) {
t_relay();
exit;
} else {
t_reply ("503", "Service not available");
exit;
}
}
Thanks in Advance,
F.Chahrour