<div dir="ltr">Thanks Alex,<div><br></div><div>What you said is correct: I want to shorten the timeout <span style="font-family:arial,sans-serif;font-size:13px">for non-response to the OPTIONS keepalives in order to end calls with dead peers much more faster. Right now, no matter how often those keep-alives are sent, since the timeout is about 30s, I have to wait 30s when a peer does not respond. In the meantime, dialog module, if ka_timer is less than 30s, keeps sending more keepalives. So I thought that maybe we could set the ka_timer parameter to represent the fr timer for the OPTIONS, and the ka_interval to represent the interval between successfully responded keep-alives. So the final result would be:</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">User sets ka_timer to e.g. 5 secs and ka_interval to e.g 3 secs. then dialog module sends OPTIONS with timeout of 5 secs and waits for the fake 408 or 481 or a succesful 200 response, whichever hits first. If timer hits first we expire the dialog. If 200 response comes first, we send another OPTIONS again after 3 secs and so on. This way we can adjust it however we want, and no keep-alive is sent before the previous is expired or is successful.</span></div>
<div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">The only way I can see this happening is the final response timer for those OPTIONS. So I am trying to find out how to do it, because from script I cant, since I have no control over the sending or creation of those keep alives because dialog module doesnt expose any parameter to adjust it. You are right it should be through a parameter, but I am new to kamailio internals and just beginning messing with the source code and for now I am just looking to succeed in reducing the timer.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">See this </span><font face="arial, sans-serif"><a href="http://sip-router.org/tracker/index.php?do=details&task_id=417&project=1&order=id&sort=desc">http://sip-router.org/tracker/index.php?do=details&task_id=417&project=1&order=id&sort=desc</a> and my last comment to see how I got to trying to reduce this timer.</font></div>
<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Any advice on how to proceed? </font></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 17, 2014 at 2:39 PM, Alex Balashov <span dir="ltr"><<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>What are you going to do when this timer fires? <br>
<br>
Internally generated requests do not create TM transactions that are accessible from route script. <br>
<br>
What is your actual goal? To change the timeout for non-response to the OPTIONS keepalives? If so, that should probably be added as a modparam. In that case, fr_timer isn't quite the language in which to speak of it, as that makes it sound like a transaction to which you have access in script (with the implication that its failure can trigger a failure_route callback of your own making). That's not the case here. <br>

<br><br><div class="gmail_quote"><div><div class="h5">On 17 April 2014 15:33:57 GMT+04:00, Vassilis Radis <<a href="mailto:radisb@gmail.com" target="_blank">radisb@gmail.com</a>> wrote:</div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div class="h5">
<div dir="ltr">Hello, I would like to try customizing the fr_timer for the OPTIONS keep-alive msgs transactions that the dialog module sends. I tried to call t_set_fr() function from inside the dialog modules's code (in dlg_req_within.c , in dlg_send_ka() function after the call to <span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">d_tmb</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">.</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">t_request_within</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">(</span><span style="font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">&</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">uac_r</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">);</span><div>

<div>But it seems that this tm function is not available from inside other module's code.</div><div><br></div><div>Is the above is the correct place to try and do it, and how can I programmatically ,inside a module's code, adjust fr_timer?</div>

<div><br></div><div>On a side note, i followed the call flow from dlg_send_ka()<span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap"> </span>down to the t_uac_prepare() function of tm module, where the fr_timer is set. In there, there is this comment+code:<br>

</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;padding-left:10px;min-height:18px">

<span style="color:rgb(153,153,136);font-style:italic">/* init timers hack, new_cell->fr_timer and new_cell->fr_inv_timer</span></div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;padding-left:10px;min-height:18px">

<span style="color:rgb(153,153,136);font-style:italic">  * must be set, or else the fr will happen immediately</span></div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;padding-left:10px;min-height:18px">

<span style="color:rgb(153,153,136);font-style:italic">  * we can't call init_new_t() because we don't have a sip msg</span></div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;padding-left:10px;min-height:18px">

<span style="color:rgb(153,153,136);font-style:italic">  * => we'll ignore t_set_fr() or avp timer value and will use directly the</span></div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;padding-left:10px;min-height:18px">

<span style="color:rgb(153,153,136);font-style:italic">  * module params fr_inv_timer and fr_timer -- andrei */</span></div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;padding-left:10px;min-height:18px">

 <span>new_cell</span><span style="font-weight:bold">-></span><span>fr_timeout</span><span style="font-weight:bold">=</span><span>cfg_get</span><span>(</span><span>tm</span><span>,</span> <span>tm_cfg</span><span>,</span> <span>fr_timeout</span><span>);</span></div>

<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;padding-left:10px;min-height:18px"> <span>new_cell</span><span style="font-weight:bold">-></span><span>fr_inv_timeout</span><span style="font-weight:bold">=</span><span>cfg_get</span><span>(</span><span>tm</span><span>,</span> <span>tm_cfg</span><span>,</span> <span>fr_inv_timeout</span><span>);</span></div>

<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;padding-left:10px;min-height:18px"> <span>new_cell</span><span style="font-weight:bold">-></span><span>end_of_life</span><span style="font-weight:bold">=</span><span>get_ticks_raw</span><span>()</span><span style="font-weight:bold">+</span><span>lifetime</span><span>;</span></div>

<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:18px;padding-left:10px;min-height:18px"><br></div></pre></div></div><div><span style="white-space:pre-wrap">Does this mean that it cant be done in a straighforward way?</span><span style="white-space:pre-wrap"><br>

</span></div><div><span style="white-space:pre-wrap">Any advice on how I can achieve the customized fr_timers for those messages?</span><br></div><div><span style="white-space:pre-wrap"><br></span></div><div>Thanks.<span style="white-space:pre-wrap"><br>

</span></div></div>
<p style="margin-top:2.5em;margin-bottom:1em;border-bottom:1px solid #000"></p></div></div><pre><hr><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></pre></blockquote></div><br>
--<br>
Sent from my mobile, and thus lacking in the refinement one might expect from a fully fledged keyboard. <br>
<br>
Alex Balashov - Principal <br>
Evariste Systems LLC<br>
235 E Ponce de Leon Ave<br>
Suite 106<br>
Decatur, GA 30030<br>
United States<br>
Tel: <a href="tel:%2B1-678-954-0671" value="+16789540671" target="_blank">+1-678-954-0671</a><br>
Web: <a href="http://www.evaristesys.com" target="_blank">http://www.evaristesys.com</a>/, <a href="http://www.alexbalashov.com" target="_blank">http://www.alexbalashov.com</a></div><br>_______________________________________________<br>

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">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>