REST API文档

高级配置-模块配置

系统模块

参数说明
kFreeSWITCH 模块名称
disabled是否启用 0-启用 1-不启用
status状态 false-未运行 true-运行

查看系统模块

  • 请求 URL/api/modules
  • 请求方式GET
  • Body 信息:无
  • 返回值
[
	{
		"deleted_at": "",
		"updated_at": "2022-05-16 09:51:32",
		"v": "",
		"id": 79,
		"k": "mod_console",
		"created_at": "2022-05-16 09:51:32",
		"realm": "MODULES",
		"ref_id": 0,
		"disabled": 0
	},
	{
		"deleted_at": "",
		"updated_at": "2022-05-16 09:51:32",
		"v": "",
		"id": 80,
		"k": "mod_graylog2",
		"created_at": "2022-05-16 09:51:32",
		"realm": "MODULES",
		"ref_id": 0,
		"disabled": 1
	}
	...
]
  • curl 示例:
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/modules

新增系统模块

  • 请求 URL/api/modules
  • 请求方式POST
  • Body 信息
{
  "k": "mod_test",
  "disabled": "1"
}
  • curl 示例:
curl -POST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \
-d '{"k": "mod_test","disabled": "1"}' \
-H "Content-Type: application/json" http://192.168.1.100:8081/api/modules
  • 返回值
{
  "code": 200,
  "message": "success",
  "data": 1754
}

修改系统模块

  • 请求 URL/api/modules/$id
  • 请求方式PUT
  • Body 信息
{
  "k": "mod_testtwo"
}
  • curl 示例:
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{"k": "mod_testtwo"}' \
192.168.1.100:8081/api/modules/1754
  • 返回值
{
  "message": "success",
  "code": 200,
  "data": "1754"
}

删除系统模块

  • 请求 URL/api/modules/:id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "data": "1754",
  "message": "success",
  "code": 200
}

示例:

curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/modules/1754

XCC

查看 profile

  • 请求 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"
  }
]

查看 profile 的配置参数

  • 请求 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
}

创建 profile

  • 请求 URL/api/xcc_profiles
  • 请求方式POST
  • Body 信息
{
  "name": "test",
  "disabled": "0",
  "template": "default"
}
  • 返回值
{
  "message": "success",
  "code": 200,
  "data": "2"
}

修改 profile

  • 请求 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
}

在某个 profile 内的新增参数

  • 请求 URL/api/xcc_profiles/:id/params
  • 请求方式POST
  • Body 信息
{
  "k": "test",
  "v": "11",
  "realm": "XCC-CDR"
}
  • 返回值
{
  "message": "success",
  "code": 200,
  "data": "1840"
}

修改指定 profile 的参数配置

  • 请求 URL/api/xcc_profiles/:id/params/:param_id
  • 请求方式PUT
  • Body 信息
{
  "action": "toggle"
}

{
  "k": "test",
  "v": "true"
}
  • 返回值
{
  "code": 200,
  "message": "success",
  "data": "1840"
}

删除 profile 内的某个参数

  • 请求 URL/api/xcc_profiles/:id/params/:params_id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "code": 200,
  "data": "1840",
  "message": "success"
}

删除 profile

  • 请求 URL/api/xcc_profiles/:id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "code": 200,
  "data": "2",
  "message": "success"
}

XCC—RTC

查看 XCC-RTC 配置

  • 请求 URL/api/xcc_rtc
  • 请求方式GET
  • Body 信息:无
  • 返回值
[
  {
    "description": "default profile",
    "id": 1,
    "name": "default",
    "disabled": 0,
    "created_at": "2022-05-16 09:51:32",
    "deleted_at": "",
    "updated_at": "2022-05-16 09:51:32"
  }
]

查看 XCC-RTC 的配置参数

  • 请求 URL/api/xcc_rtc/:id
  • 请求方式GET
  • Body 信息:无
  • 返回值
{
	"deleted_at": "",
	"id": 1,
	"updated_at": "2022-05-16 09:51:32",
	"params": [
		{
			"updated_at": "2022-05-16 09:51:32",
			"deleted_at": "",
			"disabled": "0",
			"created_at": "2022-05-16 09:51:32",
			"id": "566",
			"ref_id": "1",
			"v": "$${domain}",
			"k": "force-register-domain",
			"realm": "XCC-RTC-DEFAULT"
		},
		{
			"updated_at": "2022-05-16 09:51:32",
			"deleted_at": "",
			"disabled": "0",
			"created_at": "2022-05-16 09:51:32",
			"id": "567",
			"ref_id": "1",
			"v": "true",
			"k": "userauth",
			"realm": "XCC-RTC-DEFAULT"
		}
		...
	],
	"name": "default",
	"disabled": 0,
	"created_at": "2022-05-16 09:51:32",
	"description": "default profile"
}

创建 XCC-RTC profile

  • 请求 URL/api/xcc_rtc
  • 请求方式POST
  • Body 信息
{
  "name": "test",
  "disabled": "0",
  "template": "default"
}
  • 返回值
{
  "message": "success",
  "data": "3",
  "code": 200
}

修改 XCC-RTC profile

  • 请求 URL/api/xcc_rtc/:id
  • 请求方式PUT
  • Body 信息
{
  "description": "default profile",
  "name": "default"
}
  • 返回值
{
  "code": 200,
  "data": "2",
  "message": "success"
}

创建 XCC-RTC 配置中 Default Profile

  • 请求 URL/api/xcc_rtc/:id/params
  • 请求方式POST
  • Body 信息
{
  "name": "test",
  "realm": "XCC-RTC-DEFAULT",
  "value": "test"
}
  • 返回值
{
  "code": 200,
  "message": "success",
  "data": "1877"
}

修改 XCC-RTC 配置中 Default Profile

  • 请求 URL/api/xcc_rtc/:id/params/:param_id
  • 请求方式PUT
  • Body 信息
{
  "action": "toggle"
}

{
  "k": "test",
  "v": "true"
}
  • 返回值
{
  "message": "success",
  "code": 200,
  "data": "2152"
}

启用/禁用 XCC-RTC 的 Setting 参数

  • 请求 URL/api/params/:param_id
  • 请求方式PUT
  • Body 信息
{
  "action": "toggle"
}
  • 返回值
{
  "code": 200,
  "message": "success",
  "data": "544"
}

删除 XCC-RTC 配置中 Default Profile

  • 请求 URL/api/xcc_rtc/:id/params/:params_id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "message": "success",
  "data": "2152",
  "code": 200
}

删除 XCC-RTCprofile

  • 请求 URL/api/xcc_rtc/:id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "code": 200,
  "data": "2",
  "message": "success"
}

微信小程序

查看微信小程序的 profile 列表

  • 请求 URL/api/wxapp_profiles
  • 请求方式GET
  • Body 信息:无
  • 返回值
[
  {
    "name": "wxapp",
    "created_at": "2022-05-16 09:51:32",
    "deleted_at": "",
    "disabled": 0,
    "description": "default",
    "updated_at": "2022-05-16 09:51:32",
    "id": 1
  }
]

查看 profile 的配置参数

  • 请求 URL/api/wxapp_profiles/:id
  • 请求方式GET
  • Body 信息:无
  • 返回值
{
	"disabled": 0,
	"deleted_at": "",
	"params": [
		{
			"ref_id": "1",
			"id": "704",
			"realm": "WX-APP",
			"disabled": "0",
			"deleted_at": "",
			"k": "context",
			"created_at": "2022-05-16 09:51:32",
			"updated_at": "2022-05-16 09:51:32",
			"v": "context-1"
		},
		{
			"ref_id": "1",
			"id": "705",
			"realm": "WX-APP",
			"disabled": "0",
			"deleted_at": "",
			"k": "use-auth",
			"created_at": "2022-05-16 09:51:32",
			"updated_at": "2022-05-16 09:51:32",
			"v": "true"
		}
		...
	],
	"id": 1,
	"description": "default",
	"created_at": "2022-05-16 09:51:32",
	"updated_at": "2022-05-16 09:51:32",
	"name": "wxapp"
}

创建微信小程序的 profile

  • 请求 URL/api/wxapp_profiles
  • 请求方式POST
  • Body 信息
参数说明
name名称
description描述
template模板
{
  "name": "test",
  "description": "测试",
  "template": "default"
}
  • 返回值
{
  "code": 200,
  "data": "2",
  "message": "success"
}

修改 profile 的名字或开关状态

  • 请求 URL/api/wxapp_profiles/:id
  • 请求方式PUT
  • Body 信息
参数说明
name名称
disabled是否启用,0 为启用,1 为不启用
{
  "name": "default"
}

{
  "disabled": "1"
}
  • 返回值
{
  "code": 200,
  "data": "2",
  "message": "success"
}

修改微信小程序的 profile 参数配置

  • 请求 URL/api/wxapp_profiles/:id/params/:param_id
  • 请求方式PUT
  • Body 信息
参数说明
v需要修改的参数内容
action变更启用状态,固定为"toggle"

修改参数内容:

{
  "v": "context-1"
}

变更参数启用状态:

{
  "action": "toggle"
}
  • 返回值
{
  "code": 200,
  "data": "1878",
  "message": "success"
}

删除 profile

  • 请求 URL/api/wxapp_profiles/:id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "code": 200,
  "data": "2",
  "message": "success"
}

EventSocket

查看 Socket 事件列表

  • 请求 URL/api/event_socket
  • 请求方式GET
  • Body 信息:无
  • 返回值
{
	"pageCount": 1,
	"rowCount": 8,
	"page": 1,
	"data": [
		{
			"id": 202,
			"updated_at": "2022-05-16 09:51:32",
			"v": "127.0.0.1",
			"ref_id": 0,
			"realm": "EVENT-SOCKET",
			"created_at": "2022-05-16 09:51:32",
			"disabled": 0,
			"deleted_at": "",
			"k": "listen-ip"
		},
		{
			"id": 203,
			"updated_at": "2022-05-16 09:51:32",
			"v": "1",
			"ref_id": 0,
			"realm": "EVENT-SOCKET",
			"created_at": "2022-05-16 09:51:32",
			"disabled": 1,
			"deleted_at": "",
			"k": "debug"
		}
		...
	]
}

创建 Socket 事件参数

  • 请求 URL/api/event_socket
  • 请求方式POST
  • Body 信息
参数说明
k参数名称
v参数内容
{
  "k": "test",
  "v": "test"
}
  • 返回值
{
  "code": 200,
  "message": "success",
  "data": 1889
}

启用/禁用 Socket 事件参数

  • 请求 URL/api/event_socket/:param_id
  • 请求方式PUT
  • Body 信息
参数说明
action变更启用状态,固定为"toggle"
{
  "action": "toggle"
}
  • 返回值
{
  "data": "1889",
  "code": 200,
  "message": "success"
}

修改 Socket 事件参数

  • 请求 URL/api/event_socket/:param_id
  • 请求方式PUT
  • Body 信息
参数说明
v要修改的参数内容
{
  "v": "test—11"
}
  • 返回值
{
  "code": 200,
  "message": "success",
  "data": "1889"
}

删除 profile

  • 请求 URL/api/event_socket/:param_id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "data": "1889",
  "code": 200,
  "message": "success"
}

XUI

查看 XUI 列表

  • 请求 URL/api/xui_profiles
  • 请求方式GET
  • Body 信息:无
  • 返回值
[
  {
    "id": 1,
    "description": "default",
    "created_at": "2022-05-16 09:51:32",
    "updated_at": "2022-05-16 09:51:32",
    "disabled": 0,
    "name": "xui",
    "deleted_at": ""
  }
]

查看指定 XUI 列表

  • 请求 URL/api/xui_profiles/:id
  • 请求方式GET
  • Body 信息:无
  • 返回值
{
	"description": "default",
	"created_at": "2022-05-16 09:51:32",
	"name": "xui",
	"params": [
		{
			"created_at": "2022-05-16 09:51:32",
			"realm": "XUI-SETTINGS",
			"v": "0",
			"k": "debug",
			"updated_at": "2022-05-16 09:51:32",
			"id": "721",
			"ref_id": "1",
			"deleted_at": "",
			"disabled": "0"
		}
		...
		[
			{
				"k": "CHANNEL_CREATE",
				"realm": "XUI-BINDINGS",
				"v": "",
				"o": "0",
				"updated_at": "2022-05-16 09:51:32",
				"created_at": "2022-05-16 09:51:32",
				"id": "13",
				"ref_id": "1",
				"deleted_at": "",
				"disabled": "0"
			}
			...
		]
	],
	"id": 1,
	"disabled": 0,
	"deleted_at": "",
	"updated_at": "2022-05-16 09:51:32"
}

创建 XUI 列表

  • 请求 URL/api/xui_profiles
  • 请求方式POST
  • Body 信息
参数说明
name名称
description描述
template模板
disabled是否启用,1 为不启用,0 为启用
{
  "disabled": "1",
  "name": "222",
  "template": "default",
  "description": "test"
}
  • 返回值
{
  "data": 2,
  "code": 200,
  "message": "success"
}

修改 XUI 列表名称或描述

  • 请求 URL/api/xui_profiles/:id
  • 请求方式PUT
  • Body 信息
参数说明
name名称
description描述
{
  "name": "test1",
  "description": "test1"
}
  • 返回值
{
  "code": 200,
  "data": "2",
  "message": "success"
}

启用/禁用 XUI 配置

  • 请求 URL/api/xui_profiles/toggle/:id
  • 请求方式PUT
  • Body 信息
参数说明
action变更启用状态,固定为"toggle"
{
  "action": "toggle"
}
  • 返回值
{
  "code": 200,
  "message": "success",
  "data": "2"
}

创建 XUI-SETTINGS 参数

  • 请求 URL/api/xui_profiles/:id/settings
  • 请求方式POST
  • Body 信息
参数说明
k参数名称
v参数内容
{
  "k": "test1",
  "v": "test1"
}
  • 返回值
{
  "data": 1896,
  "message": "success",
  "code": 200
}

修改 XUI-SETTINGS 参数

  • 请求 URL/api/xui_profiles/:id/settings/param_id
  • 请求方式PUT
  • Body 信息
参数说明
v要修改的参数内容
{
  "v": "test"
}
  • 返回值
{
  "data": "1896",
  "code": 200,
  "message": "success"
}

删除 XUI-SETTINGS 参数

  • 请求 URL/api/xui_profiles/:id/settings/param_id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "data": "1896",
  "code": 200,
  "message": "success"
}

创建 XUI-BINDINGS 参数

  • 请求 URL/api/xui_profiles/:id/bindings
  • 请求方式POST
  • Body 信息
参数说明
k参数名称
v参数内容
{
  "k": "test",
  "v": "999"
}
  • 返回值
{
  "message": "success",
  "data": 37,
  "code": 200
}

修改 XUI-BINDINGS 参数

  • 请求 URL/api/xui_profiles/:id/bindings/:param_id
  • 请求方式PUT
  • Body 信息
参数说明
v要修改的参数内容
{
  "v": "test"
}
  • 返回值
{
  "data": "37",
  "code": 200,
  "message": "success"
}

删除 XUI-BINDINGS 参数

  • 请求 URL/api/xui_profiles/:id/bindings/:param_id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "code": 200,
  "data": "37",
  "message": "success"
}

删除 profile

  • 请求 URL/api/xui_profiles/:id
  • 请求方式DELETE
  • Body 信息:无
  • 返回值
{
  "code": 200,
  "message": "success",
  "data": "2"
}

Verto

todo

UniMRCP

todo

高级配置-系统管理