Generic PBX Device Sync¶
Use the phones of your existing third-party PBX as Daktela devices: the contact centre can ring them, see whether each one is free or busy (Cloudya, Pragma) and β with Cloudya β keep the list of phones and users up to date automatically.
What it does and when to use it¶
Generic PBX Device Sync connects Daktela to an external telephone system (PBX). Phones on that PBX appear in Daktela as Generic PBX Devices under Settings β Devices. When Daktela routes a call to such a device, it rings the phone through a SIP trunk to your PBX.
The integration comes in three types, depending on your PBX:
| Type | What it does |
|---|---|
| Cloudya (NFON) | Imports the PBX extensions as Generic PBX Devices, creates a user for each of them and keeps both in sync. Shows the live line state of every phone in Daktela. |
| Pragma | Shows the live state of the phones in Daktela. You create the Generic PBX Devices yourself; nothing is imported. |
| Trunk with headers | Only sends calls to the PBX through the trunk, with your own SIP headers. No import and no device states. |
Data flows from the PBX to Daktela (extensions and phone states). Daktela doesn't change anything in the PBX; it only places calls to it.
Typical use cases
- Bring office staff into the contact centre. Back-office or branch employees keep their desk phones on the company PBX and still receive contact-centre calls β with phone states in use, only when their phone is free.
- Gradual migration. Run Daktela routing alongside an existing PBX instead of replacing all phones at once.
- No manual onboarding. With Cloudya, a new extension in the PBX appears in Daktela with its own user; when an extension is removed, its device is deleted and its user deactivated.
- Call context for the PBX. Pass the agent, queue or call record ID to the PBX in SIP headers, for example for its own reporting or screen pop.
Tip
This integration is set up by Daktela. Please contact us if you would like to use it.
Prerequisites and setup¶
Prerequisites¶
- Set up by Daktela. The Generic PBX Device Sync tile in Settings β Integrations is available only to Daktela's own administrators, not to customer or partner accounts. Daktela also sets up the SIP trunk between Daktela and your PBX.
- For Cloudya: an API account (user name and password), the base API URL of your Cloudya tenant, and an active Daktela user with a profile, who will be recorded as the creator of the imported users.
- For Pragma: an IPX API user for device states, the base URL of the Pragma server and your tenant prefix.
The steps below describe what Daktela configures, so you know which details to prepare.
Step 1: Create the configuration¶
In Settings β Integrations, open Generic PBX Device Sync, click Configure, choose the Type and fill in the fields for it:
| Field | Type | What to enter |
|---|---|---|
| Title | Cloudya, Pragma | A name for the configuration. |
| Username, Password | Cloudya | The Cloudya API account. |
| Base API URL | Cloudya | The base URL of the Cloudya API. |
| Creator of Backoffice User | Cloudya | The Daktela user on whose behalf imported users are created. The user must be active and have a profile, and can't be deleted while the integration uses it. |
| Sync Refresh Time | Cloudya | How often devices and users are synchronised, in minutes. Default 60, minimum 30. |
| Username for device status, Password for device status | Pragma | The IPX API user for reading device states. |
| Base API URL for device status | Pragma | The base URL of the Pragma server. |
| Prefix device status | Pragma | Your tenant prefix in Pragma. Device numbers reported by Pragma must start with it; the prefix is cut off to get the Daktela device number. Without a prefix, no states are shown. |
| Trunk Name | all | The SIP trunk to the PBX. Filled in automatically (genericpbx). |
| Trunk SIP Headers Template | all | Optional. SIP headers to add to calls sent to the PBX β see SIP headers. |
Step 2: Authorise and activate¶
Click Authorize, then Activate. For Cloudya, Daktela signs in to the Cloudya API with the account you entered; if that fails, you see Failed to authorize Generic Device Sync. Pragma and Trunk with headers are not checked at this point.
Step 3: Devices and users¶
- Cloudya: the first synchronisation starts within a minute of activation. To run one again without waiting for the schedule, open the configuration and click Sync now (from version 33.21.0 and from 32.42.0).
- Pragma and Trunk with headers: create the Generic PBX Devices in Settings β Devices with the same numbers as the phones in the PBX, and assign them to users.
Step 4: Decide whether phone states affect routing (Cloudya)¶
With Cloudya, phone states are always shown in Daktela. Whether they also stop calls from being routed to a busy phone depends on Use presence info to route calls in Settings β Global settings. The setting appears only while a Generic PBX Device Sync configuration is active. With Pragma, phone states always affect routing.
Technical details¶
| Topic | Behaviour |
|---|---|
| Direction | PBX β Daktela: extensions (Cloudya) and phone states (Cloudya, Pragma). Daktela writes nothing to the PBX. |
| Calls to devices | A Generic PBX Device is rung as PJSIP/<device number>@<Trunk Name>. If the device has auto answer turned on, an auto-answer header is added. |
| Device and user sync | Cloudya only. The sync service checks once a minute and runs a sync when Sync Refresh Time has passed since the start of the previous run, or when Sync now was clicked. The minimum of 30 minutes is enforced from version 33.1.0 (and from 31.34.0 and 32.28.0). |
| Phone states | Live: Cloudya sends changes over a server-sent event stream, Pragma over a WebSocket. Daktela doesn't poll for them. |
| Multiple configurations | Only one active configuration is used for phone states and calls. |
| Trunk with headers | Available from version 31.3.0. |
Cloudya: how devices and users are synchronised¶
Daktela signs in with POST <Base API URL>/v1/login, verifies the access token against the keys published at /v1/.well-known/jwks.json, renews it with the refresh token when needed, and reads the extensions from GET /v1/extensions/phone/data. For each extension:
- New extension: Daktela creates a Generic PBX Device whose number is the extension number and whose title is
<extension> - <name>, and a Cloud Phone user with the extension's name. The user's login name is made from the name (lower case, without diacritics, spaces replaced by underscores, with a number appended if the name is taken); the password is random, and recording at call start is turned off. The device is assigned to the user. - Same extension as before: nothing changes. Extensions are matched by their Cloudya ID, so a renamed extension keeps its device and user (their titles aren't updated).
- Extension number changed: the old device is deleted, the user with the old number is deactivated, and a new device and user are created.
- Extension removed from Cloudya: the device is deleted and the user with that number is deactivated.
Errors in a run are written to a CSV file listing each failed device with the reason. The configuration shows the error, the number of failed devices and the file β up to the last 10 failed runs β until a run without errors clears them.
Phone states¶
| PBX state | Daktela device state |
|---|---|
| Idle, on-hook | Online |
| Forwarded because busy (Pragma) | Online |
| Unregistered, offline, blocked, in a conference | Offline |
| Do not disturb (Pragma) | Offline |
| Do not disturb (Cloudya) | Busy |
| Any other state, for example ringing or in a call | Busy |
| No state received for the device yet | Offline |
- Cloudya states come from
GET <Base API URL>/v1/extensions/phone/states; if a phone's presence is do not disturb, that wins, otherwise its line state is used. If the stream sends nothing for 50 seconds or fails, Daktela reconnects after a random 60β120 seconds with a fresh token. While the stream is down, all Cloudya devices are treated as Online, so calls keep flowing. - Pragma states come from the IPX API (
<Base API URL for device status>/ipxapi/server/v1/users/<user>/β¦): Daktela signs in with digest authentication, subscribes to presence for your tenant prefix and listens on a WebSocket. The token is checked every 40 seconds and renewed when it's no longer valid. The server certificate isn't verified, so a self-signed certificate works.
SIP headers¶
Trunk SIP Headers Template is a JSON object of header names and values. Values can contain these placeholders, which Daktela fills in for each call:
| Placeholder | Value |
|---|---|
${HASH(call,activity.user.id)} |
ID of the user the call is for |
${HASH(call,activity.user.name)} |
Login name of the user |
${HASH(call,activity.user.extension)} |
Extension of the user |
${HASH(call,activity.endpoint)} |
Device number that is rung |
${HASH(call,activity.call.name)} |
ID of the call |
${HASH(call,activity.name)} |
ID of the activity |
${HASH(call,activity.queue.id)} |
Queue ID (only when the call has a queue) |
${HASH(call,activity.queue.name)} |
Queue name (only when the call has a queue) |
${HASH(call,activity.call.cdr)} |
Call record (CDR) ID β from version 33.10.0 (and from 32.33.0) |
Example:
{"X-UserName": "${HASH(call,activity.user.name)}", "X-QueueName": "${HASH(call,activity.queue.name)}"}
The headers are added when Daktela rings a Generic PBX Device, and to outbound calls whose route uses the integration's trunk.