<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Ideally I think Kamailio should send correct (i.e increasing) CSeq numbers.</span><br></blockquote><div>in my mind it can't be increased by kamailio because of:</div><div>1. kamailio send OPTIONS with cseq+1</div><div>2. media server may send some indialog reinvite with cseq+1 and then kamailio have to remember that OPTIONS and translate reinvite to cseq+2.</div><div><br></div><div>I don't know why for "<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">ka-src" CSeq is 0 and for "<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">ka-dst" the one is <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span>equal: so may be it is possible to be fixed </span></span></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span>(for example BYE) to be dropped by the firewall.</span></blockquote><div>this may be achieved by</div><div>1. usrloc pinging</div><div>2. short re-registration period for endpoint (60 sec for ex)</div><div>3. let's media server send options by itself via kamailio</div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></span></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-04-16 15:37 GMT+03:00 Oded Arbel <span dir="ltr"><<a href="mailto:odeda@cloudonix.io" target="_blank">odeda@cloudonix.io</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 16, 2018, 14:59 Dmitri Savolainen <<a href="mailto:savolainen@erinaco.ru" target="_blank">savolainen@erinaco.ru</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">hi<div><br><div>Indeed dialog <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span>OPTIONS are send with wrong CSeq and there is no way to fix it without patching source.</span></div></div></div></blockquote></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">In docs for dialog module "If keep alive is enabled for a dialog, the module will send SIP OPTIONS requests with CSeq lower or equal than last request within dialog"</span></div></div></div></blockquote></div><div><br></div></span><div>Yes, I've read this - but why?</div><span class=""><div><br></div><div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><span style="font-size:12.8px">Usually Kamailio is used before some media server (asterisk, freeswitch...):</span></div><div><span style="font-size:12.8px">endpoint1 - kamailio ----leg1---- media_server ---leg2---- kamailio - endpoint2</span></div><div><br></div><div><span style="font-size:12.8px">So if it is your case</span></div></div></div></blockquote></div><div><br></div></span><div>This is indeed my case.</div><span class=""><div><br></div><div><br></div><div class="gmail_quote"></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><span style="font-size:12.8px"> you want to check if dialog alive, you may ping media server instead of pinging remote endpoints</span></div></div></div></blockquote></div><div><br></div></span><div>I don't want to use "keep alive" to *check* if the dialog is alive - I want to use "keep alive" to keep the dialog alive, or more precisely: to prevent the MUA's NAT from tearing down the port mappings it creates when the MUA starts the dialog, for as long as the call is alive. </div><div><br></div><div>For that I need to set:</div><div><br></div><div>For leg1: dlg_set_propery("ka-src");</div><div>For leg2: <span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">dlg_set_property("ka-<wbr>dst");</span></div><div><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px"><br></span></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div></div></blockquote></div><div>And then the MUAs need to be able to respond. Even a 500 error response is enough for Kamailio to mark the message as received successfully and to keep sending OPTIONS messages, and as I described in my email, this sometimes works for "ka-dst", but for "ka-src" Kamailio always sends CSeq 0 to the MUA - as a result the MUA does not respond, causing Kamailio to retry a few times until it gives up, stops sending keep alive messages, allowing the NAT to teardown the SIP port mapping causing the next server originated message (for example BYE) to be dropped by the firewall.</div><div><br></div><div>Ideally I think Kamailio should send correct (i.e increasing) CSeq numbers. I think I can submit a patch to fix this, but as the current behavior is (more or less) documented I would want to understand why some one thought it's a good idea before attempting to change it.</div><div><div class="h5"><div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"></div></div><div class="gmail_extra"><div class="gmail_quote">2018-04-12 23:34 GMT+03:00 Oded Arbel <span dir="ltr"><<a href="mailto:odeda@cloudonix.io" target="_blank">odeda@cloudonix.io</a>></span>:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all.<div><br></div><div>I'm trying to use the dialog module's keep alive feature (ka_interval() and dlg_set_property()), and the documentation (under dlg_set_property) says this:</div><div><br></div><div>If keep alive is enabled for a dialog, the module will send SIP OPTIONS requests with CSeq lower or equal than last request within dialog</div><div><br></div><div>This is seems really weird to me, but the problem is worse than that - when setting dlg_set_property("ka-<wbr>src"), the OPTIONS messages sent to the caller always have CSeq set to "0", regardless of what CSeq the UA sent on its invite.</div><div><br></div><div>The problem is that while some UAs respond to these purposefully broken messages with some kind of a 5xx reply (for example, Linphone funnily sends "500 Internal Server Error"), several UAs don't respond at all. Worse than that - some of the UAs that send back 5xx replies to OPTIONS with a non-zero but invalid CSeq will completely ignore the OPTIONS keep-alive message that is sent to the caller with a CSeq 0 - for example, PJSIP responds with "503 Invalid CSeq" to a "ka-dst" OPTIONS message but will ignore a "ka-src" OPTIONS message with CSeq 0.</div><div><br></div><div>My questions:</div><div>1. Why are keep-alive messages sent with a wrong CSeq?</div><div>2. If we're keeping the "wrong CSeq" approach, can we at least not send CSeq "0"?</div><div>3. Is there a way to change any of the above behaviors with a configuration (i.e. without patching the sources)?</div><div><br></div><div>Thanks in advance</div><span class="m_-3120621547708703047m_-3272182841413751168HOEnZb"><font color="#888888"><div><div><br></div>-- <br><div class="m_-3120621547708703047m_-3272182841413751168m_6623385570846377927gmail_signature"><div dir="ltr"><div><div dir="ltr">Oded Arbel<div><a href="mailto:odeda@cloudonix.io" target="_blank">odeda@cloudonix.io</a></div><div><br></div><div><br></div></div></div></div></div>
</div></font></span></div>
<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-3120621547708703047m_-3272182841413751168gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Savolainen Dmitri</div></div></div></div></div>
</div>
______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
</blockquote></div>-- <br></div></div><div dir="ltr" class="m_-3120621547708703047gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><p dir="ltr"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px">Oded Arbel</span></p><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px"><a href="mailto:oded.arbel@greenfieldtech.net" style="font-size:12.8px" target="_blank">oded.arbel@greenfieldtech.net</a><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px"><a href="http://greenfieldtech.net/" target="_blank"><img alt="Greenfield Tech" src="https://docs.google.com/uc?export=download&id=0B7YBJmVm7aC4QzZkNE1INkRUV1k&revid=0B7YBJmVm7aC4cjVKbHk4Qld3akpOWFJFd0dDQnRVVnROaEg0PQ"></a></div>
</div></div>
<br>______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Savolainen Dmitri</div></div></div></div></div>
</div>