mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-30 18:33:46 +00:00
update
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1415 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
9304f3909b
commit
87152f99ed
@ -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_time_duration_t duration;
|
||||||
switch_core_measure_time(switch_core_uptime(), &duration);
|
switch_core_measure_time(switch_core_uptime(), &duration);
|
||||||
|
|
||||||
stream->write_function(stream, "<b>UP %u year(s), %u day(s), %u hour(s), %u minute(s), %u second(s), %u millisecond(s), %u microsecond(s)</b>\n",
|
stream->write_function(stream, "<b>UP %u year%s, %u day%s, %u hour%s, %u minute%s, %u second%s, %u millisecond%s, %u microsecond%s</b>\n",
|
||||||
duration.yr,
|
duration.yr, duration.yr == 1 ? "" : "s",
|
||||||
duration.day,
|
duration.day, duration.day == 1 ? "" : "s",
|
||||||
duration.hr,
|
duration.hr, duration.hr == 1 ? "" : "s",
|
||||||
duration.min,
|
duration.min, duration.min == 1 ? "" : "s",
|
||||||
duration.sec,
|
duration.sec, duration.sec == 1 ? "" : "s",
|
||||||
duration.ms,
|
duration.ms, duration.ms == 1 ? "" : "s",
|
||||||
duration.mms
|
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, "<META HTTP-EQUIV=REFRESH CONTENT=\"%d; URL=/api/status?refresh=%d\">\n", r, r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user