From 87152f99edacd76d3a5cdafeb766cd66f1cac052 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 10 May 2006 16:35:42 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1415 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../applications/mod_commands/mod_commands.c | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 82f32a214e..af939f1f7d 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -38,15 +38,28 @@ static switch_status_t status_function(char *cmd, switch_stream_handle_t *stream switch_core_time_duration_t duration; switch_core_measure_time(switch_core_uptime(), &duration); - stream->write_function(stream, "UP %u year(s), %u day(s), %u hour(s), %u minute(s), %u second(s), %u millisecond(s), %u microsecond(s)\n", - duration.yr, - duration.day, - duration.hr, - duration.min, - duration.sec, - duration.ms, - duration.mms + stream->write_function(stream, "UP %u year%s, %u day%s, %u hour%s, %u minute%s, %u second%s, %u millisecond%s, %u microsecond%s\n", + duration.yr, duration.yr == 1 ? "" : "s", + duration.day, duration.day == 1 ? "" : "s", + duration.hr, duration.hr == 1 ? "" : "s", + duration.min, duration.min == 1 ? "" : "s", + duration.sec, duration.sec == 1 ? "" : "s", + duration.ms, duration.ms == 1 ? "" : "s", + duration.mms, duration.mms == 1 ? "" : "s" ); + + if (cmd && strstr(cmd, "refresh=")) { + char *refresh = strchr(cmd, '='); + if (refresh) { + int r; + refresh++; + r = atoi(refresh); + if (r > 0) { + stream->write_function(stream, "\n", r, r); + } + } + } + return SWITCH_STATUS_SUCCESS; }