[OpenSIPS-Devel] How to make OpenSIPS reuse client's TCP/TLS connection (and not try to connect on its own)?

Bogdan-Andrei Iancu bogdan at voice-system.ro
Fri Aug 22 15:22:23 CEST 2008


Hi Ivan,

Actually the question is if the SUBSCRIBE request comes from the same 
address (proto:ip:port) as advertised in contact hdr 
(ips:ivan at 10.0.5.112:5061). Could you check this?

Regards,
Bogdan


Ivan Genov wrote:
> Hi Bogdan,
>  
> Thanks for the answer.  I now realize I have not provided all relevant 
> information and I have not been fully correct with my first message.
>  
> I have to mention that I have a custom module on the server, which 
> takes care of subscriptions for one custom event. This module is 
> workign fine and it is responsible for sending NOTIFYs when needed.
>  
> I am pasting three packets of the communication between the client and 
> the server below. The client sends SUBSCRBE through the TLS connection 
> and the server responds with 202 OK to the client using the same 
> (single at that time) TLS connection which came from the client. But 
> after that, when the server (my custom module) needs to send NOTIFY to 
> the client, for some reason the server establishes a new TLS 
> connection to the client through which it sends the NOTIFY. Here are 
> the packets:
>  
> -----------------------------------------------------------------
> SUBSCRIBE sips:ivan at 10.0.5.5 SIP/2.0
> Via: SIP/2.0/tls 
> 10.0.5.112:2013;rport;branch=z9hG4bKPj6a7bed4a838c416fa70d57c85ef98e21
> Max-Forwards: 70
> From: "Ivan" <sips:ivan at 10.0.5.112>;tag=8e8c2497ec8e4edeb3fc031ad861698d
> To: sips:ivan at 10.0.5.5
> Contact: "Ivan" <sips:ivan at 10.0.5.112:5061;transport=TLS>
> Call-ID: 41d9d9772e89462ca9e71e225d03f596
> CSeq: 18467 SUBSCRIBE
> Event: custom-event
> Expires: 120
> Accept: text/plain
> Allow-Events: presence, refer, custom-event
> Content-Type: text/plain
> Content-Length: 6
>  
> 010203
> -----------------------------------------------------------------
> SIP/2.0 202 OK
> Via: SIP/2.0/tls 
> 10.0.5.112:2013;rport=2013;branch=z9hG4bKPj6a7bed4a838c416fa70d57c85ef98e21
> From: "Ivan" <sips:ivan at 10.0.5.112>;tag=8e8c2497ec8e4edeb3fc031ad861698d
> To: sips:ivan at 10.0.5.5;tag=10.0.1219249054.4
> Call-ID: 41d9d9772e89462ca9e71e225d03f596
> CSeq: 18467 SUBSCRIBE
> Expires: 120
> Server: OpenSER (1.3.0-tls (i386/linux))
> Content-Length: 0
> -----------------------------------------------------------------
> NOTIFY sips:ivan at 10.0.5.112:5061;transport=TLS SIP/2.0
> Via: SIP/2.0/TLS 10.0.5.5:5061;branch=z9hG4bKc2bf.75041b55.0
> To: sip:ivan at 10.0.5.112;tag=8e8c2497ec8e4edeb3fc031ad861698d
> From: sip:ivan at 10.0.5.5;tag=10.0.1219249054.4
> CSeq: 1 NOTIFY
> Call-ID: 41d9d9772e89462ca9e71e225d03f596
> Content-Length: 6
> User-Agent: OpenSER (1.3.0-tls (i386/linux))
> Max-Forwards: 70
> Event: custom-event
> Subscription-State: active;expires=120
> Content-Type: text/plain
>  
> 010203
> -----------------------------------------------------------------
>  
> Can it be told from these packets what makes the server think the 
> connection point is different? I suspect the connection point looks 
> different to the server because 
> "sips:ivan at 10.0.5.112:5061;transport=TLS" is different SIP URI than 
> "sips:ivan at 10.0.5.5", maybe? 10.0.5.112 is the client's IP and 
> 10.0.5.5 is the server's.
>  
>  
> Thanks in advance,
>  
> Ivan.
>  
>  
> ----- Original Message ----
> From: Bogdan-Andrei Iancu <bogdan at voice-system.ro>
> To: Ivan Genov <ivangg_q at yahoo.com>
> Cc: devel at lists.opensips.org
> Sent: Wednesday, August 20, 2008 1:20:20 AM
> Subject: Re: [OpenSIPS-Devel] How to make OpenSIPS reuse client's 
> TCP/TLS connection (and not try to connect on its own)?
>
> Hi Ivan,
>
> The OpenSIPS reuses the TCP/TLS connection only if the connection point
> (where it tries to connect to) is already involved in a established
> connection.
>
> In your case, maybe the connection point looks different than any
> existing connections, so a new one is opened.
>
> Regards,
> Bogdan
>
> Ivan Genov wrote:
> > Hi,
> > 
> > I am noticing that when a client connects to the OpenSIPS server via
> > TLS the server is establishing a new TLS connection to the client and
> > sends the respond through it. This works OK for internal LAN, but if
> > you are trying to connect with the client from outside Internet (or
> > other unreachable for the OpenSIPS place) the OpenSIPS cannot
> > establish this connection and it will not work.
> > 
> > My expectation was that the SIP server would reuse the same TCP/TLS
> > connection that the client made to it, but obviously it is not so. Do
> > you know if there is a way to configure the server (possibly the
> > client), so that the server reuses the client's connection and does
> > not try to create a new one?
> > 
> > 
> > Thanks,
> > 
> > Ivan.
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Devel mailing list
> > Devel at lists.opensips.org <mailto:Devel at lists.opensips.org>
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
> > 
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>   




More information about the Devel mailing list