public class

AudioCallManager

extends Object
implements PeerConnectionClient.PeerConnectionEvents RtcEvents
java.lang.Object
   ↳ com.nexmo.sdk.conversation.client.audio.AudioCallManager

Class Overview

Call Manager. Supports one ongoing call/conversation for now. Created by siltus on 17/09/2017.

Summary

Nested Classes
enum AudioCallManager.AudioCallState  
Fields
public static final String[] MANDATORY_PERMISSIONS
Public Constructors
AudioCallManager(Context context, String conversationId, String memberId, ConversationSignalingChannel conversationSignalingChannel)
Public Methods
void disable(RequestHandler listener)
Disable audio calls in the current conversation.
void disableCallStats()
Disable call statistics gathering.
void earmuff(Member member, boolean isEarmuff, RequestHandler listener)
Earmuff any member in the current audio call.
void earmuff(boolean isEarmuff, RequestHandler listener)
Earmuff self in the current audio call.
void enable(AudioCallEventListener listener)
Enable Audio calls in the current conversation.
void enableCallStats(int statCallbackInterval, AudioCallStatsListener listener)
Enable sending call stats to the calling application.
Set<AppRTCAudioManager.AudioDevice> getAvailableAudioRoutes()
AudioCallManager.AudioCallState getState()
void mute(boolean isMute, RequestHandler listener)
Mute self in the current audio call.
void mute(Member member, boolean isMute, RequestHandler listener)
Mute/unmute any member in the current audio call.
void onAnswer(SessionDescription sdp)
void onIceCandidate(IceCandidate candidate)
Callback fired once local Ice candidate is generated.
void onIceCandidatesRemoved(IceCandidate[] candidates)
Callback fired once local ICE candidates are removed.
void onIceConnected()
Callback fired once connection is established (IceConnectionState is CONNECTED).
void onIceDisconnected()
Callback fired once connection is closed (IceConnectionState is DISCONNECTED).
void onIceGatheringDone()
void onLocalDescription(SessionDescription sdp)
Callback fired once local SDP is created and set.
void onPeerConnectionClosed()
Callback fired once peer connection is closed.
void onPeerConnectionError(String description)
Callback fired once peer connection error happened.
void onPeerConnectionStatsReady(RTCStatsReport report)
Callback fired once peer connection statistics is ready.
void setAudioRoute(AppRTCAudioManager.AudioDevice audioRoute)
void startRinging(RequestHandler listener)
Send a start ringing event.
void stopRinging(RequestHandler listener)
Send a stop ringing event.
void updateRtcId(String rtcId)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.nexmo.sdk.conversation.client.audio.PeerConnectionClient.PeerConnectionEvents
From interface com.nexmo.sdk.conversation.client.audio.RtcEvents

Fields

public static final String[] MANDATORY_PERMISSIONS

Public Constructors

public AudioCallManager (Context context, String conversationId, String memberId, ConversationSignalingChannel conversationSignalingChannel)

Public Methods

public void disable (RequestHandler listener)

Disable audio calls in the current conversation. Audio capabilities require user permissions: "android.permission.MODIFY_AUDIO_SETTINGS", "android.permission.RECORD_AUDIO", "android.permission.INTERNET", therefore request would fail if they are REJECTED. The audio has to be enabled enable(AudioCallEventListener) prior to any disable action.

Parameters
listener Mandatory completion listener in charge of dispatching the result.

public void disableCallStats ()

Disable call statistics gathering.

public void earmuff (Member member, boolean isEarmuff, RequestHandler listener)

Earmuff any member in the current audio call.

Parameters
member The member to be ear-muffed.
isEarmuff true or false.
listener Mandatory completion listener in charge of dispatching the result.

public void earmuff (boolean isEarmuff, RequestHandler listener)

Earmuff self in the current audio call.

This is a convenience method, alternatively earmuff(Member, boolean, RequestHandler) can be used to earmuff any member of the call.

Audio has to be flowing before by enabling audio enable(AudioCallEventListener) before.

Parameters
isEarmuff true or false.
listener Mandatory completion listener in charge of dispatching the result.

public void enable (AudioCallEventListener listener)

Enable Audio calls in the current conversation. Audio capabilities require user permissions: "android.permission.MODIFY_AUDIO_SETTINGS", "android.permission.RECORD_AUDIO", "android.permission.INTERNET", therefore request would fail if they are REJECTED. It is recommended to check and ask for these Permissions to be GRANTED before using any Audio feature

Parameters
listener Mandatory completion listener in charge of dispatching the result.
See Also
  • Official doc

    Only one audio conversation is supported at a time, so trying to enable audio simultaneously will fail with {@link NexmoAPIError#audioAlreadyInProgress()}

public void enableCallStats (int statCallbackInterval, AudioCallStatsListener listener)

Enable sending call stats to the calling application. Note: We recommend a standard callback interval of 1000ms.

Parameters
statCallbackInterval Interval for sending stats report onStatsAvailable(RTCStatsReport).
listener Mandatory completion listener in charge of dispatching the result.

public Set<AppRTCAudioManager.AudioDevice> getAvailableAudioRoutes ()

public AudioCallManager.AudioCallState getState ()

public void mute (boolean isMute, RequestHandler listener)

Mute self in the current audio call.

This is a convenience method, alternatively mute(Member, boolean, RequestHandler) can be used to mute/unmute any member of the call.

Audio has to be flowing before muting/un muting, by enabling audio enable(AudioCallEventListener) before.

Parameters
isMute true or false
listener Mandatory completion listener in charge of dispatching the result.

public void mute (Member member, boolean isMute, RequestHandler listener)

Mute/unmute any member in the current audio call.

Parameters
member The Member of this call to be muted/unmuted.
isMute true or false
listener Mandatory completion listener in charge of dispatching the result.

public void onAnswer (SessionDescription sdp)

public void onIceCandidate (IceCandidate candidate)

Callback fired once local Ice candidate is generated.

public void onIceCandidatesRemoved (IceCandidate[] candidates)

Callback fired once local ICE candidates are removed.

public void onIceConnected ()

Callback fired once connection is established (IceConnectionState is CONNECTED).

public void onIceDisconnected ()

Callback fired once connection is closed (IceConnectionState is DISCONNECTED).

public void onIceGatheringDone ()

public void onLocalDescription (SessionDescription sdp)

Callback fired once local SDP is created and set.

public void onPeerConnectionClosed ()

Callback fired once peer connection is closed.

public void onPeerConnectionError (String description)

Callback fired once peer connection error happened.

public void onPeerConnectionStatsReady (RTCStatsReport report)

Callback fired once peer connection statistics is ready.

public void setAudioRoute (AppRTCAudioManager.AudioDevice audioRoute)

public void startRinging (RequestHandler listener)

Send a start ringing event.

Parameters
listener Mandatory completion listener in charge of dispatching the result.

public void stopRinging (RequestHandler listener)

Send a stop ringing event.

Parameters
listener Mandatory completion listener in charge of dispatching the result.

public void updateRtcId (String rtcId)