[Freeswitch-svn] [commit] r9775 - in freeswitch/trunk: conf/autoload_configs src/mod/applications/mod_voicemail
Freeswitch SVN
anthm at freeswitch.org
Wed Oct 1 09:06:59 EDT 2008
Author: anthm
Date: Wed Oct 1 09:06:59 2008
New Revision: 9775
Modified:
freeswitch/trunk/conf/autoload_configs/voicemail.conf.xml
freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
Log:
add patch from MODAPP-150 with mods
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 Wed Oct 1 09:06:59 2008
@@ -42,6 +42,8 @@
<param name="operator-key" value="9"/>
<param name="vmain-extension" value="vmain XML default"/>
<param name="vmain-key" value="*"/>
+ <!-- playback created files as soon as they were recorded by default -->
+ <!--<param name="auto-playback-recordings" value="true"/>-->
<email>
<param name="template-file" value="voicemail.tpl"/>
<param name="notify-template-file" value="notify-voicemail.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 Wed Oct 1 09:06:59 2008
@@ -123,6 +123,7 @@
uint32_t record_silence_hits;
uint32_t record_sample_rate;
switch_odbc_handle_t *master_odbc;
+ switch_bool_t auto_playback_recordings;
};
typedef struct vm_profile vm_profile_t;
@@ -314,6 +315,8 @@
char *record_comment = "FreeSWITCH Voicemail";
char *record_copyright = "http://www.freeswitch.org";
+ switch_bool_t auto_playback_recordings = SWITCH_TRUE;
+
switch_core_db_t *db;
uint32_t timeout = 10000, max_login_attempts = 3, max_record_len = 300, min_record_len = 3;
@@ -570,7 +573,7 @@
if (tmp > 0 && tmp < 10000) {
min_record_len = tmp;
} else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "invalid attempts [%s] must be between 1 and 10000s\n", val);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "invalid record length [%s] must be between 1 and 10000s\n", val);
}
} else if (!strcasecmp(var, "max-record-len")) {
int tmp = 0;
@@ -580,7 +583,7 @@
if (tmp > 0 && tmp < 10000) {
max_record_len = tmp;
} else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "invalid attempts [%s] must be between 1 and 10000s\n", val);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "invalid record length [%s] must be between 1 and 10000s\n", val);
}
} else if (!strcasecmp(var, "odbc-dsn") && !switch_strlen_zero(val)) {
#ifdef SWITCH_HAVE_ODBC
@@ -594,6 +597,8 @@
#else
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ODBC IS NOT AVAILABLE!\n");
#endif
+ } else if (!strcasecmp(var, "auto-playback-recordings")){
+ auto_playback_recordings = switch_true(val);
}
}
@@ -736,6 +741,7 @@
profile->record_silence_hits = record_silence_hits;
profile->record_sample_rate = record_sample_rate;
+ profile->auto_playback_recordings = auto_playback_recordings;
profile->operator_ext = switch_core_strdup(globals.pool, operator_ext);
profile->vmain_ext = switch_core_strdup(globals.pool, vmain_ext);
profile->storage_dir = switch_core_strdup(globals.pool, storage_dir);
@@ -1061,14 +1067,15 @@
status = SWITCH_STATUS_SUCCESS;
}
play_file:
- memset(&fh, 0, sizeof(fh));
- args.input_callback = control_playback;
- memset(&cc, 0, sizeof(cc));
- cc.profile = profile;
- cc.fh = &fh;
- args.buf = &cc;
- switch_ivr_play_file(session, &fh, file_path, &args);
-
+ if (profile->auto_playback_recordings) {
+ memset(&fh, 0, sizeof(fh));
+ args.input_callback = control_playback;
+ memset(&cc, 0, sizeof(cc));
+ cc.profile = profile;
+ cc.fh = &fh;
+ args.buf = &cc;
+ switch_ivr_play_file(session, &fh, file_path, &args);
+ }
while (switch_channel_ready(channel)) {
*input = '\0';
More information about the Freeswitch-svn
mailing list