[asterisk-commits] jpeeler: branch 1.6.0 r248953 - in /branches/1.6.0: ./ res/res_monitor.c

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


Author: jpeeler
Date: Thu Feb 25 17:11:14 2010
New Revision: 248953

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

................
  r248952 | jpeeler | 2010-02-25 17:09:54 -0600 (Thu, 25 Feb 2010) | 24 lines
  
  Merged revisions 248860 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r248860 | jpeeler | 2010-02-25 15:22:06 -0600 (Thu, 25 Feb 2010) | 18 lines
    
    Ensure that monitor recordings are written to the correct location (again)
    
    This is an extension to 248757. As such the dialplan test has been extended:
    
    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)
    exten => 5043, 1, monitor(wav,tmp/jeff/monitor_test3,m)
    exten => 5043, n, changemonitor(monitor_test4)
    exten => 5043, n, dial(sip/5001)
    exten => 5044, 1, monitor(wav,monitor_test4,m)
    exten => 5044, n, changemonitor(tmp/jeff/monitor_test5) ; this looks to fail by design and emits a warning
    exten => 5044, n, dial(sip/5001)
  ........
................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/res/res_monitor.c

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

Modified: branches/1.6.0/res/res_monitor.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.0/res/res_monitor.c?view=diff&rev=248953&r1=248952&r2=248953
==============================================================================
--- branches/1.6.0/res/res_monitor.c (original)
+++ branches/1.6.0/res/res_monitor.c Thu Feb 25 17:11:14 2010
@@ -177,7 +177,8 @@
 
 			/* try creating the directory just in case it doesn't exist */
 			if (directory) {
-				ast_mkdir(dirname(monitor->filename_base), 0777);
+				char *name = ast_strdupa(monitor->filename_base);
+				ast_mkdir(dirname(name), 0777);
 			}
 		} else {
 			ast_mutex_lock(&monitorlock);
@@ -421,12 +422,12 @@
 
 	if (chan->monitor) {
 		int directory = strchr(fname_base, '/') ? 1 : 0;
-		const char *absolute = *fname_base == '/' ? "" : "/";
+		const char *absolute = *fname_base == '/' ? "" : ast_config_AST_MONITOR_DIR;
 		char tmpstring[sizeof(chan->monitor->filename_base)] = "";
 		int i, fd[2] = { -1, -1 }, doexit = 0;
 
 		/* before continuing, see if we're trying to rename the file to itself... */
-		snprintf(tmpstring, sizeof(tmpstring), "%s%s%s", directory ? "" : ast_config_AST_MONITOR_DIR, absolute, fname_base);
+		snprintf(tmpstring, sizeof(tmpstring), "%s/%s", absolute, fname_base);
 
 		/*!\note We cannot just compare filenames, due to symlinks, relative
 		 * paths, and other possible filesystem issues.  We could use




More information about the asterisk-commits mailing list