REST API文档

会议设置

会议模版

信息说明如下:

参数说明
name名称
description描述

获取会议模版

  • 请求 URL: /api/conference_profiles 返回所有会议模版信息

  • 请求 URL: /api/conference_profiles/$id 返回指定 ID 的会议模版信息

  • 请求方式: GET

  • 返回值: 路由 JSON 对象,如果找不到会返回 HTTP 状态码404

  • curl 示例:

所有会议模版信息

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

返回:

[
  {
    "name": "example",
    "description": "conference profile",
    "disabled": "0",
    "created_at": "2022-05-12 17:45:19",
    "id": "1",
    "updated_at": "2022-05-12 17:45:19",
    "deleted_at": ""
  }
]
返回值说明
name会议模板名
disabled是否启动,0 启动,1 没启动

指定会议模版信息

curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/conference_profiles/1
{
	"params": [
		{
			"v": "auto",
			"deleted_at": "",
			"updated_at": "2023-03-01 01:18:57",
			"realm": "CONFERENCE",
			"k": "rate",
			"ref_id": 1,
			"disabled": 1,
			"id": 871,
			"created_at": "2023-03-01 01:18:57"
		},
		{
			...
		}
		{
			"v": "$${storage_dir}/recordings/conference-record-${conference_name}-${strftime(%Y-%m-%d-%H-%M-%S)}-${uuid}.wav",
			"deleted_at": "",
			"updated_at": "2023-03-01 01:18:58",
			"realm": "CONFERENCE",
			"k": "auto-record",
			"ref_id": 1,
			"disabled": 0,
			"id": 927,
			"created_at": "2023-03-01 01:18:58"
		}
	],
	"description": "conference profile",
	"id": 1,
	"deleted_at": "",
	"updated_at": "2023-03-01 01:18:54",
	"name": "example",
	"created_at": "2023-03-01 01:18:54",
	"disabled": 0
}
返回值说明
k会议模板中参数名
v会议模版参数对应的值
disabled会议模版参数是否启动,0 为启动,1 为不启动

新建会议模版

  • 请求 URL: /api/conference_profiles
  • 请求方式: POST
  • 消息头: Content-Type: application/json
  • Body 信息: 参见信息说明。
参数说明
name名称
template模板

Body:

{
  "name": "yyy",
  "description": "111",
  "template": "default"
}

返回:

{
  "data": 2,
  "message": "success",
  "code": 200
}
  • curl 示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \
-d '{"name": "mux","template": "default"}' \
-H "Content-Type: application/json" http://192.168.1.100:8081/api/conference_profiles

删除会议模版

  • 请求 URL: /api/conference_profiles/$id
  • 请求方式: DELETE
  • 消息头: 无
  • 返回值:
状态返回值
成功"code": 200
失败404
  • 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE http://192.168.1.100:8081/api/conference_profiles/3

返回:

{
  "code": 200,
  "data": "3",
  "message": "success"
}

修改会议模版

  • 请求 URL: /api/conference_profiles/$id
  • 请求方式: PUT
  • 消息头: Content-Type: application/json
  • Body 信息: 参见信息说明。

信息说明如下:

参数说明
name名称
template模板
  • 示例:

Body:

{
  "name": "xyt"
}
  • curl 示例:
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{"name": "xyt"}' \
http://192.168.1.100:8081/api/conference_profiles/5

返回:

{
  "data": "5",
  "code": 200,
  "message": "success"
}

修改会议模板参数

  • 请求 URL: /api/conference_profiles/$id/params/$param_id
  • 请求方式: PUT
  • 消息头: Content-Type: application/json
  • Body 信息: 参见信息说明。
  • 示例:

信息说明:

参数说明
k参数名称
v参数对应的值
disabled0 启用 1 禁用

Body:

{
  "k": "announce-count",
  "v": "3",
  "disabled": 0
}
  • curl 示例:
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{"k": "announce-count","v": "3"}' \
http://192.168.1.100:8081/api/conference_profiles/5/params/1676

返回:

{
  "message": "success",
  "data": "1676",
  "code": 200
}

按键控制

信息说明如下:

参数说明
name名称
description描述
params{digits, ffunction_type}digits:按键数 function_type:执行动作

function_type可选参数及说明如下:

参数说明
mute音频开启/静音切换
mute on静音
mute off解除静音
vmute视频开启/关闭切换
vmute on开启视频
vmute off关闭视频
deaf mute禁止说/听
energy up增加阈值(噪音门)
energy dn降低阈值(噪音门)
energy equ阈值重置为默认值
vol talk up提高讲话音量
vol talk zero讲话音量设置为0
vol talk dn降低讲话音量
vol listen up提高收听音量
vol listen zero收听音量设置为0
vol listen dn降低收听音量
hangup挂断
event发送DTMF事件
lock锁定会议
transfer转移到其他路由
execute_application执行其他APP
floor开启/关闭语音floor
vid-floor开启/关闭视频floor
vid-floor-force锁定/取消锁定floor

获取会议按键控制

  • 请求 URL: /api/controls 返回所有按键控制信息

  • 请求 URL: /api/controls/$id 返回指定 ID 的按键控制信息

  • 请求方式: GET

  • 返回值: 路由 JSON 对象,如果找不到会返回 HTTP 状态码404

  • curl 示例:

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

返回:

[
  {
    "id": 1,
    "deleted_at": "",
    "description": "moderator-controls",
    "created_at": "2023-03-01 01:18:54",
    "updated_at": "2023-03-01 01:18:54",
    "name": "moderator"
  },
  {
    "id": 2,
    "deleted_at": "",
    "description": "caller-controls",
    "created_at": "2023-03-01 01:18:54",
    "updated_at": "2023-03-01 01:18:54",
    "name": "caller"
  }
]

查询指定按键控制信息

信息说明如下:

参数说明
control_id按键控制 id
function_type执行动作
digits按键数
value动作对应值
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/controls/1

返回:

{
  "params": [
    {
      "deleted_at": "",
      "updated_at": "2023-03-01 01:18:54",
      "created_at": "2023-03-01 01:18:54",
      "control_id": 1,
      "value": "",
      "function_type": "mute",
      "id": 13,
      "digits": "1"
    },
    {
      "deleted_at": "",
      "updated_at": "2023-03-01 01:18:54",
      "created_at": "2023-03-01 01:18:54",
      "control_id": 1,
      "value": "",
      "function_type": "vmute on",
      "id": 15,
      "digits": "2"
    }
  ],
  "name": "moderator",
  "updated_at": "2023-03-01 01:18:54",
  "deleted_at": "",
  "description": "moderator-controls",
  "id": 1,
  "created_at": "2023-03-01 01:18:54"
}

新建按键控制

  • 请求 URL: /api/controls
  • 请求方式: POST
  • 消息头: Content-Type: application/json
  • Body 信息: 参见信息说明。

信息说明如下:

参数说明
name按键控制名称
description描述

Body:

{
  "name": "admin",
  "description": ""
}
  • curl 示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \
-d '{"name": "admin","description": ""}' \
-H "Content-Type: application/json" http://192.168.1.100:8081/api/controls

返回:

{
  "message": "success",
  "data": 4,
  "code": 200
}

新建按键控制中参数

  • 请求 URL: /api/controls/$id/params
  • 请求方式: POST
  • 消息头: Content-Type: application/json
  • Body 信息: 参见信息说明。

信息说明如下:

参数说明
function_type执行动作
digits按键数
value动作对应值

Body:

{
  "digits": "2",
  "function_type": "muto off"
}
  • curl 示例:
curl -XPOST -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \
-d '{"digits": "2","function_type": "muto off"}' \
-H "Content-Type: application/json" http://192.168.1.100:8081/api/controls/1/params

返回:

{
  "data": 50,
  "message": "success",
  "code": 200
}

修改按键控制

  • 请求 URL: /api/controls/$id

  • 请求方式: PUT

  • 消息头: Content-Type: application/json

  • Body 信息: 参见信息说明。

  • 示例:

Body:

{
  "name": "xyt"
}
  • curl 示例:
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{"name": "xyt"}' \
http://192.168.1.100:8081/api/controls/3

返回:

{
  "code": 200,
  "message": "success",
  "data": "3"
}

修改按键控制中参数信息

  • 请求 URL: /api/controls/$control_id/params/$id
  • 请求方式: PUT
  • 消息头: Content-Type: application/json
  • Body 信息: 参见信息说明。

信息说明如下:

参数说明
control_id会议按键控制 id
function_type执行动作
digits按键数
value动作对应值
  • 示例:

Body:

{
  "digits": "4",
  "function_type": "muto off"
}
  • curl 示例:
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{"digits": "4", "function_type": "muto off"}' \
http://192.168.1.100:8081/api/controls/1/params/50

返回:

{
  "code": 200,
  "message": "success",
  "data": "50"
}

删除指定按键控制

  • 请求 URL: /api/controls/$id
  • 请求方式: DELETE
  • 消息头: 无
  • 返回值:
状态返回值
成功"code": 200
失败404
  • 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE http://192.168.1.100:8081/api/controls/3

返回:

{
  "code": 200,
  "message": "success",
  "data": "3"
}

删除按键控制中指定参数

  • 请求 URL: /api/controls/$control_id/params/$id
  • 请求方式: DELETE
  • 消息头: 无
  • 返回值:
状态返回值
成功"code": 200
失败404
  • 示例:
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE http://192.168.1.100:8081/api/controls/1/params/21

返回:

{
  "message": "success",
  "data": "50",
  "code": 200
}

预约会议

会议参数说明如下

参数说明
name名称
description描述
start_date开始日期
end_date结束日期
nbr会议号-自动生成
short_nbr会议短号-已弃用
capacity容量-默认 5
realm域名(无须创建)
pin与会者密码
admin_pin管理员密码
listener_pin旁听者密码
profile_id会议模版 id
moderator会议创建人(无须创建)
recurrent_meeting0 关闭周期性会议,1 开启每日会议,2 开启每周会议,3 开启每月会议
call_perm呼叫权限,CONF_CP_CHECK_CID:检查主叫号码 ;CONF_CP_AUTH_USER:只允许认证用户呼入 默认所有人均可呼入
push_streaming推流地址
banner字幕相关信息
meeting_flag会议状态, 0 会议未开始 1 会议进行中 2 会议取消 3 会议已结束
user_id会议创建人 ID
helpers_user_id会议辅助者
helpers_user_name会议辅助者名称
auto_dial是否自动外呼,0 不开启 1 开启自动外呼,暂时不启用该功能
auto_mute入会自动静音,0 不静音; 1 静音

查看预约会议-我发起的会议列表

  • 请求 URL/api/meetings/user_id
  • 请求方式GET
  • 返回值:code,msg
  • curl 示例
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/user_id
  • 返回(示例)
{
  "page": 1,
  "pageCount": 1,
  "data": [
    {
      "end_date": "2023-03-01 04:18:54",
      "nbr": "715834449",
      "created_at": "2023-03-01 01:18:54",
      "short_nbr": "",
      "name": "测试会议",
      "profile_id": "1",
      "pin": "",
      "id": "1",
      "call_perm": "",
      "admin_pin": "",
      "deleted_at": "",
      "push_streaming": "",
      "capacity": "10",
      "moderator": "",
      "banner": {
        "text": "",
        "bgColor": "#000000",
        "fontFace": "/usr/local/freeswitch/fonts/SimHei.ttf",
        "fgColor": "#FFFFFF",
        "fontScale": "2"
      },
      "description": "Test Meeting",
      "auto_mute": "0",
      "auto_dial": "0",
      "realm": "xswitch.cn",
      "helpers_user_name": "",
      "helpers_user_id": "",
      "user_id": "1",
      "meeting_flag": "0",
      "listener_pin": "",
      "updated_at": "2023-03-01 01:18:54",
      "recurrent_meeting": "1",
      "start_date": "2023-03-01 01:18:54"
    }
  ],
  "rowCount": 1
}

查看预约会议-某个用户发起的会议列表

  • 请求 URL/api/meetings/user_id/$user_id
  • 请求方式GET
  • 返回值:code,msg
  • curl 示例
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/user_id/4

$user_id为用户ID,可通过查看用户获取用户ID。

  • 返回(示例)
{
    "page": 1,
    "rowCount": 1,
    "data": [
        {
            "name": "会议测试2",
            "listener_pin": "123456",
            "description": "测试2",
            "realm": "192.168.31.99",
            "end_date": "2025-03-03 15:30:39",
            "nbr": "717047403",
            "helpers_user_name": "",
            "short_nbr": "",
            "updated_at": "2024-07-18 07:39:05",
            "profile_id": "1",
            "admin_pin": "123",
            "moderator": "1002",
            "id": "11",
            "start_date": "2025-03-03 14:59:39",
            "auto_dial": "0",
            "capacity": "100",
            "banner": {
                "text": "${caller_id_name}${caller_id_number}",
                "fontScale": "1",
                "bgColor": "#d31d1d",
                "fgColor": "#d4cece"
            },
            "pin": "12345",
            "helpers_user_id": "2",
            "auto_mute": "0",
            "deleted_at": "",
            "push_streaming": "",
            "recurrent_meeting": "0",
            "meeting_flag": "0",
            "call_perm": "CONF_CP_CHECK_CID",
            "user_id": "4",
            "created_at": "2024-07-18 07:39:05"
        }
    ],
    "pageCount": 1
}

查看预约会议-我参与的会议列表

  • 请求 URL/api/meetings/attend/meetings
  • 请求方式GET
  • 返回值:code,msg
  • curl 示例
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/attend/meetings
  • 返回(示例)
{
  "page": 1,
  "rowCount": 1,
  "data": [
    {
      "description": "Test Meeting",
      "admin_pin": "",
      "realm": "xswitch.cn",
      "profile_id": "1",
      "recurrent_meeting": "1",
      "moderator": "",
      "updated_at": "2022-12-19 00:56:10",
      "auto_dial": "0",
      "pin": "",
      "created_at": "2022-12-19 00:56:10",
      "start_date": "2022-12-19 00:56:10",
      "nbr": "714950973",
      "helpers_user_name": "",
      "helpers_user_id": "",
      "deleted_at": "",
      "id": "1",
      "call_perm": "",
      "name": "测试会议",
      "short_nbr": "3000",
      "capacity": "10",
      "banner": {
        "fgColor": "#FFFFFF",
        "text": "",
        "fontScale": "2",
        "bgColor": "#000000",
        "fontFace": "/usr/local/freeswitch/fonts/SimHei.ttf"
      },
      "push_streaming": "",
      "user_id": "1",
      "end_date": "2022-12-19 03:56:10",
      "listener_pin": "",
      "meeting_flag": "0"
    }
  ],
  "pageCount": 1
}

查看预约会议-某个用户参与的会议列表

  • 请求 URL/api/meetings/attend/meetings/$user_id
  • 请求方式GET
  • 返回值:code,msg
  • curl 示例
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/attend/meetings/4

$user_id为用户ID,可通过查看用户获取用户ID。

  • 返回(示例)
{
    "page": 1,
    "pageCount": 1,
    "rowCount": 1,
    "data": [
        {
            "description": "",
            "name": "test2",
            "admin_pin": "",
            "call_perm": "",
            "id": "13",
            "push_streaming": "",
            "short_nbr": "",
            "capacity": "5",
            "listener_pin": "",
            "auto_dial": "0",
            "updated_at": "2024-07-18 07:55:29",
            "end_date": "2024-07-18 16:25:19",
            "moderator": "admin",
            "recurrent_meeting": "0",
            "nbr": "717000043",
            "created_at": "2024-07-18 07:55:29",
            "auto_mute": "0",
            "user_id": "1",
            "deleted_at": "",
            "helpers_user_name": "",
            "helpers_user_id": "2",
            "meeting_flag": "0",
            "banner": {
                "bgColor": "#000000",
                "fontFace": "/usr/local/freeswitch/fonts/SimHei.ttf",
                "fgColor": "#FFFFFF",
                "fontScale": "2",
                "text": ""
            },
            "start_date": "2024-07-18 15:55:19",
            "pin": "",
            "realm": "192.168.31.99",
            "profile_id": "1"
        }
    ]
}

查看预约会议-某个辅助者参与的会议列表

  • 请求 URL/api/meetings/helpers_user/history/meetings/$helpers_user_id
  • 请求方式GET
  • 返回值:code,msg
  • curl 示例
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/helpers_user/history/meetings/6

$helpers_user_id为用户ID,可通过查看用户获取用户ID。

  • 返回(示例)
{
    "pageCount": 1,
    "rowCount": 1,
    "data": [
        {
            "push_streaming": "",
            "nbr": "717000043",
            "name": "test2",
            "id": "13",
            "profile_id": "1",
            "start_date": "2024-07-18 15:55:19",
            "recurrent_meeting_id": "",
            "pin": "",
            "helpers_user_id": "6",
            "user_id": "1",
            "call_perm": "",
            "admin_pin": "",
            "moderator": "admin",
            "meeting_flag": "3",
            "end_date": "2024-07-18 17:00:19",
            "capacity": "5",
            "description": "",
            "short_nbr": "",
            "realm": "192.168.31.99",
            "banner": "",
            "recurrent_meeting": "0"
        }
    ],
    "page": 1
}

查看指定 ID 预约会议列表

  • 请求 URL/api/meetings/$id
  • 请求方式GET
  • 返回值:code,msg
  • curl 示例
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/2
  • 返回(示例)
{
  "listener_pin": "",
  "profile_id": 1,
  "short_nbr": "",
  "banner": {
    "bgColor": "#000000",
    "fontScale": "2",
    "text": "",
    "fgColor": "#FFFFFF",
    "fontFace": "/usr/local/freeswitch/fonts/SimHei.ttf"
  },
  "user_id": 1,
  "id": 2,
  "deleted_at": "",
  "push_streaming": "",
  "admin_pin": "",
  "recurrent_meeting": 0,
  "pin": "",
  "created_at": "2023-03-02 01:25:21",
  "auto_mute": 0,
  "start_date": "2023-03-02 09:25:11",
  "meeting_flag": 0,
  "auto_dial": 0,
  "nbr": "716615260",
  "helpers_user_name": "",
  "moderator": "admin",
  "call_perm": "",
  "helpers_user_id": "",
  "end_date": "2023-03-02 09:55:11",
  "updated_at": "2023-03-02 01:25:21",
  "realm": "xswitch.cn",
  "description": "",
  "capacity": 5,
  "name": "977"
}

查看指定预约会议下预约成员列表

  • 请求 URL/api/meetings/$id/members
  • 请求方式GET
  • 返回值:code,msg
返回值说明内部参数说明
users用户user_id: 用户 id;name: 用户名;num: 号码
contacts联系人phone: 联系人号码; name: 名称
external外部人员phone: 联系人号码; name: 名称
userGroup用户组user_id: 用户 id;name: 用户名;num: 号码;group_id: 组 id;group_name:组名
meeting_group_users按组添加group_name: 组名;login: 用户名;num: 号码;group_id: 组 id
  • curl 示例
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/36/members
  • 返回(示例)
{
  "users": [
    {
      "meeting_id": "3",
      "name": "1001",
      "created_at": "2023-03-02 05:54:16",
      "description": "",
      "deleted_at": "",
      "call_num": "",
      "attend_type": "",
      "user_id": "3",
      "type": "users",
      "sort": "",
      "updated_at": "2023-03-02 05:54:16",
      "disabled": "1",
      "group_id": "",
      "id": "1",
      "num": "1001"
    }
  ],
  "userGroup": [
    {
      "meeting_id": "3",
      "name": "1004",
      "created_at": "2023-03-02 05:54:16",
      "call_num": "",
      "description": "",
      "deleted_at": "",
      "group_name": "test",
      "attend_type": "",
      "user_id": "6",
      "type": "userGroup",
      "sort": "",
      "updated_at": "2023-03-02 05:54:16",
      "disabled": "1",
      "group_id": "2",
      "id": "3",
      "num": "1004"
    },
    {
      "meeting_id": "3",
      "name": "1005",
      "created_at": "2023-03-02 05:54:16",
      "call_num": "",
      "description": "",
      "deleted_at": "",
      "group_name": "test",
      "attend_type": "",
      "user_id": "7",
      "type": "userGroup",
      "sort": "",
      "updated_at": "2023-03-02 05:54:16",
      "disabled": "1",
      "group_id": "2",
      "id": "4",
      "num": "1005"
    }
  ],
  "contacts": [
    {
      "meeting_id": "3",
      "name": "张三",
      "created_at": "2023-03-02 05:54:16",
      "phone": "124567777777",
      "description": "",
      "deleted_at": "",
      "call_num": "",
      "attend_type": "",
      "user_id": "1",
      "type": "contacts",
      "sort": "",
      "updated_at": "2023-03-02 05:54:16",
      "disabled": "1",
      "group_id": "",
      "id": "5"
    }
  ],
  "external": [
    {
      "meeting_id": "3",
      "name": "lily",
      "created_at": "2023-03-02 05:54:16",
      "phone": "1567709966",
      "description": "",
      "deleted_at": "",
      "call_num": "",
      "attend_type": "",
      "user_id": "",
      "type": "external",
      "sort": "",
      "updated_at": "2023-03-02 05:54:16",
      "disabled": "1",
      "group_id": "",
      "id": "6"
    }
  ],
  "meeting_group_users": [
    {
      "login": "1004",
      "group_name": "test",
      "domain": "xswitch.cn",
      "name": "1004",
      "group_id": "2",
      "id": "6",
      "num": "1004"
    },
    {
      "login": "1005",
      "group_name": "test",
      "domain": "xswitch.cn",
      "name": "1005",
      "group_id": "2",
      "id": "7",
      "num": "1005"
    }
  ]
}

创建预约会议

信息说明如下:

参数示例描述可选值
name技术研讨会议名称
start_date"2022-05-23 16:37:44"开始时间
end_date"2022-05-23 17:07:44"结束时间
description临时例会描述
recurrent_meeting1周期性会议0:普通会议,1:每天,2:每周,3:每月
user2,8参会者
helpers_user_id4辅助者 id
profile_id1会议模板 id
groups2按组添加,填写组 id
pin789普通用户密码
admin_pin123管理员密码
listener_pin1234旁听者密码
capacity500会议容量
call_perm呼叫权限,CONF_CP_CHECK_CID:检查主叫号码 ;CONF_CP_AUTH_USER:只允许认证用户呼入 默认所有人均可呼入
bgColor#000000背景颜色
fgColor#000000字幕颜色
text欢迎字幕
fontScale1字幕大小
media_file媒体文件
auto_mute0默认不静音

user 字段说明:

参数示例描述说明
name1000参会者名称            
extn1000参会者号码若 inviteType 为 users 或 userGroup 时,此值必填
id2用户 id
inviteTypeusers参会者类型users-用户,contacts-联系人,external-外部人员(如果)如果为 contacts 或 external 等外部人员,需要额外添加 phone 字段;userGroup-用组
attend_typeadmin参会者类型参会者类型,admin 管理员,attendees 参会者,listener 旁听者
phone18888888888参会者号码若 inviteType 为 contacts 或 external 时,此值必填

groups内的id表示组IDmedia_file内的id表示媒体文件ID

  • 请求 URL/api/meetings
  • 请求方式POST
  • 消息头: Content-Type: application/json

body:

{
  "start_date": "2022-03-3 14:59:39",
  "end_date": "2023-03-3 15:30:39",
  "helpers_user_id": "2",
  "name": "会议测试",
  "recurrent_meeting": 0,
  "capacity": 100,
  "call_perm": "CONF_CP_CHECK_CID",
  "profile_id": "1",
  "description": "测试",
  "admin_pin": "123",
  "pin": "12345",
  "listener_pin": "123456",
  "banner": "{\"fontScale\":\"1\",\"bgColor\":\"#d31d1d\",\"fgColor\":\"#d4cece\",\"text\":\"${caller_id_name}${caller_id_number}\"}",
  "user": [
    {
      "name": "1000",
      "extn": "1000",
      "id": 2,
      "inviteType": "users",
      "attend_type": "admin"
    },
    {
      "name": "张三",
      "phone": "15666091234",
      "inviteType": "contact",
      "attend_type": "listener"
    },
    {
      "name": "李四",
      "phone": "15666091234",
      "inviteType": "external"
    }
  ],
  "media_file": [
    {
      "id": 206
    }
  ]
}
  • 返回(示例)
{
  "code": 200,
  "data": 36,
  "message": "success"
}

修改预约会议

  • 请求 URL/api/meetings/$id
  • 请求方式PUT
  • 消息头: Content-Type: application/json
  • body 字段:字段说明请参考创建预约会议信息说明,实例如下

body:

{
  "end_date": "2022-05-24 15:30:39",
  "helpers_user_id": "2",
  "name": "临时",
  "profile_id": "1",
  "recurrent_meeting": 0,
  "short_nbr": "3000",
  "start_date": "2022-05-24 14:59:39",
  "description": "test"
}
  • 返回(示例)
{
  "code": 200,
  "data": "6",
  "message": "success"
}

取消预约会议

  • 请求 URL/api/meetings/cancel_meeting/$id
  • 请求方式PUT
  • 消息头: Content-Type: application/json
  • body 字段:字段说明请参考创建预约会议信息说明,实例如下
参数说明
meeting_flag0 会议未开始 1 会议进行中 2 会议取消 3 会议已结束

body:

{
  "meeting_flag": "2"
}
  • 返回(示例)
{
  "message": "success",
  "code": 200,
  "data": "33"
}

查看历史会议

  • 请求 URL/api/meetings/history/meetings
  • 请求方式GET
  • 返回值:code,msg
  • curl 示例
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/history/meetings
  • 返回(示例)
{
  "page": 1,
  "data": [
    {
      "name": "临时",
      "recurrent_meeting": "0",
      "nbr": "716706358",
      "user_id": "1",
      "short_nbr": "",
      "admin_pin": "123",
      "meeting_flag": "2",
      "description": "test",
      "helpers_user_id": "2",
      "banner": "{\"text\": \"${caller_id_name}${caller_id_number}\", \"bgColor\": \"#d31d1d\", \"fgColor\": \"#d4cece\", \"fontScale\": \"1\"}",
      "recurrent_meeting_id": "",
      "end_date": "2023-05-24 15:30:39",
      "realm": "xswitch.cn",
      "start_date": "2023-05-24 14:59:39",
      "pin": "12345",
      "capacity": "100",
      "id": "8",
      "push_streaming": "",
      "profile_id": "1",
      "call_perm": "CONF_CP_CHECK_CID",
      "moderator": "admin"
    }
  ],
  "rowCount": 1,
  "pageCount": 1
}

获取临时会议号码

该接口会返回一个72开头的9位纯数字号码。

  • 请求 URL/api/meetings/immediate_meeting
  • 请求方式GET
  • 返回值:code,msg
  • curl 示例
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/immediate_meeting
  • 返回(示例)
722458261

分享会议

  • 请求 URL/api/meetings/$id/share_meeting
  • 请求方式GET
  • 返回值:code,msg
  • curl 示例
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/13/share_meeting
  • 返回(示例)
{
    "data": "Admin 邀请您参加XSwitch会议\n会议主题:test2\n主题描述:\n会议时间:2024-07-18 15:55:19 至 2024-07-18 17:00:19(GMT+08:00) 中国标准时间 - 北京\n会议类型:普通会议\n\n会议号码:717000043\n会议短号:\n内部分机一键拨号入会:717000043\n"
}

查看某个预约会议所用的媒体文件

  • 请求 URL/api/meetings/$id/media_files
  • 请求方式GET
  • 返回值:code,msg
  • curl 示例
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/4/media_files

$id为预约会议ID。

  • 返回(示例)
[
    {
        "rel_path": "conference-record-717027108-192.168.31.99-2024-07-22-14-31-20-2d3eaa3b-b79e-4d41-9c00-d3a8200209ab.mp4",
        "processing_flag": 0,
        "geo_position": "",
        "description": "717027108-192.168.31.99",
        "file_name": "",
        "abs_path": "/usr/local/freeswitch/storage/recordings/conference-record-717027108-192.168.31.99-2024-07-22-14-31-20-2d3eaa3b-b79e-4d41-9c00-d3a8200209ab.mp4",
        "type": "RECORD",
        "name": "717027108-192.168.31.99",
        "thumb_path": "",
        "meta": "",
        "created_at": "2024-07-22 14:31:22",
        "updated_at": "2024-07-22 14:31:22",
        "ext": "mp4",
        "deleted_at": "",
        "mime": "video/mp4",
        "channel_uuid": "25ceaece-e0af-4428-9d87-a6a5f292fadc",
        "original_file_name": "conference-record-717027108-192.168.31.99-2024-07-22-14-31-20-2d3eaa3b-b79e-4d41-9c00-d3a8200209ab.mp4",
        "dir_path": "/usr/local/freeswitch/storage/recordings/${strftime(%Y-%m)}",
        "file_size": 8683,
        "id": 640
    }
]

给某个预约会议内播放指定的媒体文件

媒体文件类型支持mp3wavmp4png,若播放png,则播放时长为30秒。

  • 请求 URL/api/meetings/$id/play_media_file/$mfile_id
  • 请求方式POST
  • 消息头Content-Type: application/json
  • Body信息:NULL
  • curl 示例
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/4/play_media_file/641

$id为预约会议ID,$mfile_id为媒体文件ID。

  • 返回(示例)
{
    "code": 200,
    "data": "641",
    "message": "success"
}

请保证调用此接口前,已有会议成员成功进入预约会议内。非预约会议无法调用此接口向会议内播放媒体文件。

停止给某个预约会议内播放指定的媒体文件

  • 请求 URL/api/meetings/$id/stop_media_file/$mfile_id
  • 请求方式POST
  • 消息头Content-Type: application/json
  • Body信息:NULL
  • curl 示例
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/4/stop_media_file/641

$id为预约会议ID,$mfile_id为媒体文件ID。

  • 返回(示例)
{
    "code": 200,
    "data": "641",
    "message": "success"
}

请保证调用此接口前,已有会议成员成功进入预约会议内。非预约会议无法调用此接口向会议内播放媒体文件。

停止给某个预约会议内播放所有媒体文件

  • 请求 URL/api/meetings/$id/stop_all_media_file
  • 请求方式POST
  • 消息头Content-Type: application/json
  • Body信息:NULL
  • curl 示例
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/4/stop_all_media_file/641

$id为预约会议ID。

  • 返回(示例)
{
    "data": "4",
    "code": 200,
    "message": "success"
}

请保证调用此接口前,已有会议成员成功进入预约会议内。非预约会议无法调用此接口向会议内播放媒体文件。

给某个预约会议设置背景图片

媒体文件类型仅支持png

  • 请求 URL/api/meetings/$id/play_bgimg_file/$mfile_id
  • 请求方式POST
  • 消息头Content-Type: application/json
  • Body信息:NULL
  • curl 示例
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/4/play_bgimg_file/648

$id为预约会议ID,$mfile_id为媒体文件ID。

  • 返回(示例)
{
    "code": 200,
    "data": "648",
    "message": "success"
}

请保证调用此接口前,已有会议成员成功进入预约会议内。非预约会议无法调用此接口向会议内设置背景图片。

清除某个预约会议内的背景图片

  • 请求 URL/api/meetings/$id/stop_bgimg_file/$mfile_id
  • 请求方式POST
  • 消息头Content-Type: application/json
  • Body信息:NULL
  • curl 示例
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/4/stop_bgimg_file/648

$id为预约会议ID,$mfile_id为媒体文件ID。

  • 返回(示例)
{
    "code": 200,
    "data": "648",
    "message": "success"
}

请保证调用此接口前,已有会议成员成功进入预约会议内。非预约会议无法调用此接口向会议内播放媒体文件。

给某个预约会议设置前景图片

媒体文件类型仅支持png

  • 请求 URL/api/meetings/$id/play_fgimg_file/$mfile_id
  • 请求方式POST
  • 消息头Content-Type: application/json
  • Body信息:NULL
  • curl 示例
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/4/play_fgimg_file/648

$id为预约会议ID,$mfile_id为媒体文件ID。

  • 返回(示例)
{
    "code": 200,
    "data": "648",
    "message": "success"
}

请保证调用此接口前,已有会议成员成功进入预约会议内。非预约会议无法调用此接口向会议内设置背景图片。

清除某个预约会议内的前景图片

  • 请求 URL/api/meetings/$id/stop_fgimg_file/$mfile_id
  • 请求方式POST
  • 消息头Content-Type: application/json
  • Body信息:NULL
  • curl 示例
curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/meetings/4/stop_fgimg_file/648

$id为预约会议ID,$mfile_id为媒体文件ID。

  • 返回(示例)
{
    "code": 200,
    "data": "648",
    "message": "success"
}

请保证调用此接口前,已有会议成员成功进入预约会议内。非预约会议无法调用此接口向会议内播放媒体文件。

会议室

信息说明如下:

会议参数说明如下

参数说明
name名称
description描述
start_date开始日期
end_date结束日期
nbr会议号,可自行设置
capacity容量-默认 5
realm域名(无须创建)
fps帧率
bandwidth带宽
pin与会者密码
admin_pin管理员密码
profile_id会议模版 id
moderator会议创建人(无须创建)
canvas_count画布个数
video_mode视频模式
call_perm呼叫权限,CONF_CP_CHECK_CID:检查主叫号码 ;CONF_CP_AUTH_USER:只允许认证用户呼入 默认所有人均可呼入
push_streaming推流地址
banner字幕相关信息
user_id会议创建人 ID
auto_mute入会自动静音,0 不静音; 1 静音

查看所有会议室

  • 请求 URL: /api/conference_rooms 返回所有会议室
  • 请求方式: GET
  • 返回信息: 参见会议室信息说明。
  • curl 示例
curl -H  "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe"  192.168.1.100:8081/api/conference_rooms
  • 返回(示例)
{
  "data": [
    {
      "admin_pin": "1234",
      "video_mode": "CONF_VIDEO_MODE_MUX",
      "moderator": "",
      "updated_at": "2023-03-01 06:24:43",
      "description": "Test Conference Room #2",
      "user_id": "",
      "capacity": "10",
      "bandwidth": "1mb",
      "push_streaming": "",
      "pin": "123",
      "profile_id": "1",
      "fps": "15",
      "cluster": [],
      "canvas_count": "1",
      "banner": "{\"bgColor\": \"#000000\", \"fgColor\": \"#FFFFFF\", \"fontFace\": \"/usr/local/freeswitch/fonts/SimHei.ttf\", \"fontScale\": \"2\"}",
      "realm": "xswitch.cn",
      "call_perm": "",
      "deleted_at": "",
      "created_at": "2023-03-01 01:18:54",
      "auto_mute": "0",
      "nbr": "3800",
      "name": "3800",
      "id": "3"
    }
  ],
  "rowCount": 1,
  "pageCount": 1,
  "page": 1
}

查看会议室与会者列表

  • 请求 URL/api/conference_rooms/$id/members
  • 请求方式GET
  • curl 示例
curl -H  "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe"  192.168.1.100:8081/api/conference_rooms/2/members
  • 返回(示例)
[
  {
    "sort": "1",
    "description": "",
    "id": "1",
    "disabled": "1",
    "user_id": "",
    "type": "USER",
    "num": "15666666",
    "route": "",
    "group_id": "-1",
    "group_name": "",
    "name": "156776666",
    "room_id": "2"
  },
  {
    "sort": "2",
    "description": "",
    "id": "3",
    "disabled": "1",
    "user_id": "7",
    "type": "NORMAL",
    "num": "1005",
    "route": "",
    "group_id": "2",
    "group_name": "test",
    "name": "1005",
    "room_id": "2"
  }
]

返回参数说明

参数说明
user_id用户 id
group_id所在组 id 如果 id 为-1 表示未分组成员,比如外部成员
name用户名
num号码

创建会议室

参数说明如下:

参数示例描述可选值
name3000会议名称
description临时例会描述
profile_id1会议模板 id
pin789普通用户密码
admin_pin123管理员密码
capacity10会议容量
canvas_count1一个画布
bandwidth1mb带宽
fps15帧率
call_perm呼叫权限,CONF_CP_CHECK_CID:检查主叫号码 ;CONF_CP_AUTH_USER:只允许认证用户呼入 默认所有人均可呼入
auto_mute0默认不静音
  • 请求 URL/api/conference_rooms
  • 请求方式POST
  • 消息头: Content-Type: application/json

body:

{
  "name": "3000",
  "nbr": "3000",
  "profile_id": "1",
  "realm": "xswitch.cn",
  "canvas_count": "1",
  "capacity": "10",
  "bandwidth": "1mb",
  "fps": "15",
  "video_mode": "CONF_VIDEO_MODE_MUX"
}
  • 返回(示例)
{
  "capacity": 10,
  "description": "",
  "canvas_count": 1,
  "profile_id": 1,
  "nbr": "3000",
  "realm": "xswitch.cn",
  "bandwidth": "1mb",
  "admin_pin": "",
  "id": 5,
  "cluster": "",
  "pin": "",
  "created_at": "2023-03-02 08:54:30",
  "updated_at": "2023-03-02 08:54:30",
  "moderator": "",
  "fps": "15",
  "call_perm": "",
  "deleted_at": "",
  "push_streaming": "",
  "user_id": 0,
  "banner": "",
  "auto_mute": 0,
  "name": "3000",
  "video_mode": "CONF_VIDEO_MODE_MUX"
}

添加指定会议室与会者

  • 请求 URL/api/conference_rooms/$id/members
  • 请求方式POST
  • curl 示例
curl -H  "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XPOST 192.168.1.100:8081/api/conference_rooms/2/members

Body:

添加与会者

{
  "name": "1019",
  "num": "1019"
}

添加组成员

{
  "name": "1008",
  "num": "1008",
  "group_id": 0
}
  • 返回(示例)
{
	"id": "2"
}

删除指定会议室

  • 请求 URL/api/conference_rooms/$id
  • 请求方式DELETE
  • curl 示例
curl -H  "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/conference_rooms/5
  • 返回(示例)
{
	"id": "5"
}

删除指定会议室与会者

  • 请求 URL/api/conference_rooms/$id/members/$member_id
  • 请求方式DELETE
  • curl 示例
curl -H  "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/conference_rooms/4/members/2
  • 返回(示例)
{}

会议控制

以下提供在会议进行各种操作的控制接口,其中$name均指会议号码(在创建会议后,每个会议都会有唯一的会议号码比如 712418732-xswitch.cn)

查询所有会议(正在进行的会议)

  • 请求 URL/api/conferences
  • 请求方式GET
  • 返回值:code(200 即为正常),session_id
  • curl 示例
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" localhost/api/conferences
  • 返回(示例)

部分字段说明:

参数说明
book_meeting_id预约会议 id
caller_id_name与会者名称
hold保持
can_hear可以听,false 为不可听
can_speak不可说,即静音,如果为 true 则表示未静音
has_video未开启视频
talking未说话;true 为正在说话
can_see可以看
caller_id_number与会者号码
id与会者在会议中的 id
uuid与会者通道 UUID
join_time该成员加入会议的总时长,单位:秒
max_members最大会议容量
conference_name会议号码
member_count当前会议总人数
locked会议是否锁定
canvas_count画布个数
conference_uuid会议 UUID

返回 JSON:

{
	"msg": "+OK",
	"data": [
		{
			"variables": {
				"book_meeting_id": "1",
				"book_recurrent_meeting_id": "2"
			},
			"dynamic": true,
			"members": [
				{
					"record_path": "/usr/local/freeswitch/storage/recordings/conference-record-715834449-xswitch.cn-2023-03-02-00-07-13-74dbee72-0446-420d-a125-75bdfd2e0b1c.wav",
					"join_time": 1677686833,
					"type": "recording_node"
				},
				{
					"type": "caller",
					"uuid": "74dbee72-0446-420d-a125-75bdfd2e0b1c",
					"last_talking": 0,
					"volume_out": 0,
					"join_time": 3,
					"volume_in": 0,
					"id": 1,
					"caller_id_name": "1028",
					"input-volume": 0,
					"output-volume": 0,
					"energy": 0,
					"flags": {
						"can_see": true,
						"talking": true,
						"hold": false,
						"end_conference": false,
						"mute_detect": false,
						"has_floor": true,
						"has_video": false,
						"video_bridge": false,
						"can_hear": true,
						"pass_digits": false,
						"is_moderator": false,
						"can_speak": true
					},
					"caller_id_number": "1028"
				}
			],
			"destruct": false,
			"max_members": 10,
			"video_rfc4579": false,
			"video_floor_only": false,
			"video_floor_packets": 0,
			"conference_name": "715834449-xswitch.cn",
			"member_count": 1,
			"enforce_min": true,
			"enter_sound": true,
			"exit_sound": true,
			"max_bw_in": 0,
			"wait_mod": false,
			"conference_uuid": "577fdc73-ac90-429e-b18d-bfdf47bc884b",
			"running": true,
			"locked": false,
			"canvas_count": 1,
			"ghost_count": 0,
			"bridge_to": false,
			"recording": true,
			"answered": true,
			"video_bridge": false,
			"audio_always": false,
			"run_time": 3,
			"force_bw_in": 0,
			"rate": 8000
		}
	],
	"code": 200
}

其中 conference_name 是会议的唯一标识,返回的 members 里的 id 是与会者的一个标识 ID。

查询指定会议状态

  • 请求 URL/api/conferences/$name
  • 请求方式GET
  • 返回值:code(200 即为正常),session_id
  • curl 示例 1
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" localhost/api/conferences/715834449-xswitch.cn
  • 返回(示例 1)

返回 JSON:

{
  "msg": "+OK",
  "data": [
    {
      "locked": false,
      "exit_sound": true,
      "rate": 8000,
      "member_count": 1,
      "max_members": 10,
      "conference_name": "715834449-xswitch.cn",
      "node_uuid": "4bbf9d95-dfef-40a4-9fb9-35c2c77c4dee",
      "enter_sound": true,
      "members": [
        {
          "record_path": "/usr/local/freeswitch/storage/recordings/conference-record-715834449-xswitch.cn-2023-03-02-00-10-25-daa0338c-bc7e-4830-afd7-08ad900de47c.wav",
          "type": "recording_node",
          "join_time": 1677687025
        },
        {
          "output-volume": 0,
          "caller_id_number": "1028",
          "id": 3,
          "type": "caller",
          "uuid": "daa0338c-bc7e-4830-afd7-08ad900de47c",
          "caller_id_name": "1028",
          "join_time": 14,
          "input-volume": 0,
          "volume_out": 0,
          "flags": {
            "is_moderator": false,
            "has_floor": true,
            "pass_digits": false,
            "video_bridge": false,
            "can_see": true,
            "hold": false,
            "end_conference": false,
            "can_hear": true,
            "can_speak": true,
            "talking": true,
            "has_video": false,
            "mute_detect": false
          },
          "energy": 0,
          "volume_in": 0,
          "last_talking": 0
        }
      ],
      "run_time": 14,
      "destruct": false,
      "max_bw_in": 0,
      "canvas_count": 1,
      "bridge_to": false,
      "ghost_count": 0,
      "variables": {
        "book_recurrent_meeting_id": "2",
        "book_meeting_id": "1"
      },
      "recording": true,
      "video_rfc4579": false,
      "video_bridge": false,
      "force_bw_in": 0,
      "audio_always": false,
      "video_floor_only": false,
      "video_floor_packets": 0,
      "conference_uuid": "1eee5ce6-cc83-4117-94b7-e222b12c65c8",
      "dynamic": true,
      "answered": true,
      "enforce_min": true,
      "running": true,
      "wait_mod": false
    }
  ],
  "code": 200
}

其中 conference_name 是会议的唯一标识,返回的 members 里的 id 是与会者的一个标识 ID

  • curl 示例 2 增加realMembersOnly标识,为true时只返回typecaller的成员。
curl -XGET -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" localhost:8081/api/conferences/3000-xswitch.cn?realMembersOnly=true
  • 返回(示例 2)
{
  "code": 200,
  "data": [
    {
      "audio_always": false,
      "video_floor_packets": 0,
      "locked": false,
      "run_time": 112,
      "bridge_to": false,
      "conference_name": "3000-xswitch.cn",
      "max_members": 10,
      "enforce_min": true,
      "member_count": 1,
      "variables": [],
      "ghost_count": 0,
      "conference_uuid": "9a04b0c0-f777-4beb-94c0-8d911dfe24ce",
      "answered": true,
      "members": [
        {
          "join_time": 112,
          "input-volume": 0,
          "energy": 0,
          "output-volume": 0,
          "uuid": "3ab084a3-ea3b-4686-932e-b6a3c46e6719",
          "id": 1,
          "type": "caller",
          "volume_in": 0,
          "caller_id_name": "1001",
          "last_talking": 0,
          "caller_id_number": "1001",
          "volume_out": 0,
          "flags": {
            "mute_detect": false,
            "can_see": true,
            "can_speak": true,
            "talking": true,
            "end_conference": false,
            "can_hear": true,
            "pass_digits": false,
            "has_floor": true,
            "hold": false,
            "is_moderator": false,
            "video_bridge": false,
            "has_video": false
          }
        }
      ],
      "running": true,
      "destruct": false,
      "exit_sound": true,
      "video_floor_only": false,
      "node_uuid": "dae08bca-c6e1-4540-bfce-533bd1e53f79",
      "video_rfc4579": false,
      "dynamic": true,
      "canvas_count": 1,
      "wait_mod": false,
      "recording": true,
      "force_bw_in": 0,
      "video_bridge": false,
      "enter_sound": true,
      "max_bw_in": 0,
      "rate": 8000
    }
  ],
  "msg": "+OK"
}

邀请会议成员入会

此接口的$name为会议名称,不局限于“预约页面”预约创建好的会议,当会议成员入会后,会议自动创建。

  • 请求 URL/api/conferences/$name邀请指定号码到指定会议中
  • 请求方式POST

邀请某人入会

  • Body 信息
参数说明
cidName拉人入会时,被拉的账号响铃时显示的主叫名称,建议写会议号码
cidNumber拉人入会时,被拉的账号响铃时显示的主叫号码
from和cidNumber作用一样,如果没有设置cidName及cidNumber,则取from设置的号码作为拉人入会显示的主叫号码
to需要拉入的号码比如1001,【呼叫】⇨【路由】中已有对应路由方可成功
vars需要额外设置的通道变量,只有body内包含to字段时才生效
context呼叫源,可不携带,默认为context-1

Body:

{
    "cidName": "3000-xswitch.cn",
    "cidNumber": "1001",
    "to": "1018",
    "vars": {
        "yxb": "23",
        "verto_svar_yxb": "true",
        "absolute_codec_string": "PCMA,PCMU"
    }
}
  • curl 示例
curl -XPOST -d '{"cidName": "3000-xswitch.cn","cidNumber": "1001","to": "1018","vars": {"yxb": "23","verto_svar_yxb": "true","absolute_codec_string": "PCMA,PCMU"}}' -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/conferences/9999
  • 返回值
{
    "msg": {
        "code": 200,
        "msg": "Job-UUID: dd9d4bea-8a15-4472-8d44-8dfdb4b589c6"
    },
    "code": 200,
    "data": "9999"
}

批量邀请成员入会

  • Body 信息
参数说明
from拉人入会时,被拉的账号响铃时显示的主叫号码
to需要拉入的号码比如1001、18812345678,【呼叫】⇨【路由】中已有对应路由方可成功
context呼叫源,可不携带,默认为context-1

Body:

{
    "participants": [
        {
            "from": "test1",
            "cidNumber": "120",
            "to": "1000"
        },
        {
            "from": "test2",
            "cidNumber": "110",
            "to": "20000"
        }
    ]
}
  • curl 示例
curl -XPOST -d '{"participants": [{"from": "test1","cidNumber": "120","to": "1000"},{"from": "test2","cidNumber": "110","to": "20000"}]}' -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/conferences/9999
  • 返回值
{
    "msg": {
        "code": 200,
        "msg": "Job-UUID: 05b8b350-87a3-4b90-9110-6c31570a5a10"
    },
    "code": 200,
    "data": "9999"
}

邀请预约会议的成员入会与邀请批量成员入会

该接口仅针对已经在“预约页面”预约创建好的会议,如果会议未创建,则会呼叫失败;不支持临时会议批量入会。

  • 请求 URL/api/conferences/call_members
  • 请求方式POST
  • Body 信息:参见信息说明。
  • 返回值:code(200 即为正常),data,msg,
  • curl 示例 1

callData字段说明

参数说明
id与会者分机 ID,如果为外部用户则无需填写
name被邀请的用户名
login邀请的本地分机
phone邀请的用户外部号码

roomInfo字段说明

参数说明
nbr会议号码
name会议名称

Body:

{
  "callData": [
    {
      "id": 5,
      "name": "1003",
      "login": "1003"
    },
    {
      "name": "张三",
      "phone": "15666091234"
    }
  ],
  "roomInfo": {
    "nbr": "712418732"
  }
}
  • 返回(示例)
{
  "code": 200,
  "name": "712418732-xswitch.cn"
}
  • curl 示例 2

body:

{
  "callData": [
    {
      "id": 5,
      "name": "1003",
      "login": "1003"
    },
    {
      "id": 3,
      "name": "1001",
      "login": "1001"
    }
  ],
  "roomInfo": {
    "nbr": "712418732"
  }
}
  • 返回(示例)
{
  "code": 200,
  "name": "712418732-xswitch.cn"
}

开启会议录制功能

  • 请求 URL/api/conferences/$name/record开启录制

  • 请求方式PUT

  • Body 信息:无

  • 返回值:code(200 即为正常),data,

  • curl 示例

curl -XPUT-H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/conferences/712418732-xswitch.cn/record
  • 返回值
{
  "message": "success",
  "code": 200,
  "data": {
    "rel_path": "conference-record-20220524104830-712418732-xswitch.cn.mp4",
    "name": "712418732-xswitch.cn",
    "ext": "mp4",
    "description": "Conference Video Record",
    "id": "8",
    "mime": "video/mp4",
    "original_file_name": "conference-record-20220524104830-712418732-xswitch.cn.mp4",
    "dir_path": "/usr/local/freeswitch/storage/recordings",
    "type": "VIDEO_CONF",
    "abs_path": "/usr/local/freeswitch/storage/recordings/conference-record-20220524104830-712418732-xswitch.cn.mp4",
    "channel_uuid": "4368ab30-a448-4d68-8ded-be81a5746c39"
  }
}

返回值部分字段说明

参数说明
description描述
name会议号码
rel_path文件名
ext录制格式
dir_path文件路径,不包含文件名
abs_path录音绝对路径,包含文件名
channel_uuid通道 UUID

停止会议录制功能

  • 请求 URL/api/conferences/$name/record/stop停止录制

  • 请求方式PUT

  • Body 信息:无

  • 返回值:code(200 即为正常),msg,

  • curl 示例

curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/conferences/712418732-xswitch.cn/record/stop
  • 返回(示例)
{
  "code": 200,
  "msg": "Stopped recording file /usr/local/freeswitch/storage/recordings/conference-record-20220524104830-712418732-xswitch.cn.mp4\n+OK Stopped recording 0 files\n"
}

会议内执行某个动作

  • 请求 URL/api/conferences/$name
  • 请求方式PUT

示例1,全部静音:

  • Body 信息
{
    "action": "mute",
    "val": "all"
}
  • curl 示例
curl -XPUT -d '{"action": "mute","val": "all"}' -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.31.99:8081/api/conferences/3000-192.168.31.99
  • 返回(示例)
{
    "msg": "mute 31",
    "code": 200
}

示例2,列出某个会议内所有会议成员:

  • Body 信息
{
    "action": "list"
}
  • curl 示例
curl -XPUT -d '{"action": "list"}' -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.31.99:8081/api/conferences/3000-192.168.31.99
  • 返回(示例)
{
    "msg": "31;sofia/default/20000@192.168.31.99:7060;a48bb07c-2683-45a4-923e-f0e1a7811ee4;20000;20000;hear|floor;0;0;0\n",
    "code": 200
}

会议内给某个会议成员执行某个动作

  • 请求 URL/api/conferences/$name/$memberID
  • 请求方式PUT

示例1,给某个会议成员静音:

  • Body 信息
{
    "action": "mute"
}
  • curl 示例
curl -XPUT -d '{"action": "mute"}' -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.31.99:8081/api/conferences/3000-192.168.31.99/33
  • 返回(示例)
{
    "code": 200,
    "msg": "mute 33"
}

示例2,强制设置某个会议成员为视频主持人:

  • Body 信息
{
    "action": "vid-floor",
    "val": "force"
}
  • curl 示例
curl -XPUT -d '{"action": "vid-floor","val": "force"}' -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.31.99:8081/api/conferences/3000-192.168.31.99/33
  • 返回(示例)
{
    "action": "vid-floor",
    "val": "force"
}

踢人

  • 请求 URL/api/conferences/$name/$memberID
  • 请求方式DELETE
  • Body 信息:参见信息说明。
  • 返回值: code(200 即为正常),msg

memberID 为成员在会议中的 ID(如果 all,表示所有成员)

参数:

  • action:动作。固定为hup

示例:

curl -vvv -XPUT -d '{"action": "hup"}' \
-H "X-XTRA-AUTH-ID: e30fe29f-97f0-4200-a034-8d36aca8cda2" \
-H "content-type: application/json" \
https://localhost/api/conferences/711293167-xswitch.cn/39

结束会议

  • 请求 URL/api/conferences/$name
  • 请求方式DELETE
  • Body 信息:参见信息说明。
  • 返回值: code(200 即为正常),msg
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE localhost:8088/api/conferences/711293167-xswitch.cn

事件

成员入会通知

字段说明:

参数说明
uuid通话的唯一标识
direction呼叫方向,inbound 表示呼入,outbound 呼出
name会议的唯一标识
memberId成员唯一标识
muted当前是否静音
action固定为 add-member
callIDNumber用户参会号码
{
  "Event-Subclass": "xxx",
  "uuid": "fe1b524d-cb1b-41cb-ae01-d18e1e28ed8b",
  "name": "test",
  "direction ": "inbound",
  "muted": "false",
  "action": "add-member",
  "memberId ": "9"
}

成员离开会议室通知

字段说明:

参数说明
uuid通话的唯一标识
direction呼叫方向,inbound 表示呼入,outbound 呼出
name会议的唯一标识
memberId成员唯一标识
muted当前是否静音
action固定为 del-member
callIDNumber用户参会号码
{
  "Event-Subclass": "xxx",
  "uuid": "fe1b524d-cb1b-41cb-ae01-d18e1e28ed8b",
  "name": "test",
  "direction ": "inbound",
  "muted": "false",
  "action": "del-member",
  "callerIdNumber": "1001",
  "memberId ": "9"
}

会议结束通知

字段说明:

参数说明
name会议的唯一标识
action固定为 conference-destroy
{
  "Event-Subclass": "xxxx",
  "name": "test",
  "action": "conference-destroy"
}

参会成员状态改变通知

字段说明:

参数说明
uuid通话的唯一标识
direction呼叫方向,inbound 表示呼入,outbound 呼出
name会议的唯一标识
memberId成员唯一标识
muted当前是否静音
actionunmute-member 成员解除静音,mute-member 成员静音
callIDNumber用户参会号码
{
  "Event-Subclass": "xxx",
  "uuid": "fe1b524d-cb1b-41cb-ae01-d18e1e28ed8b",
  "name": "test",
  "direction ": "inbound",
  "muted": "false",
  "action": "unmute-member",
  "callerIdNumber": "1001",
  "memberId ": "9"
}
呼叫管理