7 Call Lock

By controlling access to the device, the Call Lock function ensures that two or more softphones do not use the same Jabra device at the same time. It is not an absolute lock but acts as a semaphore to assist softphones using the same device, while reducing interference.

You can acquire a Call Lock function prior to performing any form of call control. By doing so, it informs other applications that use the Jabra SDK libraries that the call control part of the device is in use.

When you acquire a lock before using the call control functions, softphones can co-exist without interfering with each other. However, if acquiring the lock fails, then another application is already using the device, therefore your application must not use call control for the device.

The lock remains active for the duration of the call. Once the call finishes, the lock must be released, which allows other softphones to use the device.

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

Call lock consists of the following three API functions:

API Function Description Usage
Jabra_IsLocked() Reads the current state of the lock within your application Use the Jabra_IsLocked API function to check if your application has already obtained the lock; you may use Jabra_IsLocked without using Jabra_GetLock.

Note
Jabra_IsLocked does not check if another softphone has obtained a lock on the device.
Jabra_GetLock() Acquire the lock Use Jabra_GetLock to see whether you can obtain the lock or not.
Jabra_ReleaseLock() Release the lock -

For sample code that uses API functions on Call Lock, see the Developer's Guide.

7.1 Acquiring Call Lock

Acquiring a Call Lock can be successful, however, it can also fail when another softphone is using the device.

If Call Lock cannot be acquired, your app can continue to work, but it must not integrate with the device nor connect to any call control functions from the Jabra library.

As depicted in the following Unified Modeling Language (UML) diagram, after ending the call, the call lock is released, irrespective of whether the Call lock was acquired successfully or not.

sequenceDiagram
    participant User as User
    participant App as Softphone
    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
    else Does not have call lock
        Note over App: Continue without<br>device integration
    end


    Note over User,Device: Ending call
    App ->> Library: Release call lock

For sample code on acquiring and releasing a call lock, see the Call Lock chapter in the Developer's guide.