User Tools

Site Tools


api:pbx:trunk:get

API : PBX : Trunk Get

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 return a single trunk.

URL https://api.telecomx.dk/pbx/trunk/TRUNK_ID
Method GET
Access level VIEWER, MANAGER or OWNER if user belongs to the customer.
RESELLER if customer belongs to the reseller.
ADMIN.
Param TRUNK_ID Id of the trunk (24 hex-char string)
Query expandGoto [optional] True to expand goto id's into _id/type/number/name objects

Query examples

https://api.telecomx.dk/pbx/trunk/1234567890ABCDEF12345678

Response

JSON object
_id Id Unique id of the extension.
type String Always 'TRUNK'.
customer Id Id of the customer the trunk belongs to.
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.
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

{
  _id: '12345678901234567890ABCD',
  type: 'TRUNK',
  customer: '12345678901234567890ADEF',
  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
400 bad_request Id not found in requestURI
404 not_found Trunk not found
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/pbx/trunk/get.txt · Last modified: 2018/09/12 07:20 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki