Call Lock

As described in the accompanying Integrator's Guide Section, the first step in being able to change the state of a device states is acquiring a call lock.

How to acquire a call lock

// 1. Initialize library
// 2. Acquire connected devices

// Create a `ICallControl` object from an arbitrary device
const deviceCallControl = await callControlFactory.createCallControl(
  jabra.deviceList.value[0]
);

try {
  let doesDeviceHaveLock = await deviceCallControl.takeCallLock();

  if (doesDeviceHaveLock) {
    // You can now set device states, e.g. callControl.setMute(true)
  }
} catch (err) {
  alert(err); // will throw if you already have the call lock
}

How to release a call lock

try {
  deviceCallControl.releaseCallLock();
} catch (err) {
  alert(err); // will throw if you did not have the call lock
}

Summary

  1. Make sure to acquire a lock for the device.

  2. Once acquired, you can synchronize states between your app, the library, and the Jabra headset.

  3. Once the call ends, make sure to release the lock.

Next Steps