From: <do...@us...> - 2007-12-04 13:24:08
|
Revision: 1298 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1298&view=rev Author: dohpaz Date: 2007-12-04 05:24:13 -0800 (Tue, 04 Dec 2007) Log Message: ----------- Use consistant registration timeout. Schedule registration refresh 2 seconds before expiration to better allow for packet retry. Modified Paths: -------------- branches/team/elbunce/iaxclient/lib/iaxclient_lib.c Modified: branches/team/elbunce/iaxclient/lib/iaxclient_lib.c =================================================================== --- branches/team/elbunce/iaxclient/lib/iaxclient_lib.c 2007-12-04 05:15:51 UTC (rev 1297) +++ branches/team/elbunce/iaxclient/lib/iaxclient_lib.c 2007-12-04 13:24:13 UTC (rev 1298) @@ -80,6 +80,8 @@ struct iaxc_registration *next; }; +static int registration_timeout = 60; + static int next_registration_id = 0; static struct iaxc_registration *registrations = NULL; @@ -763,7 +765,7 @@ iaxci_usermsg(IAXC_ERROR, "Can't make new registration session"); return; } - iax_register(cur->session, cur->host, cur->user, cur->pass, 60); + iax_register(cur->session, cur->host, cur->user, cur->pass, registration_timeout); cur->last = now; } } @@ -1264,14 +1266,14 @@ } gettimeofday(&newreg->last,NULL); - newreg->refresh = 60*1000*1000; /* 60 seconds, in usecs */ + newreg->refresh = (registration_timeout - 2) *1000*1000; /* 2 seconds before registration timeout, in usecs */ strncpy(newreg->host, host, 256); strncpy(newreg->user, user, 256); strncpy(newreg->pass, pass, 256); - /* send out the initial registration timeout 300 seconds */ - iax_register(newreg->session, host, user, pass, 300); + /* send out the initial registration with registration_timeout seconds */ + iax_register(newreg->session, host, user, pass, registration_timeout); /* add it to the list; */ newreg->id = ++next_registration_id; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |