Revision
16233
Author
mikej
Date
2010-01-10 21:20:42 -0600 (Sun, 10 Jan 2010)

Log Message

add recordings_dir

Modified Paths

Diff

Modified: freeswitch/trunk/Makefile.am (16232 => 16233)


--- freeswitch/trunk/Makefile.am	2010-01-10 23:36:10 UTC (rev 16232)
+++ freeswitch/trunk/Makefile.am	2010-01-11 03:20:42 UTC (rev 16233)
@@ -320,6 +320,7 @@
 	@for x in mod db log log/xml_cdr bin scripts grammar recordings ; do \
 		$(mkinstalldirs) $(DESTDIR)$(prefix)/$$x ; \
 	 done
+	$(mkinstalldirs) $(DESTDIR)@recordingsdir@
 	$(mkinstalldirs) $(DESTDIR)@modinstdir@
 	test -d $(DESTDIR)@confdir@ || $(MAKE) samples-conf
 	test -d $(DESTDIR)$(prefix)/htdocs || $(MAKE) samples-htdocs

Modified: freeswitch/trunk/conf/autoload_configs/conference.conf.xml (16232 => 16233)


--- freeswitch/trunk/conf/autoload_configs/conference.conf.xml	2010-01-10 23:36:10 UTC (rev 16232)
+++ freeswitch/trunk/conf/autoload_configs/conference.conf.xml	2010-01-11 03:20:42 UTC (rev 16233)
@@ -97,7 +97,7 @@
       <!-- Uncomment auto-record to toggle recording every conference call. -->
       <!-- Another valid value is   shout://user:pass@server.com/live.mp3   -->
       <!--
-      <param name="auto-record" value="$${base_dir}/recordings/${conference_name}_${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
+      <param name="auto-record" value="$${recordings_dir}/${conference_name}_${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
       -->
     </profile>
 

Modified: freeswitch/trunk/conf/dialplan/default.xml (16232 => 16233)


--- freeswitch/trunk/conf/dialplan/default.xml	2010-01-10 23:36:10 UTC (rev 16232)
+++ freeswitch/trunk/conf/dialplan/default.xml	2010-01-11 03:20:42 UTC (rev 16233)
@@ -247,7 +247,7 @@
 	<action application="export" data="dialed_extension=$1"/>
 	<!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> -->
 	<action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/>
-	<action application="bind_meta_app" data="2 b s record_session::$${base_dir}/recordings/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
+	<action application="bind_meta_app" data="2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
 	<action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/>
 	<action application="set" data="ringback=${us-ring}"/>
 	<action application="set" data="transfer_ringback=$${hold_music}"/>

Modified: freeswitch/trunk/conf/sip_profiles/internal-ipv6.xml (16232 => 16233)


--- freeswitch/trunk/conf/sip_profiles/internal-ipv6.xml	2010-01-10 23:36:10 UTC (rev 16232)
+++ freeswitch/trunk/conf/sip_profiles/internal-ipv6.xml	2010-01-11 03:20:42 UTC (rev 16233)
@@ -27,7 +27,7 @@
     <param name="apply-inbound-acl" value="domains"/>
     <!--<param name="apply-register-acl" value="domains"/>-->
     <!--<param name="dtmf-type" value="info"/>-->
-    <param name="record-template" value="$${base_dir}/recordings/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
+    <param name="record-template" value="$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
     <!--enable to use presence and mwi -->
     <param name="manage-presence" value="true"/>
     <!-- This setting is for AAL2 bitpacking on G726 -->

Modified: freeswitch/trunk/conf/sip_profiles/internal.xml (16232 => 16233)


--- freeswitch/trunk/conf/sip_profiles/internal.xml	2010-01-10 23:36:10 UTC (rev 16232)
+++ freeswitch/trunk/conf/sip_profiles/internal.xml	2010-01-11 03:20:42 UTC (rev 16233)
@@ -79,7 +79,7 @@
     <param name="local-network-acl" value="localnet.auto"/>
     <!--<param name="apply-register-acl" value="domains"/>-->
     <!--<param name="dtmf-type" value="info"/>-->
-    <param name="record-path" value="$${base_dir}/recordings"/>
+    <param name="record-path" value="$${recordings_dir}"/>
     <param name="record-template" value="${caller_id_number}.${target_domain}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
     <!--enable to use presence -->
     <param name="manage-presence" value="true"/>

Modified: freeswitch/trunk/configure.in (16232 => 16233)


--- freeswitch/trunk/configure.in	2010-01-10 23:36:10 UTC (rev 16232)
+++ freeswitch/trunk/configure.in	2010-01-11 03:20:42 UTC (rev 16233)
@@ -46,6 +46,10 @@
 AC_SUBST(rundir)
 AC_DEFINE_UNQUOTED([SWITCH_RUN_DIR],"${rundir}",[where to put pidfile to])
 
+recordingsdir="${prefix}/recordings"
+AC_SUBST(recordingsdir)
+AC_DEFINE_UNQUOTED([SWITCH_RECORDINGS_DIR],"${recordingsdir}",[where to put recording files])
+
 if test "$sysconfdir" = "\${prefix}/etc" ; then
     confdir="$prefix/conf"
 else

Modified: freeswitch/trunk/contrib/intralanman/PHP/fs_curl/sql/mysql-4.0-with-samples.sql (16232 => 16233)


--- freeswitch/trunk/contrib/intralanman/PHP/fs_curl/sql/mysql-4.0-with-samples.sql	2010-01-10 23:36:10 UTC (rev 16232)
+++ freeswitch/trunk/contrib/intralanman/PHP/fs_curl/sql/mysql-4.0-with-samples.sql	2010-01-11 03:20:42 UTC (rev 16233)
@@ -241,7 +241,7 @@
 (52, 30, 'sleep', '1000', 'action', 520),
 (53, 30, 'voicemail', 'check default ${domain_name} ${dialed_extension}', 'action', 530),
 (54, 30, 'bind_meta_app', '1 b s execute_extension::dx XML features', 'anti-action', 540),
-(55, 30, 'bind_meta_app', '2 b s record_session::$${base_dir}/recordings/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav', 'anti-action', 550),
+(55, 30, 'bind_meta_app', '2 b s record_session::$${recordings_dir}//${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav', 'anti-action', 550),
 (56, 30, 'bind_meta_app', '3 b s execute_extension::cf XML features', 'anti-action', 560),
 (57, 30, 'set', 'ringback=${us-ring}', 'anti-action', 570),
 (58, 30, 'set', 'transfer_ringback=$${hold_music}', 'anti-action', 580),

Modified: freeswitch/trunk/contrib/intralanman/PHP/fs_curl/sql/mysql-5.0-with-samples.sql (16232 => 16233)


--- freeswitch/trunk/contrib/intralanman/PHP/fs_curl/sql/mysql-5.0-with-samples.sql	2010-01-10 23:36:10 UTC (rev 16232)
+++ freeswitch/trunk/contrib/intralanman/PHP/fs_curl/sql/mysql-5.0-with-samples.sql	2010-01-11 03:20:42 UTC (rev 16233)
@@ -269,7 +269,7 @@
 (52, 30, 'sleep', '1000', 'action', 520),
 (53, 30, 'voicemail', 'check default ${domain_name} ${dialed_extension}', 'action', 530),
 (54, 30, 'bind_meta_app', '1 b s execute_extension::dx XML features', 'anti-action', 540),
-(55, 30, 'bind_meta_app', '2 b s record_session::$${base_dir}/recordings/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav', 'anti-action', 550),
+(55, 30, 'bind_meta_app', '2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav', 'anti-action', 550),
 (56, 30, 'bind_meta_app', '3 b s execute_extension::cf XML features', 'anti-action', 560),
 (57, 30, 'set', 'ringback=${us-ring}', 'anti-action', 570),
 (58, 30, 'set', 'transfer_ringback=$${hold_music}', 'anti-action', 580),

Modified: freeswitch/trunk/contrib/intralanman/PHP/fs_curl/sql/oracle-with-examples.sql (16232 => 16233)


--- freeswitch/trunk/contrib/intralanman/PHP/fs_curl/sql/oracle-with-examples.sql	2010-01-10 23:36:10 UTC (rev 16232)
+++ freeswitch/trunk/contrib/intralanman/PHP/fs_curl/sql/oracle-with-examples.sql	2010-01-11 03:20:42 UTC (rev 16233)
@@ -241,7 +241,7 @@
 (52, 30, 'sleep', '1000', 'action', 520),
 (53, 30, 'voicemail', 'check default ${domain_name} ${dialed_extension}', 'action', 530),
 (54, 30, 'bind_meta_app', '1 b s execute_extension::dx XML features', 'anti-action', 540),
-(55, 30, 'bind_meta_app', '2 b s record_session::$${base_dir}/recordings/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav', 'anti-action', 550),
+(55, 30, 'bind_meta_app', '2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav', 'anti-action', 550),
 (56, 30, 'bind_meta_app', '3 b s execute_extension::cf XML features', 'anti-action', 560),
 (57, 30, 'set', 'ringback=${us-ring}', 'anti-action', 570),
 (58, 30, 'set', 'transfer_ringback=$${hold_music}', 'anti-action', 580),

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/configs/default.xml (16232 => 16233)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/configs/default.xml	2010-01-10 23:36:10 UTC (rev 16232)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/configs/default.xml	2010-01-11 03:20:42 UTC (rev 16233)
@@ -195,7 +195,7 @@
 	<action application="export" data="dialed_extension=$1"/>
 	<!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> -->
 	<action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/>
-	<action application="bind_meta_app" data="2 b s record_session::$${base_dir}/recordings/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
+	<action application="bind_meta_app" data="2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
 	<action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/>
 	<action application="set" data="ringback=${us-ring}"/>
 	<action application="set" data="transfer_ringback=$${hold_music}"/>

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (16232 => 16233)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2010-01-10 23:36:10 UTC (rev 16232)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2010-01-11 03:20:42 UTC (rev 16233)
@@ -5144,7 +5144,7 @@
 				if (!strcasecmp(rec_header, "on")) {
 					char *file = NULL, *tmp = NULL;
 
-					tmp = switch_mprintf("%s%s%s", profile->record_path ? profile->record_path : "${base_dir}/recordings",
+					tmp = switch_mprintf("%s%s%s", profile->record_path ? profile->record_path : "${recordings_dir}",
 										 SWITCH_PATH_SEPARATOR, profile->record_template);
 					file = switch_channel_expand_variables(channel, tmp);
 					switch_ivr_record_session(session, file, 0, NULL);

Modified: freeswitch/trunk/src/switch_core.c (16232 => 16233)


--- freeswitch/trunk/src/switch_core.c	2010-01-10 23:36:10 UTC (rev 16232)
+++ freeswitch/trunk/src/switch_core.c	2010-01-11 03:20:42 UTC (rev 16233)
@@ -458,6 +458,14 @@
 #endif
 	}
 
+	if (!SWITCH_GLOBAL_dirs.recordings_dir && (SWITCH_GLOBAL_dirs.recordings_dir = (char *) malloc(BUFSIZE))) {
+#ifdef SWITCH_RECORDINGS_DIR
+		switch_snprintf(SWITCH_GLOBAL_dirs.recordings_dir, BUFSIZE, "%s", SWITCH_RECORDINGS_DIR);
+#else
+		switch_snprintf(SWITCH_GLOBAL_dirs.recordings_dir, BUFSIZE, "%s%srecordings", base_dir, SWITCH_PATH_SEPARATOR);
+#endif
+	}
+
 	if (!SWITCH_GLOBAL_dirs.storage_dir && (SWITCH_GLOBAL_dirs.storage_dir = (char *) malloc(BUFSIZE))) {
 #ifdef SWITCH_STORAGE_DIR
 		switch_snprintf(SWITCH_GLOBAL_dirs.storage_dir, BUFSIZE, "%s", SWITCH_STORAGE_DIR);
@@ -520,6 +528,7 @@
 	switch_assert(SWITCH_GLOBAL_dirs.script_dir);
 	switch_assert(SWITCH_GLOBAL_dirs.htdocs_dir);
 	switch_assert(SWITCH_GLOBAL_dirs.grammar_dir);
+	switch_assert(SWITCH_GLOBAL_dirs.recordings_dir);
 	switch_assert(SWITCH_GLOBAL_dirs.temp_dir);
 }
 
@@ -1219,6 +1228,7 @@
 	switch_dir_make_recursive(SWITCH_GLOBAL_dirs.script_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
 	switch_dir_make_recursive(SWITCH_GLOBAL_dirs.htdocs_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
 	switch_dir_make_recursive(SWITCH_GLOBAL_dirs.grammar_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
+	switch_dir_make_recursive(SWITCH_GLOBAL_dirs.recordings_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
 	switch_dir_make_recursive(SWITCH_GLOBAL_dirs.temp_dir, SWITCH_DEFAULT_DIR_PERMS, runtime.memory_pool);
 
 	switch_mutex_init(&runtime.uuid_mutex, SWITCH_MUTEX_NESTED, runtime.memory_pool);
@@ -1253,6 +1263,7 @@
 	switch_find_local_ip(guess_ip, sizeof(guess_ip), NULL, AF_INET6);
 	switch_core_set_variable("local_ip_v6", guess_ip);
 	switch_core_set_variable("base_dir", SWITCH_GLOBAL_dirs.base_dir);
+	switch_core_set_variable("recordings_dir", SWITCH_GLOBAL_dirs.recordings_dir);
 	switch_core_set_serial();
 
 	switch_console_init(runtime.memory_pool);
@@ -1791,6 +1802,7 @@
 	switch_safe_free(SWITCH_GLOBAL_dirs.script_dir);
 	switch_safe_free(SWITCH_GLOBAL_dirs.htdocs_dir);
 	switch_safe_free(SWITCH_GLOBAL_dirs.grammar_dir);
+	switch_safe_free(SWITCH_GLOBAL_dirs.recordings_dir);
 	switch_safe_free(SWITCH_GLOBAL_dirs.temp_dir);
 
 	switch_core_hash_destroy(&runtime.global_vars);