Skip to main content

Overview#

The Jabra library is a modular library. It comes with a "core" interface, which enables developers to discover Jabra USB devices and communicate with these devices via HID. Several modules are then available, which build on top of the core interface, in order to provide common functionality, for example call control or telemetry.

These modules are optional and are meant to be initialized depending on your use case.

The functionality they offer can be almost completely replicated by using the basic core module.

This guide will guide you through initializing and using these optional modules.

Initializing a module#

Initializing the core library#

The prerequisite in using any of the optional modules is initializing the core library.

You can follow the hello world (browser) guide or the hello world (Node) guide in order to initialize the library.

[Note] For the rest of this guide, we will assume you have initialized the core API and assigned it to a variable called coreApi.

Initializing an optional module#

Once you have initialized and have a reference to the core API, you can initialize any optional module.

For every module, a "factory" class exists that helps you initialize the module and make use of the attached Jabra devices.

To initialize a module, you have to create a new instance of the aforementioned "factory" helper class. Creating that instance requires you to pass a reference to the core API. Depending on the module, additional parameters might be required. For example, the Call Control module comes with a CallControlFactory class, and has an additional mandatory parameter, which specifies the unique name and ID of your software product.

Below is an example of initializing the Call Control module:

const coreApi; // We assume the core has been initialized
// Describe your app name and provide a UUID (both should be unique)
// Please DO NOT use the UUID shown below
const softphoneInfo = { name: 'my-third-party-phone-app', uuid: '3b9d6acb-6435-4e75-abd2-7b77c28fa3b0' };
// Creating a CallControlFactory initializes the module
const callControlFactory = new CallControlFactory(softphoneInfo, coreApi);

[Note] The modules do not interfere with each other. You can also initialize the same module multiple times if you so decide, although we do not recommend it.

Using the core API to enable module functionality#

Once the module is initialized, you can take any ISdkDevice instance and feed it to the factory object you used to initialize the optional module.

Using the Call Control module as an example, you can use any ISdkDevice to create a ICallControl object, which you can then use for any call control functionality (for that device):

const callControlFactory = new CallControlFactory(softphoneInfo, coreApi);
// Whenever the core module detects new devices...
coreApi.deviceAdded.subscribe((newCoreDevice: ISdkDevice) => {
// Convert the ISdkDevice to a ICallControl
callControlFactory.createCallControl(newCoreDevice).then(
(deviceCallControl: ICallControl) => {
// Do call control-related functionality, for example
deviceCallControl.takeCallLock();
deviceCallControl.offHook(true);
deviceCallControl.mute(true);
}
);
});