<div dir="ltr">1. Ok I think I found the cause for the problem:<div><br></div><div>First of all I noticed that the dialog doesn't timeout if the ka_timer module parameter is less or equal to 10 secs. If it is above 10 secs then everything works. <div>
<br></div><div>I use the master branch and in the dialog module (<a href="https://github.com/kamailio/kamailio/blob/master/modules/dialog/dlg_req_within.c">https://github.com/kamailio/kamailio/blob/master/modules/dialog/dlg_req_within.c</a>) in line 264 there is this code:</div>
<div><br></div><div><div>if(ps->code==408 || ps->code==481) {</div><div><span class="" style="white-space:pre">               </span>if(update_dlg_timer(&dlg->tl, 10)<0) {</div><div><span class="" style="white-space:pre">                   </span>LM_ERR("failed to update dialog lifetime\n");</div>
<div><span class="" style="white-space:pre">                    </span>goto done;</div><div><span class="" style="white-space:pre">         </span>}</div><div><span class="" style="white-space:pre">          </span>dlg->lifetime = 10;</div><div><span class="" style="white-space:pre">             </span>dlg->dflags |= DLG_FLAG_CHANGED;</div>
<div><span class="" style="white-space:pre">    </span>}</div><div><br></div><div>This code is for updating the dialog's lifetime when a timeout occurs (by a fake 408 reply) or a 481 is received.</div><div>But in the call of update_dlg_timer function above, the second argument is a hardcoded 10, which causes the dialog to refresh its lifetime to 10 more seconds, every time a timeout occurs, and because when ka_timer is < 10 secs this gets refreshed again before the dialog expires. I did a test with a value of 1 and it correctly works for values of ka_timer >= 2</div>
<div><br></div><div>I cant say the correct value, propably should be 1, so that the dialog gets expired the next second that the dlg_timer_routine runs. Also this value should be less than the ka_timer value so there should be a minimum valid ka_timer value.</div>
<div><br></div></div><div>I also looked in the 4.1.2 release and it is there too.</div><div><br></div><div>2. Is it possible to manually define the OPTIONS timeout when sending it? Currently is around 30 secs, and I would like to make it less for this specific use (dialog keep-alives)<br>
</div><div><br></div><div><br></div><div>Thanks.</div><div><div><pre style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;margin-top:0px;margin-bottom:0px;color:rgb(51,51,51);line-height:18px">
<div class="" id="LC271" style="padding-left:10px;height:18px"><span style="color:rgb(153,0,0);font-weight:bold"> </span></div></pre></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 8, 2014 at 12:12 PM, Vassilis Radis <span dir="ltr"><<a href="mailto:radisb@gmail.com" target="_blank">radisb@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Kelvin, but I already have tried this. This is exactly what I wrote that the issue is: Despite having set those options, and the keep alives are sent, the dialog does not timeout as it should when no reply is sent to the keep-alive OPTIONS msg by the dst peer. <div>

<br><div>I am using the master branch and I am trying to follow the source code to see how and where the dialog module should be called back when the timeout for the OPTIONS message occurs, but I am a little lost. If you think I am missing something and there is a simple configuration solution please do point it to me.</div>

<div><br></div><div>Thanks a lot.</div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 7, 2014 at 10:02 PM, Kelvin Chua <span dir="ltr"><<a href="mailto:kelchy@gmail.com" target="_blank">kelchy@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>try this</div><div><br></div><div>modparam("dialog", "ka_timer", 3)</div><div>
modparam("dialog", "ka_interval", 10)</div>
<div><br></div><div>these 2 will make sure it will disconnect within 30 seconds</div>
<div><br></div><div><div>                dlg_set_property("ka-src");</div><div>                dlg_set_property("ka-dst");</div></div><div><br></div><div>thesse 2 will make sure that keep alive timers will apply to the current dialog</div>


</div><div class="gmail_extra"><br clear="all"><div>Kelvin Chua</div>
<br><br><div class="gmail_quote"><div><div>On Mon, Apr 7, 2014 at 1:43 AM, Vassilis Radis <span dir="ltr"><<a href="mailto:radisb@gmail.com" target="_blank">radisb@gmail.com</a>></span> wrote:<br></div></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
<div dir="ltr">Hello,<div><br></div><div>I am trying to use the dialog module for dealing with some cases where clients do not send BYE messages correctly and just disappear. For this reason i use the ka_timer and ka_interval along with ka-dst and ka-src attributes. I am using the master branch. I have setup the following test: I have setup a sipp instance as a callee uas configured to discard OPTIONS messages. Kamailio serves as a proxy between this sipp instance and a VoIP device registered to kamailio. Kamailio is also configured to send every call to the sipp uas with stateful proxing and dialog support:</div>




<div><br></div><div>CALLER ------> KAMAILIO ----->  CALLEE (sipp / ignores OPTIONS msg)</div><div><br></div><div>I have the following issue:</div><div><br></div><div>1. Dialog does send the OPTIONS messages to caller and callee, and as expected, only the caller responds (with a 200 OK response). But the dialog module never terminates the dialog as it should (because the callee never responds to the OPTIONS msg). Instead it keeps sending those OPTIONS for ever. It is like there is no timer entry in the timer list for those OPTIONS. I looked a bit in the source code and I am trying to find where a timeout for those keep alives is a)set and b)handled . I see that the dlg_timer_routine is called every second but after turning debugging on, i see that the only timer reported is the default timeout for the call which i ve set to 3600 secs in the module parameters. </div>




<div><br></div><div>Any insight or advice?</div><div><br></div><div>Thanks a lot.</div><div><br></div><div><br></div></div>
<br></div></div>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>