The Modem Call Control (mcc) API functions of this API are provided by the modemService service.
Here's a code sample binding to modem services:
bindings: { clientExe.clientComponent.le_mcc -> modemService.le_mcc }
To initiate a call, create a new call object with a destination telephone number calling the le_mcc_Create() function.
le_mcc_Start() must still initiate the call when ready.
The le_mcc_Start() function initiates a call attempt (it's asynchronous because it can take time for a call to connect).
It's essential to register a handler function to get the call events. Use le_mcc_AddCallEventHandler() API to install that handler function. The handler will be called for all calls' events (incoming and outgoing).
The le_mcc_RemoveCallEventHandler() API uninstalls the handler function.
The following APIs can be used to manage incoming or outgoing calls:
When finished with the call object, call le_mcc_Delete() to free all the allocated resources associated with the object.
Multi-threading/multi-application behaviour: the callRef is linked to a specific client (i.e. connection with the mcc service). Each client will have its own callRef for a same call. That is, if a call event handler is registered by one thread but le_mcc_Create() is called by another thread, they will each get different call references for the same call. So, when multiple threads are being used to work with the same call, a comparison of the call references themselves can't be used to tell whether or not they refer to the same call.
This code example uses CallAndPlay()
to dial a phone number, and if successful, play a sound file. Once the file has played, the call hangs up.
Receiving calls is similar sending calls. Add a handler through le_mcc_AddCallEventHandler() to be notified of incoming calls.
To answer, call le_mcc_Answer(). To reject it, call le_mcc_HangUp().
This code example uses InstallAutomaticAnswer() to install a call event handler that automatically answers incoming calls. The handler function verifies the incoming call is permitted (through a predefined list), and then decides whether to answer or terminate it.
A special function can be used to hang-up all the ongoing calls: le_mcc_HangUpAll(). This function can be used to hang-up any calls that have been initiated through another client like AT commands.
Calling Line Identification Restriction (CLIR) can be activated or deactivated by le_mcc_SetCallerIdRestrict API. The status is independent for each call object reference. Status can be read with the le_mcc_GetCallerIdRestrict() API. Default value is LE_OFF (Enable presentation of own phone number to remote).
Call waiting and call hold are not yet managed. The event Le_MCC_EVENT_WAITING warns the application for an incoming call, but there's no way to put the current call in hold.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.