提交 01267cd6 authored 作者: Marc Olivier Chouinard's avatar Marc Olivier Chouinard

mod_voicemail_ivr: Added a bunch of default prompt for future use once we get…

mod_voicemail_ivr: Added a bunch of default prompt for future use once we get sound recorded.  In the mean time, having it in the code wont cause problem as long we don't define the phrase in the config file
上级 226580b5
......@@ -9,6 +9,7 @@
<param name="Record-Silence-Hits" value="4" />
<param name="Record-Silence-Threshold" value="200" />
<param name="Record-Maximum-Length" value="30" />
<!--<param name="Record-Minimum-Length" value="3" />-->
<param name="Exit-Purge" value="true" />
<param name="Password-Mask" value="XXX." />
<param name="User-Mask" value="X." />
......
......@@ -154,6 +154,7 @@ switch_status_t ivre_init(ivre_data_t *loc, char **dtmf_accepted) {
for (i = 0; dtmf_accepted[i] && i < 16; i++) {
strncpy(loc->dtmf_accepted[i], dtmf_accepted[i], 128);
}
loc->record_tone = "%(1000, 0, 640)";
return SWITCH_STATUS_SUCCESS;
}
......@@ -210,7 +211,7 @@ switch_status_t ivre_playback(switch_core_session_t *session, ivre_data_t *loc,
return status;
}
switch_status_t ivre_record(switch_core_session_t *session, ivre_data_t *loc, switch_event_t *event, const char *file_path, switch_file_handle_t *fh, int max_record_len) {
switch_status_t ivre_record(switch_core_session_t *session, ivre_data_t *loc, switch_event_t *event, const char *file_path, switch_file_handle_t *fh, int max_record_len, switch_size_t *record_len) {
switch_status_t status = SWITCH_STATUS_SUCCESS;
switch_channel_t *channel = switch_core_session_get_channel(session);
......@@ -222,9 +223,13 @@ switch_status_t ivre_record(switch_core_session_t *session, ivre_data_t *loc, sw
if (loc->audio_stopped == SWITCH_FALSE && loc->result == RES_WAITFORMORE) {
loc->recorded_audio = SWITCH_TRUE;
switch_ivr_gentones(session, "%(1000, 0, 640)", 0, NULL); /* TODO Make this optional and configurable */
switch_ivr_gentones(session, loc->record_tone, 0, NULL);
status = switch_ivr_record_file(session, fh, file_path, &args, max_record_len);
if (record_len) {
*record_len = fh->samples_out / (fh->samplerate ? fh->samplerate : 8000);
}
}
if (loc->result == RES_WAITFORMORE) {
loc->result = RES_TIMEOUT;
......
......@@ -44,6 +44,7 @@ struct ivre_data {
int potentialMatchCount;
const char *completeMatch;
char terminate_key;
const char *record_tone;
};
typedef struct ivre_data ivre_data_t;
......@@ -59,7 +60,7 @@ typedef struct ivre_data ivre_data_t;
switch_status_t ivre_init(ivre_data_t *loc, char **dtmf_accepted);
switch_status_t ivre_playback(switch_core_session_t *session, ivre_data_t *loc, const char *macro_name, const char *data, switch_event_t *event, const char *lang, int timeout);
switch_status_t ivre_record(switch_core_session_t *session, ivre_data_t *loc, switch_event_t *event, const char *file_path, switch_file_handle_t *fh, int max_record_len);
switch_status_t ivre_record(switch_core_session_t *session, ivre_data_t *loc, switch_event_t *event, const char *file_path, switch_file_handle_t *fh, int max_record_len, switch_size_t *record_len);
switch_status_t ivre_playback_dtmf_buffered(switch_core_session_t *session, const char *macro_name, const char *data, switch_event_t *event, const char *lang, int timeout);
#endif
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论