[sr-dev] [LCR] next_gw() doesn't update $ru

Iñaki Baz Castillo ibc at aliax.net
Wed Sep 16 18:26:33 CEST 2009


2009/9/16 Iñaki Baz Castillo <ibc at aliax.net>:
> Hi, in failure route I call next_gw(), it success and the request is
> sent to a second gateway (inspecting with ngrep I see that the sent
> request has the gw IP as RURI).
> But if I print (xlog) $ru it still shows the previously selected gw
> (the first one).
>
> This is, the behaviour is correct but $ru is not updated in the script process.
>
> I show an example which hopefully would show the issue (xlogs).
> Basically the script invokes ROUTE_GW which uses LCR to select the
> first gw, sets FAILURE_ROUTE_GW and calls ROUTE_DEFAULT (in which
> t_relay is done). FAILURE_ROUTE block also sets FAILURE_ROUTE block,
> uses LCR to select a new gw and calls to ROUTE_DEFAULT:
>
>
>
> INVITE sip:1234 at sip.mydomain.org - From: ibc - from
> 222.230.253.254:48254 (Twinkle/1.4.2)
>
> [ROUTE GW] LCR: Selected gw ($rd): 222.230.249.81
>
> [ROUTE DEFAULT] $ru = sip:1234 at 222.230.249.81:0        <---- Seems to be OK
>
> 500 "Internal Error" from 222.230.249.81:5060 (GW1)
>
> [FAILURE ROUTE GW] CRITICAL: LCR: 500 replied by gw 222.230.249.81 -->
> Doing failover...
>
> [FAILURE ROUTE GW] Selected gw ($rd): 222.230.249.81        <----- WRONG !!!
>
> [ROUTE DEFAULT] $ru = sip:1234 at 222.230.249.81:0             <----- WRONG !!!
>
> 503 "Service Unavailable" from 99.121.79.216:5060 (GW2)     <----- But
> the used gw is the expected.
>
> [FAILURE ROUTE GW] CRITICAL: LCR: 503 replied by gw 99.121.79.216 -->
> Doing failover...
>
> [FAILURE ROUTE GW] CRITICAL: LCR: No gateways available --> 503



Ops, by reading again the doc:

----------
If hostname is not NULL, Request-URI is rewritten based on gateway's
URI scheme and hostname, and destination URI is set based on gateway's
URI scheme, IP address, port, and transport protocol. Upon subsequent
calls, the same is done, but instead of rewriting Request URI, a new
branch is added.
---------

Ok, this could explains my issue (however, $ru *is* rewritten for the
first selected gw !!!).


Anyhow, I also read:

---------------
1.3.6. hostname_column (string)
Name of the column holding gateway's hostname that is used in
Request-URI, when request is sent to the gateway. Note that request is
not forwarded based on hostname, but based on gateway's IP address in
destination uri.
---------------

I'd really would like this to be true, but the fact is that, after the
first gw fails, I receive an error (if it has a custom hostname):

Sep 16 18:22:45 [25444] CRITICAL:core:mk_proxy: could not resolve
hostname: "lolololololo"
Sep 16 18:22:45 [25444] ERROR:tm:uri2proxy: bad host name in URI
<sip:qwwsadasd at lolololololo>




>
>
> Kamailio 1.5 rev 5925.
>
>
>
> --
> Iñaki Baz Castillo
> <ibc at aliax.net>
>



-- 
Iñaki Baz Castillo
<ibc at aliax.net>



More information about the sr-dev mailing list