Query all the Shared Trunks

Query the detailed information of all the shared trunks.

Request URL

GET {base_url}/dm/open_api/v1/shared_trunk

Request parameters

Headers
Parameter Required Type Description
Authorization Yes String Pass the access token in the header.

Format: Bearer {access_token}.

Response parameters

Parameter Type Description
data Object <Details> The detailed information.
requestId String The unique ID of the request, which can be used to quickly locate the request.
status String Request result:
  • Success
  • Failed
time Long The response time.
Note: The YCM API response returns a timestamp, you can convert the timestamp to detailed date and time as needed. For more information, see Convert Timestamp to Local Date and Time.

Details

Parameter Type Description
id Integer The ID of the shared trunk.
regionId Integer The ID of the region where the shared trunk is created.
regionName String The name of the region where the shared trunk is created.
creator String The creator of the shared trunk.
name String The name of the shared trunk.
enable Integer Whether the shared trunk is enabled or not.
  • 0: Disabled.
  • 1: Enabled.
country String The country of the ITSP.
itsp String The name of the ITSP.
type String Trunk type.
  • register: Register trunk.
  • did_based: Peer trunk (DID based).
  • port_based: Peer trunk (Port based).
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.
transport String Transport protocol.
backupHostname String An optional backup hostname to accept SIP signaling from alternative ITSP addresses (other than the main host).
remark String Remark for the trunk.
username String The username of the SIP account that is provided by the ITSP.
Note: This parameter is only for register trunk.
password String The password of the SIP account.
Note: This parameter is only for register trunk.
authName String The authentication name that is provided by the ITSP.
Note: This parameter is only for register trunk.
enbOutboundProxy Integer Whether an outbound proxy server is enabled.
  • 0: Disabled.
  • 1: Enabled.
outboundProxyServer String The domain name or IP address of the outbound proxy server.
Note: This parameter is only for register trunk.
outboundProxyPort Integer The port of the outbound proxy server.
Note: This parameter is only for register trunk.
proxyClusterPublicIp String The public IP address of the SBC Proxy Server, which can be provided to the ITSP for trunk binding.
Note: This parameter is only for peer trunk.
proxyPort String The port of the SBC Proxy Server.
Note: This parameter is only for peer trunk.
proxyServerName String The name of the SBC Proxy Server.
codecSel String Codec settings.
dtmfMode String The mode for sending DTMF tones.
  • rfc4733: RFC4733 (RFC2833).
  • info: Info.
  • inband: Inband.
  • auto: Auto.
dtmfFmtp String DTMF fmtp.
  • 0-16
  • 0-15
enbQualify Integer Whether Qualify is enabled or not.
  • 0: Disabled.
  • 1: Enabled.
enbSrtp Integer Whether SRTP is enabled or not.
  • 0: Disabled.
  • 1: Enabled.
enbT38Support Integer Whether T.38 fax is enabled or not.
  • 0: Disabled.
  • 1: Enabled.
enbInbandProgress Integer Whether Inband Progress is enabled or not.
  • 0: Disabled.
  • 1: Enabled.
ignore183WithoutSdp Integer Whether 183 messages without SDP will be ignored or not.
  • 0: Disabled. All 183 messages without SDP will be treated the same as those with SDP and will be forwarded.
  • 1: Enabled. 183 messages without SDP will be ignored and not forwarded.
transparentTrans180Msg Integer Whether 180 messages with SDP will be forwarded when the 180 message received from the other party contains SDP.
  • 0: Disabled. 180 messages with SDP will not be forwarded, even if received from the other party contains SDP.
  • 1: Enabled. 180 messages will be forwarded if the received 180 message contains SDP.
enbDedicate Integer Whether dedicated trunk is enabled.
  • 0: Disabled.
  • 1: Enabled.
callRestrictionType String The type of calls included in the calculation of the trunk's maximum concurrent call limit.
  • outbound: Only outbound calls will be restricted.
  • all: Both outbound calls and inbound calls will be restricted.
maxCallChans Integer The maximum number of concurrent calls allowed in this trunk.
Note: If the value is 0, it indicates that the concurrent calls in this trunk is unlimited.
authErrorSipCode String The SIP error code returned by the ITSP to indicate an authentication error.
Note: This parameter is only for register trunk.
authRegisterAttempt Integer The number of registration attempts after receiving the authentication error SIP code from the ITSP.
Note: This parameter is only for register trunk.
globalRegisterRetryInterval Integer The global interval time (in seconds) for retrying registration after receiving any SIP error code (non-200 status code) from ITSP.
Note: This parameter is only for register trunk.
callerIdFrom String From which SIP header field will the trunk retrieve caller ID.
  • follow_system: Follow the global setting of the Cloud PBX (Set on PBX Settings > SIP Settings > Advanced > Incoming Caller ID/DID Retrieval > Get Caller ID From).
  • from: From.
  • contact: Contact.
  • rpid: Remote-Party-ID.
  • pai: P-Asserted-Identity.
  • ppi: P-Preferred-Identity.
didFrom String From which SIP header field will the trunk retrieve DID.
  • follow_system: Follow the global setting of the Cloud PBX (Set on PBX Settings > SIP Settings > Advanced > Incoming Caller ID/DID Retrieval > Get DID From).
  • to: To.
  • invite: Invite.
  • diversion: Diversion.
  • rpid: Remote-Party-ID.
  • pai: P-Asserted-Identity.
  • ppi: P-Preferred-Identity.
  • pcpid: P-Called-Party-ID.
fromUserPart String The caller ID (user part of the SIP From header) to be used for outbound calls.
  • default: Default. The value of the parameter is selected by the following priority from top to bottom:
    • Outbound Route Outbound Caller ID
    • Extension's Outbound Caller ID in Trunk
    • Trunk Outbound Caller ID
    • Trunk Username
    • Extension Caller ID
    • The Originator Caller ID
  • ext_cid: Extension Caller ID.
  • trunk_user: Trunk Username.
  • trunk_def_outbcid: Trunk Outbound Caller ID.
  • ext_outbcid: Extension's Outbound Caller ID in Trunk.
  • outrounter_outbcid: Outbound Route Outbound Caller ID.
  • originator_cid: Originator Caller ID.
  • custom: Custom.
fromUser String The custom value when fromUserPart is set to custom.
fromDispNamePart String The caller ID name (display name part of the SIP From header) to be used for outbound calls.
  • default: Default. Display the name associated with the actual outbound caller ID.
  • ext_cid_name: Extension Caller ID Name.
  • trunk_def_outbcid_name: Trunk Outbound Caller ID Name.
  • ext_outbcid_name: Extension's Outbound Caller ID Name in Trunk.
  • originator_cid_name: Originator Caller ID Name.
  • custom: Custom.
fromDispName String The custom value when fromDispNamePart is set to custom.
diversionUserPart String The value to be carried in the Diversion header field of the SIP INVITE packet for outbound calls.
Note: If this parameter is returned empty(""), it indicates that the header field will not be included in the SIP INVITE packet.
  • default: Default. The original call destination number (DID number) when the call diversion occurs.
  • ext_cid: Extension Caller ID.
  • trunk_user: Trunk Username.
  • trunk_def_outbcid: Trunk Outbound Caller ID.
  • ext_outbcid: Extension's Outbound Caller ID in Trunk.
  • outrounter_outbcid: Outbound Route Outbound Caller ID.
  • originator_cid: Originator Caller ID.
  • custom: Custom.
diversionUser String The custom value when diversionUserPart is set to custom.
rpidUserPart String The value to be carried in the Remote-Party-ID header field of the SIP INVITE packet for outbound calls.
Note: If this parameter is returned empty(""), it indicates that the header field will not be included in the SIP INVITE packet.
  • default: Default. The value of the parameter is selected by the following priority from top to bottom:
    • Outbound Route Outbound Caller ID
    • Extension's Outbound Caller ID in Trunk
    • Trunk Outbound Caller ID
    • Trunk Username
    • Extension Caller ID
    • The Originator Caller ID
  • ext_cid: Extension Caller ID.
  • trunk_user: Trunk Username.
  • trunk_def_outbcid: Trunk Outbound Caller ID.
  • ext_outbcid: Extension's Outbound Caller ID in Trunk.
  • outrounter_outbcid: Outbound Route Outbound Caller ID.
  • originator_cid: Originator Caller ID.
  • custom: Custom.
rpidUser String The custom value when rpidUserPart is set to custom.
paiUserPart String The value to be carried in the P-Asserted-Identity header field of the SIP INVITE packet for outbound calls.
Note: If this parameter is returned empty(""), it indicates that the header field will not be included in the SIP INVITE packet.
  • default: Default. The value of the parameter is selected by the following priority from top to bottom:
    • Outbound Route Outbound Caller ID
    • Extension's Outbound Caller ID in Trunk
    • Trunk Outbound Caller ID
    • Trunk Username
    • Extension Caller ID
    • The Originator Caller ID
  • ext_cid: Extension Caller ID.
  • trunk_user: Trunk Username.
  • trunk_def_outbcid: Trunk Outbound Caller ID.
  • ext_outbcid: Extension's Outbound Caller ID in Trunk.
  • outrounter_outbcid: Outbound Route Outbound Caller ID.
  • originator_cid: Originator Caller ID.
  • custom: Custom.
paiUser String The custom value when paiUserPart is set to custom.
paiUserPartUriFormat String The format of the P-Asserted-Identity header field.
  • sip: SIP URI (sip:).
  • tel: SIP URI (tel:).
ppiUserPart String The value to be carried in the P-Preferred-Identity header field of the SIP INVITE packet for outbound calls.
Note: If this parameter is returned empty(""), it indicates that the header field will not be included in the SIP INVITE packet.
  • default: Default. The value of the parameter is selected by the following priority from top to bottom:
    • Outbound Route Outbound Caller ID
    • Extension's Outbound Caller ID in Trunk
    • Trunk Outbound Caller ID
    • Trunk Username
    • Extension Caller ID
    • The Originator Caller ID
  • ext_cid: Extension Caller ID.
  • trunk_user: Trunk Username.
  • trunk_def_outbcid: Trunk Outbound Caller ID.
  • ext_outbcid: Extension's Outbound Caller ID in Trunk.
  • outrounter_outbcid: Outbound Route Outbound Caller ID.
  • originator_cid: Originator Caller ID.
  • custom: Custom.
ppiUser String The custom value when ppiUserPart is set to custom.
userAgent String User Agent information for authentication.
realm String Realm for SIP authentication.
enb100Rel Integer The 100rel setting for this trunk.
  • 0: Disabled. 100rel is disabled for this trunk.
  • 1: Supported. 100rel is supported by this trunk.
  • 2: Required. 100rel is required for this trunk.
maxPtime String The value of the maxptime used when the PBX sends the INVITE packet.
Note: If this parameter returns default, it indicates that PBX will send a corresponding maxptime value according to the codec that is used for the outbound call.
enbPrivacyId Integer Whether Privacy ID will be included in SIP header or not.
  • 0: Disabled.
  • 1: Enabled.
enbUserPhone Integer Whether a user=phone parameter will be included in the header field of the SIP INVITE packet.
  • 0: Disabled.
  • 1: Enabled.
enbApiCallId Integer Whether a X-OpenAPI-Call-ID field will be included in the SIP INVITE packet.
  • 0: Disabled.
  • 1: Enabled.
enbEarlyMedia Integer Whether a P-Early-Media field will be included in the SIP INVITE packet.
  • 0: Disabled.
  • 1: Enabled.
enbEarlyMediaFor183 Integer Whether a P-Early-Media field with the value of sendrecv will be included in the 183 message for inbound calls routed through the trunk.
  • 0: Disabled.
  • 1: Enabled.
fromDomainPart String The domain or IP address that will be used in the From field of a SIP INVITE header.
Note: This parameter is only for peer trunk.
  • default: The domain or IP address configured in the domain parameter will be used.
  • custom: A custom domain or IP address will be used.
fromDomainValue String The custom value when fromDomainPart is set to custom.
toDomainPart String The domain or IP address that will be used in the To field of a SIP INVITE header.
Note: This parameter is only for peer trunk.
  • default: The domain or IP address configured in the domain parameter will be used.
  • custom: A custom domain or IP address will be used.
toDomainValue String The custom value when toDomainPart is set to custom.
failoverServersList Array <Failover_Server> The information list of the ITSP's secondary server for failover.
Failover_Server
Parameter Type Description
host String The domain or IP address of the secondary server.
port Integer The registration port of the secondary server.
domain String The domain or IP address of the secondary server.

Example

Request example

GET /dm/open_api/v1/shared_trunk HTTP/1.1
Host: ycm.yeastar.com
Authorization: Bearer ******
Response example
HTTP/1.1 200 OK
{
    "data": [
        {
            "id": 2,
            "regionId": 20,
            "regionName": "China (Shanghai)",
            "creator": "Leo Ball",
            "name": "trunk-shanghai-01",
            "enable": 1,
            "country": "China",
            "itsp": "China Telecom",
            "type": "register",
            "hostname": "sip.chinatelecom.com",
            "port": 5060,
            "domain": "sip.chinatelecom.com",
            "transport": "udp",
            "username": "ct_username_001",
            "password": "encrypted_CTpass123",
            "authName": "",
            "enbOutboundProxy": 0,
            "outboundProxyServer": "",
            "outboundProxyPort": 0,
            "proxyServerName": "cn-shanghai-proxy-a",
            "codecSel": "ulaw,alaw,g729",
            "dtmfMode": "rfc4733",
            "dtmfFmtp": "0-16",
            "enbQualify": 0,
            "enbSrtp": 0,
            "enbT38Support": 0,
            "enbInbandProgress": 0,
            "ignore183WithoutSdp": 0,
            "enbDedicate": 0,
            "callRestrictionType": "outbound",
            "maxCallChans": 0,
            "transparentTrans180Msg": 0,
            "authErrorSipCode": "401;407;403",
            "authRegisterAttempt": 3,
            "globalRegisterRetryInterval": 20,
            "callerIdFrom": "follow_system",
            "didFrom": "follow_system",
            "fromUserPart": "default",
            "fromUser": "",
            "fromDispNamePart": "default",
            "fromDispName": "",
            "diversionUserPart": "",
            "diversionUser": "",
            "rpidUserPart": "",
            "rpidUser": "",
            "paiUserPart": "",
            "paiUser": "",
            "paiUserPartUriFormat": "sip",
            "ppiUserPart": "",
            "ppiUser": "",
            "userAgent": "",
            "enb100Rel": 0,
            "maxPtime": "default",
            "enbPrivacyId": 0,
            "enbUserPhone": 0,
            "enbApiCallId": 0,
            "realm": "",
            "enbEarlyMedia": 0,
            "enbEarlyMediaFor183": 0
        },
        ... ...
        {
            "id": 6688,
            "regionId": 20,
            "regionName": "China (Beijing)",
            "creator": "Leo Ball",
            "name": "bandwidth-trunk_F9I8P8",
            "enable": 1,
            "country": "United States",
            "itsp": "Bandwidth",
            "type": "did_based",
            "hostname": "sip.bandwidth.com",
            "port": 5060,
            "domain": "sip.bandwidth.com",
            "transport": "udp",
            "proxyClusterPublicIp": "52.82.120.101",
            "proxyPort": 5060,
            "proxyServerName": "cn-beijing-proxy-b",
            "codecSel": "ulaw,g729",
            "dtmfMode": "rfc4733",
            "dtmfFmtp": "0-16",
            "enbQualify": 0,
            "enbSrtp": 0,
            "enbT38Support": 0,
            "enbInbandProgress": 0,
            "ignore183WithoutSdp": 0,
            "enbDedicate": 0,
            "callRestrictionType": "outbound",
            "maxCallChans": 0,
            "transparentTrans180Msg": 0,
            "callerIdFrom": "follow_system",
            "didFrom": "follow_system",
            "fromUserPart": "default",
            "fromUser": "",
            "fromDispNamePart": "default",
            "fromDispName": "",
            "diversionUserPart": "",
            "diversionUser": "",
            "rpidUserPart": "",
            "rpidUser": "",
            "paiUserPart": "",
            "paiUser": "",
            "paiUserPartUriFormat": "sip",
            "ppiUserPart": "",
            "ppiUser": "",
            "userAgent": "",
            "enb100Rel": 0,
            "maxPtime": "default",
            "enbPrivacyId": 0,
            "enbUserPhone": 0,
            "enbApiCallId": 0,
            "enbEarlyMedia": 0,
            "enbEarlyMediaFor183": 0,
            "fromDomainPart": "default",
            "toDomainPart": "default",
            "failoverServersList": [
                {
                    "host": "67.23.8.195",
                    "port": 5060,
                    "domain": "67.23.8.195"
                }
            ]
        }
    ],
    "requestId": "41bb65359db6aa3cd3384dd72ef9629e",
    "status": "Success",
    "time": 1747120211
}