Manage Devices

In order to integrate Call Control into your app you'll need to find the device used by your user.
After initialization you can use the Jabra library to find available devices.

Devices and connections

Physical devices can have multiple ways of connecting to the PC. For example, a headset might be connected via a USB cable, but it can also be connected wirelessly to a dongle or a DECT base.

The Jabra library refers to these as individual connections. For a device to exist, it must have at least one connection.

A physical device can be connected both with a USB cable and a dongle simultaneously. The Jabra library tries to reflect this example by showing:

  • The dongle as a device with a single connection.
  • The headset as a device with two connections:
    • The USB connection.
    • The wireless connection.

In the example above, the dongle is referred as a "parent device" to the headset. Consequently, a "child device" is a device that is connected through a dongle or a DECT device. These devices are called "children" as they cannot be communicated with directly - everything has to go through the dongle or DECT base, which in this case is referred as a "parent" to the headset.

Available Devices List

The Jabra library maintain a list of available devices.

You can get the current list of devices, or you can register to receive events whenever the list changes.
Registering for device list events will trigger an immediate event with the current list of available devices.

async function printDevices(jabralib) {
    try {
        jabralib.deviceList.subscribe((devices) => {
            console.log("Current list of available devices:");

            devices.forEach(async (device) => {
                console.log(`${device.name} - ${device.productId}`)
            });
        });
    } catch (err) {
        console.log(err.message);
    }
}

Individual Added/Removed Device Events

As an alternative to receiving the full list of available devices on each change, it is also possible to subscribe to deviceAdded and deviceRemoved events.
With this approach you'll only get the device that was affected.

async function printDevices(jabralib) {
    try {
        console.log("Available devices:");

        jabralib.deviceList.forEach(async (device) => {
            console.log(`${device.name} - ${device.productId}`)
        });

        jabralib.deviceAdded.subscribe((device) => {
            console.log(`Added: ${device.name} - ${device.productId}`);
        });

        jabralib.deviceRemoved.subscribe((device) => {
            console.log(`Removed: ${device.name} - ${device.productId}`);
        });
    } catch (err) {
        console.log(err.message);
    }
}

Device Connection List

Every device maintains a list of its available connections.

You can get the current list of connections for that device, or you can register to receive events whenever the list changes. Similar to the device list, registering for the connections list will trigger an immediate event.

const device; // assuming an instance of IDevice

device.connectionList.subscribe((deviceConnections) => {
    console.log(`Current list of connections for device ${device.name}:`);

    deviceConnections.forEach((connection) => {
        console.log(`${connection.id} - ${connection.type}`);
    });
});

Individual Added/Removed Connection Events

As an alternative to receiving the full list of a devices' available connections on each change, it is also possible to subscribe to connectionAdded and connectionRemoved events. With these events, you'll only get the specific connection that changed for that device.

const device; // assuming an instance of IDevice

device.connectionAdded.subscribe((newConnection) => {
    console.log(`Added connection to ${device.name} - ${newConnection.type}`);
});

device.connectionRemoved.subscribe((removedConnection) => {
    console.log(`Removed connection from ${device.name} - ${removedConnection.type}`);
});

Next Steps