From 18289fa0131c18753996dc99a09d5590c206dc8f Mon Sep 17 00:00:00 2001 From: Michael S Collins Date: Tue, 7 Feb 2012 10:22:35 -0800 Subject: [PATCH] mod_voicemail: Change vm_announce_cid to be true/false and utilize vm_play_phone_number_macro --- conf/lang/en/vm/sounds.xml | 12 ++++++++++-- src/mod/applications/mod_voicemail/mod_voicemail.c | 8 ++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/conf/lang/en/vm/sounds.xml b/conf/lang/en/vm/sounds.xml index 976fcde32d..449ad55f2d 100644 --- a/conf/lang/en/vm/sounds.xml +++ b/conf/lang/en/vm/sounds.xml @@ -315,7 +315,7 @@ - + @@ -331,9 +331,17 @@ + + + + + - + + + + diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 8461f480bc..df68f28166 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -1544,8 +1544,6 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t char cid_buf[1024] = ""; if (switch_channel_ready(channel)) { - const char *vm_announce_cid = NULL; - switch_snprintf(cid_buf, sizeof(cid_buf), "%s|%s", cbt->cid_number, cbt->cid_name); msg.from = __FILE__; @@ -1556,10 +1554,8 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t cid_buf, switch_channel_get_name(channel)); switch_core_session_receive_message(session, &msg); - if (!zstr(cbt->cid_number) && (vm_announce_cid = switch_channel_get_variable(channel, "vm_announce_cid"))) { - switch_ivr_play_file(session, NULL, vm_announce_cid, NULL); - switch_ivr_sleep(session, 500, SWITCH_TRUE, NULL); - switch_ivr_say(session, cbt->cid_number, NULL, "name_spelled", "pronounced", NULL, NULL); + if (!zstr(cbt->cid_number) && (switch_true(switch_channel_get_variable(channel, "vm_announce_cid")))) { + TRY_CODE(switch_ivr_phrase_macro(session, VM_SAY_PHONE_NUMBER_MACRO, cbt->cid_number, NULL, NULL)); } args.input_callback = cancel_on_dtmf;