fix timeout feature

This commit is contained in:
Anthony Minessale 2010-05-27 16:55:20 -05:00
parent 8f03a7cdd0
commit e2e9765c2c

View File

@ -1853,7 +1853,7 @@ static switch_bool_t t38_gateway_start(switch_core_session_t *session, const cha
SWITCH_STANDARD_APP(t38_gateway_function)
{
switch_channel_t *channel = switch_core_session_get_channel(session);
time_t timeout = 20;
time_t timeout = switch_epoch_time_now(NULL) + 20;
const char *var;
if (zstr(data) || strcasecmp(data, "self")) {
@ -1865,7 +1865,7 @@ SWITCH_STANDARD_APP(t38_gateway_function)
if ((var = switch_channel_get_variable(channel, "t38_gateway_detect_timeout"))) {
long to = atol(var);
if (to > -1) {
timeout = (time_t) to;
timeout = (time_t) (switch_epoch_time_now(NULL) + to);
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s invalid timeout value.\n", switch_channel_get_name(channel));
}