Index: res/res_features.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_features.c,v retrieving revision 1.51 diff -u -r1.51 res_features.c --- res/res_features.c 29 Apr 2005 17:00:33 -0000 1.51 +++ res/res_features.c 6 May 2005 03:09:15 -0000 @@ -408,7 +408,7 @@ static int builtin_automonitor(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense) { - char *touch_monitor = NULL, *caller_chan_id = NULL, *callee_chan_id = NULL, *args = NULL; + char *touch_monitor = NULL, *caller_chan_id = NULL, *callee_chan_id = NULL, *args = NULL, *touch_format = NULL; int x = 0; size_t len; struct ast_channel *caller_chan = NULL, *callee_chan = NULL; @@ -456,6 +456,10 @@ } if (caller_chan && callee_chan) { + touch_format = pbx_builtin_getvar_helper(caller_chan, "TOUCH_FORMAT"); + if (!touch_format) + touch_format = pbx_builtin_getvar_helper(callee_chan, "TOUCH_FORMAT"); + touch_monitor = pbx_builtin_getvar_helper(caller_chan, "TOUCH_MONITOR"); if (!touch_monitor) touch_monitor = pbx_builtin_getvar_helper(callee_chan, "TOUCH_MONITOR"); @@ -463,13 +467,13 @@ if (touch_monitor) { len = strlen(touch_monitor) + 50; args = alloca(len); - snprintf(args, len, "WAV|auto-%ld-%s|m", time(NULL), touch_monitor); + snprintf(args, len, "%s|auto-%ld-%s|m", (touch_format) ? touch_format : "WAV", time(NULL), touch_monitor); } else { caller_chan_id = ast_strdupa(caller_chan->cid.cid_num ? caller_chan->cid.cid_num : caller_chan->name); callee_chan_id = ast_strdupa(callee_chan->cid.cid_num ? callee_chan->cid.cid_num : callee_chan->name); len = strlen(caller_chan_id) + strlen(callee_chan_id) + 50; args = alloca(len); - snprintf(args, len, "WAV|auto-%ld-%s-%s|m", time(NULL), caller_chan_id, callee_chan_id); + snprintf(args, len, "%s|auto-%ld-%s-%s|m", (touch_format) ? touch_format : "WAV", time(NULL), caller_chan_id, callee_chan_id); } for( x = 0; x < strlen(args); x++) Index: doc/README.variables =================================================================== RCS file: /usr/cvsroot/asterisk/doc/README.variables,v retrieving revision 1.43 diff -u -r1.43 README.variables --- doc/README.variables 4 May 2005 04:13:31 -0000 1.43 +++ doc/README.variables 6 May 2005 03:09:15 -0000 @@ -369,6 +369,7 @@ ${RECORDED_FILE} * Recorded file in record() ${TALK_DETECTED} * Result from talkdetect() ${TOUCH_MONITOR} The filename base to use with Touch Monitor (auto record) +${TOUCH_FORMAT} The audio format to use with Touch Monitor (auto record) ${TXTCIDNAME} * Result of application TXTCIDName ${VPB_GETDTMF} chan_vpb