[Freeswitch-svn] [commit] r13619 - freeswitch/trunk/src/mod/endpoints/mod_sofia

FreeSWITCH SVN mikej at freeswitch.org
Thu Jun 4 13:00:53 PDT 2009


Author: mikej
Date: Thu Jun  4 15:00:53 2009
New Revision: 13619

Log:
sofia-sip: fix re-register after 423 w/ Min-Expires (SFSIP-143)

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	Thu Jun  4 15:00:53 2009
@@ -310,7 +310,7 @@
 		case REG_STATE_UNREGED:
 			gateway_ptr->status = SOFIA_GATEWAY_DOWN;
 
-			sofia_reg_new_handle(gateway_ptr, now ? 1 : 0);
+			if (!gateway_ptr->nh) sofia_reg_new_handle(gateway_ptr, now ? 1 : 0);
 
 			if (sofia_glue_check_nat(gateway_ptr->profile, gateway_ptr->register_proxy)) {
 				user_via = sofia_glue_create_external_via(NULL, gateway_ptr->profile, gateway_ptr->register_transport);
@@ -1422,6 +1422,15 @@
 	
 					if (expi > 0 && expi != sofia_private->gateway->freq) {
 						sofia_private->gateway->freq = expi;
+						sofia_private->gateway->expires_str = switch_core_sprintf(sofia_private->gateway->pool, "%d", expi);
+
+						if (expi > 60) {
+							sofia_private->gateway->expires = switch_epoch_time_now(NULL) + (expi - 15);
+						} else {
+							sofia_private->gateway->expires = switch_epoch_time_now(NULL) + (expi - 2);
+						}
+
+
 						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
 										  "Changing expire time to %d by request of proxy %s\n", expi, sofia_private->gateway->register_proxy);
 					}



More information about the Freeswitch-svn mailing list