- 请求 URL:
/api/ais
- 请求方式:
GET
- Body 信息:无
- 返回值:
[
{
"context": "default",
"dial_set_cid_name": "true",
"dial": "true",
"dial_full_originate": "true",
"dial_set_cid_number": "true",
"created_at": "2022-05-13 15:08:36",
"default_profile": "default",
"deleted_at": "",
"id": 1,
"dial_set_context": "true",
"set_vars": "true",
"updated_at": "2022-05-13 15:08:36",
"description": "",
"extended_data": "false",
"set_params": "true",
"conference_set_profile": "true",
"name": "default",
"dial_set_dialplan": "true",
"dialplan": "XML",
"conference": "true",
"get_vars": "true",
"expand_vars_in_tag_body": "true"
}
]
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/ais
- 请求 URL:
/api/ais/$id
- 请求方式:
GET
- Body 信息:无
- 返回值:
{
"dial_set_context": "true",
"deleted_at": "",
"dial_full_originate": "true",
"conference_set_profile": "true",
"updated_at": "2022-05-13 15:08:36",
"name": "default",
"extended_data": "false",
"context": "default",
"description": "",
"set_vars": "true",
"conference": "true",
"dial_set_dialplan": "true",
"default_profile": "default",
"get_vars": "true",
"dial": "true",
"set_params": "true",
"params": [
{
"k": "debug",
"deleted_at": "",
"updated_at": "2022-05-13 15:08:37",
"disabled": 0,
"ref_id": 1,
"id": 353,
"v": "true",
"realm": "AI",
"created_at": "2022-05-13 15:08:37"
},
{
"k": "post-event-url",
"deleted_at": "",
"updated_at": "2022-05-13 15:08:37",
"disabled": 0,
"ref_id": 1,
"id": 364,
"v": "http://192.168.1.9:8080/freeswitch/event",
"realm": "AI",
"created_at": "2022-05-13 15:08:37"
}
],
"dialplan": "XML",
"dial_set_cid_number": "true",
"dial_set_cid_name": "true",
"id": 1,
"ai_params": [
{
"k": "gateway-url",
"deleted_at": "",
"updated_at": "2022-05-13 15:08:37",
"disabled": 0,
"ref_id": 1,
"id": 365,
"v": "http://www.freeswitch.org/api/index.cgi",
"realm": "AI-PARAMS",
"created_at": "2022-05-13 15:08:37"
}
],
"created_at": "2022-05-13 15:08:36",
"expand_vars_in_tag_body": "true"
}
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/ais/1
- 请求 URL:
/api/ais/$id/apps
- 请求方式:
GET
- Body 信息:无
- 返回值:
[
{
"deleted_at": "",
"id": 366,
"disabled": 0,
"created_at": "2022-05-13 15:08:37",
"v": "",
"k": "info",
"updated_at": "2022-05-13 15:08:37",
"ref_id": 1,
"realm": "AI-APPS"
},
{
"deleted_at": "",
"id": 367,
"disabled": 0,
"created_at": "2022-05-13 15:08:37",
"v": "",
"k": "hangup",
"updated_at": "2022-05-13 15:08:37",
"ref_id": 1,
"realm": "AI-APPS"
}
...
]
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/ais/1/apps
- 请求 URL:
/api/ais
- 请求方式:
POST
- Body 信息:
参数 | 说明 |
---|
name | 配置名称 |
template | 默认模板:"default";配置 ID:使用已存在的其他配置作为默认模板 |
示例1:
{
"name": "test",
"template": "default"
}
示例2:
{
"name": "copy_1",
"template": "1"
}
{
"data": 3,
"code": 200,
"message": "success"
}
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"name": "test","template": "default"}' 192.168.1.100:8081/api/ais
- 请求 URL:
/api/ais/$id
- 请求方式:
PUT
- Body 信息:
参数 | 说明 |
---|
name | 配置名称 |
conference | 会议 |
context | 呼叫源 |
default_profile | 会议默认配置 |
description | 描述 |
dial | 拨号 |
dial_full_originate | dial_full_originate |
dial_set_cid_number | 拨号设置主叫号码 |
dial_set_cid_name | 拨号设置主叫名称 |
dial_set_context | 拨号设置呼叫源 |
dial_set_dialplan | 拨号设置拨号规则 |
dialplan | 拨号规则 |
expand_vars_in_tag_body | 展开标签体中的变量 |
extended_data | 扩展数据 |
get_vars | 获取变量 |
set_vars | 设置变量 |
set_params | 设置参数 |
注:以上配置参数均为可选
{
"conference": "true",
"context": "default",
"default_profile": "default",
"description": "",
"dial": "true",
"dial_full_originate": "true",
"dial_set_cid_name": "true",
"dial_set_cid_number": "true",
"dial_set_context": "true",
"dial_set_dialplan": "true",
"dialplan": "test",
"expand_vars_in_tag_body": "true",
"extended_data": "false",
"get_vars": "true",
"id": "3",
"name": "default",
"set_params": "true",
"set_vars": "true"
}
{
"message": "success",
"code": 200,
"data": "3"
}
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{"name":"test","description": "test"}' \
"http://192.168.1.100:8081/api/ais/3"
- 请求 URL:
/api/ais/$id/apps
- 请求方式:
POST
- Body 信息:
{
"app": "down1"
}
{
"message": "success",
"data": "1524",
"code": 200
}
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"app": "down1"}' 192.168.1.100:8081/api/ais
- 请求 URL:
/api/ais/$id/apps/$apps_id
- 请求方式:
DELETE
- Body 信息:无
- 返回值:
{
"message": "success",
"code": 200,
"data": "1524"
}
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE https://192.168.3.222/api/ais/3/apps/1524
- 请求 URL:
/api/ais/$id/settings/$param_id
- 请求方式:
PUT
- Body 信息:
参数 | 说明 |
---|
k | settings 参数名称 |
v | settings 参数值 |
{
"k": "default-asr-engine",
"v": "baidu"
}
{
"code": 200,
"data": "1491",
"message": "success"
}
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{"k": "default-asr-engine","v": "baidu"}' \
"http://192.168.1.100:8081/api/ais/3/settings/1491"
- 请求 URL:
/api/ais/$id/profiles
- 请求方式:
POST
- Body 信息:
参数 | 说明 |
---|
k | Profiles 参数名称 |
v | Profiles 参数值 |
{
"k": "test1",
"v": "test"
}
{
"code": 200,
"data": 1526,
"message": "success"
}
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"app": "down1"}' 192.168.1.100:8081/api/ais/3/profiles
- 请求 URL:
/api/ais/$id/ai_params/$param_id
- 请求方式:
PUT
- Body 信息:
参数 | 说明 |
---|
k | Profiles 参数名称 |
v | Profiles 参数值 |
{
"k": "gateway-url",
"v": "http://www.freeswitch.org/api/index.cgi"
}
{
"code": 200,
"data": "1526",
"message": "success"
}
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"k": "gateway-url","v": "http://www.freeswitch.org/api/index.cgi"}' 192.168.1.100:8081/api/ais/3/ai_params/1526
- 请求 URL:
/api/ais/$id/ai_params/$param_id
- 请求方式:
PUT
- Body 信息:
参数 | 说明 |
---|
action | 变更启用状态,固定为"toggle" |
{
"action": "toggle"
}
{
"code": 200,
"data": "1526",
"message": "success"
}
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"action": "toggle"}' 192.168.1.100:8081/api/ais/3/ai_params/1526
- 请求 URL:
/api/ais/$id/profiles/$profiles_id
- 请求方式:
DELETE
- Body 信息:无
- 返回值:
{
"data": "1526",
"message": "success",
"code": 200
}
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/ais/3/profiles/1526
创建 AI 配置 profile 中的 Bindings 参数
- 请求 URL:
/api/ais/$id/bindings
- 请求方式:
POST
- Body 信息:
参数 | 说明 |
---|
event_name | Bindings 参数名称 |
subclass_name | Bindings 参数值 |
{
"event_name": "test01",
"subclass_name": "ALL"
}
{
"code": 200,
"data": "1550",
"message": "success"
}
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"event_name": "test01","subclass_name": "ALL"}' 192.168.1.100:8081/api/ais/3/bindings
修改 AI 配置 profile 中的 Bindings 参数
- 请求 URL:
/api/ais/$id/bindings/$param_id
- 请求方式:
PUT
- Body 信息:
参数 | 说明 |
---|
k | Bindings 参数名称 |
v | Bindings 参数值 |
{
"k": "CUSTON1",
"v": "ALL"
}
{
"code": 200,
"message": "success",
"data": "1550"
}
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"k": "CUSTON1","v": "ALL"}' 192.168.1.100:8081/api/ais/3/bindings/1550
启用/禁用 AI 配置 profile 中的 Bindings 参数
- 请求 URL:
/api/ais/$id/bindings/$param_id
- 请求方式:
PUT
- Body 信息:
参数 | 说明 |
---|
action | 变更启用状态,固定为"toggle" |
{
"action": "toggle"
}
{
"message": "success",
"data": "1550",
"code": 200
}
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"action": "toggle"}' 192.168.1.100:8081/api/ais/3/bindings/1550
删除 AI 配置 profile 中的 Bindings 参数
- 请求 URL:
/api/ais/$id/bindings/$param_id
- 请求方式:
DELETE
- Body 信息:无
- 返回值:
{
"code": 200,
"data": "1550",
"message": "success"
}
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/ais/3/bindings/1550
创建 AI 配置 profile 中的 Asr 参数
- 请求 URL:
/api/ais/$id/asr
- 请求方式:
POST
- Body 信息:
参数 | 说明 |
---|
name | Asr 参数名称 |
value | Asr 参数数值 |
realm | Asr 参数域 |
{
"name": "test",
"value": "test",
"realm": "AI-ASR"
}
{
"code": 200,
"message": "success",
"data": 4059
}
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"name": "test","value": "test","realm": "AI-ASR"}' 192.168.1.100:8081/api/ais/3/asr
修改 AI 配置 profile 中的 Asr 参数
- 请求 URL:
/api/ais/$id/asr/$param_id
- 请求方式:
PUT
- Body 信息:
{
"k": "test",
"v": "700"
}
{
"data": "4059",
"code": 200,
"message": "success"
}
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"k": "test","v": "700"}' 192.168.1.100:8081/api/ais/3/asr/4059
启用/禁用 AI 配置 profile 中的 Asr 参数
- 请求 URL:
/api/ais/$id/asr/$param_id
- 请求方式:
PUT
- Body 信息:
参数 | 说明 |
---|
action | 变更启用状态,固定为"toggle" |
{
"action": "toggle"
}
{
"data": "4059",
"message": "success",
"code": 200
}
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"action": "toggle"}' 192.168.1.100:8081/api/ais/3/asr/4059
删除 AI 配置 profile 中的 Asr 参数
- 请求 URL:
/api/ais/$id/asr/$param_id
- 请求方式:
DELETE
- Body 信息:无
- 返回值:
{
"message": "success",
"data": "4059",
"code": 200
}
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/ais/3/asr/4059
创建 AI 配置 profile 中的 Asr-Models
- 请求 URL:
/api/ais/$id/asr
- 请求方式:
POST
- Body 信息:
参数 | 说明 |
---|
name | Asr 参数名称 |
value | Asr 参数数值 |
realm | Asr-Models 参数域 |
{
"name": "test",
"realm": "AI-ASR-MODELS",
"value": "xxxx"
}
{
"code": 200,
"data": 4065,
"message": "success"
}
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"name": "test","value": "xxxx","realm": "AI-ASR-MODELS"}' 192.168.1.100:8081/api/ais/3/asr
修改 AI 配置 profile 中的 Asr-Models 参数
- 请求 URL:
/api/ais/$id/asr_models/$param_id
- 请求方式:
PUT
- Body 信息:
参数 | 说明 |
---|
k | Asr-Models 参数名称 |
v | Asr-Models 参数值 |
{
"k": "names",
"v": "values"
}
{
"data": "4065",
"message": "success",
"code": 200
}
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"k": "names","v": "values"}' 192.168.1.100:8081/api/ais/3/asr_models/4065
启用/禁用 AI 配置 profile 中的 Asr-Models
- 请求 URL:
/api/ais/$id/asr_models/$param_id
- 请求方式:
PUT
- Body 信息:
参数 | 说明 |
---|
action | 变更启用状态,固定为"toggle" |
{
"action": "toggle"
}
{
"code": 200,
"data": "4065",
"message": "success"
}
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"action": "toggle"}' 192.168.1.100:8081/api/ais/3/asr_models/4065
删除 AI 配置 profile 中的 Asr-Models
- 请求 URL:
/api/ais/$id/asr_models/$param_id
- 请求方式:
DELETE
- Body 信息:无
- 返回值:
{
"data": "4065",
"message": "success",
"code": 200
}
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/ais/3/asr_models/4065
- 请求 URL:
/api/ais/$id
- 请求方式:
DELETE
- Body 信息:无
- 返回值:
{
"data": "3",
"code": 200,
"message": "success"
}
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/ais/3
在 AI 接口中,对于"百度","阿里","华为","讯飞"模块,调用接口参数一致,URL 进行调整:
- 百度:
https://192.168.3.222/api/baidus
- 阿里:
https://192.168.3.222/api/ali_profiles
- 华为:
https://192.168.3.222/api/huawei_profiles
- 讯飞:
https://192.168.3.222/api/xunfei_profiles
各模块对应的realm | 说明 |
---|
百度 | BAIDU-TTS BAIDU-ASR BAIDU-ASR-WS |
阿里 | ALI-SETTINGS ALI-TTS ALI-ASR |
华为 | HUAWEI-SETTINGS HUAWEI-TTS HUAWEI-ASR |
讯飞 | XUNFEI-SETTINGS XUNFEI-TTS XUNFEI-ASR |
以百度模块为例:
- 请求 URL:
/api/baidus
- 请求方式:
GET
- Body 信息:无
- 返回值:
[
{
"name": "baidu",
"deleted_at": "",
"disabled": 1,
"description": "",
"updated_at": "2022-05-17 12:20:56",
"created_at": "2022-05-17 12:20:56",
"id": 1
}
]
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/baidus
- 请求 URL:
/api/baidus
- 请求方式:
POST
- Body 信息:
参数 | 说明 |
---|
name | baidu profile 名称 |
description | baidu profile 描述 |
template | 模板,默认模板:"default" |
{
"name": "test",
"description": "test",
"template": "default"
}
{
"code": 200,
"data": 2,
"message": "success"
}
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"name": "test","description": "test","template": "default"}' 192.168.1.100:8081/api/baidus
- 请求 URL:
/api/baidus/$id
- 请求方式:
PUT
- Body 信息:
参数 | 说明 |
---|
name | baidu profile 名称 |
description | baidu profile 描述 |
id | profile ID |
{
"name": "baidu",
"description": "百度模块",
"id": "1"
}
{
"data": "1",
"message": "success",
"code": 200
}
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"name": "baidu","description": "百度模块","id": "1"}' 192.168.1.100:8081/api/baidus/1
- 请求 URL:
/api/baidus/$id/params
- 请求方式:
POST
- Body 信息:
{
"k": "text1",
"realm": "BAIDU-TTS",
"v": "t1"
}
{
"k": "text2",
"realm": "BAIDU-ASR",
"v": "t2"
}
{
"code": 200,
"message": "success",
"data": 1574
}
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"k": "text1","v": "t1","realm": "BAIDU-TTS"}' 192.168.1.100:8081/api/baidus/1/params
- 请求 URL:
/api/baidus/$id/params/$param_id
- 请求方式:
PUT
- Body 信息:
{
"k": "token-url",
"realm": "BAIDU-TTS",
"v": "https://openapi.baidu.com/oauth/2.0/token"
}
{
"message": "success",
"data": "1574",
"code": 200
}
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"k": "token-url","v": "https://openapi.baidu.com/oauth/2.0/token","realm": "BAIDU-TTS"}' 192.168.1.100:8081/api/baidus/1/params/1574
- 请求 URL:
/api/baidus/$id/params/$param_id
- 请求方式:
PUT
- Body 信息:
参数 | 说明 |
---|
action | 变更启用状态,固定为"toggle" |
{
"action": "toggle"
}
{
"message": "success",
"data": "1574",
"code": 200
}
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -d '{"action": "toggle"}' 192.168.1.100:8081/api/baidus/1/params/1574
- 请求 URL:
/api/baidus/$id/params/$params_id
- 请求方式:
DELETE
- Body 信息:无
- 返回值:
{
"code": 200,
"message": "success",
"data": "1"
}
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/baidus/1/params/1
- 请求 URL:
/api/baidus/$id
- 请求方式:
DELETE
- Body 信息:无
- 返回值:
{
"message": "success",
"data": "2",
"code": 200
}
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/baidus/2