]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_voicemail: Change vm_announce_cid to be true/false and utilize vm_play_phone_numb...
authorMichael S Collins <msc@freeswitch.org>
Tue, 7 Feb 2012 18:22:35 +0000 (10:22 -0800)
committerMichael S Collins <msc@freeswitch.org>
Tue, 7 Feb 2012 18:22:35 +0000 (10:22 -0800)
conf/lang/en/vm/sounds.xml
src/mod/applications/mod_voicemail/mod_voicemail.c

index 976fcde32d7f2a679daace4aaf3568f4f240ac34..449ad55f2d64371601f73a577fe8b34acc6f4399 100644 (file)
   <macro name="voicemail_say_number">
     <input pattern="^(\d+)$">
       <match>
-       <action function="say" data="$1" method="pronounced" type="items"/>
+               <action function="say" data="$1" method="pronounced" type="items"/>
       </match>
     </input>
   </macro>
   </macro>
 
   <macro name="voicemail_say_phone_number">
+       <input pattern="^000|^$|^[Aa]non|^[Pp]rivate" break_on_match="true">
+               <match>
+                       <!-- add 'anonymous caller' sound here -->
+               </match>
+       </input>
     <input pattern="^(.*)$">
       <match>
-       <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="ivr/ivr-this_is_a_call_from.wav"/>
+               <action function="execute" data="sleep(100)"/>
+               <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+               <action function="execute" data="sleep(500)"/>
       </match>
     </input>
   </macro>
index 8461f480bcf2ea00011cefb15ea7bde7c5621482..df68f2816696e3f734a1f962b030ef2b069025e7 100644 (file)
@@ -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;