tweak defaults
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5879 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
d7edc5dc77
commit
9b7928ee85
|
@ -144,7 +144,7 @@
|
|||
<!-- phrases section (under development still) -->
|
||||
<section name="phrases" description="Speech Phrase Management">
|
||||
<macros>
|
||||
<language name="en" sound_path="/snds" tts_engine="cepstral" tts_voice="david">
|
||||
<language name="en" sound-path="/snds" tts-engine="cepstral" tts-voice="david">
|
||||
<!--#include "lang_en.xml"-->
|
||||
<!--voicemail_en_tts is purely implemented with tts, we need a files based implementation too -->
|
||||
<!--#include "voicemail_en_tts.xml"-->
|
||||
|
|
|
@ -1031,6 +1031,7 @@ static void voicemail_check_main(switch_core_session_t *session, char *profile_n
|
|||
break;
|
||||
case VM_CHECK_FOLDER_SUMMARY:
|
||||
{
|
||||
int informed = 0;
|
||||
char msg_count[80] = "";
|
||||
switch_channel_set_variable(channel, "voicemail_current_folder", myfolder);
|
||||
message_count(profile, myid, domain_name, myfolder, &total_new_messages, &total_saved_messages,
|
||||
|
@ -1038,15 +1039,13 @@ static void voicemail_check_main(switch_core_session_t *session, char *profile_n
|
|||
|
||||
if (total_new_urgent_messages > 0) {
|
||||
snprintf(msg_count, sizeof(msg_count), "%d:urgent-new:%s", total_new_urgent_messages, total_new_urgent_messages == 1 ? "" : "s");
|
||||
if ((status = switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL)) != SWITCH_STATUS_SUCCESS) {
|
||||
goto end;
|
||||
}
|
||||
TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL));
|
||||
informed++;
|
||||
}
|
||||
if (total_new_messages > 0) {
|
||||
snprintf(msg_count, sizeof(msg_count), "%d:new:%s", total_new_messages, total_new_messages == 1 ? "" : "s");
|
||||
if ((status = switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL)) != SWITCH_STATUS_SUCCESS) {
|
||||
goto end;
|
||||
}
|
||||
TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL));
|
||||
informed++;
|
||||
}
|
||||
|
||||
if (!heard_auto_new && total_new_messages > 0) {
|
||||
|
@ -1058,16 +1057,14 @@ static void voicemail_check_main(switch_core_session_t *session, char *profile_n
|
|||
|
||||
if (total_saved_urgent_messages > 0) {
|
||||
snprintf(msg_count, sizeof(msg_count), "%d:urgent-saved:%s", total_saved_urgent_messages, total_saved_urgent_messages == 1 ? "" : "s");
|
||||
if ((status = switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL)) != SWITCH_STATUS_SUCCESS) {
|
||||
goto end;
|
||||
}
|
||||
TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL));
|
||||
informed++;
|
||||
}
|
||||
|
||||
if (total_saved_messages > 0) {
|
||||
snprintf(msg_count, sizeof(msg_count), "%d:saved:%s", total_saved_messages, total_saved_messages == 1 ? "" : "s");
|
||||
if ((status = switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL)) != SWITCH_STATUS_SUCCESS) {
|
||||
goto end;
|
||||
}
|
||||
TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL));
|
||||
informed++;
|
||||
}
|
||||
|
||||
if (!heard_auto_saved && total_saved_messages > 0) {
|
||||
|
@ -1077,6 +1074,13 @@ static void voicemail_check_main(switch_core_session_t *session, char *profile_n
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!informed) {
|
||||
snprintf(msg_count, sizeof(msg_count), "0:new:s");
|
||||
TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL));
|
||||
informed++;
|
||||
}
|
||||
|
||||
|
||||
vm_check_state = VM_CHECK_MENU;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -152,9 +152,22 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
|
|||
goto done;
|
||||
}
|
||||
|
||||
sound_path = (char *) switch_xml_attr_soft(language, "sound_path");
|
||||
tts_engine = (char *) switch_xml_attr_soft(language, "tts_engine");
|
||||
tts_voice = (char *) switch_xml_attr_soft(language, "tts_voice");
|
||||
|
||||
if (!(sound_path = (char *) switch_xml_attr(language, "sound-path"))) {
|
||||
sound_path = (char *) switch_xml_attr(language, "sound_path");
|
||||
}
|
||||
|
||||
if (!(tts_engine = (char *) switch_xml_attr(language, "tts-engine"))) {
|
||||
if (!(tts_engine = (char *) switch_xml_attr(language, "tts_engine"))) {
|
||||
tts_engine = switch_channel_get_variable(channel, tts_engine);
|
||||
}
|
||||
}
|
||||
|
||||
if (!(tts_voice = (char *) switch_xml_attr(language, "tts-voice"))) {
|
||||
if (!(tts_voice = (char *) switch_xml_attr(language, "tts_voice"))) {
|
||||
tts_voice = switch_channel_get_variable(channel, tts_voice);
|
||||
}
|
||||
}
|
||||
|
||||
if (sound_path) {
|
||||
old_sound_prefix = switch_channel_get_variable(channel, "sound_prefix");
|
||||
|
@ -252,7 +265,21 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
|
|||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid SAY Interface [%s]!\n", chan_lang);
|
||||
}
|
||||
} else if (!strcasecmp(func, "speak-text")) {
|
||||
status = switch_ivr_speak_text(session, tts_engine, tts_voice, odata, args);
|
||||
char *my_tts_engine = (char *) switch_xml_attr(action, "tts-engine");
|
||||
char *my_tts_voice = (char *) switch_xml_attr(action, "tts-voice");
|
||||
|
||||
if (!my_tts_engine) {
|
||||
my_tts_engine = tts_engine;
|
||||
}
|
||||
|
||||
if (!my_tts_voice) {
|
||||
my_tts_voice = tts_voice;
|
||||
}
|
||||
if (switch_strlen_zero(tts_engine) || switch_strlen_zero(tts_voice)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "TTS is not configured\n");
|
||||
} else {
|
||||
status = switch_ivr_speak_text(session, my_tts_engine, my_tts_voice, odata, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue