No subject


Wed Jan 27 21:05:54 CET 2016


ght? Unfortunately I don't know why it does that, perhaps the best thing to=
 do is to check the client's logs.


Best regards.



RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979


________________________________
De: users-bounces at lists.opensips.org<mailto:users-bounces at lists.opensips.or=
g> <users-bounces at lists.opensips.org><mailto:users-bounces at lists.opensips.o=
rg> em nome de R=E3zvan Crainea <razvan at opensips.org><mailto:razvan at opensip=
s.org>
Enviado: quarta-feira, 26 de outubro de 2016 13:08
Para: users at lists.opensips.org<mailto:users at lists.opensips.org>
Assunto: Re: [OpenSIPS-Users] Is it a kind of TCP keep alive produced by Op=
enSIPS?

Hi, Rodrigo!

The logs you are tracing are printed when OpenSIPS receives something from =
the client, and then immediately responds back. Due to the fact that we don=
't see any other debug messages, like SIP parsing & stuff, makes me think t=
hat it is a CRLF pinging - the client periodically sends a CRLFCRLF TCP mes=
sage to OpenSIPS, and OpenSIPS responds with a single CRLF. Note that this =
is different from a TCP keep-alive, where each peer send a 0-length TCP mes=
sage, without any body. That message doesn't even get to the application la=
yer.
However, tracing the communication between OpenSIPS and the client should c=
onfirm the above :).

Best regards,

R=E3zvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com<http://www.opensips-solutions.com>

Home =97 OpenSIPS Solutions<http://www.opensips-solutions.com/>
www.opensips-solutions.com<http://www.opensips-solutions.com>
OpenSIPS is a mature Open Source implementation of a SIP server. OpenSIPS i=
s more than a SIP proxy/router as it includes application-level functionali=
ties.

On 10/26/2016 05:10 PM, Rodrigo Pimenta Carvalho wrote:

Dear OpenSIPS users,


In the OpenSIPS log I see:


Jan 01 19:30:38 colibri-imx6-jfl opensips[3444]: Jan  1 19:30:38 [3451] DBG=
:core:tcp_read_req: Using the global ( per process ) buff
Jan 01 19:30:38 colibri-imx6-jfl opensips[3444]: Jan  1 19:30:38 [3451] DBG=
:core:tcp_handle_req: content-length=3D 0
Jan 01 19:30:38 colibri-imx6-jfl opensips[3444]: Jan  1 19:30:38 [3451] DBG=
:core:async_tsend_stream: Async successful write from first try on 0x74e135=
48
Jan 01 19:30:38 colibri-imx6-jfl opensips[3444]: Jan  1 19:30:38 [3451] DBG=
:core:tcp_read_req: tcp_read_req end

The frequency is 1 time at each 1,5 minute. There is only one client online=
. I suspect that OpenSIPS uses the socket 0x74e13548 to send messages to su=
ch client. The client became online using TCP.

Just to confirm, is this log a result of a TCP keep alive function enabled?

Best regards.





RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979



_______________________________________________
Users mailing list
Users at lists.opensips.org<mailto:Users at lists.opensips.org>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users





_______________________________________________
Users mailing list
Users at lists.opensips.org<mailto:Users at lists.opensips.org>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



--_000_DM5PR02MB2732248ECE863373FEFB599BB5AA0DM5PR02MB2732namp_
Content-Type: text/html; charset="windows-1250"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dwindows-1=
250">
<style type=3D"text/css" style=3D"display:none;"><!-- P {margin-top:0;margi=
n-bottom:0;} --></style>
</head>
<body dir=3D"ltr">
<div id=3D"divtagdefaultwrapper" style=3D"font-size:12pt;color:#000000;font=
-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi. <font style=3D"font-size:11pt" color=3D"#000000" face=3D"Calibri, sa=
ns-serif">R=E3zvan</font>.</p>
<p><br>
</p>
<p>Thank you very much!</p>
<p>So, I will keep using the flag &quot;Pp&quot; to create dialogs. As I un=
derstood, it will not cause any problem.</p>
<p><br>
</p>
<p>Yes, it is the client that closes the connection, always. After some mor=
e investigation, I have discovered the following specific situation:</p>
<p><br>
</p>
<p>When softphone A (<span lang=3D"en">which</span> is always using ICE and=
 STUN) calls B, if B is not using ICE and STUN, the TCP connection between =
A and OpenSIPS remains stable. However, in this scenario, if B is using ICE=
 and STUN, A closes the TCP connection
 to OpenSIPS after 33 seconds of dialog.</p>
<p><br>
</p>
<p>Here, SIP is over TCP and ICE uses UDP. A and OpenSIPS run in the same h=
ardware. So, there is no NAT between A and OpenSIPS. B run in another hardw=
are, but in the same local network (same network domain). So, there is no N=
AT between B and OpenSIPS. A is
 a proprietary softphone and B is Microsip. I have looked at the proprietar=
y softphone log and there is no issues with SIP.<br>
</p>
<p><br>
</p>
<p>Do you have some more hint about what to investigate next?</p>
<p><br>
</p>
<p>Any hint will be very helpful!!</p>
<p>Best regards.<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<div id=3D"Signature">
<div name=3D"divtagdefaultwrapper" style=3D"font-family:Calibri,Arial,Helve=
tica,sans-serif; font-size:; margin:0">
<div class=3D"BodyFragment"><font size=3D"2">
<div class=3D"PlainText">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: &#43;55 35 3471 9200 RAMAL 979<br>
</div>
</font></div>
</div>
</div>
<br>
<br>
<div style=3D"color: rgb(0, 0, 0);">
<hr tabindex=3D"-1" style=3D"display:inline-block; width:98%">
<div id=3D"divRplyFwdMsg" dir=3D"ltr"><font style=3D"font-size:11pt" color=
=3D"#000000" face=3D"Calibri, sans-serif"><b>De:</b> users-bounces at lists.op=
ensips.org &lt;users-bounces at lists.opensips.org&gt; em nome de R=E3zvan Cra=
inea &lt;razvan at opensips.org&gt;<br>
<b>Enviado:</b> quinta-feira, 27 de outubro de 2016 05:47<br>
<b>Para:</b> users at lists.opensips.org<br>
<b>Assunto:</b> Re: [OpenSIPS-Users] Is it a kind of TCP keep alive produce=
d by OpenSIPS?</font>
<div>&nbsp;</div>
</div>
<div><tt>Hi, Rodrigo!<br>
<br>
See my answers inline.<br>
<br>
BR<br>
</tt>
<pre class=3D"moz-signature" cols=3D"72">R=E3zvan Crainea=0A=
OpenSIPS Solutions=0A=
<a previewremoved=3D"true" id=3D"LPlnk865344" class=3D"moz-txt-link-abbrevi=
ated" href=3D"http://www.opensips-solutions.com">www.opensips-solutions.com=
</a></pre>
<div style=3D"margin-bottom: 20px; overflow: auto; width: 100%; text-indent=
: 0px;" id=3D"LPBorder_GT_14775782628740.9356073187426525">
<table style=3D"width: 90%; background-color: rgb(255, 255, 255); position:=
 relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-=
top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px do=
tted rgb(200, 200, 200);" id=3D"LPContainer_14775782628710.4477988788821538=
6" cellspacing=3D"0">
<tbody>
<tr style=3D"border-spacing: 0px;" valign=3D"top">
<td colspan=3D"2" style=3D"vertical-align: top; position: relative; padding=
: 0px; display: table-cell;" id=3D"TextCell_14775782628720.7934107458903821=
">
<div id=3D"LPRemovePreviewContainer_14775782628720.5970423538183727"></div>
<div style=3D"top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-siz=
e: 21px; font-family: &quot;wf_segoe-ui_light&quot;,&quot;Segoe UI Light&qu=
ot;,&quot;Segoe WP Light&quot;,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Ta=
homa,Arial,sans-serif; line-height: 21px;" id=3D"LPTitle_14775782628720.021=
12093772763035">
<a target=3D"_blank" href=3D"http://www.opensips-solutions.com/" style=3D"t=
ext-decoration: none;" id=3D"LPUrlAnchor_14775782628730.12815466222114502">=
Home =97 OpenSIPS Solutions</a></div>
<div style=3D"margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight=
: 400; font-family: &quot;wf_segoe-ui_normal&quot;,&quot;Segoe UI&quot;,&qu=
ot;Segoe WP&quot;,Tahoma,Arial,sans-serif; font-size: 14px; line-height: 14=
px;" id=3D"LPMetadata_14775782628730.5947588421151666">
www.opensips-solutions.com</div>
<div style=3D"display: block; color: rgb(102, 102, 102); font-weight: 400; =
font-family: &quot;wf_segoe-ui_normal&quot;,&quot;Segoe UI&quot;,&quot;Sego=
e WP&quot;,Tahoma,Arial,sans-serif; font-size: 14px; line-height: 20px; max=
-height: 100px; overflow: hidden;" id=3D"LPDescription_14775782628740.18087=
400754553007">
OpenSIPS is a mature Open Source implementation of a SIP server. OpenSIPS i=
s more than a SIP proxy/router as it includes application-level functionali=
ties.</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class=3D"moz-cite-prefix">On 10/26/2016 08:15 PM, Rodrigo Pimenta Carv=
alho wrote:<br>
</div>
<blockquote type=3D"cite">
<div id=3D"divtagdefaultwrapper" style=3D"font-size:12pt; color:#000000; fo=
nt-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi R=E3zvan.</p>
<p><br>
</p>
<p>Thank you very much.</p>
<p>I'm facing a problem here related to TCP connection teared down during d=
ialogs.</p>
<p>While a peer is not in dialogs, its TCP connection to OpenSIPS keeps onl=
ine all the time.</p>
<p>However, when such peer enters in a conversation (be part of a dialog), =
after few minutes there is a EOF received in a socket. After this, OpenSIPS=
 can no more send SIP BYEs to the respective peer. In the log I can see:</p=
>
<p><br>
</p>
<div><span style=3D"font-size:10pt; color:rgb(0,111,201)">Jan 02 01:38:45 c=
olibri-imx6-jfl opensips[21018]: Jan&nbsp; 2 01:38:45 [21027] DBG:core:tcp_=
read: EOF on 0x74e3d048, FD 24&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</span><br>
<span style=3D"font-size:10pt; color:rgb(0,111,201)">Jan 02 01:38:45 colibr=
i-imx6-jfl opensips[21018]: Jan&nbsp; 2 01:38:45 [21027] DBG:core:tcp_read_=
req: EOF received&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; &nbsp;</span><br>
<span style=3D"font-size:10pt; color:rgb(0,111,201)">Jan 02 01:38:45 colibr=
i-imx6-jfl opensips[21018]: Jan&nbsp; 2 01:38:45 [21027] DBG:core:io_watch_=
del: [TCP_worker] io_watch_del op on index 0 24 (0x1875e8, 24, 0, 0x10,0x3)=
 fd_no=3D3 called&nbsp; &nbsp;</span><br>
<span style=3D"font-size:10pt; color:rgb(0,111,201)">Jan 02 01:38:45 colibr=
i-imx6-jfl opensips[21018]: Jan&nbsp; 2 01:38:45 [21027] DBG:core:tcpconn_r=
elease:&nbsp; releasing con 0x74e3d048, state -1, fd=3D-1, id=3D3&nbsp;&nbs=
p;
</span><br>
<span style=3D"font-size:10pt; color:rgb(0,111,201)">Jan 02 01:38:45 colibr=
i-imx6-jfl opensips[21018]: Jan&nbsp; 2 01:38:45 [21027] DBG:core:tcpconn_r=
elease:&nbsp; extra_data (nil)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</span><br>
<span style=3D"font-size:10pt; color:rgb(0,111,201)">Jan 02 01:38:45 colibr=
i-imx6-jfl opensips[21018]: Jan&nbsp; 2 01:38:45 [21029] DBG:core:handle_tc=
p_worker: reader response=3D 74e3d048, -1 from 2&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp; &nbsp;</span><br>
<span style=3D"font-size:10pt; color:rgb(0,111,201)">Jan 02 01:38:45 colibr=
i-imx6-jfl opensips[21018]: Jan&nbsp; 2 01:38:45 [21029] DBG:core:tcpconn_d=
estroy: destroying connection 0x74e3d048, flags 0006&nbsp;&nbsp;</span></di=
v>
<br>
<p>...</p>
<p>When OpenSIPS try to send a SIP BYE via socket <span style=3D"font-size:=
10pt; color:rgb(0,111,201)">
0x74e3d048</span> , I can see the log:<br>
</p>
<p><span style=3D"font-size:10pt; color:rgb(0,111,201)">Jan 02 01:40:49 col=
ibri-imx6-jfl opensips[21018]: Jan&nbsp; 2 01:40:49 [21026] DBG:core:proto_=
tcp_send: no open tcp connection found, opening new one, async =3D 1</span>=
</p>
<p><br>
</p>
<p>I have already used the flag &quot;Pp&quot; in the creation of dialogs, =
but it didn't take effect. That is, even with &quot;Pp&quot; I'm still gett=
ing &quot;EOF&quot; in the TCP socket.</p>
<p><br>
</p>
<p>1 - Should the flag &quot;Pp&quot; avoid those EOFs during dialogs?</p>
</div>
</blockquote>
Ideally, it should. However if the client does not &quot;like&quot; the pin=
ging and closes the connection, there's not that much we can do.<br>
<blockquote type=3D"cite">
<div id=3D"divtagdefaultwrapper" style=3D"font-size:12pt; color:#000000; fo=
nt-family:Calibri,Arial,Helvetica,sans-serif">
<p><br>
</p>
<p>That flag causes the OpenSIPS to send SIP OPTIONS. The peers are replyin=
g with SIP 500.
<br>
</p>
</div>
</blockquote>
That's not really an issue. The SIP OPTIONs pinging has two purposes: 1. ve=
rify if the dialog is still active, and 2. keep the NAT pinhole open. If th=
e SIP client doesn't know how to reply to in-dialog pinging, then 1. isn't =
really useful. So the reply code
 doesn't really matter, unless it is a 408, which means that the peer did n=
ot respond at all, and the dialog will be turn down.<br>
<blockquote type=3D"cite">
<div id=3D"divtagdefaultwrapper" style=3D"font-size:12pt; color:#000000; fo=
nt-family:Calibri,Arial,Helvetica,sans-serif">
<p></p>
<p><br>
</p>
<p>2- Is a SIP 500 reply enough to OpenSIPS keep the dialog connected?</p>
</div>
</blockquote>
Any communication between OpenSIPS and the client keeps the NAT pinhole ope=
n (see 2. above). From SIP perspective, that 500 could have a lot of meanin=
gs: the client does not know how to reply, or there was an internal error t=
hat could not process the message.
 However, this whole communication will keep the connection alive.<br>
<blockquote type=3D"cite">
<div id=3D"divtagdefaultwrapper" style=3D"font-size:12pt; color:#000000; fo=
nt-family:Calibri,Arial,Helvetica,sans-serif">
<p><br>
</p>
<p>3 - Does it make sense getting <span>absence</span> of keep alive messag=
es during dialogs?</p>
</div>
</blockquote>
So as I said above, any pinging method is useful to keep the connection ali=
ve. Regarding the dialogs, there is no special need for pinging from SIP pe=
rspective, unless you are using SST, which I presume you are not.<br>
<blockquote type=3D"cite">
<div id=3D"divtagdefaultwrapper" style=3D"font-size:12pt; color:#000000; fo=
nt-family:Calibri,Arial,Helvetica,sans-serif">
<p><br>
</p>
<p>Any hint will be very helpful!</p>
<p>P.S.: I will check the TCP trace too, looking for keep alives. <br>
</p>
</div>
</blockquote>


More information about the Users mailing list