[svn-commits] oej: branch oej/minivoicemail-1.4 r251400 - /team/oej/minivoicemail-1.4/apps/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Mar 9 02:53:39 CST 2010


Author: oej
Date: Tue Mar  9 02:53:34 2010
New Revision: 251400

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=251400
Log:
Various updates based on reminders from people around me. Thanks Geir.

After testing, this needs to be integrated into trunk.

Modified:
    team/oej/minivoicemail-1.4/apps/app_minivm.c

Modified: team/oej/minivoicemail-1.4/apps/app_minivm.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/minivoicemail-1.4/apps/app_minivm.c?view=diff&rev=251400&r1=251399&r2=251400
==============================================================================
--- team/oej/minivoicemail-1.4/apps/app_minivm.c (original)
+++ team/oej/minivoicemail-1.4/apps/app_minivm.c Tue Mar  9 02:53:34 2010
@@ -1195,7 +1195,10 @@
 		}
 	}
 	if (option_debug > 1)
-		ast_log(LOG_DEBUG, "Creating directory for %s@%s folder %s : %s\n", username, domain, folder, dest);
+		ast_log(LOG_DEBUG, "Creating directory for %s@%s folder %s : %s\n", 
+			ast_strlen_zero(username) ? "-" : username, 
+			ast_strlen_zero(domain) ? "-" : domain, 
+			ast_strlen_zero(folder) ? "-" : folder, dest);
 	return 0;
 }
 
@@ -1776,12 +1779,14 @@
 	if (!tmp) {
 		ast_log(LOG_ERROR, "Out of memory\n");
 		ast_module_user_remove(u);
+		pbx_builtin_setvar_helper(chan, "MINIVM_RECORD_STATUS", "FAILED");
 		return -1;
 	}
 	argc = ast_app_separate_args(tmp, '|', argv, sizeof(argv) / sizeof(argv[0]));
 	if (argc == 2) {
 		if (ast_app_parse_options(minivm_app_options, &flags, opts, argv[1])) {
 			ast_module_user_remove(u);
+			pbx_builtin_setvar_helper(chan, "MINIVM_RECORD_STATUS", "FAILED");
 			return -1;
 		}
 		ast_copy_flags(&leave_options, &flags, OPT_SILENT | OPT_BUSY_GREETING | OPT_UNAVAIL_GREETING );
@@ -1791,6 +1796,7 @@
 			if (sscanf(opts[OPT_ARG_RECORDGAIN], "%d", &gain) != 1) {
 				ast_log(LOG_WARNING, "Invalid value '%s' provided for record gain option\n", opts[OPT_ARG_RECORDGAIN]);
 				ast_module_user_remove(u);
+				pbx_builtin_setvar_helper(chan, "MINIVM_RECORD_STATUS", "FAILED");
 				return -1;
 			} else 
 				leave_options.record_gain = (signed char) gain;
@@ -1805,9 +1811,9 @@
 		/* Send the call to n+101 priority, where n is the current priority*/
 		pbx_builtin_setvar_helper(chan, "MINIVM_RECORD_STATUS", "FAILED");
 		res = 0;
-	}
-	pbx_builtin_setvar_helper(chan, "MINIVM_RECORD_STATUS", "SUCCESS");
-
+	} else {
+		pbx_builtin_setvar_helper(chan, "MINIVM_RECORD_STATUS", "SUCCESS");
+	}
 	
 	ast_module_user_remove(u);
 
@@ -2080,6 +2086,7 @@
 	char *prompt = NULL;
 	int duration;
 	int cmd;
+	int userdir;
 	
 	u = ast_module_user_add(chan);
 
@@ -2156,7 +2163,15 @@
 		message = "greet";
 		prompt = "vm-rec-name";
 	}
-	snprintf(filename,sizeof(filename), "%s%s/%s/%s", MVM_SPOOL_DIR, vmu->domain, vmu->username, message);
+	userdir = check_dirpath(tmp, sizeof(tmp), vmu->domain, vmu->username, "tmp");
+
+	/* If we have no user directory, use generic temporary directory */
+	if (!userdir) {
+		create_dirpath(tmp, sizeof(tmp), vmu->domain, vmu->username, "");
+		if (option_debug > 2)
+			ast_log(LOG_DEBUG, "Creating temporary directory %s\n", tmp);
+	}
+	snprintf(filename,sizeof(filename), "%s/%s", tmp, message);
 	/* Maybe we should check the result of play_record_review ? */
 	cmd = play_record_review(chan, prompt, filename, global_maxgreet, default_vmformat, 0, vmu, &duration, NULL, FALSE);
 
@@ -2169,6 +2184,7 @@
 
 	/* Ok, we're ready to rock and roll. Return to dialplan */
 	ast_module_user_remove(u);
+	pbx_builtin_setvar_helper(chan, "MINIVM_ACCMESS_STATUS", "SUCCESS");
 
 	return 0;
 




More information about the svn-commits mailing list