diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml index 953ad1957d..a2c93aa544 100644 --- a/conf/freeswitch.xml +++ b/conf/freeswitch.xml @@ -144,7 +144,7 @@
- + diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index feb19d5435..16312c729a 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -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; diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index 123be7bbb1..78de3d7618 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -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); + } } } }