查询分机列表

查询 PBX 分机列表的基本信息,如分机号码、分机状态、分机类型、分机名称等。

请求 URL

GET {base_url}/{api_path}/extension/list?access_token={access_token}

请求参数

1.
参数 是否必填 类型 说明
page Integer 定义显示第几个页面。
page_size Integer 定义每页显示几项查询结果。
sort_by String 定义排序字段。

取值范围

  • id
  • number
  • caller_id_name
  • email_addr
  • mobile_number
  • presence_status
order_by String 定义显示顺序。

取值范围

  • asc:升序
  • desc:降序

响应参数

2.
参数 类型 说明
errcode Integer 返回错误码。
  • 0:请求成功。
  • 非零值:请求失败。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息
errmsg String 返回信息。
  • SUCCESS:请求成功。
  • FAILURE:请求失败。
total_number Integer 分机总数。
data Array<Ext_Basicinfo> 分机基本信息。
Ext_Basicinfo
3.
参数 类型 说明
id Integer 分机的唯一 ID。
online_status Object<Online_Status> 分机的终端在线状态,包含以下终端:
  • fxs_phone:FXS 话机。
  • sip_phone:SIP 终端。
  • linkus_desktop:Linkus 桌面端。
  • linkus_mobile:Linkus 手机端。
  • linkus_web:Linkus 网页端。
presence_status String 分机状态。
  • available:空闲。
  • away:离开。
  • business_trip:出差。
  • do_not_disturb:免打扰 (DND)。
  • lunch:午休。
  • off_work:下班。
number String 分机号码。
caller_id_name String 用户姓名。
role_name String 用户角色。
email_addr String 邮箱地址。
mobile_number String 手机号码。
Online_Status
4.
参数 类型 说明
status Integer 分机的终端在线状态 (SIP 终端除外)。
注: 分机在 SIP 终端上的在线状态会在 status_list 中返回。
  • 0:离线
  • 1:在线
ext_dev_type String 在线终端类型。
  • fxs:FXS 话机。
  • sip:SIP 终端。
  • linkusdesktop:Linkus 桌面端。
  • linkusmobile:Linkus 手机端。
  • linkusweb:Linkus 网页端。
status_list Array<Status_List> 分机在 SIP 终端上的在线信息详情。
注: 该参数仅在分机注册在 SIP 终端时返回。
Status_List
5.
参数 类型 说明
status Integer 分机在 SIP 终端的在线状态。
  • 0:离线
  • 1:在线
ip String SIP 终端的 IP 地址和 SIP 端口。

例如:192.168.28.190:5060

linkus_dev_type String 在线 Linkus 手机端和 Linkus 平板端 (SDK) 的类型。
  • ios: Linkus 手机端 iOS 版本。
  • android: Linkus 手机端安卓版本。
  • ipad: Linkus 平板端 (SDK) iOS 版本。
  • pad: Linkus 平板端 (SDK) 安卓版本。

示例

请求示例

GET /openapi/v1.0/extension/list?page=1&page_size=4&sort_by=number&order_by=asc&access_token=IqJch3aPGM68rpf3D3C10Mf2t7Bi 
Host: 192.168.5.150:8088

响应示例

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "total_number": 12,
    "data": [
        {
            "id": 238,
            "online_status": {
                "fxs_phone": {
                    "status": 0
                },
                "sip_phone": {
                    "status": 0,
                    "ext_dev_type": "sip",                  //分机 2000 注册在 SIP 终端上。
                    "status_list": [                        
                        {
                            "status": 1,                    //分机在 SIP 终端上的在线状态
                            "ip": "192.168.28.190:5060"     //SIP 终端的 IP 地址和 SIP 端口
                        }
                    ]
                },
                "linkus_desktop": {
                    "status": 0
                },
                "linkus_mobile": {
                    "status": 0
                },
                "linkus_web": {
                    "status": 0
                }
            },
            "presence_status": "available",
            "number": "2000",
            "caller_id_name": "Leo Ball",
            "role_name": "Administrator",
            "email_addr": "leo@sample.com"
        },
        {
            "id": 223,
            "online_status": {
                "fxs_phone": {
                    "status": 0
                },
                "sip_phone": {
                    "status": 0
                },
                "linkus_desktop": {                         //分机 2001 登录 Linkus 桌面端。
                    "status": 1,
                    "ext_dev_type": "linkusdesktop"
                },
                "linkus_mobile": {
                    "status": 0
                },
                "linkus_web": {
                    "status": 0
                }
            },
            "presence_status": "away",
            "number": "2001",
            "caller_id_name": "Phillip Huff",
            "role_name": "Administrator",
            "email_addr": "philip@sample.com"
        },
        {
            "id": 227,
            "online_status": {
                "fxs_phone": {
                    "status": 0
                },
                "sip_phone": {
                    "status": 0,
                    "ext_dev_type": "sip"
                },
                "linkus_desktop": {
                    "status": 0
                },
                "linkus_mobile": {                          //分机 2002 登录 Linkus 手机端。
                    "status": 1,
                    "ext_dev_type": "linkusmobile",
                    "status_list": [
                        {
                            "status": 1,
                            "ip": "112.48.22.71",
                            "linkus_dev_type": "android"
                        }
                    ]
                },
                "linkus_web": {
                    "status": 0,
                    "ext_dev_type": "linkusweb"
                }
            },
            "presence_status": "business_trip",
            "number": "2002",
            "caller_id_name": "Terrell Smith",
            "role_name": "Administrator",
            "email_addr": "terrell@sample.com",
            "mobile_number": "15880123456"
        },
        {
            "id": 229,
            "online_status": {
                "fxs_phone": {
                    "status": 0
                },
                "sip_phone": {
                    "status": 0,
                    "ext_dev_type": "sip"
                },
                "linkus_desktop": {                 
                    "status": 0
                },
                "linkus_mobile": {
                    "status": 0
                },
                "linkus_web": {                             //分机 2003 登录 Linkus 网页端。
                    "status": 1,
                    "ext_dev_type": "linkusweb"
                }
            },
            "presence_status": "do_not_disturb",
            "number": "2003",
            "caller_id_name": "Dave Haris",
            "email_addr": "dave@sample.com",
            "mobile_number": "13600930000"
        }
    ]
}