List available extensions in a given context

Description

As a UI developer I need to know which extensions are available in a given context to propose my user with an available extension.

The way to do that at the moment is to use the context API to find the range for my ressource type. Users from 10000 to 19999 for example.

Then I have to list all extensions filtered on my context to figure out which extensions are still available.

For contexts with 10000 extensions this can be quite taxing for the user to do that computation.

A new API should be added that would allow the UI to get these available extensions easily.

 

The API could be something like

GET /context/<id>/ranges/available/<type>?limit=10&offset=0&order=exten&direction=asc { "extensions": [ {"exten": "1000", context="<context-name>", tenant_uuid="<tenant-uuid>"}, {"exten": "1001", context="<context-name>", tenant_uuid="<tenant-uuid>"}, ... ], "total": 934 }

In this example the type could be user, group, conference, queue

Zendesk Ticket IDs

None

Activity

Show:

Pascal Cadotte October 17, 2023 at 12:50 PM
Edited

Here’s a counter proposition after some discussions

GET /context/<id>/ranges/<type>?available=true&limit=10&offset=0&order=exten&direction=asc { "items": [ {"start": "1000", "end": "1004"}, # 1000 to 1004 are available {"start": "1006", "end": "1006"}, # 1006 is available {"start": "1010", "end": "1999"}, # 1010 to 1999 are available ], "total": 3 }

If we do not specify the available=true query string the body would only contain the ranges defined in the context without any filtering.

Pagination is based on listed ranges not on extensions, a limit=10 could return 10 ranges containing 4000 extensions

Done

Details

Priority

Assignee

Reporter

Approvers

Nabil Ben Youssef

Pair

Nabil Ben Youssef

Fix versions

Sprint

Zendesk Support

Created October 4, 2023 at 2:53 PM
Updated November 1, 2023 at 7:31 PM
Resolved October 30, 2023 at 2:31 PM

Flag notifications