we have an issue with our Kamailio.
This configuration is multi-homed, we have two network interfaces, one on a private network and on the public Internet. Kamailio is configured to listen on port 5060 and 5066 on both interfaces. We register two users Alice and Bob on the public Internet using port 5066. Both users are behind a NAT and we capture the SIP exchange on the proxy server.
We have set the parameter mhomed=1
The ACK packet gets relayed with the wrong source port. Then the NAT rejects the packet and the call cannot be established.
Also, if we set mhomed=0 it works BUT we are not sure that multi homed is handled correctly.
the issue seems to be located in the RR module and the loose_route() function.
In the after_loose() function in loose.c, the function set_force_socket() is called only if a DOUBLE route is mentioned in the route set of the ACK message
But when both users are using 5066 as proxy port, we get only ONE route for the proxy in the route set (and to us it is OK). In this case, we get a trace:
"No next URI found"
and the code exits. Later in the message processing, when t_relay() is called, the forward_request() selects the first socket defined in our configuration instead.
At this point, we can't presume what socket we be select. We believe that it is a software bug and that after_loose() should force the send_socket even though we have only one route in the route set
(paste your debugging data here)
(paste your log messages here)
(paste your sip traffic here)
Adding the process of set_force_socket in case we have one route and only.
L.808 if (res > 0) { /* No next route found */
LM_DBG("No next URI found\n");
if (!use_ob) {
if ((si = grep_sock_info( &puri.host, puri.port_no?puri.port_no:proto_default_port(puri.proto), puri.proto)) != 0) {
set_force_socket(_m, si);
} else if ((si = grep_sock_info( &puri.host, puri.port_no, puri.proto)) != 0) {
set_force_socket(_m, si);
} else {
if (enable_socket_mismatch_warning) {
LM_WARN("no socket found to match second RR (%.*s)\n",
rt->nameaddr.uri.len, ZSW(rt->nameaddr.uri.s));
if(!is_myself(&puri)) {
LM_WARN("second RR uri is not myself (%.*s)\n",
rt->nameaddr.uri.len, ZSW(rt->nameaddr.uri.s));
}
}
}
}
status = (preloaded ? NOT_RR_DRIVEN : RR_DRIVEN);
goto done;
}
kamailio -v
(paste your output here)
(paste your output here)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.