Appearance
Easy Call Control
The recommended way for integrating call control with Jabra headsets into a softphone is to use our Easy Call Control module (multi-call option) which is part of the core SDK module.
Legacy CallControl and Easy Call Control (single-call option)
If you have an existing softphone integration using the legacy CallControl or Easy Call Control (single-call option), you can keep using that and it is fully supported. However, for all new integrations, we strongly recommend basing only on Easy Call Control (multi-call option).
Easy Call Control offers a high-level abstraction for call control integrations and is intended to be quick and easy to integrate with no need to understand the complexities of signals to and from headsets.
Once Easy Call Control is set up for a device, you can change the call state using high-level methods. Likewise, you can subscribe to events from Easy Call Control letting you know what state the device has requested.
Call control sample code
See code samples for a complete demo implementation of Easy Call Control.
Set up Easy Call Control
To set up Easy Call Control for a device, you should first check that the device supports call control and then create an instance of Easy Call Control.
C#
// Create an Easy Call Control Factory from your
// instance of the IApi you got when initializing SDK.
EasyCallControlFactory easyCallControlFactory = new EasyCallControlFactory(jabraSdk);
// If the device supports Easy Call Control, enable it.
if (easyCallControlFactory.SupportsEasyCallControl(device))
{
IMultiCallControl easyCallControl = await easyCallControlFactory.CreateMultiCallControl(device);
}Subscribe to events
By listening to these events your application can keep track of the call state of the device and update your application's state accordingly.
C#
// OngoingCalls is the number of ongoing calls on the device. This includes active and held calls.
easyCallControl.OngoingCalls.Subscribe((ongoingCalls) =>
{
// (...)
});
// MuteState is the microphone mute state of the device.
easyCallControl.MuteState.Subscribe((isMuted) =>
{
// (...)
});
// HoldState indicates if call is on hold or not.
easyCallControl.HoldState.Subscribe((isOnHold) =>
{
// (...)
});
// RingState indicates if the device is ringing or not (incoming call).
easyCallControl.RingState.Subscribe((isRinging) =>
{
// (...)
});
// SwapRequest is called when the user wants to swap between two calls.
easyCallControl.SwapRequest.Subscribe((_) =>
{
// (...)
});Change call state
By using these methods you can update Easy Call Control with state changes from your application.
Optional timeout for incoming calls
When using SignalIncomingCall() with no parameters, a default ringTimeout is applied after which the call is automatically rejected. This default may vary between versions of the SDK. Developers should indicate the desired ringTimeout duration to ensure consistent behavior.
C#
// New incoming call
// The async call to SignalIncomingCall() will not resolve
// until the call is either accepted or rejected.
// Note there is an optional ringTimeout parameter, determining how long (in milliseconds) before the incoming call is automatically rejected due to a timeout.
Console.WriteLine("SignalIncomingCall(30000)");
bool callAcceptedResult = await easyCallControl.SignalIncomingCall(30000); // Incoming call will be automatically rejected after the 30000 milliseconds timeout.
if (callAcceptedResult)
{
Console.WriteLine("SignalIncomingCall() - Call accepted");
}
else
{
Console.WriteLine("SignalIncomingCall() - Call rejected");
}C#
// Accept incoming call.
// Note there is an optional parameter in case of multiple calls to specify whether to
// accept and hang up current call, or accept and put current call on hold.
await easyCallControl.AcceptIncomingCall();C#
// Reject incoming call.
await easyCallControl.RejectIncomingCall();C#
// New outgoing call
await easyCallControl.StartCall();C#
// End active call
await easyCallControl.EndCall();C#
// Put active call on hold
await easyCallControl.Hold();C#
// Resume call from held state
await easyCallControl.Resume();C#
// Mute headset microphone
await easyCallControl.Mute();C#
// Unmute headset microphone
await easyCallControl.Unmute();