public class Call
extends InternalCall
It is strongly recommended that Call instances are created and accessed from a single application thread. Accessing an instance from multiple threads may cause synchronization problems. Listeners are called on the thread that created the Call instance, unless the thread that created the Call instance does not have a Looper. In that case, the listener will be called on the application’s main thread.
Modifier and Type | Class and Description |
---|---|
static class |
Call.Issue
An enum representing issue type associated with a call.
|
static interface |
Call.Listener
Call.Listener interface defines a set of callbacks for events related to
call.
|
static class |
Call.Score
An enum representing call quality score.
|
static class |
Call.State
An enum describing the possible states of a Call.
|
Modifier and Type | Method and Description |
---|---|
void |
disconnect()
Disconnects the Call.
|
String |
getFrom()
Returns the caller information when available.
|
String |
getSid()
Returns the call sid.
|
Call.State |
getState()
Returns the current state of the call.
|
void |
getStats(StatsListener statsListener)
Retrieve stats for all media tracks and notify
StatsListener via calling thread. |
String |
getTo()
Returns the callee information when available.
|
void |
hold(boolean hold)
Holds or un-holds the audio.
|
boolean |
isMuted()
Reports whether the audio input is muted.
|
boolean |
isOnHold()
Reports whether the call is on hold.
|
void |
mute(boolean mute)
Mutes or unmutes the audio input.
|
void |
postFeedback(Call.Score score,
Call.Issue issue)
Posts the feedback collected for this call to Twilio.
|
void |
sendDigits(String digits)
Sends a string of DTMF digits.
|
public String getFrom()
public String getTo()
public String getSid()
Call.State.RINGING
state.public Call.State getState()
Call is in Call.State.CONNECTING
state when it is made or accepted.
Call is in Call.State.RINGING
state when it is ringing.
Call transitions to Call.State.CONNECTED
state when connected to Twilio.
Call transitions to Call.State.DISCONNECTED
state when disconnected.
public void getStats(StatsListener statsListener)
StatsListener
via calling thread.
In case where call is in Call.State.DISCONNECTED
state, reports won't be delivered.statsListener
- listener that receives stats reports for all media tracks.public void postFeedback(Call.Score score, Call.Issue issue)
score
- - the call quality score.issue
- - the issue type associated with the call.public void mute(boolean mute)
public void sendDigits(String digits)
digits
- A string of digits to be sent. Valid values are "0" - "9", "*", "#", and "w". Each "w" will cause a 500 ms pause between digits sent.public void hold(boolean hold)
public boolean isMuted()
public boolean isOnHold()
public void disconnect()
3.0.0-beta6