提交 9227b538 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-3252 try latest patch with new option to set sip_execute_on_image to…

FS-3252 try latest patch with new option to set sip_execute_on_image to 't38_gateway self nocng' this should skip the tone detection adn go right into the gateway mode so you should be able to do only this and have it work based on remote re-invite
上级 6fa64e30
......@@ -80,23 +80,34 @@ SWITCH_STANDARD_APP(t38_gateway_function)
switch_channel_t *channel = switch_core_session_get_channel(session);
time_t timeout = switch_epoch_time_now(NULL) + 20;
const char *var;
int argc = 0;
char *argv[2] = { 0 };
char *dupdata;
const char *direction = argv[0], *flags = argv[1];
dupdata = switch_core_session_strdup(session, data);
argc = switch_split(dupdata, ' ', argv);
if (zstr(data) || strcasecmp(data, "self")) {
data = "peer";
if (zstr(direction) || strcasecmp(direction, "self")) {
direction = "peer";
}
switch_channel_set_variable(channel, "t38_leg", direction);
switch_channel_set_variable(channel, "t38_leg", data);
if ((var = switch_channel_get_variable(channel, "t38_gateway_detect_timeout"))) {
long to = atol(var);
if (to > -1) {
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));
if (!zstr(flags) && !strcasecmp(flags, "nocng")) {
t38_gateway_start(session, direction, NULL);
} else {
if ((var = switch_channel_get_variable(channel, "t38_gateway_detect_timeout"))) {
long to = atol(var);
if (to > -1) {
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));
}
}
switch_ivr_tone_detect_session(session, "t38", "1100.0", "rw", timeout, 1, direction, NULL, t38_gateway_start);
}
switch_ivr_tone_detect_session(session, "t38", "1100.0", "rw", timeout, 1, data, NULL, t38_gateway_start);
}
/**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论