api:pbx:queue:get
Table of Contents
API : PBX : Queue Get
Introduction
A Queue item is a dialplan call distribution entity with advanced features for members and callers.
Request
This request will return a single queue.
| URL | https://api.telecomx.dk/pbx/queue/QUEUE_ID | |
|---|---|---|
| Method | GET | |
| Access level | PERSONAL if user is a member or may be a member of the queue. VIEWER, MANAGER or OWNER if user belongs to the customer. RESELLER if customer belongs to the reseller. ADMIN. |
|
| Param | QUEUE_ID | Id of the queue (24 hex-char string) |
| Query | expandGoto | [optional] True to expand goto id's into _id/type/number/name objects |
| members | [optional] True to also include list of queue members. |
|
| callers | [optional] True to also include list of callers currently in the queue. |
|
Query examples
https://api.telecomx.dk/pbx/queue/1234567890ABCDEF12345678 https://api.telecomx.dk/pbx/queue/1234567890ABCDEF12345678?members=true&callers=true https://api.telecomx.dk/pbx/queue/1234567890ABCDEF12345678?expandGoto=true
Response
| JSON object | ||
|---|---|---|
| _id | Id | Unique id of the queue item. |
| type | String | Always 'QUEUE'. |
| customer | Id | Id of the customer the queue belongs to. |
| 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. |
| strategy | String | How calls are distributed to the queue members: CONCURRENT - call all available members simultaneously. ROUND_ROBIN - call next available member. SEQUENTIAL - call first available member(s) according to member priority. LONGEST_IDLE - call the available member that has been idle for the longest time. LEAST_CALLS - call the available member that has answered the fewest calls today. RANDOM - call a random available member. |
| musicOnHold | Id | Id of music on hold class to use for music when waiting in the queue. Null to inherit previously set class or fallback to default class. |
| whenAllMembersBusyGoto | Id | Id of dialplan item to send caller to if all members are busy, null if not used. |
| whenNoMembersGoto | Id | Id of dialplan item to send caller to if queue has no members, null if not used. |
| whenTimeoutGoto | Id | Id of dialplan item to send caller to on timeout. |
| maxWaitTime | Number | Number of seconds a caller may stay in the queue before timeout - 1-86400 seconds, 0 to disable. |
| announcePosition | Boolean | If the current queue position should be announced when the caller advances in the queue. |
| announceWaitTime | Boolean | If the expected remaining wait time should be announced when the caller advances in the queue. |
| outboundCallerId | String | Number to present when calling external members and mobile phones: DEFAULT - callers number NUMBER - phone number specified in outboundCallerIdNumber SECRET - call is marked as secret caller, no number is presented. MARK - callers number is postfixed with *outboundCallerIdNumber. |
| outboundCallerIdNumber | String | If outboundCallerId is NUMBER, this is the number to present on outbound calls. If outboundCallerId is MARK, this is the number to postfix the callers number with. |
| priority | Number | Priority in relation to other queues, 1-10. Lowest gets access to members first. |
| ringLoopLength | Number | Number of seconds members are rung in each ring loop before timing out. Default 30 seconds. |
| prefixNameWithLabel | String | Optional text label to prefix callers name with, on SIP phones. |
| prefixNameWithWaitTime | Boolean | True to prefix callers name with the time the caller waited in the queue. |
| serviceLevel | Number | Max. seconds a call may wait to be answered to uphold the service level, default 60. |
| serviceLevelCritical | Number | Max. seconds a call may wait to be answered before it is considered critical, default 300. |
| callback | Object | Callback settings |
| callback.enabled | boolean | Permit callback, where the caller confirms her number, is hung up, and when first in the queue is called back, when a member answers. |
| callback.delay | number | This is the number of seconds the caller must have waited in the queue for callback to be available. 0-3600 seconds. |
| callback.domesticOnly | boolean | If callback is only available for domestic callers. |
| callback.message | Id | Id of audio to playback to the caller after caller presses 1 to enable callback. Null if not used. |
| breakout | Object | Breakout settings |
| breakout.enabled | boolean | True if feature is enabled. |
| breakout.delay | number | This is the number of seconds the caller must have waited in the queue for breakout to be available. 0-3600 seconds. |
| breakout.key | string | Key to press to break out of the queue. |
| breakout.goto | Id | Id of dialplan item to goto when breakout key is pressed. |
| announcements | Array | List of announcements to playback to the caller |
| announcements[].delay | Number | Number of seconds caller waits in the queue before this announcement is played. 0-3600 seconds. |
| announcements[].message | Id | Id of audio to playback. |
| announcementsLoop | Boolean | True to start over on the announcement list after playing the last announcement. |
| member | Object | Member settings |
| member.wrapup | Number | Period of time after a member has finished a call, before the next call may be offered to the member. 0-3600 seconds. |
| member.announce | Id | Id of audio to playback to the member before handing over the caller. Null if not used. |
| member.accept | Boolean | If true and the called member is an external number or a mobile phone - then the member will be presented with “this is a call from queue X from caller NUMBER and NAME (if available) - press 1 to accept call or hangup”. Then enabled the member to accept the call or let it pass on to to the next in line. |
| member.dynamic | Boolean | True if members can join and leave the queue. False if only MANAGER and up may add/remove members. |
| member.group | Id | Id of a group whose members are the only ones who may join the queue. Requires dynamic to be true. Null if not used. |
| member.sipOnly | Boolean | True if only SIP phones should be called. If extensions has both SIP and mobile phones, only the SIP phones will get calls from the queue. |
| member.overrideOffWork | Boolean | True if members with status OFF_WORK and OUT_OF_OFFICE shall also be called. |
| member.persistPriority | Boolean | True if members priority is persisted, so that when the member joins again without providing priority the last known priority is used. |
| member.lockLastMember | Boolean | True if last member of queue is locked and can't leave |
| members | Array | Members of the queue - only included if members=true |
| members[]._id | String | Unique id of the member. Used when removing member from the queue. |
| members[].extension | Id | Id of a member extension, null if member is external. |
| members[].number | String | Phone number of external member. Null if member is extension. |
| members[].name | String | Name of the member. Employee's name if extension is used, or name from phonebook - if available. |
| members[].priority | Number | Priority of member in the queue, 1-20, lower gets calls first. Defaults to 1. |
| members[].calls | Number | Number of calls answered today. |
| members[].seconds | Number | Number of seconds talking to queue callers today. |
| members[].lastCallEnded | Date | Date and time the member ended the last call. |
| members[].permanent | Boolean | If true, the member cannot leave the queue. It can only be done via API/Web by a MANAGER or higher. |
| callers | Array | List of callers currently in the queue - only included if callers=true |
| callers[]._id | String | Unique id of the call - <channel-id>-<hostname>. |
| callers[].state | String | State of caller: QUEUED - waiting to be answered CALLBACK - waiting to be answered but requires callback VIP - VIP caller waiting to be answered, not included when calculating position in queue. |
| callers[].number | String | Callers number. |
| callers[].name | String | Callers name - if available. |
| callers[].privacy | Boolean | True if callers number is secret. |
| callers[].entered | Date | Date and time when the caller entered the queue. |
| callers[].answered | Date | Date and time when the caller was answered (or called back). |
| callers[].presentation | String | The number the caller called. Used as a-number when doing callback. |
| callers[].answeredByExtension | Id | Extension id of member who answered the call. |
| callers[].answeredByNumber | String | Phone number of member who answered the call. |
Example
{ _id: '12345678901234567890ABCD', type: 'QUEUE', name: 'Support queue', customer: '12345678901234567890ADEF', number: '510', startAudio: null, redirect: null, notes: 'Technical support queue - manager is Donald Duck', strategy: 'CONCURRENT', musicOnHold: '12345678901234567890AAAA', whenAllMembersBusyGoto: '123456789012334567890BBBB', whenNoMembersGoto: '12345678901234567890CCCC', whenTimeoutGoto: '12345678901234567890DDDD', maxWaitTime: 600, announcePosition: false, announceWaitTime: false, outboundCallerId: 'NUMBER', outboundCallerIdNumber: '+4570305052', priority: 1, ringLoopLength: 30, prefixNameWithLabel: 'SUPQ:', prefixNameWithWaitTime: true, serviceLevel: 60, serviceLevelCritical: 300, callback: { enabled: true, delay: 180, domesticOnly: true, message: '12345678901234567890EEEE' }, breakout: { enabled: true, delay: 180, key: '1', goto: '1234567890123457890ABCD' }, announcements: [ { delay: 60, message: '12345678901234567890FFFF' }, { delay: 180, message: '12345678901234567890FEFE' } ], announcementsLoop: true, member: { wrapup: 30, announce: null, accept: true, dynamic: true, group: '1234567890123457890DEDE', sipOnly: false, overrideOffWork: false, persistPriority: false, lockLastMember: false }, members: [ { _id: '12345678901234567890DADA', extension: '1234567890124567890DBDB', number: null, priority: 1, calls: 0, seconds: 0, lastCallEnded: null, permanent: false }, { ... } ], callers: [ { _id: '46265y784.234-pbx1.telecomx.dk', state: 'QUEUED', number: '+4535203040', name: 'Bamse & Kylling', privacy: false, entered: '2018-01-01T00:00:00.000Z', answered: '2018-01-01T00:00:00.000Z', presentation: '+4570305050', answeredByExtension: null, answeredByNumber: null }, { ... } ] }
Errors
| Error code | Message | Description |
|---|---|---|
| 400 | bad_request | Id not found in requestURI |
| 404 | not_found | Queue not found |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |
api/pbx/queue/get.txt · Last modified: 2025/04/28 07:01 by Thomas Andersen