]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix phrase stuff
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 7 Nov 2007 23:37:22 +0000 (23:37 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 7 Nov 2007 23:37:22 +0000 (23:37 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6181 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_voicemail/mod_voicemail.c
src/switch_ivr_play_say.c

index 6cb90247d4376917275eb2be7a6e55a3e17ed3aa..93ca73b8ad9a2a5e37ca17ec709ce7314f6f4262 100644 (file)
@@ -1160,10 +1160,13 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro
             {
                 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, 
                               &total_new_urgent_messages, &total_saved_urgent_messages);
 
+
+
                 if (total_new_urgent_messages > 0) {
                     snprintf(msg_count, sizeof(msg_count), "%d:urgent-new", total_new_urgent_messages);
                     TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, NULL));
@@ -1416,7 +1419,8 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro
                                        char *xtra;
                     int ok = 1;
                     caller_profile = switch_channel_get_caller_profile(channel);
-                    xtra = switch_mprintf("mailbox=%s&destination_number=%s&caller_id_number=%s", myid,caller_profile->destination_number,caller_profile->caller_id_number);
+                    xtra = switch_mprintf("mailbox=%s&destination_number=%s&caller_id_number=%s", 
+                                          myid,caller_profile->destination_number,caller_profile->caller_id_number);
                     
                     assert(xtra);
 
index 20a3761d5a8a2d1736171adc7442f5f77f4d5f7d..a01eb37dde730df39170ac638173e03796275893 100644 (file)
@@ -100,6 +100,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
        const char *module_name = NULL, *chan_lang = NULL;
        switch_channel_t *channel;
        uint8_t done = 0;
+       int matches = 0;
 
        channel = switch_core_session_get_channel(session);
        assert(channel != NULL);
@@ -214,6 +215,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
                        char *expanded = NULL;
                        switch_xml_t match = NULL;
 
+                       status = SWITCH_STATUS_SUCCESS;
+
                        if ((proceed = switch_regex_perform(data, pattern, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
                                match = switch_xml_child(input, "match");
                        } else {
@@ -221,7 +224,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
                        }
 
                        if (match) {
-                               status = SWITCH_STATUS_SUCCESS;
+                               matches++;
                                for (action = switch_xml_child(match, "action"); action && status == SWITCH_STATUS_SUCCESS; action = action->next) {
                                        char *adata = (char *) switch_xml_attr_soft(action, "data");
                                        char *func = (char *) switch_xml_attr_soft(action, "function");
@@ -302,12 +305,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
        }
 
   done:
+       if (!matches) {
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "macro [%s] did not match any patterns\n", macro_name);
+       }
+
        if (old_sound_prefix) {
                switch_channel_set_variable(channel, "sound_prefix", old_sound_prefix);
        }
        if (xml) {
                switch_xml_free(xml);
        }
+
        return status;
 }