A voice call is needed for applications that want to establish a voice communication with a remote party. The voice call can be over a mobile network, or over VoIP.
All the functions of this API are provided by the voiceCallService application service.
Here's a code sample binding to Voice Call services:
bindings: { clientExe.clientComponent.le_voicecall -> voiceCallService.le_voicecall }
A voice call can be started using le_voicecall_Start() with the destination identifier passed as a parameter.
Before the voice call is started, an application registers a state handler using le_voicecall_AddStateHandler(). Once the voice call is established, the handler will be called indicating it's now connected. If the state of the voice call changes, then the handler will be called with the new state. To release a voice call, an application can use le_voicecall_End(). Application should use le_voicecall_Delete() to release le_voicecall_CallRef_t voice call reference object.
If a voice call is already started when le_voicecall_Start is called(), a new voice call will not be established. Instead, LE_VOICECALL_EVENT_RESOURCE_BUSY event will be sent. This event means call was not processed, while a LE_VOICECALL_EVENT_TERMINATED event means that the call was not processed and then terminated or failed.
Once an application makes a voice call request, it should monitor the establishment state reported to the registered state handler.
Once the LE_VOICECALL_EVENT_CONNECTED voice call event is received by the application, it must get the Rx and Tx audio streams with le_voicecall_GetRxAudioStream() and le_voicecall_GetTxAudioStream() functions in order to set up the audio path. The audio path can be set up thanks to the audio API (cf. Audio).
If a LE_VOICECALL_EVENT_TERMINATED event is received, application can get the termination reason by using le_voicecall_GetTerminationReason().
An Incoming voice call will be notified by an LE_VOICECALL_EVENT_INCOMING event on state handler with a Call reference le_voicecall_CallRef_t().
Application can answer the call by using le_voicecall_Answer() or reject the call by using le_voicecall_End() passing the call reference le_voicecall_CallRef_t. Application should use le_voicecall_Delete() to release le_voicecall_CallRef_t voice call reference object.
Some applications may have voice call requirements that are not met by the default voice call (e.g., use a least cost voice call link or disable roaming on mobile networks). You can do this by:
le_voicecall_AddStateHandler() , le_voicecall_End() and le_voicecall_Delete() APIs can continue to be used, as described above.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.