Table of Contents

API : PBX : Set Value list

Introduction

A Set Value item is a dialplan object that can set and manipulate various properties on a call or on the system. Send e-mail and SMS notifications, and receive input from a caller.

Request

This request returns a list of all of the customers set value items.

URL https://api.telecomx.dk/pbx/setvalue
Method GET
Access level VIEWER, MANAGE, OWNER if set value items 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 1000.
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.
expandAction [optional] True to expand redirect, music on hold and presence action with the name of the of the item that is references. Also sets full=true.
customer [optional] Id of customer to show set value items 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/setvalue
https://api.telecomx.dk/pbx/setvalue?customer=123458789012457890ABCD
https://api.telecomx.dk/pbx/setvalue?customer=123458789012457890ABCD&limit=20&offset=100
https://api.telecomx.dk/pbx/setvalue?filter=donald
https://api.telecomx.dk/pbx/setvalue?customer=12345678901234567890ABCD&full=true
https://api.telecomx.dk/pbx/setvalue?customer=12345678901234567890ABCD&expandGoto=true&expandAction=true

Response

JSON object
offset Index of the first set value item returned.
limit Number of set value item to return. Note that the actual number of returned items may be lower.
total Number of set value items that can be returned when offset and limit is not considered. This is to be used for paging through the data.
setValues Array of set value items, see definition below.
Set value object (normal)
Property Type Description
_id Id Unique id of the set value item.
name String Name/description of the set value item.
number String The phone number to dial to reach this set value item, null if it is not dial-able.
redirect String Number to redirect to when execution starts. Used to quickly circumvent the set value item.
notes String Notes about the set value item.
inputMode Boolean True if caller is required to enter digits.
actions Number Number of actions the set value item contains.
Set value object (full=true)
Property Type Description
_id Id Unique id of the set value item.
type String Always 'SET_VALUE'.
customer Id Id of customer the set value item belongs to.
name String Name/description of the set value item.
number String The phone number to dial to reach this set value item locally, null if it is not dial-able.
startAudio Id A sound item to playback when the set value item is entered, null if not used.
redirect String Number to redirect to when execution starts. Used to quickly circumvent the set value item.
notes String Notes about the set value item.
inputMode Boolean True if this requires the caller to enter digits.
Input entered by the caller, is stored in a CALL_VARIABLE named input, and can also be stored elsewhere in actions.
inputLength Number Number of digits to receive from the caller, 1-50 (input mode only).
inputRepeat Number Number of times to repeat the input process before giving up. Default 0 (no repeat), can be 0-10.
timeout Number Number of seconds to wait for input, 1-30 (input mode only).
timeoutAudio Id Id of sound item to playback when input timeout occurs (input mode only).
timeoutGoto Id Id of dialplan item to goto on timeout (input mode only).
goto Id Id of dialplan item to go to when done.
actions Array Array of actions to perform - see definition below.
actions[].type String Type of item to perform action on.
actions[].target String Target for types that requires it.
actions[].how String How to affect the target of the action.
actions[].value String Value to use.
Action object
Type Description Target How Value
CALL_VARIABLE A variable that only exists with the call Name of the variable
a-z A-Z 0-9 _ and -
EQUALS Text or number to set variable to.
EQUALS_INPUT n/a - sets to caller entered digits.
PREFIX String to prefix variable with.
POSTFIX String to postfix variable with.
ADD Number to add to variable.
SUBTRACT Number to subtract from variable.
DELETE n/a - variable is deleted.
CUT_PRE Number of characters to remove from the beginning of the variable.
CUT_POST Number of characters to remove from the end of the variable.
VARIABLE A persistent system variable Name of the variable
a-z A-Z 0-9 _ and -
EQUALS Text or number to set variable to.
EQUALS_INPUT n/a - sets to caller entered digits.
PREFIX String to prefix variable with.
POSTFIX String to postfix variable with.
ADD Number to add to variable.
SUBTRACT Number to subtract from variable.
DELETE n/a - variable is deleted.
CUT_PRE Number of characters to remove from the beginning of the variable.
CUT_POST Number of characters to remove from the end of the variable.
SWITCH A persistent switch that can be on or off Name of the switch
a-z A-Z 0-9 _ and -
EQUALS true, false, 1, 0, yes, no.
EQUALS_INPUT n/a - set to caller entered digits 1 or 0.
A_NUMBER The callers phone number EQUALS Phone number to set.
EQUALS_INPUT n/a - sets to caller entered number.
PREFIX Number to prefix with.
POSTFIX Number to postfix with.
DELETE n/a - Number is deleted/made secret.
CUT_PRE Number of digits to remove from the beginning of the phone number.
CUT_POST Number of digits to remove from the end of the phone number.
A_NAME The callers name EQUALS String to set name to.
PREFIX String to prefix the name with.
POSTFIX String to postfix the name with.
DELETE n/a - name is deleted.
CUT_PRE Number of characters to remove from the beginning of the name.
CUT_POST Number of characters to remove from the end of the name.
B_NUMBER The called phone number EQUALS Phone number to set.
EQUALS_INPUT n/a - sets to caller entered number.
PREFIX Number to prefix with.
POSTFIX Number to postfix with.
DELETE n/a - Number is deleted/made secret.
CUT_PRE Number of digits to remove from the beginning of the phone number.
CUT_POST Number of digits to remove from the end of the phone number.
CDR_NOTE A note stored with the CDR for the call EQUALS Text or number to set the note to.
EQUALS_INPUT n/a - sets to caller entered digits.
PREFIX String to prefix the note with.
POSTFIX String to postfix the note with.
ADD Number to add to the note.
SUBTRACT Number to subtract from the note.
DELETE n/a - note is deleted.
CUT_PRE Number of characters to remove from the beginning of the note.
CUT_POST Number of characters to remove from the end of the note.
LANGUAGE The language to use on the call EQUALS Langauge to use: da or en.
MUSIC_ON_HOLD Set the music on hold class to use EQUALS Id of the music on hold class to use.
PRESENCE_STATE Set the presence state of an employee Id of employee EQUALS The state to set: AVAILABLE, BUSY, OUT_OF_OFFICE, OFF_WORK, HOLIDAY.
PRESENCE_LOCATION The presence location for an employee Id of employee EQUALS Text to set.
PREFIX String to prefix location with.
POSTFIX String to postfix location with.
DELETE n/a - location is deleted.
CUT_PRE Number of characters to remove from the beginning of the location.
CUT_POST Number of characters to remove from the end of the location.
PRESENCE_MESSAGE The presence message for an employee Id of employee EQUALS Text to set.
PREFIX String to prefix message with.
POSTFIX String to postfix message with.
DELETE n/a - message is deleted.
CUT_PRE Number of characters to remove from the beginning of the message.
CUT_POST Number of characters to remove from the end of the message.
PRESENCE_EXPIRES Set or remove expiration on an employee's presence Id of employee EQUALS When the presence shall expire:
IN_5 - in 5 minutes
IN_10 - in 10 minutes
IN_15 - in 15 minutes
IN_30 - in 30 minutes
IN_60 - in 1 hour
IN_90 - in 1.5 hour
IN_120 - in 2 hours
IN_180 - in 3 hours
IN_240 - in 4 hours
ON_THE_HOUR - at the next whole hour
END_OF_DAY - at midnight
TOMORROW_AT_8 - tomorrow at 08:00
END_OF_WEEK - at the end of the week
END_OF_MONTH - at the end of the month.
DELETE n/a - removes the expiration.
REDIRECT Control redirection of dialplan items Id of dialplan item EQUALS Number to redirect to.
DELETE n/a - removes the redirect.
RECORD Control if call is recorded EQUALS true or false.
EMAIL Send an e-mail Recipient e-mail address EQUALS Body of e-mail, max. 256 chars.
SMS Send an SMS Recipient phone number EQUALS SMS message, max. 256 chars.
RINGTONE Set alternative ringtone to use on supported SIP phones EQUALS Ringtone 0-9.
DELETE n/a - removes alternative ringtone.

If expandAction is true, the follow is added:

actions[].targetName String Name of the target (only for action type PRESENSE_STATE, PRESENCE_LOCATION, PRESENCE_MESSAGE, PRESENCE_EXPIRES and REDIRECT).
actions[].valueName String Name of the music on hold class (only for action MUSIC_ON_HOLD and how EQUALS).

Example - normal

{
  offset: 0,
  limit: 50,
  total: 25,
  setValues: [
    {
      _id: '12345678901234567890ABCD',
      name: 'Get customer number',
      number: '830',
      redirect: null,
      notes: 'Get the customer number from the caller',
      inputMode: true,
      actions: 3
    },
    {
      ...
    }
  ]

Example - full=true

{
  offset: 0,
  limit: 50,
  total: 25,
  urlRouters: [
    {
      _id: '12345678901234567890ABCD',
      type: 'SET_VALUE',
      customer: '12345678901234567890BCED',
      name: 'Get customer number',
      number: '830',
      startAudio: '12345678901234567890AAAA',
      redirect: null,
      notes: 'Get the customer number from the caller',
      inputMode: true,
      inputLength: 10,
      inputRepeat: 2,
      timeout: 10,
      timeoutAudio: '12345678901234567890BBBB',
      actions: [
        {
          type: 'CALL_VARIABLE',
          target: 'customer-number',
          how: 'EQUALS_INPUT'
        },
        {
          type: 'CDR_NOTE',
          how: 'EQUALS_INPUT'
        },
        {
          type: 'CDR_NOTE',
          how: 'PREFIX',
          value: 'customer='
      ]
    },
    {
      ...
    }
  ]
}

Errors

Error code Message Description
403 access_denied Insufficient access level
500 internal_error <Unspecified>