Query Information of Multiple Trunks

Query detailed information of multiple SIP trunks.

Request URL

GET {base_url}/{api_path}/trunk/query?access_token={access_token}

Request parameters

Table 1.
Parameter Required Type Description
ids Yes String The unique ID(s) of trunk(s).
Note:

Response parameters

Register Trunk
Table 2.
Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
data Array <Trunk_Info> The detailed information of the trunk.
Trunk_Info
Table 3.
Parameter Type Description
id Integer Trunk ID.
name String Trunk name.
enable Integer Whether the trunk is enabled.
  • 0: Disabled

  • 1: Enabled

country String The country of the ITSP.
itsp String ITSP.
type String Trunk type.
  • register
transport String Transport protocol.
hostname String The domain or IP address of the ITSP.
port Integer The registration port of the SIP trunk.
domain String The domain or IP address of the ITSP.
username String The username of the SIP account that is provided by the ITSP.
password String The password of the SIP account.
auth_name String The authentication name that is provided by the ITSP.
enb_outbound_proxy Integer Whether an outbound proxy is enabled.
  • 0: Disabled
  • 1: Enabled
outbound_proxy_server String The domain name or IP address of the outbound proxy server.
outbound_proxy_port Integer The port of the outbound proxy server.
codec_sel String Codec settings of the trunk.
def_outbound_cid String Default outbound caller ID.
def_outbound_cid_name String Default outbound caller ID name.
outbound_cid_list Array <OutCaller_Info>

The information of customized outbound caller ID for specific extensions.

did_list Array <DID_List> DID information associated with the trunk.
OutCaller_Info
Table 4.
Parameter Type Description
id Integer The unique ID of an outbound caller ID entry.
outbound_cid_option String The type of outbound caller ID.
  • range
  • shared
outbound_cid String The outbound caller ID.
outbound_cid_name String The outbound caller ID name.
outbound_cid_to_ext_range String The extension range corresponding to the outbound caller ID range.
Note: This parameter is displayed only when outbound_cid_option is set to range.
ext_list Array <Extension_Info> The information of the associated extensions.
Note: This parameter is displayed only when outbound_cid_option is set to shared.
Extension_Info
Table 5.
Parameter Type Description
id Integer The unique ID of an extension or an extension group.
type String An extension or an extension group.
  • extension
  • ext_group
ext_number String The number of an extension or the name of an extension group.
ext_name String The name of an extension or an extension group.
DID_List
Table 6.
Parameter Type Description
id Integer The unique ID of a DID entry.
did String The DID number associated with the trunk.
did_name String The DID name associated with the trunk.
Peer Trunk
Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
data Array <Trunk_Info> The detailed information of the trunk.
Trunk_Info
Table 7.
Parameter Type Description
id Integer Trunk ID.
name String Trunk name.
enable Integer Whether the trunk is enabled.
  • 0: Disabled

  • 1: Enabled

country String The country of the ITSP.
itsp String ITSP.
type String Trunk type.
  • peer
transport String Transport protocol.
hostname String The domain or IP address of the ITSP.
port Integer The registration port of the SIP trunk.
domain String The domain or IP address of the ITSP.
codec_sel String Codec settings of the trunk.
def_outbound_cid String Default outbound caller ID.
def_outbound_cid_name String Default outbound caller ID name.
outbound_cid_list Array <OutCaller_Info>

The information of customized outbound caller ID for specific extensions.

did_list Array <DID_List> DID information associated with the trunk.
OutCaller_Info
Table 8.
Parameter Type Description
id Integer The unique ID of an outbound caller ID entry.
outbound_cid_option String The type of outbound caller ID.
  • range
  • shared
outbound_cid String The outbound caller ID.
outbound_cid_name String The outbound caller ID name.
outbound_cid_to_ext_range String The extension range corresponding to the outbound caller ID range.
Note: This parameter is displayed only when outbound_cid_option is set to range.
ext_list Array <Extension_Info> The information of the associated extensions.
Note: This parameter is displayed only when outbound_cid_option is set to shared.
Extension_Info
Table 9.
Parameter Type Description
id Integer The unique ID an extension or an extension group.
type String Whether this is an extension or an extension group.
  • extension
  • ext_group
ext_number String The number of an extension or the name of an extension group.
ext_name String The name of an extension or an extension group.
DID_List
Table 10.
Parameter Type Description
id Integer The unique ID of a DID entry.
did String The DID number associated with the trunk.
did_name String The DID name associated with the trunk.
Account Trunk
Table 11.
Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
data Array <Trunk_Info> The detailed information of the trunk.
Trunk_Info
Table 12.
Parameter Type Description
id Integer Trunk ID.
name String Trunk name.
enable Integer Whether the trunk is enabled.
  • 0: Disabled

  • 1: Enabled

country String The country of the ITSP.
itsp String ITSP.
type String Trunk type.
  • account
transport String Transport protocol.
username String The user name of the SIP account trunk.
password String The password associated with the username.
auth_name String The authentication name for a third-party device to register with.
codec_sel String Codec settings of the trunk.
def_outbound_cid String Default outbound caller ID.
def_outbound_cid_name String Default outbound caller ID name.
outbound_cid_list Array <OutCaller_Info>

The information of customized outbound caller ID for specific extensions.

OutCaller_Info
Table 13.
Parameter Type Description
id Integer The unique ID of an outbound caller ID entry.
outbound_cid_option String The type of outbound caller ID.
  • range
  • shared
outbound_cid String The outbound caller ID.
outbound_cid_name String The outbound caller ID name.
outbound_cid_to_ext_range String The extension range corresponding to the outbound caller ID range.
Note: This parameter is displayed only when outbound_cid_option is set to range.
ext_list Array <Extension_Info> The information of the associated extensions.
Note: This parameter is displayed only when outbound_cid_option is set to shared.
Extension_Info
Table 14.
Parameter Type Description
id Integer The unique ID of an extension or an extension group.
type String Whether this is an extension or an extension group.
  • extension
  • ext_group
ext_number String The number of an extension or the name of an extension group.
ext_name String The name of an extension or extension group.

Examples

Request example

GET /openapi/v1.0/trunk/query?ids=8,12&access_token=47I1W4RwMGyDYlXfdymHUqFesJF6QIwi HTTP/1.1
Host: 192.168.5.150:8088

Response example

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "data": [
        {
            "id": 8,
            "name": "Local_Calls",
            "enable": 1,
            "country": "general",
            "type": "register",
            "transport": "udp",
            "hostname": "abc.provider.com",
            "port": 5060,
            "domain": "abc.provider.com",
            "username": "6701",
            "password": "0T9crrZ0gx",
            "auth_name": "mubJwYEWs9",
            "enb_outbound_proxy": 0,
            "outbound_proxy_server": "",
            "outbound_proxy_port": 0,
            "codec_sel": "ulaw,alaw,g729",
            "def_outbound_cid": "",
            "def_outbound_cid_name": "",
            "outbound_cid_list": [
                {
                    "id": 11,
                    "outbound_cid_option": "shared",
                    "outbound_cid": "5503302",
                    "outbound_cid_name": "Yeastar Sales",
                    "ext_list": [
                        {
                            "ext_number": "Yeastar Sales",
                            "ext_name": "Yeastar Sales",
                            "type": "ext_group",
                            "id": 7
                        }
                    ]
                }
            ],
            "did_list": [
                {
                    "id": 8,
                    "did": "5503300",
                    "did_name": "Yeastar"
                }
            ]
        },
        {
            "id": 12,
            "name": "ToPAE",
            "enable": 1,
            "country": "general",
            "type": "account",
            "transport": "udp",
            "hostname": "",
            "port": 0,
            "domain": "",
            "username": "6700",
            "password": "HSkQfXVg5V",
            "auth_name": "y7H9V8oFv1",
            "enb_outbound_proxy": 0,
            "outbound_proxy_server": "",
            "outbound_proxy_port": 0,
            "codec_sel": "ulaw,alaw,g729",
            "def_outbound_cid": "5502200",
            "def_outbound_cid_name": "Yeastar Hotline",
            "outbound_cid_list": [
                {
                    "id": 13,
                    "outbound_cid_option": "shared",
                    "outbound_cid": "5502201",
                    "outbound_cid_name": "Yeastar Test",
                    "ext_list": [
                        {
                            "ext_number": "Default_All_Extensions",
                            "ext_name": "Default_All_Extensions",
                            "type": "ext_group",
                            "id": 1
                        }
                    ]
                },
                {
                    "id": 15,
                    "outbound_cid_option": "range",
                    "outbound_cid": "5503301-5503302",
                    "outbound_cid_name": "",
                    "outbound_cid_to_ext_range": "1001-1002"
                }
            ]
        }
    ]
}