[asterisk-commits] russell: trunk r85682 - in /trunk: CHANGES res/res_features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Oct 15 15:08:04 CDT 2007


Author: russell
Date: Mon Oct 15 15:08:04 2007
New Revision: 85682

URL: http://svn.digium.com/view/asterisk?view=rev&rev=85682
Log:
Added support for reading the TOUCH_MONITOR_PREFIX channel variable.
It allows you to configure a prefix for auto-monitor recordings.

(closes issue #6353)
Reported by: ivanfm
Patches: 
      asterisk_automon_v4.patch uploaded by ivanfm (original patch)
	   - updated patch:
         6353-touch_monitor_prefix.diff uploaded by qwell (license 4)

Modified:
    trunk/CHANGES
    trunk/res/res_features.c

Modified: trunk/CHANGES
URL: http://svn.digium.com/view/asterisk/trunk/CHANGES?view=diff&rev=85682&r1=85681&r2=85682
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Mon Oct 15 15:08:04 2007
@@ -295,3 +295,5 @@
      SIP call to Voicemail by putting a Local channel in the middle.  This
      feature is enabled by using the 'j' option in the Dial string to the Local
      channel in conjunction with the existing 'n' option for local channels.
+  * Added support for reading the TOUCH_MONITOR_PREFIX channel variable.
+     It allows you to configure a prefix for auto-monitor recordings.

Modified: trunk/res/res_features.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_features.c?view=diff&rev=85682&r1=85681&r2=85682
==============================================================================
--- trunk/res/res_features.c (original)
+++ trunk/res/res_features.c Mon Oct 15 15:08:04 2007
@@ -672,26 +672,30 @@
 	if (caller_chan && callee_chan) {
 		const char *touch_format = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MONITOR_FORMAT");
 		const char *touch_monitor = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MONITOR");
+		const char *touch_monitor_prefix = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MONITOR_PREFIX");
 
 		if (!touch_format)
 			touch_format = pbx_builtin_getvar_helper(callee_chan, "TOUCH_MONITOR_FORMAT");
 
 		if (!touch_monitor)
 			touch_monitor = pbx_builtin_getvar_helper(callee_chan, "TOUCH_MONITOR");
+	
+		if (!touch_monitor_prefix)
+			touch_monitor_prefix = pbx_builtin_getvar_helper(callee_chan, "TOUCH_MONITOR_PREFIX");
 	
 		if (touch_monitor) {
 			len = strlen(touch_monitor) + 50;
 			args = alloca(len);
 			touch_filename = alloca(len);
-			snprintf(touch_filename, len, "auto-%ld-%s", (long)time(NULL), touch_monitor);
-			snprintf(args, len, "%s|%s|m", (touch_format) ? touch_format : "wav", touch_filename);
+			snprintf(touch_filename, len, "%s-%ld-%s", S_OR(touch_monitor_prefix, "auto"), (long)time(NULL), touch_monitor);
+			snprintf(args, len, "%s|%s|m", S_OR(touch_format, "wav"), touch_filename);
 		} else {
 			caller_chan_id = ast_strdupa(S_OR(caller_chan->cid.cid_num, caller_chan->name));
 			callee_chan_id = ast_strdupa(S_OR(callee_chan->cid.cid_num, callee_chan->name));
 			len = strlen(caller_chan_id) + strlen(callee_chan_id) + 50;
 			args = alloca(len);
 			touch_filename = alloca(len);
-			snprintf(touch_filename, len, "auto-%ld-%s-%s", (long)time(NULL), caller_chan_id, callee_chan_id);
+			snprintf(touch_filename, len, "%s-%ld-%s-%s", S_OR(touch_monitor_prefix, "auto"), (long)time(NULL), caller_chan_id, callee_chan_id);
 			snprintf(args, len, "%s|%s|m", S_OR(touch_format, "wav"), touch_filename);
 		}
 




More information about the asterisk-commits mailing list