Methods Summary |
---|
public android.net.sip.ISipSessionListener | getListener()
return mListener;
|
private void | handle(java.lang.Throwable t, java.lang.String message)
if (t instanceof DeadObjectException) {
mListener = null;
// This creates race but it's harmless. Just don't log the error
// when it happens.
} else if (mListener != null) {
loge(message, t);
}
|
private void | log(java.lang.String s)
Rlog.d(TAG, s);
|
private void | loge(java.lang.String s, java.lang.Throwable t)
Rlog.e(TAG, s, t);
|
public void | onCallBusy(android.net.sip.ISipSession session)
if (mListener == null) return;
proxy(new Runnable() {
@Override
public void run() {
try {
mListener.onCallBusy(session);
} catch (Throwable t) {
handle(t, "onCallBusy()");
}
}
});
|
public void | onCallChangeFailed(android.net.sip.ISipSession session, int errorCode, java.lang.String message)
if (mListener == null) return;
proxy(new Runnable() {
@Override
public void run() {
try {
mListener.onCallChangeFailed(session, errorCode, message);
} catch (Throwable t) {
handle(t, "onCallChangeFailed()");
}
}
});
|
public void | onCallEnded(android.net.sip.ISipSession session)
if (mListener == null) return;
proxy(new Runnable() {
@Override
public void run() {
try {
mListener.onCallEnded(session);
} catch (Throwable t) {
handle(t, "onCallEnded()");
}
}
});
|
public void | onCallEstablished(android.net.sip.ISipSession session, java.lang.String sessionDescription)
if (mListener == null) return;
proxy(new Runnable() {
@Override
public void run() {
try {
mListener.onCallEstablished(session, sessionDescription);
} catch (Throwable t) {
handle(t, "onCallEstablished()");
}
}
});
|
public void | onCallTransferring(android.net.sip.ISipSession newSession, java.lang.String sessionDescription)
if (mListener == null) return;
proxy(new Runnable() {
@Override
public void run() {
try {
mListener.onCallTransferring(newSession, sessionDescription);
} catch (Throwable t) {
handle(t, "onCallTransferring()");
}
}
});
|
public void | onCalling(android.net.sip.ISipSession session)
if (mListener == null) return;
proxy(new Runnable() {
@Override
public void run() {
try {
mListener.onCalling(session);
} catch (Throwable t) {
handle(t, "onCalling()");
}
}
});
|
public void | onError(android.net.sip.ISipSession session, int errorCode, java.lang.String message)
if (mListener == null) return;
proxy(new Runnable() {
@Override
public void run() {
try {
mListener.onError(session, errorCode, message);
} catch (Throwable t) {
handle(t, "onError()");
}
}
});
|
public void | onRegistering(android.net.sip.ISipSession session)
if (mListener == null) return;
proxy(new Runnable() {
@Override
public void run() {
try {
mListener.onRegistering(session);
} catch (Throwable t) {
handle(t, "onRegistering()");
}
}
});
|
public void | onRegistrationDone(android.net.sip.ISipSession session, int duration)
if (mListener == null) return;
proxy(new Runnable() {
@Override
public void run() {
try {
mListener.onRegistrationDone(session, duration);
} catch (Throwable t) {
handle(t, "onRegistrationDone()");
}
}
});
|
public void | onRegistrationFailed(android.net.sip.ISipSession session, int errorCode, java.lang.String message)
if (mListener == null) return;
proxy(new Runnable() {
@Override
public void run() {
try {
mListener.onRegistrationFailed(session, errorCode, message);
} catch (Throwable t) {
handle(t, "onRegistrationFailed()");
}
}
});
|
public void | onRegistrationTimeout(android.net.sip.ISipSession session)
if (mListener == null) return;
proxy(new Runnable() {
@Override
public void run() {
try {
mListener.onRegistrationTimeout(session);
} catch (Throwable t) {
handle(t, "onRegistrationTimeout()");
}
}
});
|
public void | onRinging(android.net.sip.ISipSession session, android.net.sip.SipProfile caller, java.lang.String sessionDescription)
if (mListener == null) return;
proxy(new Runnable() {
@Override
public void run() {
try {
mListener.onRinging(session, caller, sessionDescription);
} catch (Throwable t) {
handle(t, "onRinging()");
}
}
});
|
public void | onRingingBack(android.net.sip.ISipSession session)
if (mListener == null) return;
proxy(new Runnable() {
@Override
public void run() {
try {
mListener.onRingingBack(session);
} catch (Throwable t) {
handle(t, "onRingingBack()");
}
}
});
|
private void | proxy(java.lang.Runnable runnable)
// One thread for each calling back.
// Note: Guarantee ordering if the issue becomes important. Currently,
// the chance of handling two callback events at a time is none.
new Thread(runnable, "SipSessionCallbackThread").start();
|
public void | setListener(android.net.sip.ISipSessionListener listener)
mListener = listener;
|