FS-6927 #comment allow sub millisecond resolution for option ping times
This commit is contained in:
parent
3c1ad1f014
commit
3b9f0c32e6
|
@ -2545,7 +2545,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
|
|||
ob_failed += gp->ob_failed_calls;
|
||||
ob += gp->ob_calls;
|
||||
|
||||
stream->write_function(stream, "%25s\t%32s\t%s\t%9u\t%u/%u\t%u/%u",
|
||||
stream->write_function(stream, "%25s\t%32s\t%s\t%6.2f\t%u/%u\t%u/%u",
|
||||
pkey, gp->register_to, sofia_state_names[gp->state], gp->ping_time,
|
||||
gp->ib_failed_calls, gp->ib_calls, gp->ob_failed_calls, gp->ob_calls);
|
||||
|
||||
|
@ -2591,7 +2591,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
|
|||
stream->write_function(stream, "Freq \t%d\n", gp->freq);
|
||||
stream->write_function(stream, "Ping \t%d\n", gp->ping);
|
||||
stream->write_function(stream, "PingFreq\t%d\n", gp->ping_freq);
|
||||
stream->write_function(stream, "PingTime\t%d\n", gp->ping_time);
|
||||
stream->write_function(stream, "PingTime\t%0.2f\n", gp->ping_time);
|
||||
stream->write_function(stream, "PingState\t%d/%d/%d\n", gp->ping_min, gp->ping_count, gp->ping_max);
|
||||
stream->write_function(stream, "State \t%s\n", sofia_state_names[gp->state]);
|
||||
stream->write_function(stream, "Status \t%s%s\n", status_names[gp->status], gp->pinging ? " (ping)" : "");
|
||||
|
@ -2836,7 +2836,7 @@ static void xml_gateway_status(sofia_gateway_t *gp, switch_stream_handle_t *stre
|
|||
stream->write_function(stream, " <pingmin>%d</pingmin>\n", gp->ping_min);
|
||||
stream->write_function(stream, " <pingcount>%d</pingcount>\n", gp->ping_count);
|
||||
stream->write_function(stream, " <pingmax>%d</pingmax>\n", gp->ping_max);
|
||||
stream->write_function(stream, " <pingtime>%d</pingtime>\n", gp->ping_time);
|
||||
stream->write_function(stream, " <pingtime>%0.2f</pingtime>\n", gp->ping_time);
|
||||
stream->write_function(stream, " <pinging>%d</pinging>\n", gp->pinging);
|
||||
stream->write_function(stream, " <state>%s</state>\n", sofia_state_names[gp->state]);
|
||||
stream->write_function(stream, " <status>%s</status>\n", status_names[gp->status]);
|
||||
|
|
|
@ -505,7 +505,7 @@ struct sofia_gateway {
|
|||
int ping_max;
|
||||
int ping_min;
|
||||
switch_time_t ping_sent;
|
||||
uint32_t ping_time;
|
||||
float ping_time;
|
||||
switch_bool_t ping_monitoring;
|
||||
uint8_t flags[REG_FLAG_MAX];
|
||||
int32_t retry_seconds;
|
||||
|
|
|
@ -5683,7 +5683,7 @@ static void sofia_handle_sip_r_options(switch_core_session_t *session, int statu
|
|||
gateway->name, status, gateway->ping_min, gateway->ping_count, gateway->ping_max, sofia_gateway_status_name(gateway->status));
|
||||
}
|
||||
if (gateway->ping_sent) {
|
||||
gateway->ping_time = (switch_micro_time_now() - gateway->ping_sent) / 1000;
|
||||
gateway->ping_time = (float)(switch_time_now() - gateway->ping_sent) / 1000;
|
||||
gateway->ping_sent = 0;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -379,7 +379,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
|
|||
nua_handle_bind(nh, pvt);
|
||||
|
||||
gateway_ptr->pinging = 1;
|
||||
gateway_ptr->ping_sent = switch_micro_time_now();
|
||||
gateway_ptr->ping_sent = switch_time_now();
|
||||
nua_options(nh,
|
||||
TAG_IF(gateway_ptr->register_sticky_proxy, NUTAG_PROXY(gateway_ptr->register_sticky_proxy)),
|
||||
TAG_IF(user_via, SIPTAG_VIA_STR(user_via)),
|
||||
|
|
Loading…
Reference in New Issue