- 请求 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"
}
- 请求 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
- 请求方式:
POST
- Body 信息:
{
"k": "test",
"v": "test",
"ai_id": "2"
}
{
"data": 3589,
"message": "success",
"code": 200
}
- 请求 URL:
/api/ais/$id/settings
- 请求方式:
GET
- Body 信息:无
- 返回值:
[
{
"created_at": "2025-09-03 09:01:09",
"disabled": 0,
"v": "true",
"realm": "AI",
"k": "debug",
"deleted_at": "",
"ref_id": 2,
"id": 3548,
"updated_at": "2025-09-03 09:01:09"
}, {
"created_at": "2025-09-03 09:01:09",
"disabled": 0,
"v": "300",
"realm": "AI",
"k": "file-not-found-expires",
"deleted_at": "",
"ref_id": 2,
"id": 3549,
"updated_at": "2025-09-03 09:03:14"
}
...
]
- 请求 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/settings/$param_id
- 请求方式:
DELETE
- Body 信息:无
- 返回值:
{
"code": 200,
"data": "3589",
"message": "success"
}
- 请求 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 '{"k": "test1","v": "test"}' 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
启用/禁用指定 AI 实例的 Profiles 参数
- 请求 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
- 请求 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
- 请求 URL:
/api/ais/$id/bindings
- 请求方式:
GET
- Body 信息:无
- 返回值:
[
{
"ref_id": 1,
"id": 452,
"realm": "AI-BINDINGS",
"updated_at": "2025-09-03 01:42:52",
"v": "ALL",
"deleted_at": "",
"created_at": "2025-09-03 01:42:52",
"k": "CHANNEL_CREATE",
"disabled": 0
}, {
"ref_id": 1,
"id": 453,
"realm": "AI-BINDINGS",
"updated_at": "2025-09-03 01:42:52",
"v": "ALL",
"deleted_at": "",
"created_at": "2025-09-03 01:42:52",
"k": "CHANNEL_ANSWER",
"disabled": 0
}
...
]
修改指定 AI 实例的 Bindings 参数 {#update-ai-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 实例的 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
- 请求 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
- 请求 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
- 请求 URL:
/api/ais/$id/asr
- 请求方式:
GET
- Body 信息:无
- 返回值:
[
{
"created_at": "2025-09-03 09:01:09",
"updated_at": "2025-09-03 09:01:09",
"id": 3566,
"k": "threshold",
"ref_id": 2,
"disabled": 0,
"deleted_at": "",
"realm": "AI-ASR",
"v": "400"
}, {
"created_at": "2025-09-03 09:01:09",
"updated_at": "2025-09-03 09:01:09",
"id": 3567,
"k": "silence-ms",
"ref_id": 2,
"disabled": 0,
"deleted_at": "",
"realm": "AI-ASR",
"v": "700"
}
...
]
- 请求 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
- 请求 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
- 请求 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 实例的 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 实例的 ASR Models 参数
- 请求 URL:
/api/ais/$id/asr_models
- 请求方式:
GET
- Body 信息:无
- 返回值:
[
{
"k": "text1",
"created_at": "2025-09-03 09:41:29",
"v": "text",
"updated_at": "2025-09-03 09:41:29",
"id": 3590,
"realm": "AI-ASR-MODELS",
"ref_id": 2,
"disabled": 0,
"deleted_at": ""
}, {
"k": "vosk-model-cn-0.15",
"created_at": "2025-09-03 09:01:09",
"v": "8000",
"updated_at": "2025-09-03 09:41:22",
"id": 3575,
"realm": "AI-ASR-MODELS",
"ref_id": 2,
"disabled": 0,
"deleted_at": ""
}
...
]
修改指定 AI 实例的 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 实例的 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 实例的 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
字段说明:
字段 | 说明 |
---|
disabled | 是否启用,0 启用,1 不启用 |
name | 名称 |
params | 参数信息 |
description | 描述 |
action | 按动作查询 |
startDate | 按起始时间查询 |
params 中参数说明;
参数 | 说明 |
---|
disabled | 是否启用,0 启用,1 不启用 |
k | 参数名称 |
v | 参数值 |
realm | 参数对应域 |
ref_id | 对应的 XCC 配置 ID |
realm 说明:
realm | 说明 |
---|
XCC-SETTINGS | XCC 设置项参数 |
XCC-BINDINGS | 绑定哪些事件,被绑定的事件才会被获取到 |
XCC-SUBS | 订阅哪些事务 |
XCC-CDR | 话单事件中的参数 |
XCC-CHANNEL | 订阅哪些通道变量 |
XCC-DIALPLAN | 订阅 DIALPLAN 中参数 |
- 请求 URL:
/api/xcc_profiles
- 请求方式:
GET
- Body 信息:无
- 返回值:
[
{
"disabled": 0,
"id": 1,
"description": "default",
"updated_at": "2022-05-16 09:51:32",
"deleted_at": "",
"created_at": "2022-05-16 09:51:32",
"name": "xcc"
}
]
- 请求 URL:
/api/xcc_profiles/$id
- 请求方式:
GET
- Body 信息:无
- 返回值:
{
"description": "default",
"created_at": "2022-05-16 09:51:32",
"params": [
{
"disabled": "0",
"created_at": "2022-05-16 09:51:32",
"realm": "XCC-SETTINGS",
"k": "debug",
"deleted_at": "",
"id": "478",
"v": "0",
"ref_id": "1",
"updated_at": "2022-05-16 09:51:32"
},
{
"disabled": "0",
"created_at": "2022-05-16 09:51:32",
"realm": "XCC-SETTINGS",
"k": "mq-type",
"deleted_at": "",
"id": "479",
"v": "NATS",
"ref_id": "1",
"updated_at": "2022-05-16 09:51:32"
}
...
],
"deleted_at": "",
"id": 1,
"name": "xcc",
"updated_at": "2022-05-16 09:51:32",
"disabled": 0
}
- 请求 URL:
/api/xcc_profiles/json_status
- 请求方式:
GET
- Body 信息:无
- 返回值:
[]
- 请求 URL:
/api/xcc_profiles
- 请求方式:
POST
- Body 信息:
{
"name": "test",
"disabled": "0",
"template": "default"
}
{
"message": "success",
"code": 200,
"data": "2"
}
- 请求 URL:
/api/xcc_profiles/$id
- 请求方式:
PUT
- Body 信息:
{
"name": "test",
"disabled": "0"
}
注:当携带disabled
参数的时候,会返回全部的配置内容
{
"message": "success",
"code": 200,
"data": [
{
"name": "xcc",
"description": "default",
"disabled": 1,
"deleted_at": "",
"id": 1,
"updated_at": "2023-03-11 03:47:17",
"created_at": "2023-03-03 02:46:42"
},
{
"name": "test2",
"description": "",
"disabled": 1,
"deleted_at": "",
"id": 2,
"updated_at": "2023-03-11 03:47:17",
"created_at": "2023-03-11 02:38:09"
}
]
}
不携带`disabled`参数时:
{
"data": "2",
"message": "success",
"code": 200
}
- 请求 URL:
/api/xcc_profiles/$id/params
- 请求方式:
POST
- Body 信息:
{
"k": "test",
"v": "11",
"realm": "XCC-CDR"
}
{
"message": "success",
"code": 200,
"data": 1840
}
- 请求 URL:
/api/xcc_profiles/$id/params/$param_id
- 请求方式:
PUT
- Body 信息:
{
"disabled": "0",
}
或
{
"v": "true"
}
{
"code": 200,
"message": "success",
"data": "1840"
}
- 请求 URL:
/api/xcc_profiles/$id/params/$params_id
- 请求方式:
DELETE
- Body 信息:无
- 返回值:
{
"code": 200,
"data": "1840",
"message": "success"
}
- 请求 URL:
/api/xcc_profiles/$id
- 请求方式:
DELETE
- Body 信息:无
- 返回值:
{
"code": 200,
"data": "2",
"message": "success"
}