elastix 2.0的录音文件按年月日分开存放的方法
时间:2010-11-22 来源:luckytuo
原文发表于:http://www.voip88.com/space-uid-7.html
说明 elastix2.0的通话录音默认全部直接放在/var/spool/asterisk/monitor/ 目录下,话务量大的话将会是灾难,现在我们要将它按日期排放 例如,2010-11月1日的录音放在 /var/spool/asterisk/monitor/10-11/01/下 2011-2月15日的放在/var/spool/asterisk/monitor/11-02/15/下 我们需要做的是 1:首先创建这些文件夹 (方法很多,略之) 2:修改freepbx的functions.inc.php文件 $ext->add($context, $exten, 'check', new ext_execif('$["${ARG1}"=""]','MacroExit')); $ext->add($context, $exten, '', new ext_gotoif('$["${ARG2}"="Group"]', 'Group','OUT')); $ext->add($context, $exten, 'Group', new ext_set('LOOPCNT','${FIELDQTY(ARG1,-)}')); $ext->add($context, $exten, '', new ext_set('ITER','1')); $ext->add($context, $exten, 'begin', new ext_gotoif('$["${CUT(DB(AMPUSER/${CUT(ARG1,-,${ITER})}/recording),=,3)}" != "Always"]', 'continue')); $ext->add($context, $exten, '', new ext_set('TEXTEN','${CUT(ARG1,-,${ITER})}')); $ext->add($context, $exten, '', new ext_noop('Recording enable for ${TEXTEN}')); $ext->add($context, $exten, '', new ext_set('CALLFILENAME','g${TEXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID}')); $ext->add($context, $exten, '', new ext_goto('record')); $ext->add($context, $exten, 'continue', new ext_set('ITER','$[${ITER}+1]')); $ext->add($context, $exten, '', new ext_gotoif('$[${ITER}<=${LOOPCNT}]', 'begin')); $ext->add($context, $exten, 'OUT', new ext_gotoif('$["${ARG2}"="IN"]', 'IN')); $ext->add($context, $exten, '', new ext_execif('$["${CUT(DB(AMPUSER/${ARG1}/recording),\\\\\|,1):4}" != "Always"]','MacroExit')); $ext->add($context, $exten, '', new ext_noop('Recording enable for ${ARG1}')); //$ext->add($context, $exten, '', new ext_set('CALLFILENAME','OUT${ARG1}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID}')); //zhangtuo edit 2010-8-2 $ext->add($context, $exten, '', new ext_set('CALLFILENAME','${STRFTIME(${EPOCH},,/%y-%m/%d/)}${UNIQUEID}')); //zhangtuo add 2010-8-2 $ext->add($context, $exten, '', new ext_goto('record')); $ext->add($context, $exten, 'IN', new ext_execif('$["${CUT(DB(AMPUSER/${ARG1}/recording),\\\\\|,2):3}" != "Always"]','MacroExit')); $ext->add($context, $exten, '', new ext_noop('Recording enable for ${ARG1}')); $ext->add($context, $exten, '', new ext_set('CALLFILENAME','${STRFTIME(${EPOCH},,/%y-%m/%d/)}${UNIQUEID}')); //zhangtuo add 2010-8-2 // $ext->add($context, $exten, '', new ext_set('CALLFILENAME','${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID}')); //zhangtuo edit 2010-8-2 $ext->add($context, $exten, 'record', new ext_mixmonitor('${MIXMON_DIR}${CALLFILENAME}.${MIXMON_FORMAT}','','${MIXMON_POST}')); $ext->add($context, $exten, '', new ext_macroexit()); 其中红色的是修改的 这样“应用”后,就会生成我们想要的拨号规则,录音就会存放到对应的日期子文件夹中 扩展 同样道理,还可以进一步修改,让录音文件名中包含CALLERID(num) 等等 freepbx 底的版本是用recordingcheck文件实现的,高的版本就要用这个方法来搞 |
相关阅读 更多 +