A Dial item is a dialplan terminator that end with dialing a phone number. The number can be the number the originating caller called, it can be a fixed predefined number or it can be a number stored in a variable.
This request will update a dial item. As little as a single property is required.
| URL | https://api.telecomx.dk/pbx/dial/DIAL_ID | ||
|---|---|---|---|
| Method | POST | ||
| Access level | MANAGER or OWNER if user belongs to the customer. RESELLER if customer belongs to the reseller. ADMIN. |
||
| Params | DIAL_ID | Id | Id of the dial item to update. |
| Body | name | String | Name/description of the dial item. |
| number | String | [optional] The phone number to dial to reach this dial item locally. Null if not used. |
|
| startAudio | Id | [optional] A sound item to playback when the dial item is entered. |
|
| redirect | String | [optional] Number to redirect to when execution starts. Used to quickly circumvent the dial item. Null if not used. |
|
| notes | String | Notes about the dial item. | |
| method | String | Method used to dial: CALLED - the called number. PREDEFINED - A fixed predefined number. CALL_VARIABLE - number stored in given call variable. VARIABLE - number stored in PBX wide variable. |
|
| value | String | Number data when method is PREDEFINED, CALL_VARIABLE or VARIABLE. PREDEFINED - this is the phone number to dial, in E.164 format or local 1-7 digits. CALL_VARIABLE - this is the name of the call variable that holds the phone number to dial. VARIABLE - this is the name of the system variable that holds the phone number to dial. |
|
| callerId | String | What caller number (a-number) to present: ASIS - no change (default). NUMBER - the number specified in callerId. SECRET - no number, call is marked at secret. |
|
| callerIdNumber | String | Number to present if callerId is NUMBER). | |
| ringtone | ObjectID | If music on hold is to be played to the caller instead of a standard ringtone, this is the id of the PbxMusicOnHold item, otherwise null to use regular ringtone. | |
{ name: 'Support night mode', startAudio: '12345678901234567890AAAA' }
| JSON object | ||
|---|---|---|
| _id | Id | Unique id of the dial item. |
| type | String | Always 'DIAL'. |
| name | String | Name/description of the dial item. |
| number | String | The phone number to dial to reach this dial item locally, null if it is not dial-able. |
| startAudio | Id | A sound item to playback when the dial item is entered, null if not used. |
| redirect | String | Number to redirect to when execution starts. Used to quickly circumvent the dial item. |
| notes | String | Notes about the dial item. |
| method | String | Method used to dial: CALLED - the called number. PREDEFINED - A fixed predefined number. CALL_VARIABLE - number stored in given call variable. VARIABLE - number stored in PBX wide variable. |
| value | String | Number data when method is PREDEFINED, CALL_VARIABLE or VARIABLE. PREDEFINED - this is the phone number to dial, in E.164 format or local 1-7 digits. CALL_VARIABLE - this is the name of the call variable that holds the phone number to dial. VARIABLE - this is the name of the system variable that holds the phone number to dial. |
| callerId | String | What caller number (a-number) to present: ASIS - no change (default). NUMBER - the number specified in callerId. SECRET - no number, call is marked at secret. |
| callerIdNumber | String | Number to present if callerId is NUMBER). |
| ringtone | ObjectID | If music on hold is to be played to the caller instead of a standard ringtone, this is the id of the PbxMusicOnHold item, otherwise null to use regular ringtone. |
{ _id: '12345678901234567890ABCD', type: 'DIAL', name: 'Support night mode', number: '800', startAudio: '12345678901234567890AAAA', redirect: null, notes: 'Used to call support staff during night based on external lookup result', method: 'CALL_VARIABLE', value: 'on_duty_support_number', callerId: 'NUMBER', callerIdNumber: '+4570305050', ringtone: '12345678901234567890ABCD' }
| Error code | Message | Description |
|---|---|---|
| 400 | bad_request | Id not found in request URI |
| 404 | not_found | Dial not found |
| 404 | customer | Customer not found or not active |
| 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 | Start audio file not found |
| 404 | ringtone | The music on hold class does not exist |
| 422 | value | Not a valid phone number |
| 422 | value | Variable name is invalid, use only a-z A-Z 0-9 _ and -. |
| 422 | callerIdNumber | Invalid phone number |
| 409 | method | Value is not one of the permitted values |
| 409 | callerId | Value is not one of the permitted values |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |