Query SIP Trunk Settings

Query detailed settings of a SIP trunk, multiple SIP trunks, or all SIP trunks.

Request URL

{base_url}/{api_path}/trunk/query_siptrunk?token={token}

Request parameters

Parameter Required Type Description
id Yes Integer The unique ID of a SIP trunk.

Valid values:

  • A SIP trunk id: Query settings of the specified SIP trunk.

    Example: "id":"15"

  • Multiple SIP trunk ids: Query settings of multiple SIP trunks. Separate multiple ids with ,.

    Example: "id":"15,16"

  • all: Query all SIP trunks.

    Example: "id":"all"

Response parameters

Parameter Type Description
status String Request result.
  • Success
  • Failed
trunks Array <TrunkInfo> Trunk information.
TrunkInfo
Yeastar S-Series VoIP PBX supports three types of SIP trunk: Register Trunk, Peer Trunk, and Account Trunk.
Table 1. Register Trunk
Parameter Type Description
id Integer The unique ID of a trunk.
trunkname String Trunk name.
trunktype String Trunk type.
  • register
host String The domain or IP address of the ITSP.
port String The port of the SIP trunk.
domain String The domain or IP address of the ITSP.
username String The SIP account that is provided by the ITSP.
authname String The SIP account that is provided by the ITSP.
fromuser String If fromuser is set, all outgoing calls from this SIP trunk will use the fromuser value as From Header of the SIP INVITE packets.
Note: Leave the parameter blank if ITSP does not support this feature.
password String The password of the SIP account.
extensionsdod String

The DOD number that is bound with an extension.

  • Bind a DOD number

    Format:

    "extensionsdod":"{dod_number}-{dod_name}-{extension_number}"

    Example:

    "extensionsdod":"5503301-yeastar-1000"
  • Bind multiple DOD numbers

    Format:

    "extensionsdod":"{dod_number}-{dod_name}-{extension_number}"

    Separate multiple DOD numbers with ,.

    Example:

    "extensionsdod":"5503301-yeastar-1000,5503302-yeastar-1001"
extensionsgroupdod String The DOD number that is bound with an extension group.
  • Bind a DOD number

    Format:

    "extensionsgroupdod":"{dod_number}-{dod_name}-{extension_group_name}
    Example:
    "extensionsgroupdod":"5503301-yeastar-sales"
  • Bind multiple DOD numbers

    Format:

    "extensionsgroupdod":"{dod_number}-{dod_name}-{extension_group_name}

    Separate multiple DOD numbers with ,.

    Example:

    "extensionsgroupdod":"5503301-yeastar-sales,5503302-yeastar-support"
Table 2. Peer Trunk
Parameter Type Description
id Integer The unique ID of a trunk.
trunkname String Trunk name.
trunktype String Trunk type.
  • peer
host String The domain or IP address of the ITSP.
port String The port of the SIP trunk.
domain String The domain or IP address of the ITSP.
extensionsdod String

The DOD number that is bound with an extension.

  • Bind a DOD number

    Format:

    "extensionsdod":"{dod_number}-{dod_name}-{extension_number}"

    Example:

    "extensionsdod":"5503301-yeastar-1000"
  • Bind multiple DOD numbers

    Format:

    "extensionsdod":"{dod_number}-{dod_name}-{extension_number}"

    Separate multiple DOD numbers with ,.

    Example:

    "extensionsdod":"5503301-yeastar-1000,5503302-yeastar-1001"
extensionsgroupdod String The DOD number that is bound with an extension group.
  • Bind a DOD number

    Format:

    "extensionsgroupdod":"{dod_number}-{dod_name}-{extension_group_name}
    Example:
    "extensionsgroupdod":"5503301-yeastar-sales"
  • Bind multiple DOD numbers

    Format:

    "extensionsgroupdod":"{dod_number}-{dod_name}-{extension_group_name}

    Separate multiple DOD numbers with ,.

    Example:

    "extensionsgroupdod":"5503301-yeastar-sales,5503302-yeastar-support"
Table 3. Account Trunk
Parameter Type Description
id Integer The unique ID of a trunk.
trunkname String Trunk name.
trunktype String Trunk type.
  • account
username String The user name of the Account Trunk.
authname String The authentication name of the Account Trunk.
password String The password of the Account Trunk.
extensionsdod String

The DOD number that is bound with an extension.

  • Bind a DOD number

    Format:

    "extensionsdod":"{dod_number}-{dod_name}-{extension_number}"

    Example:

    "extensionsdod":"5503301-yeastar-1000"
  • Bind multiple DOD numbers

    Format:

    "extensionsdod":"{dod_number}-{dod_name}-{extension_number}"

    Separate multiple DOD numbers with ,.

    Example:

    "extensionsdod":"5503301-yeastar-1000,5503302-yeastar-1001"
extensionsgroupdod String The DOD number that is bound with an extension group.
  • Bind a DOD number

    Format:

    "extensionsgroupdod":"{dod_number}-{dod_name}-{extension_group_name}
    Example:
    "extensionsgroupdod":"5503301-yeastar-sales"
  • Bind multiple DOD numbers

    Format:

    "extensionsgroupdod":"{dod_number}-{dod_name}-{extension_group_name}

    Separate multiple DOD numbers with ,.

    Example:

    "extensionsgroupdod":"5503301-yeastar-sales,5503302-yeastar-support"

Examples

Request example

Query detailed settings of the trunk with id 15.

POST /api/v2.0.0/trunk/query_siptrunk?token=277ac400357b509b4a587ff2157f7ad5
Content-Type:application/json; charset=utf-8
Host: 192.168.5.150

{
    "id": "15"
}

Response example

HTTP/1.1 200 OK
Server: Boa/0.94.14rc21
Accept-Ranges: bytes
Connection: close
Content-Type: application/json
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE

{
	"status": "Success",
	"trunks": [
		{
			"id": "15",
			"trunkname": "test",
			"trunktype": "peer",
			"host": "192.168.6.36",
			"port": "5060",
			"domain": "192.168.6.36",
			"extensionsdod": "",
			"extensionsgroupdod": "5503301-yeastar-sales,5503302-yealink-support,"
		}
	]
}