when proxy gets ack to invite, it spits out this kind of error message:
Sep 20 22:03:35 wheezy2 /usr/sbin/sip-proxy[4575]: INFO: processing ACK sip:jh@192.98.103.10:5074 Sep 20 22:03:35 wheezy2 /usr/sbin/sip-proxy[4575]: WARNING: rr [loose.c:744]: no socket found for match second RR
route headers in the request are:
Route: sip:192.98.103.10:5060;transport=tcp;r2=on;ftag=43884fd989cff6dc;lr Route: sip:192.98.103.10:5060;r2=on;ftag=43884fd989cff6dc;lr
and when i start the proxy it tells this:
Listening on udp: 192.98.103.2 [192.98.103.2]:5070 udp: 127.0.0.1:5072 tcp: 192.98.103.2 [192.98.103.2]:5070 tcp: 127.0.0.1:5072 tcp: 127.0.0.1:6060 Aliases: *: 192.98.103.10:5060 *: sip.test.fi:5060
why does loose_route() not find the first alias?
-- juha
Hello,
On 9/20/12 9:14 PM, Juha Heinanen wrote:
when proxy gets ack to invite, it spits out this kind of error message:
Sep 20 22:03:35 wheezy2 /usr/sbin/sip-proxy[4575]: INFO: processing ACK sip:jh@192.98.103.10:5074 Sep 20 22:03:35 wheezy2 /usr/sbin/sip-proxy[4575]: WARNING: rr [loose.c:744]: no socket found for match second RR
route headers in the request are:
Route: sip:192.98.103.10:5060;transport=tcp;r2=on;ftag=43884fd989cff6dc;lr Route: sip:192.98.103.10:5060;r2=on;ftag=43884fd989cff6dc;lr
and when i start the proxy it tells this:
Listening on udp: 192.98.103.2 [192.98.103.2]:5070 udp: 127.0.0.1:5072 tcp: 192.98.103.2 [192.98.103.2]:5070 tcp: 127.0.0.1:5072 tcp: 127.0.0.1:6060 Aliases: *: 192.98.103.10:5060 *: sip.test.fi:5060
why does loose_route() not find the first alias?
loose_route() matches the alias as being local (myself condition), but there is no relation between aliases and sockets, so searching a soket using an alias value does not work.
The advertise for listen does what you need, if it fits in what you try to achieve:
listen=IP1 advertise IP2
If Route has IP2 then the socket IP1 is used for relaying.
Cheers, Daniel
why does loose_route() not find the first alias?
loose_route() matches the alias as being local (myself condition), but there is no relation between aliases and sockets, so searching a soket using an alias value does not work.
ok, but i don't understand what loose_route() has to do with sockets at all. it should just check if the topmost one or two route uris match itself, and if they do, remove them from the set and then possibly set $du from the next route uri (if any). it is then t_relay that needs to worry about sockets.
The advertise for listen does what you need, if it fits in what you try to achieve:
listen=IP1 advertise IP2
If Route has IP2 then the socket IP1 is used for relaying.
i'll give it a try, but i'm worried about via changes.
the situation is such that proxy behind dispatched should be able to execute loose_route() without errors when one or two topmost route headers match ip and port of the dispatcher (not those of the proxy itself).
-- juha
Hello,
On 9/21/12 10:38 AM, jh@tutpro.com wrote:
why does loose_route() not find the first alias?
loose_route() matches the alias as being local (myself condition), but there is no relation between aliases and sockets, so searching a soket using an alias value does not work.
ok, but i don't understand what loose_route() has to do with sockets at all. it should just check if the topmost one or two route uris match itself, and if they do, remove them from the set and then possibly set $du from the next route uri (if any). it is then t_relay that needs to worry about sockets.
when there is double record-routing, the second is used to detect outgoing socket, because it is the case of transport layer bridging. Otherwise, for example, udp-tcp conversion will not work transparently and send sockets would need to be forced manually.
The advertise for listen does what you need, if it fits in what you try to achieve:
listen=IP1 advertise IP2
If Route has IP2 then the socket IP1 is used for relaying.
i'll give it a try, but i'm worried about via changes.
the situation is such that proxy behind dispatched should be able to execute loose_route() without errors when one or two topmost route headers match ip and port of the dispatcher (not those of the proxy itself).
Via headers are for replies, which should go back through the same path as the request, so it might break you case, because there will be two Vias with the dispatcher IP.
It looks a bit strange for me that you add Record-Route to dispatcher and then you want the proxy to consume the Routes, but I don't know what you want to achieve. If there will be no transport layer bridging, so no double record routing, all should go fine. Actually all should go fine anyway, just a warning message is printed because loose routing is expecting a local socket on double Route headers.
Cheers, Daniel
Daniel-Constantin Mierla writes:
If there will be no transport layer bridging, so no double record routing, all should go fine. Actually all should go fine anyway, just a warning message is printed because loose routing is expecting a local socket on double Route headers.
daniel,
yes, everything works fine, it is just that warning that i would like to get rid of. is it ok to change it to debug? or perhaps loose_route could have a param that tells it to skip the socket test?
-- juha
On 9/21/12 11:37 AM, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
If there will be no transport layer bridging, so no double record routing, all should go fine. Actually all should go fine anyway, just a warning message is printed because loose routing is expecting a local socket on double Route headers.
daniel,
yes, everything works fine, it is just that warning that i would like to get rid of. is it ok to change it to debug? or perhaps loose_route could have a param that tells it to skip the socket test?
the second is better in this case, because will avoid a loop through local sockets. Also, your case is very rare, the warning is good to spot if someone changed the uri in route headers.
Cheers, Daniel
Daniel-Constantin Mierla writes:
the second is better in this case, because will avoid a loop through local sockets. Also, your case is very rare, the warning is good to spot if someone changed the uri in route headers.
daniel,
sorry about the noise. there is already rr mod param
enable_socket_mismatch_warning
which can be used to globally turn off the warning. it is at the moment good enough for me, but a parameter could be added later that also disables looking for the socket in cases when it is known not to be found.
-- juha
Sorry Juha,
I forgot to reply to you that I added that warning in the code for the same reason. What do you mean by a parameter that disables looking for the socket?
-ovidiu
On Fri, Sep 21, 2012 at 9:28 AM, Juha Heinanen jh@tutpro.com wrote:
Daniel-Constantin Mierla writes:
the second is better in this case, because will avoid a loop through local sockets. Also, your case is very rare, the warning is good to spot if someone changed the uri in route headers.
daniel,
sorry about the noise. there is already rr mod param
enable_socket_mismatch_warning
which can be used to globally turn off the warning. it is at the moment good enough for me, but a parameter could be added later that also disables looking for the socket in cases when it is known not to be found.
-- juha
Ovidiu Sas writes:
I forgot to reply to you that I added that warning in the code for the same reason. What do you mean by a parameter that disables looking for the socket?
hi ovidiu,
the piece of code currently looks like this:
if (enable_double_rr && is_2rr(&puri.params)) { /* double route may occure due different IP and port, so force as * send interface the one advertise in second Route */ if (parse_uri(rt->nameaddr.uri.s,rt->nameaddr.uri.len,&puri)<0) { LM_ERR("failed to parse the double route URI\n"); return RR_ERROR; } si = grep_sock_info( &puri.host, puri.port_no, puri.proto); if (si) { set_force_socket(_m, si); } else { if (enable_socket_mismatch_warning)f LM_WARN("no socket found for match second RR\n"); }
when the "disable socket check" parameter would have been given either globally or per loose_route() call, then this part of the code would not be executed at all:
si = grep_sock_info( &puri.host, puri.port_no, puri.proto); if (si) { set_force_socket(_m, si); } else { if (enable_socket_mismatch_warning)f LM_WARN("no socket found for match second RR\n"); }
which would save some cpu cycles.
-- juha
It would need to be per loose_route() call, because a server can have mixed traffic (real sockets only and real and advertised). For real sockets, you would want to run the checks. For advertised, you would not want to run the checks.
Then in the config, you will need to track calls through advertised addresses and call appropriately loose_route(). Because of this, I implemented the warning disable parameter. It is not optimal either, because for traffic through real sockets the warning should be printed.
Regards. Ovidiu Sas
On Fri, Sep 21, 2012 at 10:18 AM, Juha Heinanen jh@tutpro.com wrote:
Ovidiu Sas writes:
I forgot to reply to you that I added that warning in the code for the same reason. What do you mean by a parameter that disables looking for the socket?
hi ovidiu,
the piece of code currently looks like this:
if (enable_double_rr && is_2rr(&puri.params)) { /* double route may occure due different IP and port, so force as * send interface the one advertise in second Route */ if (parse_uri(rt->nameaddr.uri.s,rt->nameaddr.uri.len,&puri)<0) { LM_ERR("failed to parse the double route URI\n"); return RR_ERROR; } si = grep_sock_info( &puri.host, puri.port_no, puri.proto); if (si) { set_force_socket(_m, si); } else { if (enable_socket_mismatch_warning)f LM_WARN("no socket found for match second RR\n"); }
when the "disable socket check" parameter would have been given either globally or per loose_route() call, then this part of the code would not be executed at all:
si = grep_sock_info( &puri.host, puri.port_no, puri.proto); if (si) { set_force_socket(_m, si); } else { if (enable_socket_mismatch_warning)f LM_WARN("no socket found for match second RR\n"); }
which would save some cpu cycles.
-- juha