[OpenSIPS-Users] Receiving requests via registration TCP connection

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Oct 14 12:25:23 CEST 2008


Iñaki Baz Castillo wrote:
> 2008/10/14 Bogdan-Andrei Iancu <bogdan at voice-system.ro>:
>
>   
>>> Well, I tryed it for long time in OpenSer 1.2 and it never worked as
>>> expected. Anyway that's a different question.
>>>
>>>       
>> What did not worked? could you open a new thread on this?
>>     
>
> As far as I remember, it did never mantain the REGISTER TCP connection
> with the client open. Let me try it again.
>   
Note that for keeping the connection up, none of the parties should 
close it. We can control the server side (like opensips not closing the 
connection), but the client does whatever it wants (it can close the 
connection).
Check which party is doing RESET.
>
>   
>> when registering from behind a NAT, opensips will learn the received IP and
>> used this one (and not the contact) to deliver calls. So, if the TCP
>> connection of the REGISTER is still one, it will be re-used (as the target
>> is the same).
>>     
>
> Imagine there is no NAT.
> UA registers with the proxy by sending a REGISTER via TCP from random
> port 12345 (but of course UA listens in 5060). The REGISTER Contact
> says, of course:
>   Contact: user at UA_PUBLIC_IP:5060;transport=tcp
>
> Now imagine that the proxy, for whatever reason, forwards requests to
> the UA using the previous TCP connection (still open), this is, with
> destination port 12345.
>   
The proxy should use the registered contact (if no nat detected). So, 
the proxy should open a second TCP connection to UA_PUBLIC_IP:5060. 
Proxy has to use the registered contact as received, if there are no 
network limitations (like NAT).
> Should the UA accept those requests?
> Shouldn't the UA rejects them because they don't come via 5060 port?
>   

Hmmm....To be honest, it is a difficult question. I made some inquires 
around and the we agreed that:
    1) RFC says nothing on this matter
    2) in the worst case, the client should check only the username and 
domain - no URI parameters, port, etc
    3) in the best case, the client should not check - otherwise you 
could not do static registration (simply fwd to the client without 
registration).

>
>
>
>   
>>> Bogus? well, the RURI is correct since it's exactly the Contact sent
>>> by the UA during registration, but the UA receives the request using
>>> the random port used for the REGISTER instead of receiving the request
>>> via the LISTENING port (5060).
>>> This is the main question, is it valid per RFC 3261?
>>>
>>>       
>> Not sure if the RFC3261 says something on this matter - it is more a logical
>> one I would say.....Let me check, SIPit is the right place for this ;)
>>     
>
> As Klaus said, RFC 3261 decides "NAT doesn't exist" XD
>
>   
Yes, RFC 3261 is sometime to idealistic  ....a bit off the ground :D

Regards,
Bogdan



More information about the Users mailing list