[sr-dev] LCR: defunct_gw() is dangerous

Iñaki Baz Castillo ibc at aliax.net
Thu Dec 29 11:42:34 CET 2011


2011/12/28 Juha Heinanen <jh at tutpro.com>:
> Iñaki Baz Castillo writes:
>
>> Anyhow, we are not discussing about that. Tomorrow I will paste the
>> malformed SIP request that Kamailio forwards to the GW.
>
> originally we were discussing, why lcr module does not poll gws and my
> reply was that the polling can be done in a timed route that stores the
> status of the gw in a htable entry.  if gw does not respond to a
> request, your script can check what to do about it by checking the gw's
> htable entry.

AFAIK locally sends requests (from Kamailio) do not generate a
transaction so there is no failure_route to react. So, if I miss
nothing, your proposal is not feasible.

In the other side, please check this SIP request:

--------------------------
OPTIONS sip:bob at domain.com SIP/2.0
Via: SIP/2.0/UDP 1.1.1.1;branch=qweqweqwe
From: "Alice" <sip:alice at domain.com>;tag=tag1234
To: "Bob" <sip:bob at domain.com>
Bad-Header( lalala <sip:lalala at 1.2.3.4>
Call-id: qweqweqweqwe
Cseq: 1234 OPTIONS
Content-Length: 0
--------------------------

This request is *invalid* since the "Bad-Header" header is fully
malformed (it's not a header in fact), so it becomes an invalid whole
SIP message.
But send this request to Kamailio and Kamailio will happily forward
it. And maybe the UAS receiving it will just *drop* the request rather
than replying 400 (since it's not a valid SIP request).

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



More information about the sr-dev mailing list