User Tools

Site Tools


api:pbx:menurouter:update

API : PBX : Menu Router Update

Introduction

A Menu Router is a dialplan object that routes calls based on the input of the caller. Also known as Interactive Voice Response (IVR).

Request

This request will update a menu router. As little as a single property may be provided. If updating the menu array, the entire array must be provided.

URL https://api.telecomx.dk/pbx/menurouter/MENU_ROUTER_ID
Method POST
Access level MANAGER or OWNER if user belongs to the customer.
RESELLER if customer belongs to the reseller.
ADMIN.
Params MENU_ROUTER_ID ID Id of the menu router to update.
Body name String Name/description of the menu router.
number String [optional] The phone number to dial to reach this menu router item locally. Null if not used.
startAudio Id [optional] A sound item to playback when the menu router is entered.
redirect String [optional] Number to redirect to when execution starts. Used to quickly circumvent the menu router. Null if not used.
notes String Notes about the menu router.
timeout Number Number of seconds to wait for the user to enter a selection, 1-30 seconds.
repeat Number Number of times to repeat on timeout before playing timeout audio and going to timeout goto. 0-10.
timeoutAudio Id Id of an audio item to play when timeout occurs.
invalidAudio Id id fo an audio item to play when the user makes an invalid choice.
timeoutGoto Id Id of a dialplan item to go to on timeout, and after the timeout message has been played. Null to go to the menu itself.
menu Array List of keys and the PbxDialplan item we goto when it is selected.
menu[].input String The input to press for the menu, 0123456789*# - max 20 digits.
menu[].goto Id Id of the PbxDialplans item to goto when the input is matched.
menu[].mode String Operating mode:
ENABLED - Enabled
DISABLED - Disabled
CALL_VARIABLE - Enabled if the call variable is truthful (true, yes, y, 1)
VARIABLE - Enabled if the variable is truthful (true, yes, y, 1)
SWITCH - Enabled if the switch is on
QUEUE_MEMBER - Enabled if extension is member of the queue
menu[].variableName String Name of call variable, variable or switch to check if menu[].mode requires it.
menu[].extension Id Id of extension that must be member of a queue if menu[].mode requires it.
menu[].queue Id Id of queue, that the extension must be member of if menu[].mode requires it.
menu[].audio Id Optional Id of PbxSounds item to playback when this menu item is enabled.

Request body example

{
  name: 'Main menu',
  number: '480',
  timeout: 5,
  repeat: 0
}

Response

JSON object
Property Type Description
_id Id Unique id of the menu router.
type String Always 'MENU_ROUTER'.
customer Id Id of customer the menu router belongs to.
name String Name/description of the menu router.
number String The phone number to dial to reach this menu router locally, null if it is not dial-able.
startAudio Id A sound item to playback when the menu router is entered, null if not used.
redirect String Number to redirect to when execution starts. Used to quickly circumvent the menu router item.
notes String Notes about the menu router item.
timeout Number Number of seconds to wait for the user to enter a selection, 1-30 seconds.
repeat Number Number of times to repeat on timeout before playing timeout audio and going to timeout goto. 0-10.
timeoutAudio Id Id of an audio item to play when timeout occurs.
invalidAudio Id id fo an audio item to play when the user makes an invalid choice.
timeoutGoto Id Id of a dialplan item to go to on timeout, and after the timeout message has been played. Null to go to the menu itself.
menu Array List of keys and the PbxDialplan item we goto when it is selected.
menu[].input String The input to press for the menu, 0123456789*# - max 20 digits.
menu[].goto Id Id of the PbxDialplans item to goto when the input is matched.
menu[].mode String Operating mode:
ENABLED - Enabled
DISABLED - Disabled
CALL_VARIABLE - Enabled if the call variable is truthful (true, yes, y, 1)
VARIABLE - Enabled if the variable is truthful (true, yes, y, 1)
SWITCH - Enabled if the switch is on
QUEUE_MEMBER - Enabled if extension is member of the queue
menu[].variableName String Name of call variable, variable or switch to check if menu[].mode requires it.
menu[].extension Id Id of extension that must be member of a queue if menu[].mode requires it.
menu[].queue Id Id of queue, that the extension must be member of if menu[].mode requires it.
menu[].audio Id Optional Id of PbxSounds item to playback when this menu item is enabled.

Example

{
  _id: '12345678901234567890ABCD',
  type: 'MENU_ROUTER',
  customer: '12345678901234567890BBCD',
  name: 'Main menu',
  number: '404',
  startAudio: null,
  redirect: null,
  notes: 'Primary menu during opening hours',
  timeout: 10,
  repeat: 2,
  timeoutAudio: '12345678901234567890AAAA',
  invalidAudio: '12345678901234567890BBBB',
  timeoutGoto: '12345678901234567890CCCC',
  menu: [
    {
      input: '1',
      goto: '12345678901234567890DDDD',
      mode: 'ENABLED',
      audio: '12345678901234567890AB01',
    },
    {
      input: '2',
      goto: '12345678901234567890EEEE',
      mode: 'SWITCH',
      variableName: 'AdamInTheOffice',
      audio: '12345678901234567890AB01',
    },
    {
      input: '3',
      goto: '12345678901234567890FFFF',
      mode: 'SWITCH',
      variableName: 'AndrewInTheOffice',
      audio: '12345678901234567890AB01',
    }
  ]
}

Errors

Error code Message Description
404 customer Customer not found or not active
404 not_found Menu router not found
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
409 menu[x].input Input already used
422 menu[x].input Input is invalid, use 0-9 # and *
404 menu[x].goto Dialplan item not found
422 menu[x].mode Invalid mode
422 menu[x].variableName Invalid variable name
422 menu[x].extension Invalid extension
422 menu[x].queue Invalid queue
404 menu[x].audio Audio not found
404 startAudio Start audio file not found
422 timeout Invalid timeout, use 1 - 30 seconds
422 repeat Invalid repeat, use 0 - 10 times
404 timeoutGoto Dialplan item not found
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/pbx/menurouter/update.txt · Last modified: 2021/01/30 12:49 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki