User Tools

Site Tools


api:pbx:trunk:update

API : PBX : Trunk Update

Introduction

A trunk is an entrypoint into the PBX from the outside world. A trunk holds one or more public numbers that leads into the PBX.

The trunks task is to receive the calls and send them into the next dialplan item that shall handle the call.

A trunk may also be in FAX mode, where it instead acts as a fax receiver, sender or both.

Request

This request will update a trunk. As little as a single property can be specified.

URL https://api.telecomx.dk/pbx/trunk/TRUNK_ID
Method POST
Access level MANAGER or OWNER if user belongs to the customer.
RESELLER if customer belongs to the reseller.
ADMIN.
Params TRUNK_ID Id Id of the trunk to update.
Body name String Name/description of the trunk.
number String [optional] The phone number to dial to reach this trunk locally. Null if not used.
startAudio Id [optional] A sound item to playback when the trunk is entered.
redirect String [optional] Number to redirect to when execution starts. Used to quickly circumvent the trunk. Null if not used.
notes String Notes about the trunk.
numbers Array Array of phone numbers (E.164 format) that are handled by the trunk, Fixed line and mobile phones marked for PBX usage can be used.
selectable Boolean True if the numbers on this trunk may be used by employees for outbound number presentation.
language String Language to use for voice prompts against the caller: da or en.
ringtone Number If an alternative ringtone should be used on supported SIP phones, this is the index of it (1-19). 0 for silent ringtone, -1 to not override it.
musicOnHold Id Id of music on hold class to set, null if not used.
goto Id Id of dialplan item to send inbound calls to.
Fax
fax.mode String Fax mode:
OFF - used as normal trunk.
RECEIVE - receive fax only.
SEND - Send fax only.
BOTH - send and receive fax.
fax.retension Number Number of days to keep received faxes, 1-90 days, 0 to not store faxes and only e-mail them. Only used when fax.mode is not off.
fax.email String E-mail address to send received faxes to. Only used when fax.mode is not OFF.

Request body example

{
  numbers: [
    '+4570305051',
    '+4570305052',
    '++4570305053'
  ],
  selectable: true
}

Response

JSON object
_id Id Unique id of the extension.
type String Always 'TRUNK'.
name String Name of the trunk.
number String The phone number to dial to reach this trunk, null if it is not dial-able.
startAudio Id A sound item to playback when the trunk is entered, null if not used.
redirect String Number to redirect to when execution starts. Used to quickly circumvent the trunk.
notes String Notes about the trunk.
numbers Array Array of phone numbers (E.164 format) that are handled by the trunk, Fixed line and mobile phones marked for PBX usage can be used.
selectable Boolean True if the numbers on this trunk may be used by employees for outbound number presentation.
language String Language to use for voice prompts against the caller: da or en.
ringtone Number If an alternative ringtone should be used on supported SIP phones, this is the index of it (1-19). 0 for silent ringtone, -1 to not override it.
musicOnHold Id Id of music on hold class to set, null if not used.
goto Id Id of dialplan item to send inbound calls to.
Fax
fax.mode String Fax mode:
OFF - used as normal trunk.
RECEIVE - receive fax only.
SEND - Send fax only.
BOTH - send and receive fax.
fax.retension Number Number of days to keep received faxes, 1-90 days, 0 to not store faxes and only e-mail them. Only used when fax.mode is not off.
fax.email String E-mail address to send received faxes to. Only used when fax.mode is not OFF.

Example

{
  _id: '12345678901234567890ABCD',
  name: 'Primary fax trunk CPH',
  number: '800',
  startAudio: null,
  redirect: null,
  notes: 'Faxing only',
  numbers: [
    '+4570305051',
    '+4570305052',
    '+4570305053'
  ],
  selectable: true,
  language: 'da',
  ringtone: -1,
  musicOnHold: null,
  goto: null,
  pbx: {
    mode: 'BOTH',
    retension: 7,
    email: 'info@telecomx.dk'
  }
}

Errors

Error code Message Description
400 bad_request Id not found in request URI
404 not_found Trunk not found
404 customer Customer not found or not active
422 name Name must be at least 3 characters
409 number Number is in use by another dialplan item
422 number Number is invalid, only 0-9 is allowed and no public service numbers
422 redirect Redirect number is invalid, only + 0-9, # and * is allowed
404 redirect Redirect number is local but does not point to an existing dialplan item
404 startAudio Start audio file not found
404 musicOnHold The music on hold class does not exist
404 goto Dialplan item not found
409 numbers One or more numbers are not available
409 numbers One or more numbers are already in use
422 retension Retension must be between 0 and 90 days
422 fax.mode Invalid mode, use OFF, RECEIVE, SEND or BOTH
422 fax.email Not a valid e-mail address
422 ringtone Invalid ringetone
422 language Invalid language, use en or da
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/pbx/trunk/update.txt · Last modified: 2018/08/20 13:29 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki