拨号方案和路由配置

介绍

为了实现动态组合拨号方案避免重复配置,把拨号方案拆分成了2个部分,一个是cti_dialplan_extensio@domain,保存单个拨号方案配置,一个是cti_dialplan_context@domain把多个拨号方案组合一个路由表。拨号方案和路由配置修改后会实时生效。

配置

  1. cti_dialplan_extensio@domain [哈希表]
    • key 拨号方案的名字
    • value
录音的例子
{
"condition": [
{
"field": "${record_filename}",
"description": "测试是否已经启动录音",
"expression": ".+",
"anti-action": [
{
"application": "export",
"data": "RECORD_READ_ONLY=false",
"description": "是否只录音对方"
},
{
"application": "export",
"data": "RECORD_WRITE_ONLY=false",
"description": "是否只录音本方"
},
{
"application": "export",
"data": "RECORD_BRIDGE_REQ=false",
"description": "是否应答后开始录音"
},
{
"application": "export",
"data": "RECORD_STEREO=false",
"description": "是否双道录音"
},
{
"application": "export",
"data": "record_filename=$${recordings_dir}/${strftime(%Y-%m-%d)}/${caller_id_number}.${destination_number}.${strftime(%H-%M-%S)}.${uuid}.wav",
"description": "录音录音文件名"
},
{
"application": "record_session",
"data": "${record_filename}",
"description": "开始录音"
}
]
}
],
"continue": true
}

外呼的例子
{
"condition": [
{
"field": "destination_number",
"expression": "^00\\d*$",
"description": "静止呼叫国际长途",
"action": [
{
"application": "hangup",
"description": "00开始的号码挂断"
}
],
"break": "on-true"
},
{
"field": "destination_number",
"expression": "^\\d+$",
"description": "允许全数字号码呼出",
"action": [
{
"application": "bridge",
"description": "通过default网关呼出",
"data": "sofia/gateway/default/${destination_number}"
}
]
}
]
}

这里就不做解析了,具体参考FreeSWITCH的拨号方案写法。
支持嵌套等XML拨号方案的所有功能。

  1. cti_dialplan_context@domain [list]
[
"call extension",
"call trunk",
"testabc"
]

CTI模块根据顺序把cti_dialplan_extensio@domain里面的内容组合成一个拨号方案的XML文件。