Call lock

The Call Lock functionality ensures that two (or more) softphones do not use the same Jabra device at the same time - it does so by controlling access to the device. Please note that Call Lock is not an absolute lock; it is a semaphore to assist softphones using the same device without interfering with each other.

You acquire a ‘Call Lock’ before you perform any form of call control. The Call Lock informs other applications that use the Jabra SDK libraries to “keep hands-off”. The lock is kept for the duration of the call, once the call is finished, you release the lock to allow other softphones to use the device.

By acquiring a lock before using the call control functions softphones can co-exist without interfering with each other - if acquiring the lock fails another softphone is currently using the device. Note that interference may still occur if the Call Lock functionality is not implemented by all softphones.

Call Lock consists of three API functions:

  1. Jabra_GetLock()
  2. Jabra_ReleaseLock()
  3. Jabra_IsLocked()

Use Jabra_GetLock to acquire the lock, use ‘Jabra_ReleaseLock’ to release the lock.

Jabra_IsLocked reads the current state of the lock within your application. This can be used to check if your application already has obtained the lock; using Jabra_IsLocked does not affect performance and has been provided as a convenient way of checking this without using Jabra_GetLock. Depending on the situation, the lock might already be acquired by your application, hence an internal check for the lock should be the first step in acquiring the lock. Executing multiple features in quick succession is an example of when the lock might already be acquired.

Note that Jabra_IsLocked() does not check if another softphone has obtained a lock on the device. You must use Jabra_GetLock to see if you can obtain the lock or not.

The current Call Lock functionality is backward compatible with the one introduced in the first generation of Jabra SDK libraries (C# only).

Moreover, if call lock is not implemented on all applications, interference may still occur as there is no check to validate whether the device is available.

Acquiring and releasing a call lock

See the following diagram showing a call lock release when acquiring is successful.

sequenceDiagram
    participant User as User
    participant App as Application
    participant Library as Jabra Library
    participant Device as Headset

    Note over User,Device: Incoming call or starting outgoing call
    App ->> Library: Acquire call lock
    Library ->> App: Success/Fail
    alt Has call lock
        loop Each call control interaction
            Note over User,Device: Perform call control actions
        end
        Note over User,Device: Ending call
        App ->> Library: Release call lock
    else Does not have call lock
        Note over App: Continue without<br>device integration
    end