[asterisk-commits] jpeeler: trunk r248793 - in /trunk: ./ res/res_monitor.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 25 12:37:59 CST 2010


Author: jpeeler
Date: Thu Feb 25 12:37:56 2010
New Revision: 248793

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=248793
Log:
Merged revisions 248757 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r248757 | jpeeler | 2010-02-25 12:06:54 -0600 (Thu, 25 Feb 2010) | 15 lines
  
  Ensure that monitor recordings are written to the correct location.
  
  Recordings should be placed in the monitor directory when a non-absolute path
  is used.
  
  Exact dialplan used for testing:
  exten => 5040, 1, monitor(wav,tmp/jeff/monitor_test,b)
  exten => 5040, n, dial(sip/5001)
  exten => 5041, 1, monitor(wav,/tmp/jeff/monitor_test2,b)
  exten => 5041, n, dial(sip/5001)
  exten => 5042, 1, monitor(wav,monitor_test3,b)
  exten => 5042, n, dial(sip/5001)
  
  ABE-2101
........

Modified:
    trunk/   (props changed)
    trunk/res/res_monitor.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/res/res_monitor.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_monitor.c?view=diff&rev=248793&r1=248792&r2=248793
==============================================================================
--- trunk/res/res_monitor.c (original)
+++ trunk/res/res_monitor.c Thu Feb 25 12:37:56 2010
@@ -305,18 +305,19 @@
 		/* Determine file names */
 		if (!ast_strlen_zero(fname_base)) {
 			int directory = strchr(fname_base, '/') ? 1 : 0;
-			const char *absolute = *fname_base == '/' ? "" : "/";
+			const char *absolute = *fname_base == '/' ? "" : ast_config_AST_MONITOR_DIR;
+
+			snprintf(monitor->read_filename, FILENAME_MAX, "%s/%s-in",
+						absolute, fname_base);
+			snprintf(monitor->write_filename, FILENAME_MAX, "%s/%s-out",
+						absolute, fname_base);
+			snprintf(monitor->filename_base, FILENAME_MAX, "%s/%s",
+					 	absolute, fname_base);
+
 			/* try creating the directory just in case it doesn't exist */
 			if (directory) {
-				char *name = ast_strdupa(fname_base);
-				ast_mkdir(dirname(name), 0777);
-			}
-			snprintf(monitor->read_filename, FILENAME_MAX, "%s%s%s-in",
-						directory ? "" : ast_config_AST_MONITOR_DIR, absolute, fname_base);
-			snprintf(monitor->write_filename, FILENAME_MAX, "%s%s%s-out",
-						directory ? "" : ast_config_AST_MONITOR_DIR, absolute, fname_base);
-			snprintf(monitor->filename_base, FILENAME_MAX, "%s%s%s",
-					 	directory ? "" : ast_config_AST_MONITOR_DIR, absolute, fname_base);
+				ast_mkdir(dirname(monitor->filename_base), 0777);
+			}
 		} else {
 			ast_mutex_lock(&monitorlock);
 			snprintf(monitor->read_filename, FILENAME_MAX, "%s/audio-in-%ld",




More information about the asterisk-commits mailing list