api:pbx:valuerouter:update
Table of Contents
API : PBX : Value Router Create
Introduction
A Value Router is a dialplan object that holds one or more rule sets to evaluate. Each ruleset may contain one or more rules of which one or all must be matched. On match a list of actions may be performed and then the caller will be routed to the specified dialplan item.
Request
This request will update a value router. As little as a single property may be provided. If modifying the ruleset, the entire ruleset must be provided.
| URL | https://api.telecomx.dk/pbx/valuerouter/VALUE_ROUTER_ID | ||
|---|---|---|---|
| Method | POST | ||
| Access level | MANAGER or OWNER if user belongs to the customer. RESELLER if customer belongs to the reseller. ADMIN. |
||
| Params | VALUE_ROUTER_ID | Id | Id of value router to update. |
| Body | name | String | Name/description of the value router. |
| number | String | [optional] The phone number to dial to reach this value router item locally. Null if not used. |
|
| startAudio | Id | [optional] A sound item to playback when the value router is entered. |
|
| redirect | String | [optional] Number to redirect to when execution starts. Used to quickly circumvent the value router. Null if not used. |
|
| notes | String | Notes about the value router. | |
| onNoMatchGoto | Id | Id of diaplan item to goto if no rules are matched. | |
| rulesets | Array | List of rulesets to evaluate one by one. | |
| rulesets[].index | Number | Index of the ruleset - order of evaluation. | |
| rulesets[].name | String | Friendly name of the ruleset. | |
| rulesets[].matchAll | Boolean | True if all rules must be matched, otherwise one 1 rule is required to match. | |
| rulesets[].onMatchGoto | Id | Dialplan item to go to on match. | |
| rulesets[].actions | Array | List of actions to perform on match before goto, see below. | |
| rulesets[].actions[].type | String | Type of item to perform action on. | |
| rulesets[].actions[].target | String | Target for types that requires it. | |
| rulesets[].actions[].how | String | How to affect the target of the action. | |
| rulesets[].actions[].value | String | Value to use. | |
| rulesets[].rules | Array | List of rules to evaluate, if one matches (or all if matchAll is true), then actions and/or matchGoto is performed. | |
| rulesets[].rules[].type | String | Type of item to evaluate. | |
| rulesets[].rules[].target | String | Target of evaluation for types that requires it. | |
| rulesets[].rules[].comparison | String | How to compare. | |
| rulesets[].rules[].value | String | Value to compare against. | |
| Rule object | ||||
|---|---|---|---|---|
| Type | Description | Target | Comparison | Value |
| CALL_VARIABLE | A variable that only exists with the call | Name of the variable a-z A-Z 0-9 _ and - | EQUALS | Must match this text or number. |
| NOT_EQUALS | Must not match this text or number. | |||
| GREATER_THAN | Must be greater than this (nummeric comparison). | |||
| LESS_THAN | Must be less than this (nummeric comparison). | |||
| STARTS_WITH | Must start with this string. | |||
| ENDS_WITH | Must end with this string. | |||
| CONTAINS | Must contain this string. | |||
| LENGTH_EQUALS | Must have this number of chars. | |||
| LENGTH_LESS_THAN | Must have less than this number of chars. | |||
| LENGTH_GREATER_THAN | Must have more that this number of chars. | |||
| RX | Regular expression to match. | |||
| CALL_DURATION | The number of seconds the call has lasted so far | EQUALS | Number of seconds to match. | |
| NOT_EQUALS | Must not match this number of seconds. | |||
| GREATER_THAN | Must be greater than this number of seconds. | |||
| LESS_THAN | Must be less than this number of seconds. | |||
| CALL_ORIGIN | Where the call started from | EQUALS | EXTERNAL, SIP, MOBILE or DIALPLAN. | |
| NOT_EQUALS | EXTERNAL, SIP, MOBILE or DIALPLAN. | |||
| CALL_DIRECTION | Call direction | EQUALS | INBOUND or OUTBOUND. | |
| NOT_EQUALS | INBOUND or OUTBOUND. | |||
| VARIABLE | A persistent system variable | Name of the variable a-z A-Z 0-9 _ and - | EQUALS | Must match this text or number. |
| NOT_EQUALS | Must not match this text or number. | |||
| GREATER_THAN | Must be greater than this (nummeric comparison). | |||
| LESS_THAN | Must be less than this (nummeric comparison). | |||
| STARTS_WITH | Must start with this string. | |||
| ENDS_WITH | Must end with this string. | |||
| CONTAINS | Must contain this string. | |||
| LENGTH_EQUALS | Must have this number of chars. | |||
| LENGTH_LESS_THAN | Must have less than this number of chars. | |||
| LENGTH_GREATER_THAN | Must have more that this number of chars. | |||
| RX | Regular expression to match. | |||
| 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. |
| A_NUMBER | The callers phone number | EQUALS | Must match this phone number. | |
| NOT_EQUALS | Must not match this phone number. | |||
| STARTS_WITH | Must start with this number. | |||
| ENDS_WITH | Must end with this number. | |||
| CONTAINS | Must contain this number. | |||
| LENGTH_EQUALS | Must have this number of digits. | |||
| LENGTH_LESS_THAN | Must have less than this number of digits. | |||
| LENGTH_GREATER_THAN | Must have more that this number of digits. | |||
| RX | Regular expression to match. | |||
| A_NAME | The callers name | EQUALS | Must match this string. | |
| NOT_EQUALS | Must not match this text or number. | |||
| GREATER_THAN | Must be greater than this (nummeric comparison). | |||
| LESS_THAN | Must be less than this (nummeric comparison). | |||
| STARTS_WITH | Must start with this string. | |||
| ENDS_WITH | Must end with this string. | |||
| CONTAINS | Must contain this string. | |||
| LENGTH_EQUALS | Must have this number of chars. | |||
| LENGTH_LESS_THAN | Must have less than this number of chars. | |||
| LENGTH_GREATER_THAN | Must have more that this number of chars. | |||
| RX | Regular expression to match. | |||
| A_NUMBER_SECRET | Is callers number marked as secret | EQUALS | true or false. | |
| B_NUMBER | The called phone number | EQUALS | Must match this phone number. | |
| NOT_EQUALS | Must not match this phone number. | |||
| STARTS_WITH | Must start with this number. | |||
| ENDS_WITH | Must end with this number. | |||
| CONTAINS | Must contain this number. | |||
| LENGTH_EQUALS | Must have this number of digits. | |||
| LENGTH_LESS_THAN | Must have less than this number of digits. | |||
| LENGTH_GREATER_THAN | Must have more that this number of digits. | |||
| RX | Regular expression to match. | |||
| DIVERSION_NUMBER | The phone number of the one who diverted the call (if diverted) | EQUALS | Must match this phone number. | |
| NOT_EQUALS | Must not match this phone number. | |||
| STARTS_WITH | Must start with this number. | |||
| ENDS_WITH | Must end with this number. | |||
| CONTAINS | Must contain this number. | |||
| LENGTH_EQUALS | Must have this number of digits. | |||
| LENGTH_LESS_THAN | Must have less than this number of digits. | |||
| LENGTH_GREATER_THAN | Must have more that this number of digits. | |||
| RX | Regular expression to match. | |||
| CDR_NOTE | A note stored with the CDR for the call | EQUALS | Must match this string. | |
| NOT_EQUALS | Must not match this text or number. | |||
| GREATER_THAN | Must be greater than this (nummeric comparison). | |||
| LESS_THAN | Must be less than this (nummeric comparison). | |||
| STARTS_WITH | Must start with this string. | |||
| ENDS_WITH | Must end with this string. | |||
| CONTAINS | Must contain this string. | |||
| LENGTH_EQUALS | Must have this number of chars. | |||
| LENGTH_LESS_THAN | Must have less than this number of chars. | |||
| LENGTH_GREATER_THAN | Must have more that this number of chars. | |||
| RX | Regular expression to match. | |||
| SIP_PHONE_ONLINE | Is a SIP phone online or offline | Id of SIP phone | EQUALS | true or false. |
| IP_PING | Does a given IP address respond to ping within 2 seconds | IP address or name of call variable | EQUALS | true or false. |
| EXTENSION_ONLINE | Is an extension online (at least one of the extensions SIP phones) | Id of extension | EQUALS | true or false. |
| EXTENSION_STATUS | Is an extension in a given state | Id of extension | EQUALS | AVAILABLE, RINGING or BUSY (includes RINGING state). |
| NOT_EQUALS | AVAILABLE, RINGING or BUSY (includes RINGING state). | |||
| QUEUE_MEMBERS_COUNT | Current number of members in a queue | Id of queue | EQUALS | Must match this number. |
| NOT_EQUALS | Must not match this number. | |||
| GREATER_THAN | Must be greater than this number. | |||
| LESS_THAN | Must be less than this number. | |||
| QUEUE_MEMBERS_AVAILABLE | Current number of members in a queue that are not busy | Id of queue | EQUALS | Must match this number. |
| NOT_EQUALS | Must not match this number. | |||
| GREATER_THAN | Must be greater than this number. | |||
| LESS_THAN | Must be less than this number. | |||
| QUEUE_CALLERS_COUNT | Current number of callers in a queue | Id of queue | EQUALS | Must match this number. |
| NOT_EQUALS | Must not match this number. | |||
| GREATER_THAN | Must be greater than this number. | |||
| LESS_THAN | Must be less than this number. | |||
| QUEUE_CALLERS_MAX_WAIT | The number of seconds the #1 caller in the queue has been waiting | Id of queue | EQUALS | Must match this number. |
| NOT_EQUALS | Must not match this number. | |||
| GREATER_THAN | Must be greater than this number. | |||
| LESS_THAN | Must be less than this number. | |||
| IS_QUEUE_MEMBER | Check if an extension is member of a queue | Id of extension | EQUALS | Id of queue. |
| NOT_EQUALS | Id of queue. | |||
| PRESENCE_STATE | Presence state of employee | Id of employee | EQUALS | AVAILABLE, BUSY, OUT_OF_OFFICE, OFF_WORK or HOLIDAY. |
| NOT_EQUALS | AVAILABLE, BUSY, OUT_OF_OFFICE, OFF_WORK or HOLIDAY. | |||
| PRESENCE_LOCATION | Presence location of employee | Id of employee | EQUALS | Must match this string. |
| NOT_EQUALS | Must not match this string. | |||
| STARTS_WITH | Must start with this string. | |||
| ENDS_WITH | Must end with this string. | |||
| CONTAINS | Must contain this string. | |||
| LENGTH_EQUALS | Must have this number of chars. | |||
| LENGTH_LESS_THAN | Must have less than this number of chars. | |||
| LENGTH_GREATER_THAN | Must have more that this number of chars. | |||
| RX | Regular expression to match. | |||
| PRESENCE_MESSAGE | Presence message of employee | Id of employee | EQUALS | Must match this string. |
| NOT_EQUALS | Must not match this string. | |||
| STARTS_WITH | Must start with this string. | |||
| ENDS_WITH | Must end with this string. | |||
| CONTAINS | Must contain this string. | |||
| LENGTH_EQUALS | Must have this number of chars. | |||
| LENGTH_LESS_THAN | Must have less than this number of chars. | |||
| LENGTH_GREATER_THAN | Must have more that this number of chars. | |||
| RX | Regular expression to match. | |||
| REDIRECT | Current redirect on a dialplan item | Id of dialplan item | EQUALS | Must match this phone number. |
| NOT_EQUALS | Must not match this phone number. | |||
| STARTS_WITH | Must start with this number. | |||
| ENDS_WITH | Must end with this number. | |||
| CONTAINS | Must contain this number. | |||
| LENGTH_EQUALS | Must have this number of digits. | |||
| LENGTH_LESS_THAN | Must have less than this number of digits. | |||
| LENGTH_GREATER_THAN | Must have more that this number of digits. | |||
| RX | Regular expression to match. | |||
| RECORD | Current call recording state | EQUALS | true (on), false (off). | |
| DATE_NOW | The date today | EQUALS | Must match this date. | |
| NOT_EQUALS | Must not match this date. | |||
| GREATER_THAN | Must be after this date. | |||
| LESS_THAN | Must be before this date. | |||
| TIME_NOW | The time right now | EQUALS | Must match this time, e.g. 12:30. | |
| NOT_EQUALS | Must not match this time. | |||
| GREATER_THAN | Must be after this time. | |||
| LESS_THAN | Must be before this time. | |||
| DAY_OF_WEEK | The current day of the week 0 (sunday) to 6 (saturday) | EQUALS | Must match this time, e.g. 1 for monday. | |
| NOT_EQUALS | Must not match this day. | |||
| GREATER_THAN | Must be after this day. | |||
| LESS_THAN | Must be before this day. | |||
| 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. | |
| 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. | |||
Request body example
{ number: '890', startAudio: '123457890124567890FEDE', onNoMatchGoto: '124567890123457890FFEE' }
Response
| JSON object | ||
|---|---|---|
| Property | Type | Description |
| _id | Id | Unique id of the value router. |
| type | String | Always 'VALUE_ROUTER'. |
| customer | Id | Id of the customer the value router belongs to. |
| name | String | Name/description of the value router. |
| number | String | The phone number to dial to reach this value router locally, null if it is not dial-able. |
| startAudio | Id | A sound item to playback when the value router is entered, null if not used. |
| redirect | String | Number to redirect to when execution starts. Used to quickly circumvent the value router item. |
| notes | String | Notes about the value router item. |
| onNoMatchGoto | Id | Id of diaplan item to goto if no rules are matched. |
| rulesets | Array | List of rulesets to evaluate one by one. |
| rulesets[].index | Number | Index of the ruleset - order of evaluation. |
| rulesets[].name | String | Friendly name of the ruleset. |
| rulesets[].matchAll | Boolean | True if all rules must be matched, otherwise one 1 rule is required to match. |
| rulesets[].onMatchGoto | Id | Dialplan item to go to on match. |
| rulesets[].actions | Array | List of actions to perform on match before goto, see below. |
| rulesets[].actions[].type | String | Type of item to perform action on. |
| rulesets[].actions[].target | String | Target for types that requires it. |
| rulesets[].actions[].how | String | How to affect the target of the action. |
| rulesets[].actions[].value | String | Value to use. |
| rulesets[].rules | Array | List of rules to evaluate, if one matches (or all if matchAll is true), then actions and/or matchGoto is performed. |
| rulesets[].rules[].type | String | Type of item to evaluate. |
| rulesets[].rules[].target | String | Target of evaluation for types that requires it. |
| rulesets[].rules[].comparison | String | How to compare. |
| rulesets[].rules[].value | String | Value to compare against. |
| Rule object | ||||
|---|---|---|---|---|
| Type | Description | Target | Comparison | Value |
| CALL_VARIABLE | A variable that only exists with the call | Name of the variable a-z A-Z 0-9 _ and - | EQUALS | Must match this text or number. |
| NOT_EQUALS | Must not match this text or number. | |||
| GREATER_THAN | Must be greater than this (nummeric comparison). | |||
| LESS_THAN | Must be less than this (nummeric comparison). | |||
| STARTS_WITH | Must start with this string. | |||
| ENDS_WITH | Must end with this string. | |||
| CONTAINS | Must contain this string. | |||
| LENGTH_EQUALS | Must have this number of chars. | |||
| LENGTH_LESS_THAN | Must have less than this number of chars. | |||
| LENGTH_GREATER_THAN | Must have more that this number of chars. | |||
| RX | Regular expression to match. | |||
| CALL_DURATION | The number of seconds the call has lasted so far | EQUALS | Number of seconds to match. | |
| NOT_EQUALS | Must not match this number of seconds. | |||
| GREATER_THAN | Must be greater than this number of seconds. | |||
| LESS_THAN | Must be less than this number of seconds. | |||
| CALL_ORIGIN | Where the call started from | EQUALS | EXTERNAL, SIP, MOBILE or DIALPLAN. | |
| NOT_EQUALS | EXTERNAL, SIP, MOBILE or DIALPLAN. | |||
| CALL_DIRECTION | Call direction | EQUALS | INBOUND or OUTBOUND. | |
| NOT_EQUALS | INBOUND or OUTBOUND. | |||
| VARIABLE | A persistent system variable | Name of the variable a-z A-Z 0-9 _ and - | EQUALS | Must match this text or number. |
| NOT_EQUALS | Must not match this text or number. | |||
| GREATER_THAN | Must be greater than this (nummeric comparison). | |||
| LESS_THAN | Must be less than this (nummeric comparison). | |||
| STARTS_WITH | Must start with this string. | |||
| ENDS_WITH | Must end with this string. | |||
| CONTAINS | Must contain this string. | |||
| LENGTH_EQUALS | Must have this number of chars. | |||
| LENGTH_LESS_THAN | Must have less than this number of chars. | |||
| LENGTH_GREATER_THAN | Must have more that this number of chars. | |||
| RX | Regular expression to match. | |||
| 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. |
| A_NUMBER | The callers phone number | EQUALS | Must match this phone number. | |
| NOT_EQUALS | Must not match this phone number. | |||
| STARTS_WITH | Must start with this number. | |||
| ENDS_WITH | Must end with this number. | |||
| CONTAINS | Must contain this number. | |||
| LENGTH_EQUALS | Must have this number of digits. | |||
| LENGTH_LESS_THAN | Must have less than this number of digits. | |||
| LENGTH_GREATER_THAN | Must have more that this number of digits. | |||
| RX | Regular expression to match. | |||
| A_NAME | The callers name | EQUALS | Must match this string. | |
| NOT_EQUALS | Must not match this text or number. | |||
| GREATER_THAN | Must be greater than this (nummeric comparison). | |||
| LESS_THAN | Must be less than this (nummeric comparison). | |||
| STARTS_WITH | Must start with this string. | |||
| ENDS_WITH | Must end with this string. | |||
| CONTAINS | Must contain this string. | |||
| LENGTH_EQUALS | Must have this number of chars. | |||
| LENGTH_LESS_THAN | Must have less than this number of chars. | |||
| LENGTH_GREATER_THAN | Must have more that this number of chars. | |||
| RX | Regular expression to match. | |||
| A_NUMBER_SECRET | Is callers number marked as secret | EQUALS | true or false. | |
| B_NUMBER | The called phone number | EQUALS | Must match this phone number. | |
| NOT_EQUALS | Must not match this phone number. | |||
| STARTS_WITH | Must start with this number. | |||
| ENDS_WITH | Must end with this number. | |||
| CONTAINS | Must contain this number. | |||
| LENGTH_EQUALS | Must have this number of digits. | |||
| LENGTH_LESS_THAN | Must have less than this number of digits. | |||
| LENGTH_GREATER_THAN | Must have more that this number of digits. | |||
| RX | Regular expression to match. | |||
| DIVERSION_NUMBER | The phone number of the one who diverted the call (if diverted) | EQUALS | Must match this phone number. | |
| NOT_EQUALS | Must not match this phone number. | |||
| STARTS_WITH | Must start with this number. | |||
| ENDS_WITH | Must end with this number. | |||
| CONTAINS | Must contain this number. | |||
| LENGTH_EQUALS | Must have this number of digits. | |||
| LENGTH_LESS_THAN | Must have less than this number of digits. | |||
| LENGTH_GREATER_THAN | Must have more that this number of digits. | |||
| RX | Regular expression to match. | |||
| CDR_NOTE | A note stored with the CDR for the call | EQUALS | Must match this string. | |
| NOT_EQUALS | Must not match this text or number. | |||
| GREATER_THAN | Must be greater than this (nummeric comparison). | |||
| LESS_THAN | Must be less than this (nummeric comparison). | |||
| STARTS_WITH | Must start with this string. | |||
| ENDS_WITH | Must end with this string. | |||
| CONTAINS | Must contain this string. | |||
| LENGTH_EQUALS | Must have this number of chars. | |||
| LENGTH_LESS_THAN | Must have less than this number of chars. | |||
| LENGTH_GREATER_THAN | Must have more that this number of chars. | |||
| RX | Regular expression to match. | |||
| SIP_PHONE_ONLINE | Is a SIP phone online or offline | Id of SIP phone | EQUALS | true or false. |
| IP_PING | Does a given IP address respond to ping within 2 seconds | IP address or name of call variable | EQUALS | true or false. |
| EXTENSION_ONLINE | Is an extension online (at least one of the extensions SIP phones) | Id of extension | EQUALS | true or false. |
| EXTENSION_STATUS | Is an extension in a given state | Id of extension | EQUALS | AVAILABLE, RINGING or BUSY (includes RINGING state). |
| NOT_EQUALS | AVAILABLE, RINGING or BUSY (includes RINGING state). | |||
| QUEUE_MEMBERS_COUNT | Current number of members in a queue | Id of queue | EQUALS | Must match this number. |
| NOT_EQUALS | Must not match this number. | |||
| GREATER_THAN | Must be greater than this number. | |||
| LESS_THAN | Must be less than this number. | |||
| QUEUE_MEMBERS_AVAILABLE | Current number of members in a queue that are not busy | Id of queue | EQUALS | Must match this number. |
| NOT_EQUALS | Must not match this number. | |||
| GREATER_THAN | Must be greater than this number. | |||
| LESS_THAN | Must be less than this number. | |||
| QUEUE_CALLERS_COUNT | Current number of callers in a queue | Id of queue | EQUALS | Must match this number. |
| NOT_EQUALS | Must not match this number. | |||
| GREATER_THAN | Must be greater than this number. | |||
| LESS_THAN | Must be less than this number. | |||
| QUEUE_CALLERS_MAX_WAIT | The number of seconds the #1 caller in the queue has been waiting | Id of queue | EQUALS | Must match this number. |
| NOT_EQUALS | Must not match this number. | |||
| GREATER_THAN | Must be greater than this number. | |||
| LESS_THAN | Must be less than this number. | |||
| IS_QUEUE_MEMBER | Check if an extension is member of a queue | Id of extension | EQUALS | Id of queue. |
| NOT_EQUALS | Id of queue. | |||
| PRESENCE_STATE | Presence state of employee | Id of employee | EQUALS | AVAILABLE, BUSY, OUT_OF_OFFICE, OFF_WORK or HOLIDAY. |
| NOT_EQUALS | AVAILABLE, BUSY, OUT_OF_OFFICE, OFF_WORK or HOLIDAY. | |||
| PRESENCE_LOCATION | Presence location of employee | Id of employee | EQUALS | Must match this string. |
| NOT_EQUALS | Must not match this string. | |||
| STARTS_WITH | Must start with this string. | |||
| ENDS_WITH | Must end with this string. | |||
| CONTAINS | Must contain this string. | |||
| LENGTH_EQUALS | Must have this number of chars. | |||
| LENGTH_LESS_THAN | Must have less than this number of chars. | |||
| LENGTH_GREATER_THAN | Must have more that this number of chars. | |||
| RX | Regular expression to match. | |||
| PRESENCE_MESSAGE | Presence message of employee | Id of employee | EQUALS | Must match this string. |
| NOT_EQUALS | Must not match this string. | |||
| STARTS_WITH | Must start with this string. | |||
| ENDS_WITH | Must end with this string. | |||
| CONTAINS | Must contain this string. | |||
| LENGTH_EQUALS | Must have this number of chars. | |||
| LENGTH_LESS_THAN | Must have less than this number of chars. | |||
| LENGTH_GREATER_THAN | Must have more that this number of chars. | |||
| RX | Regular expression to match. | |||
| REDIRECT | Current redirect on a dialplan item | Id of dialplan item | EQUALS | Must match this phone number. |
| NOT_EQUALS | Must not match this phone number. | |||
| STARTS_WITH | Must start with this number. | |||
| ENDS_WITH | Must end with this number. | |||
| CONTAINS | Must contain this number. | |||
| LENGTH_EQUALS | Must have this number of digits. | |||
| LENGTH_LESS_THAN | Must have less than this number of digits. | |||
| LENGTH_GREATER_THAN | Must have more that this number of digits. | |||
| RX | Regular expression to match. | |||
| RECORD | Current call recording state | EQUALS | true (on), false (off). | |
| DATE_NOW | The date today | EQUALS | Must match this date. | |
| NOT_EQUALS | Must not match this date. | |||
| GREATER_THAN | Must be after this date. | |||
| LESS_THAN | Must be before this date. | |||
| TIME_NOW | The time right now | EQUALS | Must match this time, e.g. 12:30. | |
| NOT_EQUALS | Must not match this time. | |||
| GREATER_THAN | Must be after this time. | |||
| LESS_THAN | Must be before this time. | |||
| DAY_OF_WEEK | The current day of the week 0 (sunday) to 6 (saturday) | EQUALS | Must match this time, e.g. 1 for monday. | |
| NOT_EQUALS | Must not match this day. | |||
| GREATER_THAN | Must be after this day. | |||
| LESS_THAN | Must be before this day. | |||
| 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. | |
| 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 expandRulesets is true, the follow is added:
| Property | Type | Description |
|---|---|---|
| rulesets[].actions[].targetName | String | Name of the target (only for action type PRESENSE_STATE, PRESENCE_LOCATION, PRESENCE_MESSAGE, PRESENCE_EXPIRES). |
| rulesets[].actions[].valueName | String | Name of the music on hold class (only for action MUSIC_ON_HOLD and how EQUALS). |
| rulesets[].actions[].target | Object | For type REDIRECT, target is overwritten with an object containing _id, name, type, number. |
| rulesets[].rules[].targetName | String | Name of the target (only for rule type SIP_PHONE_ONLINE, PRESENCE_STATE, PRESENCE_LOCATION, PRESENCE_MESSAGE. |
| rulesets[].rules[].target | Object | For type REDIRECT, EXTENSION_ONLINE, EXTENSION_STATE, QUEUE_MEMBERS_COUNT, QUEUE_MEMBERS_AVAILABLE, QUEUE_CALLERS_COUNT and QUEUE_CALLERS_MAX_WAIT target is overwritten with an object containing _id, name, type, number. |
Example
{ _id: '12345678901234567890ABCD', type: 'VALUE_ROUTER', customer: '12345678901234567890BCED', name: 'Is caller VIP', number: '888', startAudio: '12345678901234567890FEDE', redirect: null, notes: 'Check if caller is VIP and ensure caller gets the VIP treatment', onNoMatchGoto: '124567890123457890FFEE', rulesets: [ { index: 0, name: 'Gold members', matchAll: true, onMatchGoto: '12345678901234567890BBBB', rules: [ { type: 'CALL_VARIABLE', target: 'customer_type', comparison: 'EQUALS', value: 'GOLD' }, { type: 'TIME_NOW', comparison: 'GREATER_THAN', value: '08:00' }, { type: 'TIME_NOW', comparison: 'LESS_THAN', value: '16:00' } ], actions: [ { type: 'A_NAME', how: 'PREFIX', value: 'VIP: ' }, { type: 'MUSIC_ON_HOLD', how: 'EQUALS', value: '1234567890123457890CCCC' } ] }, { index: 1, name: 'Platinum members', matchAll: false, onMatchGoto: '1234567890123457890DDDD', rules: [ { type: 'CALL_VARIABLE', target: 'customer_type', comparison: 'EQUALS', value: 'PLATINUM' } ], actions: [ { type: 'A_NAME', how: 'PREFIX', value: 'VIP:' } ] } ] }
Errors
| Error code | Message | Description |
|---|---|---|
| 404 | customer | Customer not found or not active |
| 404 | not_found | Value 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 |
| 404 | startAudio | Audio file not found |
| 404 | onNoMatchGoto | Dialplan item not found |
| 422 | rulesets[x].actions[x].type | Missing or invalid |
| 422 | rulesets[x].actions[x].how | Missing or invalid |
| 422 | rulesets[x].actions[x].target | Missing or invalid |
| 422 | rulesets[x].actions[x].target | Not a valid e-mail address |
| 422 | rulesets[x].actions[x].target | Not a valid phone number |
| 422 | rulesets[x].actions[x].value | E-mail body missing or too long |
| 422 | rulesets[x].actions[x].value | Missing or invalid |
| 422 | rulesets[x].actions[x].value | Missing or not a number |
| 422 | rulesets[x].actions[x].value | Missing or too long |
| 422 | rulesets[x].actions[x].value | E-mail body missing or too long |
| 422 | rulesets[x].actions[x].value | SMS message missing or too long |
| 422 | rulesets[x].rules[x].type | Missing or invalid |
| 422 | rulesets[x].rules[x].target | Missing or invalid |
| 422 | rulesets[x].rules[x].comparison | Missing or invalid |
| 422 | rulesets[x].rules[x].value | Missing or invalid |
| 422 | rulesets[x].rules[x].value | Missing or not a number |
| 422 | rulesets[x].rules[x].value | Missing or not a valid date |
| 422 | rulesets[x].rules[x].value | Missing or not a valid time |
| 422 | rulesets[x].rules[x].value | Missing or too long |
| 422 | rulesets[x].rules[x].value | Not a valid regular expression |
| 404 | rulesets[x].actions[x].value | Music on hold class not found |
| 404 | rulesets[x].actions[x].target | Employee not found |
| 404 | rulesets[x].rules[x].target | Employee not found |
| 404 | rulesets[x].actions[x].target | Dialplan item not found |
| 404 | rulesets[x].rules[x].target | Dialplan item not found |
| 404 | rulesets[x].onMatchGoto | Dialplan item not found |
| 404 | rulesets[x].rules[x].target | SIP phone not found |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |
api/pbx/valuerouter/update.txt · Last modified: 2021/01/30 20:54 by Per Møller