Package com.twilio.voice
Interface Call.Listener
- Enclosing class:
- Call
public static interface Call.Listener
Call.Listener interface defines a set of callbacks for events related to call.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
onCallQualityWarningsChanged
(Call call, Set<Call.CallQualityWarning> currentWarnings, Set<Call.CallQualityWarning> previousWarnings) Emitted when network quality warnings have changed for theCall
.void
onConnected
(Call call) The call has connected.void
onConnectFailure
(Call call, CallException callException) The call failed to connect.void
onDisconnected
(Call call, CallException callException) The call was disconnected.void
onReconnected
(Call call) The call is reconnected.void
onReconnecting
(Call call, CallException callException) The call starts reconnecting.void
Emitted once before theonConnected(Call)
callback.
-
Method Details
-
onConnectFailure
The call failed to connect.Calls that fail to connect will result in
onConnectFailure(Call, CallException)
and always return aCallException
providing more information about what failure occurred.- Parameters:
call
- An object model representing a call that failed to connect.callException
- CallException that describes why the connect failed.
-
onRinging
Emitted once before theonConnected(Call)
callback. IfanswerOnBridge
is true, this represents the callee being alerted of a call.The
Call.getSid()
is now available.- Parameters:
call
- An object model representing a call.
-
onConnected
The call has connected.- Parameters:
call
- An object model representing a call.
-
onReconnecting
The call starts reconnecting.Reconnect is triggered when a network change is detected and Call is already in
Call.State.CONNECTED
state. If the call is inCall.State.CONNECTING
or inCall.State.RINGING
when network change happened the SDK will continue attempting to connect, but a reconnect event will not be raised.- Parameters:
call
- An object model representing a call.callException
- CallException that describes the reconnect reason. This would have one of the two possible values with error codes 53001 "Signaling connection disconnected" and 53405 "Media connection failed".
-
onReconnected
The call is reconnected.- Parameters:
call
- An object model representing a call.
-
onDisconnected
The call was disconnected.A call can be disconnected for the following reasons:
- A user calls `disconnect()` on the `Call` object.
- The other party disconnects or terminates the call.
- An error occurs on the client or the server that terminates the call.
If the call ends due to an error the `CallException` is non-null. If the call ends normally `CallException` is null.
- Parameters:
call
- An object model representing a call.callException
- CallException that caused the call to disconnect.
-
onCallQualityWarningsChanged
default void onCallQualityWarningsChanged(@NonNull Call call, @NonNull Set<Call.CallQualityWarning> currentWarnings, @NonNull Set<Call.CallQualityWarning> previousWarnings) Emitted when network quality warnings have changed for theCall
.The trigger conditions for the
Call.CallQualityWarning
s are defined as below:Call.CallQualityWarning.WARN_HIGH_RTT
- Round Trip Time (RTT) > 400 ms for 3 out of last 5 samples.Call.CallQualityWarning.WARN_HIGH_JITTER
- Jitter > 30 ms for 3 out of last 5 samples.Call.CallQualityWarning.WARN_HIGH_PACKET_LOSS
- Packet loss > 1% in 3 out of last 5 samples.Call.CallQualityWarning.WARN_LOW_MOS
- Mean Opinion Score (MOS) < 3.5 for 3 out of last 5 samples.Call.CallQualityWarning.WARN_CONSTANT_AUDIO_IN_LEVEL
` - Audio input level is unchanged for 10 seconds and call is not in muted state.
- Parameters:
call
- An object model representing a call.currentWarnings
- ASet
that contains the currentCall.CallQualityWarning
s.previousWarnings
- ASet
that contains the previousCall.CallQualityWarning
s.
-