Interface ICallControl
- Namespace
- Jabra.NET.Sdk.Modules.CallControl
- Assembly
- Jabra.NET.Sdk.dll
Defines the necessary functionality for call control:
- being able to start/end a call,
- mute/unmute the microphone,
- hold/resume a call,
- start/stop the ringer on the device,
- events for emitted signals from the device, and
- the required call lock for executing all of these functions.
public interface ICallControl
Remarks
All of this functionality is associated with a single connection on a single physical device. For every connected Jabra device, there is an additional instance of ICallControl that is used to manipulate its call-related state and functionality.
Properties
Connection
IConnection Connection { get; }
Property Value
- IConnection
The single physical connection with which the call control functionalities are associated.
DeviceSignals
IObservable<ICallControlSignal> DeviceSignals { get; }
Property Value
- IObservable<ICallControlSignal>
Observable for signals emitted by the device. Whenever the device sends a new signal, this observable will be populated with ICallControlSignal instances for each emission.
Remarks
Reacting to incoming signals is an advanced topic. Before implementing your solution, we urge you to check out the section on Interacting with Jabra Devices in the Integrator's Guide
OnDisconnect
IObservable<Unit> OnDisconnect { get; }
Property Value
- IObservable<Unit>
Emits when the connection used for call control gets disconnected.
Methods
Hold(bool)
Tells the device whether an active call was put on hold or a held up call was resumed.
void Hold(bool shouldHold)
Parameters
shouldHold
booltrue
when a call gets put on hold,false
when it is resumed.
Exceptions
- JabraException
TakeCallLock() throws if a call lock was not acquired prior to execution.
Mute(bool)
Mutes or unmutes the microphone of the device.
void Mute(bool shouldMute)
Parameters
shouldMute
booltrue
to mute the device,false
to unmute it.
Remarks
Should only be used during a call.
Exceptions
- JabraException
TakeCallLock() throws if a call lock was not acquired prior to execution.
OffHook(bool)
Informs the device that there's a change in the call status.
void OffHook(bool isOffHook)
Parameters
isOffHook
boolThe new offHook status of the device. Use
true
when a call becomes active, regardless of call type (outgoing or incoming). Usefalse
when a call has ended and the device is no longer used.
Remarks
This controls if the device considers itself in an active call. When offHook is true, a call is ongoing, otherwise there is no active call.
Exceptions
- JabraException
TakeCallLock() throws if a call lock was not acquired prior to execution.
ReleaseCallLock()
Releases a previously acquired call lock. Releasing the call lock is the last step in performing call control operations so remember to execute it once you are done with the device.
void ReleaseCallLock()
Exceptions
- JabraException
If there is no active call lock imposed on the device by your softphone.
Ring(bool)
Starts or ends the ringing effect on the device. Used to indicate an incoming call.
void Ring(bool shouldRing)
Parameters
shouldRing
booltrue
to start the "ring" effect,false
to stop it.
Exceptions
- JabraException
TakeCallLock() throws if a call lock was not acquired prior to execution.
TakeCallLock()
Tries to acquire a call lock. The call lock is a unique, per-device lock, and is required to change the device state. Acquiring a call lock must be the first step in performing call control operations.
Task<bool> TakeCallLock()
Returns
- Task<bool>
A Task that resolves with
true
if the call lock is successfully acquired,false
otherwise.
Remarks
Acquiring a call lock can fail. This can happen for the following reasons:
-
The device is call locked by another softphone using the Jabra SDK,
resulting in
false
being returned. -
The device is call locked by another instance of your softphone implementation.
This results in
false
being returned. - You've already call locked the device (and therefore can proceed with any other functionality that requires the call lock). This results in a JabraException being thrown.
Exceptions
- JabraException
When the device is already call locked.