提交 4db944c2 authored 作者: Anthony Minessale's avatar Anthony Minessale

add last_dtmf_duration variable

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9526 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 49667777
......@@ -1028,6 +1028,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf_string(switch_core
char *string;
int i, argc;
char *argv[256];
int dur_total = 0;
switch_assert(session != NULL);
......@@ -1078,10 +1079,17 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf_string(switch_core
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s send dtmf\ndigit=%c ms=%u samples=%u\n",
switch_channel_get_name(session->channel), dtmf.digit, dur, dtmf.duration);
sent++;
dur_total += dtmf.duration + 2000; /* account for 250ms pause */
}
}
}
if (dur_total) {
char tmp[32] = "";
switch_snprintf(tmp, sizeof(tmp), "%d", dur_total / 8);
switch_channel_set_variable(session->channel, "last_dtmf_duration", tmp);
}
}
return sent ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论