公司的录音系统坏了,该系统是通过PHP做的产品,数据库是MYSQL,通过LOG分析,原因是录音文件太多,查询录音文件时直接内存溢出。
我的任务就是通过JAVA写一个查询连上这个MYSQL,在加上各种查询条件,方便客服每天都要查询与听录音。痛苦研究了一个星期,分析了风语者系统的表,终于搞定了。
主要用到的表是CDR,但是由于物理录音文件的命名是年月日时分秒,而系统里只能查到年月日,无法通过程序关联到物理文件。
所以只好改配置文件了,将录音文件命名改为年月日,根据CDR中的calldate进行关联,
找到文件:extensions_override_freepbx.conf,它原本是空的,添加如下内容即可。
[ext-queues] include => ext-queues-custom exten => 9000,1,Macro(user-callerid,) exten => 9000,n,Answer exten => 9000,n,Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL}) exten => 9000,n,Set(__BLKVM_BASE=${EXTEN}) exten => 9000,n,Set(DB(${BLKVM_OVERRIDE})=TRUE) exten => 9000,n,ExecIf($["${REGEX("(M[(]auto-blkvm[)])" ${DIAL_OPTIONS})}" != "1"],Set,_DIAL_OPTIONS=${DIAL_OPTIONS}M(auto-blkvm)) exten => 9000,n,Set(__NODEST=${EXTEN}) exten => 9000,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d)}-${UNIQUEID}) exten => 9000,n,Set(__CWIGNORE=TRUE) exten => 9000,n,Set(BAOHAO=1) exten => 9000,n,Queue(9000,t,,,30,baohao.php) exten => 9000,n,dbDel(${BLKVM_OVERRIDE}) exten => 9000,n,Set(__NODEST=) exten => 9000,n,Goto(app-blackhole,busy,1) exten => 9000*,1,Macro(agent-add,9000,) exten => 9000**,1,Macro(agent-del,9000,9000) exten => 9001,1,Macro(user-callerid,) exten => 9001,n,Answer exten => 9001,n,Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL}) exten => 9001,n,Set(__BLKVM_BASE=${EXTEN}) exten => 9001,n,Set(DB(${BLKVM_OVERRIDE})=TRUE) exten => 9001,n,ExecIf($["${REGEX("(M[(]auto-blkvm[)])" ${DIAL_OPTIONS})}" != "1"],Set,_DIAL_OPTIONS=${DIAL_OPTIONS}M(auto-blkvm)) exten => 9001,n,Set(__NODEST=${EXTEN}) exten => 9001,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d)}-${UNIQUEID}) exten => 9001,n,Set(__CWIGNORE=TRUE) exten => 9001,n,Set(BAOHAO=1) exten => 9001,n,Queue(9001,t,,,30,baohao.php) exten => 9001,n,dbDel(${BLKVM_OVERRIDE}) exten => 9001,n,Set(__NODEST=) exten => 9001,n,Goto(app-blackhole,busy,1) exten => 9001*,1,Macro(agent-add,9001,) exten => 9001**,1,Macro(agent-del,9001,9001) exten => 9002,1,Macro(user-callerid,) exten => 9002,n,Answer exten => 9002,n,Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL}) exten => 9002,n,Set(__BLKVM_BASE=${EXTEN}) exten => 9002,n,Set(DB(${BLKVM_OVERRIDE})=TRUE) exten => 9002,n,ExecIf($["${REGEX("(M[(]auto-blkvm[)])" ${DIAL_OPTIONS})}" != "1"],Set,_DIAL_OPTIONS=${DIAL_OPTIONS}M(auto-blkvm)) exten => 9002,n,Set(__NODEST=${EXTEN}) exten => 9002,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d)}-${UNIQUEID}) exten => 9002,n,Set(__CWIGNORE=TRUE) exten => 9002,n,Set(BAOHAO=1) exten => 9002,n,Queue(9002,t,,,30,baohao.php) exten => 9002,n,dbDel(${BLKVM_OVERRIDE}) exten => 9002,n,Set(__NODEST=) exten => 9002,n,Goto(app-blackhole,busy,1) exten => 9002*,1,Macro(agent-add,9002,) exten => 9002**,1,Macro(agent-del,9002,9002) ; end of [ext-queues]