<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><DIV>Hi Bogdan,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks for the answer.&nbsp; I now realize I have not provided all relevant information and I have not been fully correct with my first message.</DIV>
<DIV>&nbsp;</DIV>
<DIV>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.</DIV>
<DIV>&nbsp;</DIV>
<DIV>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:</DIV>
<DIV>&nbsp;</DIV>
<DIV>-----------------------------------------------------------------</DIV>
<DIV>SUBSCRIBE sips:ivan@10.0.5.5 SIP/2.0<BR>Via: SIP/2.0/tls 10.0.5.112:2013;rport;branch=z9hG4bKPj6a7bed4a838c416fa70d57c85ef98e21<BR>Max-Forwards: 70<BR>From: "Ivan" &lt;sips:ivan@10.0.5.112&gt;;tag=8e8c2497ec8e4edeb3fc031ad861698d<BR>To: sips:ivan@10.0.5.5<BR>Contact: "Ivan" &lt;sips:ivan@10.0.5.112:5061;transport=TLS&gt;<BR>Call-ID: 41d9d9772e89462ca9e71e225d03f596<BR>CSeq: 18467 SUBSCRIBE<BR>Event: custom-event<BR>Expires: 120<BR>Accept: text/plain<BR>Allow-Events: presence, refer, custom-event<BR>Content-Type: text/plain<BR>Content-Length: 6</DIV>
<DIV>&nbsp;</DIV>
<DIV>010203</DIV>
<DIV>-----------------------------------------------------------------</DIV>
<DIV>SIP/2.0 202 OK<BR>Via: SIP/2.0/tls 10.0.5.112:2013;rport=2013;branch=z9hG4bKPj6a7bed4a838c416fa70d57c85ef98e21<BR>From: "Ivan" &lt;sips:ivan@10.0.5.112&gt;;tag=8e8c2497ec8e4edeb3fc031ad861698d<BR>To: sips:ivan@10.0.5.5;tag=10.0.1219249054.4<BR>Call-ID: 41d9d9772e89462ca9e71e225d03f596<BR>CSeq: 18467 SUBSCRIBE<BR>Expires: 120<BR>Server: OpenSER (1.3.0-tls (i386/linux))<BR>Content-Length: 0</DIV>
<DIV>-----------------------------------------------------------------</DIV>
<DIV>NOTIFY sips:ivan@10.0.5.112:5061;transport=TLS SIP/2.0<BR>Via: SIP/2.0/TLS 10.0.5.5:5061;branch=z9hG4bKc2bf.75041b55.0<BR>To: sip:ivan@10.0.5.112;tag=8e8c2497ec8e4edeb3fc031ad861698d<BR>From: sip:ivan@10.0.5.5;tag=10.0.1219249054.4<BR>CSeq: 1 NOTIFY<BR>Call-ID: 41d9d9772e89462ca9e71e225d03f596<BR>Content-Length: 6<BR>User-Agent: OpenSER (1.3.0-tls (i386/linux))<BR>Max-Forwards: 70<BR>Event: custom-event<BR>Subscription-State: active;expires=120<BR>Content-Type: text/plain</DIV>
<DIV>&nbsp;</DIV>
<DIV>010203</DIV>
<DIV>-----------------------------------------------------------------</DIV>
<DIV>&nbsp;</DIV>
<DIV>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@10.0.5.112:5061;transport=TLS" is different SIP URI than "sips:ivan@10.0.5.5", maybe? 10.0.5.112 is the client's IP and 10.0.5.5 is the server's.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks in advance,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Ivan.</DIV>
<DIV>
<DIV>&nbsp;</DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: arial, helvetica, sans-serif">
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: arial, helvetica, sans-serif">----- Original Message ----<BR>From: Bogdan-Andrei Iancu &lt;bogdan@voice-system.ro&gt;<BR>To: Ivan Genov &lt;ivangg_q@yahoo.com&gt;<BR>Cc: devel@lists.opensips.org<BR>Sent: Wednesday, August 20, 2008 1:20:20 AM<BR>Subject: Re: [OpenSIPS-Devel] How to make OpenSIPS reuse client's TCP/TLS connection (and not try to connect on its own)?<BR><BR>Hi Ivan,<BR><BR>The OpenSIPS reuses the TCP/TLS connection only if the connection point <BR>(where it tries to connect to) is already involved in a established <BR>connection.<BR><BR>In your case, maybe the connection point looks different than any <BR>existing connections, so a new one is opened.<BR><BR>Regards,<BR>Bogdan<BR><BR>Ivan Genov wrote:<BR>&gt; Hi,<BR>&gt;&nbsp; <BR>&gt; I am noticing that when a client connects to the OpenSIPS server via <BR>&gt; TLS the server is establishing a new TLS connection to the client and <BR>&gt; sends the
 respond through it. This works OK for internal LAN, but if <BR>&gt; you are trying to connect with the client from outside Internet (or <BR>&gt; other unreachable for the OpenSIPS place) the OpenSIPS cannot <BR>&gt; establish this connection and it will not work.<BR>&gt;&nbsp; <BR>&gt; My expectation was that the SIP server would reuse the same TCP/TLS <BR>&gt; connection that the client made to it, but obviously it is not so. Do <BR>&gt; you know if there is a way to configure the server (possibly the <BR>&gt; client), so that the server reuses the client's connection and does <BR>&gt; not try to create a new one?<BR>&gt;&nbsp; <BR>&gt;&nbsp; <BR>&gt; Thanks,<BR>&gt;&nbsp; <BR>&gt; Ivan.<BR>&gt;<BR>&gt; ------------------------------------------------------------------------<BR>&gt;<BR>&gt; _______________________________________________<BR>&gt; Devel mailing list<BR>&gt; <A href="mailto:Devel@lists.opensips.org"
 ymailto="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</A><BR>&gt; <A href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel" target=_blank>http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</A><BR>&gt;&nbsp; <BR><BR></DIV></DIV></div><br>

      </body></html>