提交 5db985d1 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-8909 add record_indication variable/param with path to beep sound etc

上级 950c26c8
......@@ -416,35 +416,34 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
fh->samples = 0;
}
if ((vval = switch_channel_get_variable(channel, "record_sample_rate"))) {
if ((p = switch_channel_get_variable(channel, "record_sample_rate")) || (fh->params && (p = switch_event_get_header(fh->params, "record_sample_rate")))) {
int tmp = 0;
tmp = atoi(vval);
tmp = atoi(p);
if (switch_is_valid_rate(tmp)) {
fh->samplerate = tmp;
}
}
if ((vval = switch_channel_get_variable(channel, "record_fill_cng"))) {
if (!strcasecmp(vval, "true")) {
if ((p = switch_channel_get_variable(channel, "record_fill_cng")) || (fh->params && (p = switch_event_get_header(fh->params, "record_fill_cng")))) {
if (!strcasecmp(p, "true")) {
fill_cng = 1400;
} else {
if ((fill_cng = atoi(vval)) < 0) {
if ((fill_cng = atoi(p)) < 0) {
fill_cng = 0;
}
}
}
if ((p = switch_channel_get_variable(channel, "record_waste_resources")) ||
(fh->params && (p = switch_event_get_header(fh->params, "record_waste_resources")))) {
if ((vval = switch_channel_get_variable(channel, "record_waste_resources"))) {
if (!strcasecmp(vval, "true")) {
if (!strcasecmp(p, "true")) {
waste_resources = 1400;
} else {
if ((waste_resources = atoi(vval)) < 0) {
if ((waste_resources = atoi(p)) < 0) {
waste_resources = 0;
}
}
......@@ -587,6 +586,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
switch_channel_set_flag(channel, CF_VIDEO_BLANK);
}
if ((p = switch_channel_get_variable(channel, "record_indication")) || (fh->params && (p = switch_event_get_header(fh->params, "record_indication")))) {
switch_ivr_play_file(session, NULL, p, NULL);
}
if (sample_start > 0) {
uint32_t pos = 0;
switch_core_file_seek(fh, &pos, sample_start, SEEK_SET);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论