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

This commit is contained in:
Anthony Minessale 2016-03-09 10:56:07 -06:00
parent 950c26c878
commit 5db985d117
1 changed files with 15 additions and 11 deletions

View File

@ -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);