diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-15 20:08:04 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-15 20:08:04 +0000 |
commit | 4f94e42a6787e4e47325ad25dfcde8cd7cd82ea0 (patch) | |
tree | b6c7ca473e2943e3373d691c6e8b93dc02b3ebe4 | |
parent | 8381ecb24000935e815839fa6c03f7137677a5a6 (diff) |
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)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85682 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | res/res_features.c | 10 |
2 files changed, 9 insertions, 3 deletions
@@ -295,3 +295,5 @@ Miscellaneous 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. diff --git a/res/res_features.c b/res/res_features.c index e45d02184..9bf0914e9 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -672,6 +672,7 @@ static int builtin_automonitor(struct ast_channel *chan, struct ast_channel *pee 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"); @@ -679,19 +680,22 @@ static int builtin_automonitor(struct ast_channel *chan, struct ast_channel *pee 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); } |