Methods Summary |
---|
public void | answerCall(java.lang.String sessionDescription, int timeout)Answers an incoming call with the specified session description. The
method is only valid to call when the session state is in
{@link State#INCOMING_CALL}.
try {
mSession.answerCall(sessionDescription, timeout);
} catch (RemoteException e) {
loge("answerCall:", e);
}
|
public void | changeCall(java.lang.String sessionDescription, int timeout)Changes the session description during a call. The method is only valid
to call when the session state is in {@link State#IN_CALL}.
try {
mSession.changeCall(sessionDescription, timeout);
} catch (RemoteException e) {
loge("changeCall:", e);
}
|
private ISipSessionListener | createListener()
return new ISipSessionListener.Stub() {
@Override
public void onCalling(ISipSession session) {
if (mListener != null) {
mListener.onCalling(SipSession.this);
}
}
@Override
public void onRinging(ISipSession session, SipProfile caller,
String sessionDescription) {
if (mListener != null) {
mListener.onRinging(SipSession.this, caller,
sessionDescription);
}
}
@Override
public void onRingingBack(ISipSession session) {
if (mListener != null) {
mListener.onRingingBack(SipSession.this);
}
}
@Override
public void onCallEstablished(ISipSession session,
String sessionDescription) {
if (mListener != null) {
mListener.onCallEstablished(SipSession.this,
sessionDescription);
}
}
@Override
public void onCallEnded(ISipSession session) {
if (mListener != null) {
mListener.onCallEnded(SipSession.this);
}
}
@Override
public void onCallBusy(ISipSession session) {
if (mListener != null) {
mListener.onCallBusy(SipSession.this);
}
}
@Override
public void onCallTransferring(ISipSession session,
String sessionDescription) {
if (mListener != null) {
mListener.onCallTransferring(
new SipSession(session, SipSession.this.mListener),
sessionDescription);
}
}
@Override
public void onCallChangeFailed(ISipSession session, int errorCode,
String message) {
if (mListener != null) {
mListener.onCallChangeFailed(SipSession.this, errorCode,
message);
}
}
@Override
public void onError(ISipSession session, int errorCode, String message) {
if (mListener != null) {
mListener.onError(SipSession.this, errorCode, message);
}
}
@Override
public void onRegistering(ISipSession session) {
if (mListener != null) {
mListener.onRegistering(SipSession.this);
}
}
@Override
public void onRegistrationDone(ISipSession session, int duration) {
if (mListener != null) {
mListener.onRegistrationDone(SipSession.this, duration);
}
}
@Override
public void onRegistrationFailed(ISipSession session, int errorCode,
String message) {
if (mListener != null) {
mListener.onRegistrationFailed(SipSession.this, errorCode,
message);
}
}
@Override
public void onRegistrationTimeout(ISipSession session) {
if (mListener != null) {
mListener.onRegistrationTimeout(SipSession.this);
}
}
};
|
public void | endCall()Ends an established call, terminates an outgoing call or rejects an
incoming call. The method is only valid to call when the session state is
in {@link State#IN_CALL},
{@link State#INCOMING_CALL},
{@link State#OUTGOING_CALL} or
{@link State#OUTGOING_CALL_RING_BACK}.
try {
mSession.endCall();
} catch (RemoteException e) {
loge("endCall:", e);
}
|
public java.lang.String | getCallId()Gets the call ID of the session.
try {
return mSession.getCallId();
} catch (RemoteException e) {
loge("getCallId:", e);
return null;
}
|
public java.lang.String | getLocalIp()Gets the IP address of the local host on which this SIP session runs.
try {
return mSession.getLocalIp();
} catch (RemoteException e) {
loge("getLocalIp:", e);
return "127.0.0.1";
}
|
public SipProfile | getLocalProfile()Gets the SIP profile that this session is associated with.
try {
return mSession.getLocalProfile();
} catch (RemoteException e) {
loge("getLocalProfile:", e);
return null;
}
|
public SipProfile | getPeerProfile()Gets the SIP profile that this session is connected to. Only available
when the session is associated with a SIP dialog.
try {
return mSession.getPeerProfile();
} catch (RemoteException e) {
loge("getPeerProfile:", e);
return null;
}
|
ISipSession | getRealSession()
return mSession;
|
public int | getState()Gets the session state. The value returned must be one of the states in
{@link State}.
try {
return mSession.getState();
} catch (RemoteException e) {
loge("getState:", e);
return State.NOT_DEFINED;
}
|
public boolean | isInCall()Checks if the session is in a call.
try {
return mSession.isInCall();
} catch (RemoteException e) {
loge("isInCall:", e);
return false;
}
|
private void | loge(java.lang.String s, java.lang.Throwable t)
Rlog.e(TAG, s, t);
|
public void | makeCall(SipProfile callee, java.lang.String sessionDescription, int timeout)Initiates a call to the specified profile. The session listener is called
back upon defined session events. The method is only valid to call when
the session state is in {@link State#READY_TO_CALL}.
try {
mSession.makeCall(callee, sessionDescription, timeout);
} catch (RemoteException e) {
loge("makeCall:", e);
}
|
public void | register(int duration)Performs registration to the server specified by the associated local
profile. The session listener is called back upon success or failure of
registration. The method is only valid to call when the session state is
in {@link State#READY_TO_CALL}.
try {
mSession.register(duration);
} catch (RemoteException e) {
loge("register:", e);
}
|
public void | setListener(android.net.sip.SipSession$Listener listener)Sets the listener to listen to the session events. A {@code SipSession}
can only hold one listener at a time. Subsequent calls to this method
override the previous listener.
mListener = listener;
|
public void | unregister()Performs unregistration to the server specified by the associated local
profile. Unregistration is technically the same as registration with zero
expiration duration. The session listener is called back upon success or
failure of unregistration. The method is only valid to call when the
session state is in {@link State#READY_TO_CALL}.
try {
mSession.unregister();
} catch (RemoteException e) {
loge("unregister:", e);
}
|