public class ImsCallSession extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ImsCallSession.Listener
Listener for events relating to an IMS session, such as when a session is being
recieved ("on ringing") or a call is outgoing ("on calling").
|
static class |
ImsCallSession.State
Defines IMS call session state.
|
Constructor and Description |
---|
ImsCallSession(IImsCallSession iSession) |
ImsCallSession(IImsCallSession iSession,
ImsCallSession.Listener listener) |
Modifier and Type | Method and Description |
---|---|
void |
accept(int callType,
ImsStreamMediaProfile profile)
Accepts an incoming call or session update.
|
void |
close()
Closes this object.
|
void |
extendToConference(String[] participants)
Extends this call to the conference call with the specified recipients.
|
String |
getCallId()
Gets the call ID of the session.
|
ImsCallProfile |
getCallProfile()
Gets the call profile that this session is associated with
|
ImsCallProfile |
getLocalCallProfile()
Gets the local call profile that this session is associated with
|
String |
getProperty(String name)
Gets the value associated with the specified property of this session.
|
ImsCallProfile |
getRemoteCallProfile()
Gets the remote call profile that this session is associated with
|
IImsCallSession |
getSession()
Gets the native IMS call session.
|
int |
getState()
Gets the session state.
|
IImsVideoCallProvider |
getVideoCallProvider()
Gets the video call provider for the session.
|
void |
hold(ImsStreamMediaProfile profile)
Puts a call on hold.
|
void |
inviteParticipants(String[] participants)
Requests the conference server to invite an additional participants to the conference.
|
boolean |
isAlive()
Determines if the
ImsCallSession is currently alive (e.g. not in a terminated or
closed state). |
boolean |
isInCall()
Checks if the session is in call.
|
boolean |
isMultiparty()
Determines if the session is multiparty.
|
void |
merge()
Merges the active & hold call.
|
void |
reject(int reason)
Rejects an incoming call or session update.
|
void |
removeParticipants(String[] participants)
Requests the conference server to remove the specified participants from the conference.
|
void |
resume(ImsStreamMediaProfile profile)
Continues a call that's on hold.
|
void |
sendDtmf(char c,
Message result)
Sends a DTMF code.
|
void |
sendUssd(String ussdMessage)
Sends an USSD message.
|
void |
setListener(ImsCallSession.Listener listener)
Sets the listener to listen to the session events.
|
void |
setMute(boolean muted)
Mutes or unmutes the mic for the active call.
|
void |
start(String[] participants,
ImsCallProfile profile)
Initiates an IMS conference call with the specified target and call profile.
|
void |
start(String callee,
ImsCallProfile profile)
Initiates an IMS call with the specified target and call profile.
|
void |
startDtmf(char c)
Starts a DTMF code.
|
void |
stopDtmf()
Stops a DTMF code.
|
void |
terminate(int reason)
Terminates a call.
|
String |
toString()
Provides a string representation of the
ImsCallSession . |
void |
update(int callType,
ImsStreamMediaProfile profile)
Updates the current call's properties (ex. call mode change: video upgrade / downgrade).
|
public ImsCallSession(IImsCallSession iSession)
public ImsCallSession(IImsCallSession iSession, ImsCallSession.Listener listener)
public void close()
public String getCallId()
public ImsCallProfile getCallProfile()
public ImsCallProfile getLocalCallProfile()
public ImsCallProfile getRemoteCallProfile()
public IImsVideoCallProvider getVideoCallProvider()
public String getProperty(String name)
public int getState()
ImsCallSession.State
.public boolean isAlive()
ImsCallSession
is currently alive (e.g. not in a terminated or
closed state).True
if the session is alive.public IImsCallSession getSession()
public boolean isInCall()
public void setListener(ImsCallSession.Listener listener)
ImsCallSession
can only hold one listener at a time. Subsequent calls to this method
override the previous listener.listener
- to listen to the session events of this objectpublic void setMute(boolean muted)
muted
- true if the call is muted, false otherwisepublic void start(String callee, ImsCallProfile profile)
ImsCallSession#State#IDLE
.callee
- dialed string to make the call toprofile
- call profile to make the call with the specified service type,
call type and media informationListener#callSessionStarted, Listener#callSessionStartFailed
public void start(String[] participants, ImsCallProfile profile)
ImsCallSession#State#IDLE
.participants
- participant list to initiate an IMS conference callprofile
- call profile to make the call with the specified service type,
call type and media informationListener#callSessionStarted, Listener#callSessionStartFailed
public void accept(int callType, ImsStreamMediaProfile profile)
callType
- call type specified in ImsCallProfile
to be answeredprofile
- stream media profile ImsStreamMediaProfile
to be answeredImsCallSession.Listener.callSessionStarted(com.android.ims.internal.ImsCallSession, com.android.ims.ImsCallProfile)
public void reject(int reason)
reason
- reason code to reject an incoming callImsCallSession.Listener.callSessionStartFailed(com.android.ims.internal.ImsCallSession, com.android.ims.ImsReasonInfo)
public void terminate(int reason)
public void hold(ImsStreamMediaProfile profile)
ImsCallSession.Listener.callSessionHeld(com.android.ims.internal.ImsCallSession, com.android.ims.ImsCallProfile)
is called.profile
- stream media profile ImsStreamMediaProfile
to hold the callListener#callSessionHeld, Listener#callSessionHoldFailed
public void resume(ImsStreamMediaProfile profile)
ImsCallSession.Listener.callSessionResumed(com.android.ims.internal.ImsCallSession, com.android.ims.ImsCallProfile)
is called.profile
- stream media profile ImsStreamMediaProfile
to resume the callListener#callSessionResumed, Listener#callSessionResumeFailed
public void merge()
ImsCallSession.Listener.callSessionMergeStarted(com.android.ims.internal.ImsCallSession, com.android.ims.internal.ImsCallSession, com.android.ims.ImsCallProfile)
is called., Listener#callSessionMergeFailed
public void update(int callType, ImsStreamMediaProfile profile)
callType
- call type specified in ImsCallProfile
to be updatedprofile
- stream media profile ImsStreamMediaProfile
to be updatedListener#callSessionUpdated, Listener#callSessionUpdateFailed
public void extendToConference(String[] participants)
Listener#sessionConferenceExtened, Listener#sessionConferenceExtendFailed
public void inviteParticipants(String[] participants)
Listener#sessionInviteParticipantsRequestDelivered,
Listener#sessionInviteParticipantsRequestFailed
public void removeParticipants(String[] participants)
participants
- participant list to be removed from the conference callListener#sessionRemoveParticipantsRequestDelivered,
Listener#sessionRemoveParticipantsRequestFailed
public void sendDtmf(char c, Message result)
c
- the DTMF to send. '0' ~ '9', 'A' ~ 'D', '*', '#' are valid inputs.public void startDtmf(char c)
c
- the DTMF to send. '0' ~ '9', 'A' ~ 'D', '*', '#' are valid inputs.public void stopDtmf()
public void sendUssd(String ussdMessage)
ussdMessage
- USSD message to sendpublic boolean isMultiparty()
True
if the session is multiparty.public String toString()
ImsCallSession
. Primarily intended for
use in log statements.