User Tools

Site Tools


api:pbx:trunk:list

API : PBX : Trunks list

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 returns a list of all of the customers trunks.

URL https://api.telecomx.dk/pbx/trunk
Method GET
Access level VIEWER, MANAGE, OWNER if trunks belongs to the customer, RESELLER if customer belongs to the reseller or ADMIN.
Query offset [optional] Index of the first item to return, default 0.
limit [optional] The number of items to return, default 50, min 1, max 100.
filter [optional] Search query that will match against searchable fields.
full [optional] True to include all settings.
expandGoto [optional] True to expand goto id's into _id/type/number/name objects. Also sets full=true.
customer [optional] Id of customer to show trunks for. Defaults to the users own customer if not specified.
sort [optional] Which property to sort result by: number (default), name, redirect.

Query examples

https://api.telecomx.dk/pbx/trunk
https://api.telecomx.dk/pbx/trunk?customer=123458789012457890ABCD
https://api.telecomx.dk/pbx/trunk?customer=123458789012457890ABCD&limit=20&offset=100
https://api.telecomx.dk/pbx/trunk?filter=donald
https://api.telecomx.dk/pbx/trunk?customer=12345678901234567890ABCD&full=true

Response

JSON object
offset Index of the first trunk returned.
limit Number of trunks to return. Note that the actual number of returned items may be lower.
total Number of trunks that can be returned when offset and limit is not considered. This is to be used for paging through the data.
trunks Array of trunks, see definition below.
Trunk object (normal)
_id Id Unique id of the trunk.
name String Name/description of the trunk.
number String The phone number to dial to reach this trunk, null if it is not dial-able.
redirect String Number to redirect to when execution starts. Used to quickly circumvent the trunk.
notes String Notes about the trunk.
numbers Number Number of phone numbers that the trunk handles.
fax Boolean True if this is a fax trunk.
Trunk object (full=true)
_id Id Unique id of the trunk.
type String Always 'TRUNK'.
name String Name/description of the trunk.
number String The phone number to dial to reach this trunk locally, 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.
If expandGoto=true *goto properties are expanded to an object
_id Id Unique id of the dialplan item.
type String Type of item:
EXTENSION - a local extension
TRUNK - entry point for inbound calls
CONFERENCE - a conference room where multiple parties can talk
DIAL - dial a destination
DISA - callback/dialtone
PLAYBACK - play an audio file
QUEUE - queue
SET_VALUE - sets a value
MENU_ROUTER - route based on menu selection
TIME_ROUTER - route based on date/time
URL_ROUTER - route based on URL call reply
VALUE_ROUTER - route based on a value
GROUP - a group of extensions that can be controlled and called.
name String Item name.
number String The phone number to dial to reach this item, null if it is not dial-able.

Example - normal

{
  offset: 0,
  limit: 50,
  total: 25,
  trunks: [
    {
      _id: '12345678901234567890ABCD',
      name: 'Primary fax trunk CPH',
      number: '800',
      redirect: null,
      notes: 'Our main fax number at the Copenhagen office',
      numbers: 1,
      fax: true
    },
    {
      ...
    }
  ]

Example - full=true

{
  offset: 0,
  limit: 50,
  total: 25,
  trunks: [
    {
      _id: '12345678901234567890ABCD',
      type: 'TRUNK',
      name: 'Primary fax trunk CPH',
      number: '800',
      startAudio: null,
      redirect: null,
      notes: 'Faxing only',
      numbers: [
        '+4570305051',
        '+4570305052'
      ],
      selectable: false,
      language: 'da',
      ringtone: -1,
      musicOnHold: null,
      goto: null,
      pbx: {
        mode: 'BOTH',
        retension: 7,
        email: 'info@telecomx.dk'
      }
    },
    {
      ...
    }
  ]

Errors

Error code Message Description
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/pbx/trunk/list.txt · Last modified: 2018/08/22 08:42 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki