le_voicecall_interface.h File Reference

#include "legato.h"
#include "le_mdmDefs_interface.h"
#include "le_audio_interface.h"

Go to the source code of this file.

Typedefs

typedef struct le_voicecall_Call * le_voicecall_CallRef_t
 
typedef struct le_voicecall_StateHandler * le_voicecall_StateHandlerRef_t
 
typedef void(* le_voicecall_StateHandlerFunc_t) (le_voicecall_CallRef_t reference, const char *identifier, le_voicecall_Event_t event, void *contextPtr)
 

Enumerations

enum  le_voicecall_Event_t {
  LE_VOICECALL_EVENT_ALERTING = 0, LE_VOICECALL_EVENT_CONNECTED = 1, LE_VOICECALL_EVENT_TERMINATED = 2, LE_VOICECALL_EVENT_OFFLINE = 3,
  LE_VOICECALL_EVENT_BUSY = 4, LE_VOICECALL_EVENT_RESOURCE_BUSY = 5, LE_VOICECALL_EVENT_CALL_END_FAILED = 6, LE_VOICECALL_EVENT_CALL_ANSWER_FAILED = 7,
  LE_VOICECALL_EVENT_INCOMING = 8
}
 
enum  le_voicecall_TerminationReason_t {
  LE_VOICECALL_TERM_NETWORK_FAIL = 0, LE_VOICECALL_TERM_BAD_ADDRESS = 1, LE_VOICECALL_TERM_BUSY = 2, LE_VOICECALL_TERM_LOCAL_ENDED = 3,
  LE_VOICECALL_TERM_REMOTE_ENDED = 4, LE_VOICECALL_TERM_UNDEFINED = 5
}
 

Functions

void le_voicecall_ConnectService (void)
 
le_result_t le_voicecall_TryConnectService (void)
 
void le_voicecall_DisconnectService (void)
 
le_voicecall_StateHandlerRef_t le_voicecall_AddStateHandler (le_voicecall_StateHandlerFunc_t handlerPtr, void *contextPtr)
 
void le_voicecall_RemoveStateHandler (le_voicecall_StateHandlerRef_t addHandlerRef)
 
le_voicecall_CallRef_t le_voicecall_Start (const char *DestinationID)
 
le_result_t le_voicecall_End (le_voicecall_CallRef_t reference)
 
le_result_t le_voicecall_Delete (le_voicecall_CallRef_t reference)
 
le_result_t le_voicecall_Answer (le_voicecall_CallRef_t reference)
 
le_result_t le_voicecall_GetTerminationReason (le_voicecall_CallRef_t reference, le_voicecall_TerminationReason_t *reasonPtr)
 
le_audio_StreamRef_t le_voicecall_GetTxAudioStream (le_voicecall_CallRef_t reference)
 
le_audio_StreamRef_t le_voicecall_GetRxAudioStream (le_voicecall_CallRef_t reference)
 

Detailed Description

Legato Voice Call Service include file.

Typedef Documentation

typedef struct le_voicecall_Call* le_voicecall_CallRef_t

Reference returned by Start function and used by End function

typedef void(* le_voicecall_StateHandlerFunc_t) (le_voicecall_CallRef_t reference, const char *identifier, le_voicecall_Event_t event, void *contextPtr)

Handler for voice call state changes.

Parameters
referenceEvent voice call object reference.
identifierIdentifier of the remote party
eventVoice call event.
contextPtr
typedef struct le_voicecall_StateHandler* le_voicecall_StateHandlerRef_t

Reference type used by Add/Remove functions for EVENT 'le_voicecall_State'

Enumeration Type Documentation

Voice call establishment states.

Enumerator
LE_VOICECALL_EVENT_ALERTING 

Voice call establishment in progress. Far end is now alerting its user (outgoing call).

LE_VOICECALL_EVENT_CONNECTED 

Call has been established, and is media is active.

LE_VOICECALL_EVENT_TERMINATED 

Call has terminated.

LE_VOICECALL_EVENT_OFFLINE 

NO Service available to try establish a voice call.

LE_VOICECALL_EVENT_BUSY 

Remote party (callee) is busy.

LE_VOICECALL_EVENT_RESOURCE_BUSY 

All local connection resources (lines/channels) are in use.

LE_VOICECALL_EVENT_CALL_END_FAILED 

Call ending failed.

LE_VOICECALL_EVENT_CALL_ANSWER_FAILED 

Call answering failed.

LE_VOICECALL_EVENT_INCOMING 

Incoming voice call in progress.

Voice call termination reason.

Enumerator
LE_VOICECALL_TERM_NETWORK_FAIL 

Network could not complete the call.

LE_VOICECALL_TERM_BAD_ADDRESS 

Remote address could not be resolved.

LE_VOICECALL_TERM_BUSY 

Caller is currently busy and cannot take the call.

LE_VOICECALL_TERM_LOCAL_ENDED 

Local party ended the call.

LE_VOICECALL_TERM_REMOTE_ENDED 

Remote party ended the call.

LE_VOICECALL_TERM_UNDEFINED 

Undefined reason.

Function Documentation

le_voicecall_StateHandlerRef_t le_voicecall_AddStateHandler ( le_voicecall_StateHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'le_voicecall_State'

This event provides information on voice call state changes

Parameters
[in]handlerPtr
[in]contextPtr
le_result_t le_voicecall_Answer ( le_voicecall_CallRef_t  reference)

Answer to incoming voice call.

Returns
  • LE_OK if the incoming voice call can be answered
  • LE_NOT_FOUND if the incoming voice call object reference is not found.
Parameters
[in]referenceIncoming voice call object reference to answer.
void le_voicecall_ConnectService ( void  )

Connect the current client thread to the service providing this API. Block until the service is available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client-specific Functions.

This function is created automatically.

le_result_t le_voicecall_Delete ( le_voicecall_CallRef_t  reference)

Delete voice call object reference create by le_voicecall_Start() or an incoming voice call.

Returns
  • LE_OK if the delete of voice call can be processed.
  • LE_FAULT if the voice call is not terminated.
  • LE_NOT_FOUND if the voice call object reference is not found.
Parameters
[in]referenceVoice call object reference to delete.
void le_voicecall_DisconnectService ( void  )

Disconnect the current client thread from the service providing this API.

Normally, this function doesn't need to be called. After this function is called, there's no longer a connection to the service, and the functions in this API can't be used. For details, see Client-specific Functions.

This function is created automatically.

le_result_t le_voicecall_End ( le_voicecall_CallRef_t  reference)

Release a voice call.

Returns
  • LE_OK if the end of voice call can be processed.
  • LE_NOT_FOUND if the voice call object reference is not found.
Parameters
[in]referenceVoice call object reference to hang-up.
le_audio_StreamRef_t le_voicecall_GetRxAudioStream ( le_voicecall_CallRef_t  reference)

Called to get the received audio stream. All audio received from the other end of the call is received on this stream.

Returns
Received audio stream reference.
Parameters
[in]referenceVoice call object reference to read from.
le_result_t le_voicecall_GetTerminationReason ( le_voicecall_CallRef_t  reference,
le_voicecall_TerminationReason_t reasonPtr 
)

Get the termination reason of a voice call reference.

Returns
  • LE_OK if the termination reason is got
  • LE_NOT_FOUND if the incoming voice call object reference is not found.
  • LE_FAULT if the voice call is not terminated.
Parameters
[in]referenceVoice call object reference to read from.
[out]reasonPtrTermination reason of the voice call.
le_audio_StreamRef_t le_voicecall_GetTxAudioStream ( le_voicecall_CallRef_t  reference)

Called to get the transmitted audio stream. All audio generated on this end of the call is sent on this stream.

Returns
Transmitted audio stream reference.
Parameters
[in]referenceVoice call object reference to read from.
void le_voicecall_RemoveStateHandler ( le_voicecall_StateHandlerRef_t  addHandlerRef)

Remove handler function for EVENT 'le_voicecall_State'

Parameters
[in]addHandlerRef
le_voicecall_CallRef_t le_voicecall_Start ( const char *  DestinationID)

Start a voice call.

Returns
  • Reference to the voice call (to be used later for releasing the voice call)
  • NULL if the voice call could not be processed
Parameters
[in]DestinationIDDestination identifier for the voice
le_result_t le_voicecall_TryConnectService ( void  )

Try to connect the current client thread to the service providing this API. Return with an error if the service is not available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client-specific Functions.

This function is created automatically.

Returns
  • LE_OK if the client connected successfully to the service.
  • LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
  • LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
  • LE_COMM_ERROR if the Service Directory cannot be reached.