Interface IMultiCallControl

Defines the necessary functionality for easy call control, when handling multiple calls.

This functionality includes:

  • being able to start an outgoing call,
  • signaling an incoming call, answer and reject it,
  • mute/unmute the microphone,
  • subscribing to device events,
  • ending a call, and
  • holding/resuming/swapping a call (unlike ISingleCallControl).

All of this functionality is associated with a single physical device. For every connected Jabra headset, there is an additional instance of IEasyCallControlBase that is used to manipulate its call-related state and functionality.

interface IMultiCallControl {
    device: IDevice;
    holdState: Observable<HoldState>;
    muteState: Observable<MuteState>;
    onDisconnect: Observable<void>;
    ongoingCalls: Observable<number>;
    ringState: Observable<boolean>;
    swapRequest: Observable<undefined>;
    acceptIncomingCall(behavior?: AcceptIncomingCallBehavior): Promise<void>;
    endCall(): Promise<void>;
    hold(): Promise<void>;
    mute(): Promise<void>;
    mute(): void;
    rejectIncomingCall(): void;
    resume(): Promise<void>;
    signalIncomingCall(ringTimeout?: number): Promise<boolean>;
    startCall(): Promise<void>;
    teardown(): void;
    unmute(): void;
}

Hierarchy (View Summary)

Methods

  • Accepts an incoming call and sets the device into call state.

    Parameters

    • Optionalbehavior: AcceptIncomingCallBehavior

      Optionally controls the behavior when accepting an incoming call, defaults to END_CURRENT

    Returns Promise<void>

    If an incoming call is not pending.

    Accepting an incoming call behaves differently whether called from idle (1) or while another call is active (2).

    1. From idle: the device is simply set into call state and the call counter is increased by one.
    2. While another call is active: depends on the behavior parameter. It can either be to end the current call and start a new call (default), or hold the current call and start a new call.
  • Ends the current call.

    Returns Promise<void>

    If a call is not active.

  • Sets the current call on hold.

    Returns Promise<void>

    You can only change the hold state while the device is in an active call.

    If a call is not active.

  • Mutes the device.

    Returns Promise<void>

    You can only change the mute state while the device is in an active call.

    If a call is not active.

  • Mute the device.

    Returns void

    If a call is not active.

    Return type has changed. Now it returns Promise<void> instead of void. Nevertheless, the API will still work without awaiting.

  • Rejects an incoming call.

    Returns void

    The call can be rejected by the user by interacting with their device or with your softphone. In the first case, the incoming call will be automatically rejected and IEasyCallControlBase.signalIncomingCall will resolve with false. The second case requires your softphone to manually call this method, before the incoming call is rejected and IEasyCallControlBase.signalIncomingCall is resolved with false.

    If an incoming call is not pending.

  • Resumes the current call when on hold.

    Returns Promise<void>

    You can only change the hold state while the device is in an active call.

    If a call is not active, or if no call is on hold.

  • Signals that there is an incoming call. The promise resolves only once the incoming call is either accepted or rejected.

    Parameters

    • OptionalringTimeout: number

      Optional parameter, determining how long before the incoming call is automatically rejected due to a timeout.

    Returns Promise<boolean>

    true if the call was accepted, and false if rejected.

    On most devices, this starts the device ringer.

    If the device is locked by another softphone.

  • Sets the device into call state.

    Returns Promise<void>

    If the device is used by another softphone.

  • Teardown the Easy Call Control instance.

    All internal state subscriptions will be stopped to avoid potential memory leaks, and the internal call lock will be released if taken.

    After using this method, you must create a new Easy Call Control instance to continue usage.

    Returns void

    Use this when you want to stop using the ISingleCallControl or IMultiCallControl object but the connection to the device is still active (e.g. when changing device or navigating between views).

  • Unmutes the device.

    Returns void

    You can only change the mute state while the device is in an active call.

    If a call is not active.

Properties

device: IDevice

The single physical device to which the easy call control functionalities are associated to.

holdState: Observable<HoldState>

Emits the hold state of the device whenever that state changes.

This can happen due to interaction with the device (the hold command can differ between devices, but is often triggered by long-pressing the start/end-call button) or due to interaction with your softphone (e.g. pressing a hold button in the GUI).

muteState: Observable<MuteState>

Emits the mute state of the device whenever that state changes.

This can happen due to interaction with the device (e.g. raising the boom arm) or due to interaction with your softphone (e.g. pressing a mute button in the GUI).

onDisconnect: Observable<void>

Emits when the connection used for easy call control gets disconnected.

If this observable emits, the connection and thus the Easy Call Control instance can no longer be used.

If this happens, for example, in the middle of a call, you can select a new device (or the same device with another connection) and recover the state. See ISingleInitialState or IMultiInitialState and for examples refer to the 'Easy Call Control' chapter of the 'Managing Calls' section of the JavaScript Developer's Guide.

ongoingCalls: Observable<number>

Emits the number of calls currently in progress.

0 means that the device is idle with no calls in progress, while 1 or more signifies the number of calls currently active.

Starting a new call - or accepting an incoming call - will increment this counter. Similarly, ending a call will decrement the count until it reaches 0.

To handle multiple-call scenarios, ensure you keep your application's list of ongoing calls in sync with this count.

To handle one active call at a time, do one of the following:

  • treat this value as an ON-OFF toggle,
  • optionally throw an error if the count increases to more than 1, which would mean something went wrong in the application logic, or
  • use ISingleCallControl instead.
ringState: Observable<boolean>

Emits the ring state of the device whenever that state changes.

This can happen whenever a new incoming call is signalled, and whenever that incoming call is accepted or rejected.

swapRequest: Observable<undefined>

Emits whenever swap request is triggered.

This can happen due to interaction with the device (most often the same button that triggers hold) or due to interaction with your softphone (e.g. pressing a swap button in the GUI).

The observable does not emit any value, and it does not keep track of what call was swapped to or from - this should be handled by the softphone application.

The most common implementation pattern would be to maintain a list of ongoing calls in the softphone application. Then, whenever swap is triggered, the active call is moved to the next call in line.