Hello Anthony,<div><br></div><div>Thanks. I have tested the registration-thread-frequency, but it seems this does not address the issue I'm having here.</div><div><br></div><div>But the good news is: I just found the bug with the help of Alexandr Dubovikov...</div>
<div><br></div><div>In sofia_reg.c, sofia_reg_check_gateway(...) it reads:</div><div><br></div><div><div><font face="'courier new', monospace"> if (gateway_ptr->freq >= 60) {</font></div><div><font face="'courier new', monospace"> gateway_ptr->expires = now + (gateway_ptr->freq - 15);</font></div>
<div><font face="'courier new', monospace"> } else {</font></div><div><font face="'courier new', monospace"> if (gateway_ptr->freq < 30 && gateway_ptr->freq >= 5) {</font></div>
<div><font face="'courier new', monospace"> gateway_ptr->expires = now + (gateway_ptr->freq - 5);</font></div><div><font face="'courier new', monospace"> } else {</font></div>
<div><font face="'courier new', monospace"> gateway_ptr->expires = now + (gateway_ptr->freq);</font></div><div><font face="'courier new', monospace"> }</font></div>
<div><font face="'courier new', monospace"> }</font></div></div><div><br></div><div>this results in a re-REGISTER 15 seconds ahead of expiration if the register timer is more than 60 seconds. We are a 5 seconds ahead of expiration if the register timer is between 5 and 29 seconds. And the winner is... if the register timer is between 30 and 59 seconds, we have no "ahead". Obviously a bug, since the code is difficult to read with all those else conditions.</div>
<div><br></div><div>I created a patch, verified that is works and attached it to this mail. Let me know if I need to do more (open an issue etc.) to make sure this patch gets applied...</div><div><br></div><div>Thanks again,</div>
<div>Roland</div><div><br><br><div class="gmail_quote">2012/1/10 Anthony Minessale <span dir="ltr"><<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It might be because we only check for expiration every 30 seconds.<div><br></div><div>update to latest GIT and I added a profile param: registration-thread-frequency</div><div><br></div><div>The default is 30 so you can try setting it to 10 or 5 or something.</div>
<div><br></div><div><br><div><br><div><br><br><div class="gmail_quote">2012/1/9 Roland Hänel <span dir="ltr"><<a href="mailto:roland@haenel.me" target="_blank">roland@haenel.me</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5">
Hi,<div><br></div><div>It seems that I'm running into a timing issue with outgoing (gateway) registrations, which results in some milliseconds in that I can't send calls over that gateway.</div><div><br></div><div>
I have configured a gateway like this:</div><div><br></div><div><div><font face="'courier new', monospace"> <gateway name="duro"></font></div><div><font face="'courier new', monospace"> <param name="username" value="XXXXXXX"/></font></div>
<div><font face="'courier new', monospace"> <param name="from-domain" value="<a href="http://durosip.qsc.de" target="_blank">durosip.qsc.de</a>"/></font></div><div><font face="'courier new', monospace"> <param name="password" value="XXXXXXXXXXX"/></font></div>
<div><font face="'courier new', monospace"> <param name="proxy" value="<a href="http://durosip.qsc.de" target="_blank">durosip.qsc.de</a>"/></font></div><div><font face="'courier new', monospace"> <param name="expire-seconds" value="120"/></font></div>
<div><font face="'courier new', monospace"> <param name="register" value="true"/>^M</font></div><div><font face="'courier new', monospace"> <param name="register-transport" value="udp"/></font></div>
<div><font face="'courier new', monospace"> <param name="retry-seconds" value="5"/></font></div><div><font face="'courier new', monospace"> <param name="caller-id-in-from" value="true"/></font></div>
<div><span style="font-family:'courier new',monospace"> </gateway>^M</span></div><div><br></div><div>If I look at the "200 OK" messages for the SIP REGISTER packet, the server sends me an "Expires: 30", so FreeSwitch should re-REGISTER every 30 seconds.</div>
<div><br></div><div>However, that's what happening:</div><div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><div><font face="'courier new', monospace"><a href="tel:2012-01-09%2016" value="+12012010916" target="_blank">2012-01-09 16</a>:37:00.804865 [NOTICE] sofia_reg.c:407 Registering duro</font></div>
</div></div><div><div><div><font face="'courier new', monospace"><a href="tel:2012-01-09%2016" value="+12012010916" target="_blank">2012-01-09 16</a>:37:31.804880 [NOTICE] sofia_reg.c:407 Registering duro</font></div>
</div></div><div><div><div><font face="'courier new', monospace"><a href="tel:2012-01-09%2016" value="+12012010916" target="_blank">2012-01-09 16</a>:38:<a href="tel:03.804894" value="+493804894" target="_blank">03.804894</a> [NOTICE] sofia_reg.c:407 Registering duro</font></div>
</div></div><div><div><div><font face="'courier new', monospace"><a href="tel:2012-01-09%2016" value="+12012010916" target="_blank">2012-01-09 16</a>:38:35.824877 [NOTICE] sofia_reg.c:407 Registering duro</font></div>
</div></div><div><div><div><font face="'courier new', monospace"><b><a href="tel:2012-01-09%2016" value="+12012010916" target="_blank">2012-01-09 16</a>:39:<a href="tel:06.825090" value="+496825090" target="_blank">06.825090</a> [NOTICE] sofia_reg.c:407 Registering duro</b></font></div>
</div></div><div><div><div><font face="'courier new', monospace"><a href="tel:2012-01-09%2016" value="+12012010916" target="_blank">2012-01-09 16</a>:39:39.824881 [NOTICE] sofia_reg.c:407 Registering duro</font></div>
</div></div></blockquote><div><div><br></div><div>You can see that it's <i>approximately</i> 30 seconds betwee registrations, but in fact every time it's just a little more than 30 secs. This alone makes me feel a little bit strange, since my registration might have been expired during this time window (and consequently, maybe I'm loosing incoming calls because of that).</div>
<div><br></div><div>Even for outgoing calls, this seems to be an issue, let's take a look at the 16:39:<a href="tel:06.825090" value="+496825090" target="_blank">06.825090</a> re-REGISTER.</div><div><br></div><div>We can see that at 16:39:05 (no micro-seconds here) the gateway becomes "UNREGED":</div>
<div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><div><font face="'courier new', monospace">Content-Length: 542</font></div></div></div><div><div><font face="'courier new', monospace">Content-Type: text/event-plain</font></div>
</div><div><div><font face="'courier new', monospace"><br></font></div></div><div><div><font face="'courier new', monospace">Event-Subclass: sofia::gateway_state</font></div></div><div><div><font face="'courier new', monospace">Event-Name: CUSTOM</font></div>
</div><div><div><font face="'courier new', monospace">Core-UUID: 243269fe-d280-4f83-aca1-abb88f2ad258</font></div></div><div><div><font face="'courier new', monospace">FreeSWITCH-Hostname: lap597</font></div>
</div><div><div><font face="'courier new', monospace">FreeSWITCH-Switchname: lap597</font></div></div><div><div><font face="'courier new', monospace">FreeSWITCH-IPv4: 192.168.232.164</font></div></div><div>
<div><font face="'courier new', monospace">FreeSWITCH-IPv6: ::1</font></div></div><div><div><font face="'courier new', monospace"><b>Event-Date-Local: <a href="tel:2012-01-09%2016" value="+12012010916" target="_blank">2012-01-09 16</a>:39:05</b></font></div>
</div><div><div><font face="'courier new', monospace">Event-Date-GMT: Mon, 09 Jan 2012 15:39:05 GMT</font></div>
</div><div><div><font face="'courier new', monospace">Event-Date-Timestamp: 1326123545824882</font></div></div><div><div><font face="'courier new', monospace">Event-Calling-File: sofia_reg.c</font></div></div>
<div><div><font face="'courier new', monospace">Event-Calling-Function: sofia_reg_fire_custom_gateway_state_event</font></div></div><div><div><font face="'courier new', monospace">Event-Calling-Line-Number: 151</font></div>
</div><div><div><font face="'courier new', monospace">Gateway: duro</font></div></div><div><div><font face="'courier new', monospace">State: UNREGED</font></div></div><div><div><font face="'courier new', monospace">Ping-Status: UP</font></div>
</div></blockquote><div><div><br></div><div>But the new REGISTER is done a full second later (this is not just a display issue, I saw those messages scrolling by and there was just a second pause between them):</div><div>
<br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><font face="'courier new', monospace">Event-Subclass: sofia::gateway_state</font></div></div><div><div><font face="'courier new', monospace">Event-Name: CUSTOM</font></div>
</div><div><div><font face="'courier new', monospace">Core-UUID: 243269fe-d280-4f83-aca1-abb88f2ad258</font></div></div><div><div><font face="'courier new', monospace">FreeSWITCH-Hostname: lap597</font></div>
</div><div><div><font face="'courier new', monospace">FreeSWITCH-Switchname: lap597</font></div></div><div><div><font face="'courier new', monospace">FreeSWITCH-IPv4: 192.168.232.164</font></div></div><div>
<div><font face="'courier new', monospace">FreeSWITCH-IPv6: ::1</font></div></div><div><div><font face="'courier new', monospace">Event-Date-Local: <a href="tel:2012-01-09%2016" value="+12012010916" target="_blank">2012-01-09 16</a>:39:06</font></div>
</div><div><div><font face="'courier new', monospace"><b>Event-Date-GMT: Mon, 09 Jan 2012 15:39:06 GMT</b></font></div>
</div><div><div><font face="'courier new', monospace">Event-Date-Timestamp: 1326123546825090</font></div></div><div><div><font face="'courier new', monospace">Event-Calling-File: sofia_reg.c</font></div></div>
<div><div><font face="'courier new', monospace">Event-Calling-Function: sofia_reg_fire_custom_gateway_state_event</font></div></div><div><div><font face="'courier new', monospace">Event-Calling-Line-Number: 151</font></div>
</div><div><div><font face="'courier new', monospace">Gateway: duro</font></div></div><div><div><font face="'courier new', monospace">State: TRYING</font></div></div><div><div><font face="'courier new', monospace">Ping-Status: DOWN</font></div>
</div></blockquote><div><div><br></div><div>Then, the gateway gets re-registered in a couple of milliseconds and everything is fine again.</div><div><br></div><div><b>It seems that this behaviour effectively creates a timespan of 1-2 seconds, where the gateway is not available for outgoing (and maybe also incoming) calls.</b></div>
<div><br></div><div>Does anyone of you know this issue? I wonder because this looks just to easy to be wrong in this fashion?</div><div><br></div>Greetings,<div>Roland</div><div><br></div><br>
</div>
<br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>
GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:<a href="tel:%2B19193869900" value="+19193869900" target="_blank">+19193869900</a><br>
</div></div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Gruß,<div>Roland</div><div><br></div><br>
</div>