update mod_rss to match new switch_ivr_speak_text_handle api.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3822 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
89414ed9b8
commit
a1c5f1c5f8
|
@ -184,6 +184,7 @@ static void rss_function(switch_core_session_t *session, char *data)
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
int32_t jumpto = -1;
|
int32_t jumpto = -1;
|
||||||
uint32_t matches = 0;
|
uint32_t matches = 0;
|
||||||
|
switch_input_args_t args = {0};
|
||||||
|
|
||||||
channel = switch_core_session_get_channel(session);
|
channel = switch_core_session_get_channel(session);
|
||||||
assert(channel != NULL);
|
assert(channel != NULL);
|
||||||
|
@ -324,14 +325,15 @@ static void rss_function(switch_core_session_t *session, char *data)
|
||||||
snprintf(buf + len, sizeof(buf) - len, "<break time=\"2000ms\"/>");
|
snprintf(buf + len, sizeof(buf) - len, "<break time=\"2000ms\"/>");
|
||||||
len = (int32_t)strlen(buf);
|
len = (int32_t)strlen(buf);
|
||||||
|
|
||||||
|
args.input_callback = NULL;
|
||||||
|
args.buf = cmd;
|
||||||
|
args.buflen = sizeof(cmd);
|
||||||
status = switch_ivr_speak_text_handle(session,
|
status = switch_ivr_speak_text_handle(session,
|
||||||
&sh,
|
&sh,
|
||||||
&speech_codec,
|
&speech_codec,
|
||||||
timerp,
|
timerp,
|
||||||
NULL,
|
|
||||||
buf,
|
buf,
|
||||||
cmd,
|
&args);
|
||||||
sizeof(cmd));
|
|
||||||
if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
|
if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
|
||||||
goto finished;
|
goto finished;
|
||||||
}
|
}
|
||||||
|
@ -370,14 +372,15 @@ static void rss_function(switch_core_session_t *session, char *data)
|
||||||
} else if (matches > 1) {
|
} else if (matches > 1) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
args.input_callback = NULL;
|
||||||
|
args.buf = NULL;
|
||||||
|
args.buflen = 0;
|
||||||
status = switch_ivr_speak_text_handle(session,
|
status = switch_ivr_speak_text_handle(session,
|
||||||
&sh,
|
&sh,
|
||||||
&speech_codec,
|
&speech_codec,
|
||||||
timerp,
|
timerp,
|
||||||
NULL,
|
|
||||||
"I'm sorry. That is an Invalid Selection. ",
|
"I'm sorry. That is an Invalid Selection. ",
|
||||||
NULL,
|
&args);
|
||||||
0);
|
|
||||||
if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
|
if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
|
||||||
goto finished;
|
goto finished;
|
||||||
}
|
}
|
||||||
|
@ -492,14 +495,15 @@ static void rss_function(switch_core_session_t *session, char *data)
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), ",<break time=\"500ms\"/>%s. %s. %s. local time: %s, Press 0 for options, 5 to change voice, or pound to return to the main menu. ",
|
snprintf(buf, sizeof(buf), ",<break time=\"500ms\"/>%s. %s. %s. local time: %s, Press 0 for options, 5 to change voice, or pound to return to the main menu. ",
|
||||||
title_txt, description_txt, rights_txt, date);
|
title_txt, description_txt, rights_txt, date);
|
||||||
|
args.input_callback = NULL;
|
||||||
|
args.buf = cmd;
|
||||||
|
args.buflen = sizeof(cmd);
|
||||||
status = switch_ivr_speak_text_handle(session,
|
status = switch_ivr_speak_text_handle(session,
|
||||||
&sh,
|
&sh,
|
||||||
&speech_codec,
|
&speech_codec,
|
||||||
timerp,
|
timerp,
|
||||||
NULL,
|
|
||||||
buf,
|
buf,
|
||||||
cmd,
|
&args);
|
||||||
sizeof(cmd));
|
|
||||||
if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
|
if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
|
||||||
goto finished;
|
goto finished;
|
||||||
}
|
}
|
||||||
|
@ -591,14 +595,15 @@ static void rss_function(switch_core_session_t *session, char *data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch_core_speech_flush_tts(&sh);
|
switch_core_speech_flush_tts(&sh);
|
||||||
|
args.input_callback = on_dtmf;
|
||||||
|
args.buf = &dtb;
|
||||||
|
args.buflen = sizeof(dtb);
|
||||||
status = switch_ivr_speak_text_handle(session,
|
status = switch_ivr_speak_text_handle(session,
|
||||||
&sh,
|
&sh,
|
||||||
&speech_codec,
|
&speech_codec,
|
||||||
timerp,
|
timerp,
|
||||||
on_dtmf,
|
|
||||||
buf,
|
buf,
|
||||||
&dtb,
|
&args);
|
||||||
sizeof(dtb));
|
|
||||||
if (status == SWITCH_STATUS_BREAK) {
|
if (status == SWITCH_STATUS_BREAK) {
|
||||||
continue;
|
continue;
|
||||||
} else if (status != SWITCH_STATUS_SUCCESS) {
|
} else if (status != SWITCH_STATUS_SUCCESS) {
|
||||||
|
@ -611,14 +616,15 @@ static void rss_function(switch_core_session_t *session, char *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entries[dtb.index].description_txt) {
|
if (entries[dtb.index].description_txt) {
|
||||||
|
args.input_callback = on_dtmf;
|
||||||
|
args.buf = &dtb;
|
||||||
|
args.buflen = sizeof(dtb);
|
||||||
status = switch_ivr_speak_text_handle(session,
|
status = switch_ivr_speak_text_handle(session,
|
||||||
&sh,
|
&sh,
|
||||||
&speech_codec,
|
&speech_codec,
|
||||||
timerp,
|
timerp,
|
||||||
on_dtmf,
|
|
||||||
entries[dtb.index].description_txt,
|
entries[dtb.index].description_txt,
|
||||||
&dtb,
|
&args);
|
||||||
sizeof(dtb));
|
|
||||||
}
|
}
|
||||||
if (status == SWITCH_STATUS_BREAK) {
|
if (status == SWITCH_STATUS_BREAK) {
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue