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

Freeswitch SVN anthm at freeswitch.org
Mon Sep 22 17:53:51 EDT 2008


Author: anthm
Date: Mon Sep 22 17:53:50 2008
New Revision: 9620

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

Log:
fix negative number in printf

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Mon Sep 22 17:53:50 2008
@@ -1376,7 +1376,12 @@
 					switch_assert(gp->state < REG_STATE_LAST);
 					stream->write_function(stream, "%25s\t%s\t  %32s\t%s", gp->name, "gateway", gp->register_to, sofia_state_names[gp->state]);
 					if (gp->state == REG_STATE_FAILED || gp->state == REG_STATE_TRYING) {
-						stream->write_function(stream, " (retry: %ds)", gp->retry - switch_timestamp(NULL));
+						time_t now = switch_timestamp(NULL);
+						if (gp->retry > now) {
+							stream->write_function(stream, " (retry: %ds)", gp->retry - now);
+						} else {
+							stream->write_function(stream, " (retry: NEVER)");
+						}
 					}
 					stream->write_function(stream, "\n");
 				}



More information about the Freeswitch-svn mailing list