Edit a SIP Trunk

Edit basic settings and DOD number settings of a SIP trunk.

Request URL

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

Request parameters

Send different request parameters according to different types of SIP trunk.
Edit a register trunk
Parameter Required Type Description
id Yes Integer The unique ID of a trunk.
trunkname No String Trunk name.
trunktype Yes String Trunk type.

Valid value: register

host No String The domain or IP address of the ITSP.
port No String The port of the SIP trunk.
domain No String The domain or IP address of the ITSP.
username No String The SIP account that is provided by the ITSP.
authname No String The SIP account that is provided by the ITSP.
fromuser No 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 No String The password of the SIP account.
extensionsdod No String

The DOD number that is bound with an extension.

Valid values:

  • A DOD number

    Format:

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

    Example:

    "extensionsdod":"5503301-yeastar-1000"
  • 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 No String The DOD number that is bound with an extension group.
  • A DOD number

    Format:

    "extensionsgroupdod":"{dod_number}-{dod_name}-{extension_group_name}
    Example:
    "extensionsgroupdod":"5503301-yeastar-sales"
  • 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"
Edit a peer trunk
Parameter Required Type Description
id Yes Integer The unique ID of a trunk.
trunkname No String Trunk name.
trunktype Yes String Trunk type.

Valid value: peer

host No String The domain or IP address of the ITSP.
port No String The port of the SIP trunk.
domain No String The domain or IP address of the ITSP.
extensionsdod No String

The DOD number that is bound with an extension.

Valid values:

  • A DOD number

    Format:

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

    Example:

    "extensionsdod":"5503301-yeastar-1000"
  • 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 No String The DOD number that is bound with an extension group.
  • A DOD number

    Format:

    "extensionsgroupdod":"{dod_number}-{dod_name}-{extension_group_name}
    Example:
    "extensionsgroupdod":"5503301-yeastar-sales"
  • 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"
Edit an account trunk
Parameter Required Type Description
id Yes Integer The unique ID of a trunk.
trunkname No String Trunk name.
trunktype Yes String Trunk type.

Valid value: account.

username No String The user name of the Account Trunk.
authname No String The authentication name of the Account Trunk.
password No String The password of the Account Trunk.
extensionsdod No String

The DOD number that is bound with an extension.

Valid values:

  • A DOD number

    Format:

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

    Example:

    "extensionsdod":"5503301-yeastar-1000"
  • 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 No String The DOD number that is bound with an extension group.
  • A DOD number

    Format:

    "extensionsgroupdod":"{dod_number}-{dod_name}-{extension_group_name}
    Example:
    "extensionsgroupdod":"5503301-yeastar-sales"
  • 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"

Response parameters

Parameter Type Description
status String Request result.
  • Success
  • Failed

Examples

Request example

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

{
    "id":"8",
    "trunkname": "siptrunk1",
    "trunktype": "register",
    "host": "192.168.12.161",
    "port": "5060",
    "domain": "192.168.12.161",
    "username": "1001",
    "authname": "1001",
    "password": "Pajsjx9183",
}

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"
}