<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.HTMLVorformatiertZchn
        {mso-style-name:"HTML Vorformatiert Zchn";
        mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert";
        font-family:Consolas;
        mso-fareast-language:DE;}
span.E-MailFormatvorlage21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">as already discussed, it seems to be more a problem of the SIP retransmission timer.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">This can be changed with TM parameter. But I doubt this is really the solution to your problem, usually it is not necessary to change this timer.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">My suggestion would be to look into the network trace what actually happens on the SIP level. Then you can probably better understand what the problem is.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">You can differentiate between a retransmitted INVITE and a real re-INVITE easily – the re-INVITE has a “To tag”, the retransmitted INVITE (for the initial call setup) not.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Henning<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">-- <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Henning Westerholt –
</span><span style="mso-fareast-language:EN-US"><a href="https://skalatan.de/blog/"><span lang="EN-GB" style="color:#0563C1">https://skalatan.de/blog/</span></a></span><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Kamailio services –
</span><span style="mso-fareast-language:EN-US"><a href="https://gilawa.com/"><span lang="EN-GB" style="color:#0563C1">https://gilawa.com</span></a></span><span style="mso-fareast-language:EN-US">
<span lang="EN-GB"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org>
<b>On Behalf Of </b>Anuran Barman<br>
<b>Sent:</b> Wednesday, December 18, 2019 7:30 AM<br>
<b>To:</b> Patrick Wakano <pwakano@gmail.com><br>
<b>Cc:</b> Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org><br>
<b>Subject:</b> Re: [SR-Users] How to reduce re-INVITE time in Kamailio<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">@<b><span style="font-family:"Helvetica",sans-serif;color:#202124;letter-spacing:.15pt">Henning Westerholt</span></b><o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#202124;letter-spacing:.15pt">So I loaded the sst.so module and setup the params it said to set like below:</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><i>modparam("dialog", "timeout_avp", "$avp(i:10)")<br>
# Set the sst modules timeout_avp to be the same value<br>
modparam("sst", "timeout_avp", "$avp(i:10)")<br>
modparam("sst", "min_se", 10)</i><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">and also set the flag in INVITE method in
<b>request_route</b> {}<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><i>        # account only INVITEs<br>
        if (is_method("INVITE")) {<br>
                setflag(FLT_ACC); # do accounting<br>
                setflag(5);<br>
        }</i><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">and also set the  <b>t_set_retr</b> in
<b>route</b>{}<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><i><span style="color:black;background:white">route {<br>
        dlg_manage();<br>
        t_set_retr(10, 0);<br>
        if (is_method("BYE")) {<br>
                $var(elapsed) = ( $Ts - $dlg(start_ts) );<br>
                xlog ("L_INFO", "Completed $dlg(from_uri) to $dlg(to_uri) -<br>
                $var(elapsed) duration");<br>
        }<br>
}</span></i><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">but still I am getting the INVITE after  57-59 seconds later. How do I do this?<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">On Wed, Dec 18, 2019 at 9:40 AM Anuran Barman <<a href="mailto:anuranbarman@gmail.com">anuranbarman@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Thank you all for the detailed information. Let me try both changing the transmission time and also suspending the invite transaction. That NAT port close did not hit my mind. Thanks for putting light on that. <o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">On Wed, 18 Dec 2019 at 9:35 AM, Patrick Wakano <<a href="mailto:pwakano@gmail.com" target="_blank">pwakano@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">As I understood Anuran is after the SIP retransmission timer.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">From the description, I think the first INVITE, which I assume triggers the pushkit voip to IOS stuff, is missed, then (with default timer T1) after 500ms the first retransmission is done, then after another 500ms
 you get the 2nd, then after 1s the 3rd, after 2s the 4th, after 4s the 5th, after 8s the 6th and finally after 16s the 7th. This is probably why if you wait 10/15s it works, because probably the 5th or 6th retransmission hits your client. If you wait just
 5s you can fall under one window without retransmission (if you miss the 5th you have to wait 8s for the next retransmission).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">You can change the timer T1 in the TM module and hope the retransmissions do the job for you. It might work but doesn't look safe to me. I have no idea how this pushkit voip event works, but you may have problems
 of NAT ports being closed due to lack of SIP activity, then the INVITE will never reach your destination anyway.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">The way to go seems what David has suggested about suspending the Invite transaction while your client start-up and register, but I don't know details about this....<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Cheers,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Patrick Wakano<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">On Wed, 18 Dec 2019 at 07:34, Henning Westerholt <<a href="mailto:hw@skalatan.de" target="_blank">hw@skalatan.de</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p style="margin-left:35.4pt">As mentioned, it is more a User agent related topic. But there is a module that provide related functions in Kamailio:<o:p></o:p></p>
<p style="margin-left:35.4pt"><a href="https://kamailio.org/docs/modules/stable/modules/sst.html" target="_blank">https://kamailio.org/docs/modules/stable/modules/sst.html</a><o:p></o:p></p>
<p style="margin-left:35.4pt">Cheers,<o:p></o:p></p>
<p style="margin-left:35.4pt">Henning<o:p></o:p></p>
<p style="margin-left:35.4pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Am 17.12.19 um 19:51 schrieb Anuran Barman:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Thanks for the reply. Sharing doc links of Session timer settings related to Kamailio specifically will be greatly appreciated.<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">On Wed, 18 Dec 2019 at 12:18 AM, Yuriy Gorlichenko <<a href="mailto:ovoshlook@gmail.com" target="_blank">ovoshlook@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Session-Expires header ( Just remembered right name) will help you
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">See rfc 4028<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><a href="https://tools.ietf.org/html/rfc4028#page-6" target="_blank">https://tools.ietf.org/html/rfc4028#page-6</a><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">On Tue, 17 Dec 2019, 19:44 Yuriy Gorlichenko, <<a href="mailto:ovoshlook@gmail.com" target="_blank">ovoshlook@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Hi. It is no a kamailio question but sip question itself. You can manage how often te invite will be by using session-timers. It will help you to setup time range between reInvite ir whatever message you will
 use as keepalive<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">On Tue, 17 Dec 2019, 19:34 Anuran Barman, <<a href="mailto:anuranbarman@gmail.com" target="_blank">anuranbarman@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Hi, I am using Kamailio for my SIP Phone app. My main SIP client is the iOS app. Till now everything is working fine regarding the calling. But the problem is when the app is killed I am not able to pick up incoming
 call. The thing is, when app is killed I am sending PushKit VOIP message to my ios app to wake it up. App is waking up. But by the time app is waking up, the original INVITE message got missed up. So according to SIP protocol it will re-INVITE after some time.
 Currently if I keep my app open for 10-15 secs after it wakes up, I am able to get the re-INVITE and everything works fine just as it was supposed to. But waiting 10-15 sec on the app is not practical in any sense.
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">So my question is there any way I can reduce the re-INVITE time to like 5/6 seconds so that as soon as the app open it will wait for 5/6 seconds (practical upto some extent) and it will get the call ? Or what
 kamailio is using as the interval time is a SIP standard and can not be changed? If possible to do so, how can I do that? Please help.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt">_______________________________________________<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" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></p>
</blockquote>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="margin-left:35.4pt">_______________________________________________<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" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></p>
</blockquote>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<pre style="margin-left:35.4pt">_______________________________________________<o:p></o:p></pre>
<pre style="margin-left:35.4pt">Kamailio (SER) - Users Mailing List<o:p></o:p></pre>
<pre style="margin-left:35.4pt"><a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><o:p></o:p></pre>
<pre style="margin-left:35.4pt"><a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></pre>
</blockquote>
<pre style="margin-left:35.4pt">-- <o:p></o:p></pre>
<pre style="margin-left:35.4pt">Kamailio Merchandising - <a href="https://skalatan.de/merchandising/" target="_blank">https://skalatan.de/merchandising/</a><o:p></o:p></pre>
<pre style="margin-left:35.4pt">Kamailio services - <a href="https://skalatan.de/services" target="_blank">https://skalatan.de/services</a><o:p></o:p></pre>
<pre style="margin-left:35.4pt">Henning Westerholt - <a href="https://skalatan.de/blog/" target="_blank">https://skalatan.de/blog/</a><o:p></o:p></pre>
</div>
<p class="MsoNormal" style="margin-left:35.4pt">_______________________________________________<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" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></p>
</blockquote>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>