实时质检
原理:通过ASR接口(依赖cti_asr接口),识别出实时识别说话内容,然后和关键词匹配执行挂机等动作。支持群集,配置和记录都存储到REDIS。
使用实例
<action application="export" data="nolocal:execute_on_answer_qc=cti_qc_session:bleg_group|common_group"/> <action application="set" data="execute_on_answer_qc=cti_qc_session:aleg_group|common_group"/> <action application="export" data="execute_on_answer_asr=cti_detect_speech_session:^^|127.0.0.1:9988|0|150|1000|3|0.2|5000|60000|''|''|0|''|1"/> <action application="bridge" data="sofia/external/callin@180.76.224.191:35580"/> 复制代码
redis 配置说明
cti_rt_call_qc_keyword 和cti_rt_call_qc_keyword@domain[哈希表] 配置实时质检关键词和对应的动作,关键词支持正则表达式。
cti_rt_call_qc_keyword和cti_rt_call_qc_keyword@domain的区别,cti_rt_call_qc_keyword@domain指定的domain的fs才加载,cti_rt_call_qc_keyword连接这个redis的所有fs都会加载用于群集模式。
- key 组名
- value 具体关键词JSON格式
| ``` { "脏话": { "keyword": ["他妈的", "去死吧","regex:.*操.妈."], "command": "uuid_kill", "params": "" }, "自定义分类": { "keyword": ["公账", "高新"], "command": "uuid_sendmessage", "params": "" } }
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - keyword 关键词列表,如果正则表达式用前缀“regex:”。 - command 匹配到关键词执行的API,可以执行挂机,发送通知等命令。 - params API参数,参数前面会自动加上UUID。 复制代码
cti_rt_call_qc_keyword 改变通知
cti_rt_call_qc_keyword 改变PUBLISH 通知到config@all [通道] ,cti_rt_call_qc_keyword@domain改变PUBLISH 通知到config@domain[通道]
{ "type":"config_change", "table":"cti_rt_call_qc_keyword", "key":"t1" } 复制代码
qc 通知
配置cti.json
| ``` "qc": { "log": true, "redis": { "qc_asr": { "channel": "cti_qc", "list": "cti_rt_call_qc_asr" }, "qc_hit": { "channel": "cti_qc", "list": "cti_rt_call_qc_hit" }, "qc_start": { "channel": "cti_qc", "list": "cti_rt_call_qc_start", "variables": [ "caller_id_number", "callee_id_number", "direction" ] }, "qc_stop": { "channel": "cti_qc", "list": "cti_rt_call_qc_stop" } } }
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - log 是否输出qc记录日志 - channel qc记录推送redis的channels名字 - list qc记录写入redis的list名字 #### [](http://www.ddrj.com/callcenter/callqc.html#qc-start-%E5%90%AF%E5%8A%A8%E9%80%9A%E7%9F%A5 "qc_start 启动通知")qc_start 启动通知 | ``` { "datetime": "2021-07-21 20:58:58", "domian": "my", "type": "qc_start", "groupnames": ["bleg"], "uuid": "f26805ca-7069-4a28-bde0-6bcbd32ad570", "call_uuid": "71bda206-0cbb-4ea0-b975-64a995b7b59e", "caller_id_number": "123", "callee_id_number": "123", "direction": "outbound" } ``` | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - groupnames start_qcc 使用的关键词组 - uuid 通道的uuid - call_uuid call_uuid 如果有通话的双方,2边会使用一样的call_uuid,估计是主叫的uuid #### [](http://www.ddrj.com/callcenter/callqc.html#qc-stop-%E5%81%9C%E6%AD%A2%E9%80%9A%E7%9F%A5 "qc_stop 停止通知")qc_stop 停止通知 | ``` { "uuid": "f26805ca-7069-4a28-bde0-6bcbd32ad570", "call_uuid": "71bda206-0cbb-4ea0-b975-64a995b7b59e", "domian": "my", "type": "qc_stop", "datetime": "2021-07-21 20:59:07" } ``` | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | #### [](http://www.ddrj.com/callcenter/callqc.html#qc-asr-asrt%E9%80%9A%E7%9F%A5 "qc_asr asrt通知")qc_asr asrt通知 复制代码
{
"uuid": "71bda206-0cbb-4ea0-b975-64a995b7b59e", "type": "qc_asr", "domian": "my", "datetime": "2021-07-21 20:58:58", "bridge_uuid": "f26805ca-7069-4a28-bde0-6bcbd32ad570", "call_uuid": "71bda206-0cbb-4ea0-b975-64a995b7b59e" "speak_start": "说话开始时间,接通开始计算单位毫秒", "speak_stop": "说话停止时间,接通开始计算单位毫秒", "text": "识别到的句子,第一个字符F表示句子,E表示错误", "domian":"cti.conf.xlm配置的domain,用于分别来自那台fs", 复制代码
}
- bridge_uuid 桥接的通道ID(通话的对方) - datetime 开始说话的事件 #### [](http://www.ddrj.com/callcenter/callqc.html#qc-hit-%E5%8C%B9%E9%85%8D%E5%85%B3%E9%94%AE%E8%AF%8D%E9%80%9A%E7%9F%A5 "qc_hit 匹配关键词通知")qc_hit 匹配关键词通知 复制代码
{ "uuid":"uuid", "type": "qc_hit", "datetime": "2021-07-21 20:59:04", "bridge_uuid": "f26805ca-7069-4a28-bde0-6bcbd32ad570", "call_uuid": "71bda206-0cbb-4ea0-b975-64a995b7b59e", "speak_start": "说话开始时间,接通开始计算单位毫秒", "speak_stop": "说话停止时间,接通开始计算单位毫秒", "text": "识别到的句子,第一个字符F表示句子,E表示错误,S表示没识别到说话停止就挂掉", "domian":"cti.conf.xlm配置的domain,用于分别来自那台fs", "group":"组名,cti_rt_call_qc_keyword的KEY", "category":"keyword所属的分类", "keyword": "关键词", "match":"keyword和text的匹配信息", "command":"执行命令信息" }
### [](http://www.ddrj.com/callcenter/callqc.html#FreeSWITCH-%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E "FreeSWITCH 接口说明")FreeSWITCH 接口说明 #### [](http://www.ddrj.com/callcenter/callqc.html#APP-cti-start-qc-group-%E5%BC%80%E5%A7%8B%E5%AE%9E%E6%97%B6%E9%80%9A%E8%AF%9D%E8%B4%A8%E6%A3%80 "APP cti_start_qc(group) 开始实时通话质检")APP cti_start_qc(group) 开始实时通话质检 - group rt_call_qc_keyword配置的组,多个组用|隔开,使用那些组中的关键词。 #### [](http://www.ddrj.com/callcenter/callqc.html#API-uuid-cti-start-qc-uuid-group-%E5%BC%80%E5%A7%8B%E5%AE%9E%E6%97%B6%E9%80%9A%E8%AF%9D%E8%B4%A8%E6%A3%80 "API uuid_cti_start_qc uuid group 开始实时通话质检")API uuid_cti_start_qc uuid group 开始实时通话质检 参数和start_qc一样。 #### [](http://www.ddrj.com/callcenter/callqc.html#API-uuid-cti-stop-ac-uuid-%E5%81%9C%E6%AD%A2%E5%AE%9E%E6%97%B6%E9%80%9A%E8%AF%9D%E8%B4%A8%E6%A3%80 "API uuid_cti_stop_ac uuid 停止实时通话质检")API uuid_cti_stop_ac uuid 停止实时通话质检 #### [](http://www.ddrj.com/callcenter/callqc.html#API-cti-show-qc-all-%E6%98%BE%E7%A4%BAqc%E5%B7%B2%E7%BB%8F%E5%8A%A0%E8%BD%BD%E7%9A%84%E5%85%B3%E9%94%AE%E8%AF%8D%E7%BB%84 "API cti show qc_all 显示qc已经加载的关键词组")API cti show qc_all 显示qc已经加载的关键词组 复制代码