Create a Shared Trunk

Create a register or peer trunk for trunk sharing.

Request URL

POST {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}.

Body parameters
Send different request parameters according to different types of SIP trunk.
Create a Register Trunk
Parameter Required Type Description
name Yes String The name of the shared trunk.
The system will automatically append a 6-character random suffix (e.g. _M8D90A) to ensure the name uniqueness.
Note:
  • The name you enter can not exceed 56 characters.
  • The name cannot be modified after it is set.

enable Yes Integer Whether to enable the trunk.
Valid value:
  • 0: Disable.
  • 1: Enable.
regionId Yes Integer The ID of the region where the shared trunk belongs to.
Note: You can query the region ID using Query Available Regions.
country Yes String The country of the ITSP.
Note:
  • You can query the information of supported ITSP using Query ITSP of Shared Trunks.
  • If your ITSP is not listed, set the parameter to general to create a general SIP trunk.
itsp No String The name of the supported ITSP under the selected country.
Note: You can query the information of supported ITSP using Query ITSP of Shared Trunks.
remark No String The remark for the trunk.
type Yes String The type of the trunk.

Valid value:

  • register: Register trunk.
transport Yes String Transport protocol.

Valid value:

  • udp: UDP.
  • tcp: TCP.
  • tls: TLS.
  • dnsnaptr: DNS-NAPTR.
hostname Yes String The domain or IP address of the ITSP.
port Yes Integer The registration port of the SIP trunk.
domain Yes String The domain or IP address of the ITSP.
backupHostname No String The optional backup hostnames to accept SIP signaling from alternative ITSP addresses (other than the main host), intended for ITSPs that use multiple signaling addresses.
Format: {domain/IP address}:{port}.
Note:
  • This setting only takes effect on the P-Series Cloud PBX with firmware version 84.19.0.110 or later.
  • Use commas to separate multiple hostnames. E.g. 47.47.47.47:5060,test.example.xyz:5060.
  • The total length must not exceed 255 characters.
username Yes String The username of the SIP account that is provided by the ITSP.
password Yes String The password of the SIP account.
authName No String The authentication name that is provided by the ITSP.
enbOutboundProxy No Integer Whether to enable outbound proxy server.
Valid value:
  • 0: Disable.
  • 1: Enable.
outboundProxyServer No String The domain name or IP address of the outbound proxy server.
outboundProxyPort No Integer The port of the outbound proxy server.
codecSel Yes String Codec settings.
Note: Use commas to separate multiple codecs.
Valid value:
  • ulaw
  • alaw
  • g729
  • g722
  • g726
  • ilbc
  • opus
  • gsm
  • speex
  • adpcm
  • h264
  • h263
  • h263p
  • mpeg4
  • vp8
dtmfMode Yes String The mode for sending DTMF tones.
Valid value:
  • rfc4733: RFC4733 (RFC2833).
  • info: Info.
  • inband: Inband.
  • auto: Auto.
dtmfFmtp No String DTMF fmtp.

Valid value:

  • 0-16
  • 0-15
authErrorSipCode Yes String Specify the SIP error code returned by the ITSP to indicate an authentication error.
Note:
  • You can enter up to 10 error codes.
  • Use semicolons (;) to separate multiple error codes. E.g. 401;407;403.
authRegisterAttempt Yes Integer Specify the number of registration attempts after receiving the error code specified in the authErrorSipCode parameter from the ITSP.
globalRegisterRetryInterval Yes Integer Specify the global interval time (in seconds) for retrying registration after receiving any SIP error code (non-200 status code) from ITSP.
Note: The value should not be less than 5.
enbQualify Yes Integer Whether to allow the system to send SIP OPTION packets to the SIP trunk server to check its availability.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbSrtp Yes Integer Whether to enable SRTP or not.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbT38Support Yes Integer Whether to enable T.38 fax or not.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbInbandProgress Yes Integer Whether to enable Inband Progress or not. This setting determines how the Cloud PBX handles early media when its extensions make outbound calls through this trunk.
Valid value:
  • 0: Disable. PBX sends a 180 Ringing to the extension to indicate ringing without any audio.
  • 1: Enable. PBX sends a 183 Session Progress and immediately starts sending ringing as audio to the extension.
ignore183WithoutSdp Yes Integer Whether to ignore 183 messages without SDP.
Valid value:
  • 0: Disable. PBX will process and forward all 183 messages without SDP in the same way as those with SDP.
  • 1: Enable. PBX will not forward 183 messages that don't contain SDP.
transparentTrans180Msg Yes Integer

Whether to forward 180 messages that contain SDP when received from the other party.

Valid value:
  • 0: Disable. PBX will not forward a 180 message with SDP even if the 180 message received from the other party contains SDP.
  • 1: Enable. PBX will forward a 180 message if the 180 message received from the other party includes SDP.
    Note: This setting does not take effect when enbInbandProgress is set to 1.
enbDedicate Yes Integer Whether to enable dedicated trunk setting.
Note: If your ITSP requires a dedicated internal IP address for connection, you need to set this parameter to 1 and contact your PBX provider to configure the related network settings.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbSipAuthCache No Integer Wheter to enable SIP authentication cache.
Valid value:
  • 0: Disable.
  • 1: Enable. The PBX will cache successful SIP authentication credentials and reuse them in subsequent requests (INVITE and BYE) within the same session or registration cycle.
callRestrictionType Yes String Specify based on which type of calls to restrict the max concurrent call number of this trunk.
Valid value:
  • outbound: Only outbound calls will be restricted.
  • all: Both outbound calls and inbound calls will be restricted.
maxCallChans Yes Integer Specify the maximum number of concurrent calls allowed in this trunk.

Value 0 means no limit (Unlimited).

callerIdFrom Yes String Specify from which SIP header field will the trunk retrieve caller ID.
Valid value:
  • 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 Yes String Specify from which SIP header will the trunk retrieve DID.
Valid value:
  • 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 Yes String Define the caller ID (user part of the SIP From header) that will be used for outbound calls.
Valid value:
  • 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 No String The custom caller ID.
Note: This parameter is required when fromUserPart is set to custom.
fromDispNamePart Yes String Define the caller ID name (display name part of the SIP From header) to be used for outbound calls.
Valid value:
  • 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 No String The custom caller ID name.
Note: This parameter is required when fromDispNamePart is set to custom.
diversionUserPart Yes String Define the value that will be carried in the Diversion header field of the SIP INVITE packet for outbound calls.
Note: If you don't want to include this header field in the SIP INVITE packet, set the parameter to an empty string ("").

Valid value:

  • 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 No String The custom value for Diversion header field.
Note: This parameter is required when diversionUserPart is set to custom.
rpidUserPart Yes String Define the value that will be carried in the Remote-Party-ID header field of the SIP INVITE packet for outbound calls.
Note: If you don't want to include this header field in the SIP INVITE packet, set the parameter to an empty string ("").

Valid value:

  • 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 No String The custom value for Remote-Party-ID header field.
Note: This parameter is required when rpidUserPart is set to custom.
paiUserPart Yes String Define the value that will be carried the P-Asserted-Identity header field of the SIP INVITE packet for outbound calls.
Note: If you don't want to include this header field in the SIP INVITE packet, set the parameter to an empty string ("").

Valid value:

  • 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 No String The custom value for P-Asserted-Identity header field.
Note: This parameter is required when paiUserPart is set to custom.
paiUserPartUriFormat No String The format of the P-Asserted-Identity header field.
Note: This parameter is required when paiUserPart is set to any value other than an empty string ("").
Valid value:
  • sip: SIP URI (sip:).
  • tel: SIP URI (tel:).
ppiUserPart Yes String Define the value that will be carried in the P-Preferred-Identity header field of the SIP INVITE packet for outbound calls.
Note: If you don't want to include this header field in the SIP INVITE packet, set the parameter to an empty string ("").

Valid value:

  • 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 No String The custom value for P-Preferred-Identity header field.
Note: This parameter is required when ppiUserPart is set to custom.
userAgent No String Specify the User Agent string used during SIP authentication.
Note: If the ITSP requires User Agent for authentication, enter the User Agent information that is provided by the ITSP.
realm No String Specify the authentication realm used in SIP communications to verify user credentials.
Note: If you are unsure about the information, contact your ITSP for guidance.
enb100Rel Yes Integer Configure 100rel for the trunk.

Valid value:

  • 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 Yes String Set the value of the maxptime used when the PBX sends the INVITE packet.
Valid value:
  • default: PBX will send a corresponding maxptime value according to the codec that is used for the outbound call.
  • Custom value: You can specify a value between 20 and 300, in multiples of 10.
enbPrivacyId Yes Integer Whether to send the Privacy ID in SIP header or not.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbUserPhone Yes Integer Whether to add the parameter user=phone in the header field of the SIP INVITE packet.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbApiCallId Yes Integer Whether to include a X-OpenAPI-Call-ID field in the SIP INVITE packet to carry the Call ID for inbound calls and outbound calls routed through the trunk.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbEarlyMedia Yes Integer Whether to include a P-Early-Media field in the SIP INVITE packet.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbEarlyMediaFor183 Yes Integer Whether to include the P-Early-Media field with a value of sendrecv in the 183 message for inbound calls routed through the trunk.
Valid value:
  • 0: Disable.
  • 1: Enable.
Create a Peer Trunk
Parameter Required Type Description
name Yes String The name of the shared trunk.
The system will automatically append a 6-character random suffix (e.g. _M8D90A) to ensure the name uniqueness.
Note:
  • The name you enter can not exceed 56 characters.
  • The name cannot be modified after it is set.

enable Yes Integer Whether to enable the trunk.
Valid value:
  • 0: Disable.
  • 1: Enable.
regionId Yes Integer The ID of the region where the shared trunk belongs to.
Note: You can query the region ID using Query Available Regions.
country Yes String The country of the ITSP.
Note:
  • You can query the information of supported ITSP using Query ITSP of Shared Trunks.
  • If your ITSP is not listed, set the parameter to general to create a general SIP trunk.
itsp No String The name of the supported ITSP under the selected country.
Note: You can query the information of supported ITSP using Query ITSP of Shared Trunks.
remark No String The remark for the trunk.
type Yes String The type of the trunk.

Valid value:

  • did_based: Peer trunk (DID based).
  • port_based: Peer trunk (Port based).
transport Yes String Transport protocol.

Valid value:

  • For Peer trunk (DID based):
    • udp: UDP.
    • tcp: TCP.
  • For Peer trunk (Port based):
    • udp: UDP.
hostname Yes String The domain or IP address of the ITSP.
port Yes Integer The registration port of the SIP trunk.
domain Yes String The domain or IP address of the ITSP.
backupHostname No String The optional backup hostnames to accept SIP signaling from alternative ITSP addresses (other than the main host), intended for ITSPs that use multiple signaling addresses.
Format: {domain/IP address}:{port}.
Note:
  • This setting only takes effect on the P-Series Cloud PBX with firmware version 84.19.0.110 or later.
  • Use commas to separate multiple hostnames. E.g. 47.47.47.47:5060,test.example.xyz:5060.
  • The total length must not exceed 255 characters.
failoverServersList No Array <Failover_Server> The list of the ITSP's secondary server information used for failover.
Note: If your ITSP provides a secondary server, enter the server information in this parameter.
codecSel Yes String Codec settings.
Note: Use commas to separate multiple codecs.
Valid value:
  • ulaw
  • alaw
  • g729
  • g722
  • g726
  • ilbc
  • opus
  • gsm
  • speex
  • adpcm
  • h264
  • h263
  • h263p
  • mpeg4
  • vp8
dtmfMode Yes String The mode for sending DTMF tones.
Valid value:
  • rfc4733: RFC4733 (RFC2833).
  • info: Info.
  • inband: Inband.
  • auto: Auto.
dtmfFmtp No String DTMF fmtp.

Valid value:

  • 0-16
  • 0-15
enbQualify Yes Integer Whether to allow the system to send SIP OPTION packets to the SIP trunk server to check its availability.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbSrtp Yes Integer Whether to enable SRTP or not.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbT38Support Yes Integer Whether to enable T.38 fax or not.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbInbandProgress Yes Integer Whether to enable Inband Progress or not. This setting determines how the Cloud PBX handles early media when its extensions make outbound calls through this trunk.
Valid value:
  • 0: Disable. PBX sends a 180 Ringing to the extension to indicate ringing without any audio.
  • 1: Enable. PBX sends a 183 Session Progress and immediately starts sending ringing as audio to the extension.
ignore183WithoutSdp Yes Integer Whether to ignore 183 messages without SDP.
Valid value:
  • 0: Disable. PBX will process and forward all 183 messages without SDP in the same way as those with SDP.
  • 1: Enable. PBX will not forward 183 messages that don't contain SDP.
transparentTrans180Msg Yes Integer

Whether to forward 180 messages that contain SDP when received from the other party.

Valid value:
  • 0: Disable. PBX will not forward a 180 message with SDP even if the 180 message received from the other party contains SDP.
  • 1: Enable. PBX will forward a 180 message if the 180 message received from the other party includes SDP.
    Note: This setting does not take effect when enbInbandProgress is set to 1.
enbDedicate Yes Integer Whether to enable dedicated trunk setting.
Note: If your ITSP requires a dedicated internal IP address for connection, you need to set this parameter to 1 and contact your PBX provider to configure the related network settings.
Valid value:
  • 0: Disable.
  • 1: Enable.
callRestrictionType Yes String Specify based on which type of calls to restrict the max concurrent call number of this trunk.
Valid value:
  • outbound: Only outbound calls will be restricted.
  • all: Both outbound calls and inbound calls will be restricted.
maxCallChans Yes Integer Specify the maximum number of concurrent calls allowed in this trunk.

Value 0 means no limit (Unlimited).

callerIdFrom Yes String Specify from which SIP header field will the trunk retrieve caller ID.
Valid value:
  • 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 Yes String Specify from which SIP header will the trunk retrieve DID.
Valid value:
  • 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 Yes String Define the caller ID (user part of the SIP From header) that will be used for outbound calls.
Valid value:
  • 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
    • Extension Caller ID
    • The Originator Caller ID
  • ext_cid: Extension Caller ID.
  • 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 No String The custom caller ID.
Note: This parameter is required when fromUserPart is set to custom.
fromDispNamePart Yes String Define the caller ID name (display name part of the SIP From header) to be used for outbound calls.
Valid value:
  • 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 No String The custom caller ID name.
Note: This parameter is required when fromDispNamePart is set to custom.
fromDomainPart Yes String Specify the domain or IP address that will be used in the From field of a SIP INVITE header.
Valid value:
  • 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 No String The custom domain or IP address.
Note: This parameter is required when fromDomainPart is set to custom.
toDomainPart Yes String The domain or IP address that will be used in the To field of a SIP INVITE header.
Valid value:
  • 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 No String The custom domain or IP address.
Note: This parameter is required when toDomainPart is set to custom.
diversionUserPart Yes String Define the value that will be carried in the Diversion header field of the SIP INVITE packet for outbound calls.
Note: If you don't want to include this header field in the SIP INVITE packet, set the parameter to an empty string ("").
  • default: Default. The original call destination number (DID number) when the call diversion occurs.
  • ext_cid: Extension Caller ID.
  • 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 No String The custom value for Diversion header field.
Note: This parameter is required when diversionUserPart is set to custom.
rpidUserPart Yes String Define the value that will be carried in the Remote-Party-ID header field of the SIP INVITE packet for outbound calls.
Note: If you don't want to include this header field in the SIP INVITE packet, set the parameter to an empty string ("").
  • 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
    • Extension Caller ID
    • The Originator Caller ID
  • ext_cid: Extension Caller ID.
  • 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 No String The custom value for Remote-Party-ID header field.
Note: This parameter is required when rpidUserPart is set to custom.
paiUserPart Yes String Define the value that will be carried the P-Asserted-Identity header field of the SIP INVITE packet for outbound calls.
Note: If you don't want to include this header field in the SIP INVITE packet, set the parameter to an empty string ("").

Valid value:

  • 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
    • Extension Caller ID
    • The Originator Caller ID
  • ext_cid: Extension Caller ID.
  • 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 No String The custom value for P-Asserted-Identity header field.
Note: This parameter is required when paiUserPart is set to custom.
paiUserPartUriFormat No String The format of the P-Asserted-Identity header field.
Note: This parameter is required when paiUserPart is set to any value other than an empty string ("").
Valid value:
  • sip: SIP URI (sip:).
  • tel: SIP URI (tel:).
ppiUserPart Yes String Define the value that will be carried in the P-Preferred-Identity header field of the SIP INVITE packet for outbound calls.
Note: If you don't want to include this header field in the SIP INVITE packet, set the parameter to an empty string ("").
Valid value:
  • 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
    • Extension Caller ID
    • The Originator Caller ID
  • ext_cid: Extension Caller ID.
  • 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 No String The custom value for P-Preferred-Identity header field.
Note: This parameter is required when ppiUserPart is set to custom.
userAgent No String Specify the User Agent string used during SIP authentication.
Note: If the ITSP requires User Agent for authentication, enter the User Agent information that is provided by the ITSP.
enb100Rel Yes Integer Configure 100rel for the trunk.

Valid value:

  • 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 Yes String Set the value of the maxptime used when the PBX sends the INVITE packet.
Valid value:
  • default: PBX will send a corresponding maxptime value according to the codec that is used for the outbound call.
  • Custom value: You can specify a value between 20 and 300, in multiples of 10.
enbPrivacyId Yes Integer Whether to send the Privacy ID in SIP header or not.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbUserPhone Yes Integer Whether to add the parameter user=phone in the header field of the SIP INVITE packet.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbApiCallId Yes Integer Whether to include a X-OpenAPI-Call-ID field in the SIP INVITE packet to carry the Call ID for inbound calls and outbound calls routed through the trunk.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbEarlyMedia Yes Integer Whether to include a P-Early-Media field in the SIP INVITE packet.
Valid value:
  • 0: Disable.
  • 1: Enable.
enbEarlyMediaFor183 Yes Integer Whether to include the P-Early-Media field with a value of sendrecv in the 183 message for inbound calls routed through the trunk.
Valid value:
  • 0: Disable.
  • 1: Enable.
Failover_Server
Parameter Required Type Description
host Yes String The domain or IP address of the secondary server.
port Yes Integer The registration port of the secondary server.
domain Yes String The domain or IP address of the secondary server.

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.

Example

Request examples

  • Create a register trunk.
    POST /dm/open_api/v1/shared_trunk HTTP/1.1
    Host: ycm.yeastar.com
    Authorization: Bearer ******
    Content-Type: application/json
    {
        "name": "register-test",
        "enable": 1,
        "regionId": 20,
        "country": "general",
        "itsp": "",
        "remark": "remark",
        "type": "register",
        "transport": "udp",
        "hostname": "1.1.1.1",
        "port": 5060,
        "domain": "1.1.1.1",
        "username": "username",
        "password": "cGFzc3dvcmQ=",
        "authName": "",
        "enbOutboundProxy": 0,
        "codecSel": "gsm,h264,h263,h263p,ilbc",
        "dtmfMode": "rfc4733",
        "dtmfFmtp": "0-16",
        "authErrorSipCode": "401;407;403",
        "authRegisterAttempt": 3,
        "globalRegisterRetryInterval": 20,
        "enbQualify": 0,
        "enbSrtp": 0,
        "enbT38Support": 0,
        "enbInbandProgress": 0,
        "ignore183WithoutSdp": 0,
        "transparentTrans180Msg": 0,
        "enbDedicate": 1,
        "callRestrictionType": "outbound",
        "maxCallChans": 0,
        "callerIdFrom": "follow_system",
        "didFrom": "pcpid",
        "fromUserPart": "default",
        "fromUser": "",
        "fromDispNamePart": "ext_cid_name",
        "fromDispName": "",
        "diversionUserPart": "",
        "rpidUserPart": "",
        "paiUserPart": "",
        "paiUserPartUriFormat": "tel",
        "ppiUserPart": "custom",
        "ppiUser": "custom",
        "userAgent": "user agent",
        "realm": "real",
        "enb100Rel": 1,
        "maxPtime": "100",
        "enbPrivacyId": 0,
        "enbUserPhone": 1,
        "enbApiCallId": 0,
        "enbEarlyMedia": 1,
        "enbEarlyMediaFor183": 1,   
        "enbSipauthCache":1 
    }
  • Create a peer trunk.
    POST /dm/open_api/v1/shared_trunk HTTP/1.1
    Host: ycm.yeastar.com
    Authorization: Bearer ******
    Content-Type: application/json
    
    {
        "name": "peer-general-ap-2",
        "enable": 1,
        "regionId": 20,
        "country": "general",
        "itsp": "",
        "remark": "general peer trunk",
        "type": "port_based",
        "transport": "udp",
        "hostname": "5.5.5.5",
        "port": 5060,
        "domain": "5.5.5.5",
        "codecSel": "ulaw,alaw,g729",
        "dtmfMode": "rfc4733",
        "dtmfFmtp": "0-16",
        "enbQualify": 1,
        "enbSrtp": 0,
        "enbT38Support": 0,
        "enbInbandProgress": 0,
        "ignore183WithoutSdp": 0,
        "transparentTrans180Msg": 0,
        "enbDedicate": 0,
        "callRestrictionType": "outbound",
        "maxCallChans": 0,
        "callerIdFrom": "follow_system",
        "didFrom": "follow_system",
        "fromUserPart": "default",
        "fromDispNamePart": "custom",
        "fromDispName": "test",
        "fromDomainPart": "default",
        "toDomainPart": "default",
        "diversionUserPart": "",
        "diversionUser": "",
        "rpidUserPart": "",
        "rpidUser": "",
        "paiUserPart": "",
        "paiUser": "",
        "ppiUserPart": "",
        "ppiUser": "",
        "userAgent": "tredt",
        "enb100Rel": 0,
        "maxPtime": "default",
        "enbPrivacyId": 0,
        "enbUserPhone": 0,
        "enbApiCallId": 0,
        "enbEarlyMedia": 0,
        "enbEarlyMediaFor183": 0
    }

Response example

{
    "data": {
        "id": 6692
    },
    "requestId": "9fe88e3fd0437a97166f6cee45db28ec",
    "status": "Success",
    "time": 1747187155
}