<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><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><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="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 and you want to check if dialog alive, you may ping media server instead of pinging remote endpoints:</span></div><div><span style="font-size:12.8px">for leg1: dlg_set_property("ka-dst");</span><br></div><div><span style="font-size:12.8px"><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">for leg2: dlg_set_property("ka-src");</span><br></span></div><div><span style="font-size:12.8px"><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></div><div><span style="font-size:12.8px"><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">Of course your media server should support this not </span>inaccurate CSeq handling. I successfully use it with freeswitch for example (with some minimal freeswitch tuning)</span></div><div><span style="font-size:12.8px"><br></span></div><div><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div></div></div><div class="gmail_extra"><br><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><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="HOEnZb"><font color="#888888"><div><div><br></div>-- <br><div class="m_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>______________________________<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>