[asterisk-commits] jpeeler: branch 1.6.1 r248796 - in /branches/1.6.1: ./ res/res_monitor.c

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


Author: jpeeler
Date: Thu Feb 25 12:52:08 2010
New Revision: 248796

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

................
  r248793 | jpeeler | 2010-02-25 12:37:56 -0600 (Thu, 25 Feb 2010) | 22 lines
  
  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:
    branches/1.6.1/   (props changed)
    branches/1.6.1/res/res_monitor.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/res/res_monitor.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.1/res/res_monitor.c?view=diff&rev=248796&r1=248795&r2=248796
==============================================================================
--- branches/1.6.1/res/res_monitor.c (original)
+++ branches/1.6.1/res/res_monitor.c Thu Feb 25 12:52:08 2010
@@ -166,18 +166,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