[Freeswitch-svn] [commit] r10875 - in freeswitch/trunk: conf/autoload_configs src/mod/applications/mod_voicemail

FreeSWITCH SVN mikej at freeswitch.org
Thu Dec 18 14:53:01 PST 2008


Author: mikej
Date: Thu Dec 18 17:53:01 2008
New Revision: 10875

Log:
MODAPP-181 add ability to skip greeting when leaving a voicemail.

Modified:
   freeswitch/trunk/conf/autoload_configs/voicemail.conf.xml
   freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c

Modified: freeswitch/trunk/conf/autoload_configs/voicemail.conf.xml
==============================================================================
--- freeswitch/trunk/conf/autoload_configs/voicemail.conf.xml	(original)
+++ freeswitch/trunk/conf/autoload_configs/voicemail.conf.xml	Thu Dec 18 17:53:01 2008
@@ -30,6 +30,7 @@
       <param name="restart-key" value="1"/>
       <param name="ff-key" value="6"/>
       <param name="rew-key" value="4"/>
+      <param name="skip-greet-key" value="#"/>
       <param name="record-silence-threshold" value="200"/>
       <param name="record-silence-hits" value="2"/>
       <param name="web-template-file" value="web-vm.tpl"/>

Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	Thu Dec 18 17:53:01 2008
@@ -74,6 +74,7 @@
 	char play_saved_messages_key[2];
 
 	char main_menu_key[2];
+	char skip_greet_key[2];
 	char config_menu_key[2];
 	char record_greeting_key[2];
 	char choose_greeting_key[2];
@@ -270,6 +271,7 @@
 		char *play_saved_messages_key = "2";
 
 		char *main_menu_key = "0";
+		char *skip_greet_key = "#";
 		char *config_menu_key = "5";
 		char *record_greeting_key = "1";
 		char *choose_greeting_key = "2";
@@ -450,6 +452,8 @@
 				play_saved_messages_key = val;
 			} else if (!strcasecmp(var, "main-menu-key") && !switch_strlen_zero(val)) {
 				main_menu_key = val;
+			} else if (!strcasecmp(var, "skip-greet-key") && val && is_dtmf(*val)) {
+				skip_greet_key = val;
 			} else if (!strcasecmp(var, "config-menu-key") && !switch_strlen_zero(val)) {
 				config_menu_key = val;
 			} else if (!strcasecmp(var, "record-greeting-key") && !switch_strlen_zero(val)) {
@@ -717,6 +721,7 @@
 			*profile->play_new_messages_key = *play_new_messages_key;
 			*profile->play_saved_messages_key = *play_saved_messages_key;
 			*profile->main_menu_key = *main_menu_key;
+			*profile->skip_greet_key = *skip_greet_key;
 			*profile->config_menu_key = *config_menu_key;
 			*profile->record_greeting_key = *record_greeting_key;
 			*profile->choose_greeting_key = *choose_greeting_key;
@@ -1048,7 +1053,7 @@
 	  record_file:
 		*message_len = 0;
 
-		TRY_CODE(switch_ivr_phrase_macro(session, macro_name, NULL, NULL, NULL));
+		if (macro_name) TRY_CODE(switch_ivr_phrase_macro(session, macro_name, NULL, NULL, NULL));
 		TRY_CODE(switch_ivr_gentones(session, profile->tone_spec, 0, NULL));
 
 		memset(&fh, 0, sizeof(fh));
@@ -2639,6 +2644,7 @@
 	switch_time_t ts = switch_timestamp_now();
 	char *dbuf = NULL;
 	char *vm_storage_dir = NULL;
+	char *record_macro = VM_RECORD_MESSAGE_MACRO;
 	int send_main = 0;
 	int send_notify = 0;
 	int insert_db = 1;
@@ -2830,6 +2836,8 @@
 					goto end;
 				}
 			}
+		} else if (*profile->skip_greet_key && !strcasecmp(buf, profile->skip_greet_key)) {
+			record_macro = NULL;
 		} else {
 			goto greet;
 		}
@@ -2858,7 +2866,7 @@
 	switch_snprintf(key_buf, sizeof(key_buf), "%s:%s", profile->operator_key, profile->vmain_key);
 	memset(buf, 0, sizeof(buf));
 
-	status = create_file(session, profile, VM_RECORD_MESSAGE_MACRO, file_path, &message_len, SWITCH_TRUE, key_buf, buf);
+	status = create_file(session, profile, record_macro, file_path, &message_len, SWITCH_TRUE, key_buf, buf);
 
 	if ((status == SWITCH_STATUS_NOTFOUND)) {
 		goto end;



More information about the Freeswitch-svn mailing list