SipAudioCall: re-implemented holding/unholding a call.
Now we do it on the client only instead of re-negotiating with peer
as it's not reliably supported by public sip providers.
Change-Id: Ie59f6d90858a1bb0ff3fea56a3b721149d4bc07d
diff --git a/src/com/android/sip/SipAudioCallImpl.java b/src/com/android/sip/SipAudioCallImpl.java
index 15fc726..73ecc89 100644
--- a/src/com/android/sip/SipAudioCallImpl.java
+++ b/src/com/android/sip/SipAudioCallImpl.java
@@ -341,6 +341,13 @@
}
public synchronized void holdCall() throws SipException {
+ if (mHold) return;
+ if (mRtpSession != null) {
+ mHold = true;
+ mRtpSession.stopSending();
+ mRtpSession.stopReceiving();
+ }
+ /*
try {
if (mChangingSession) return;
mChangingSession = true;
@@ -349,6 +356,7 @@
} catch (Throwable e) {
throwSipException(e);
}
+ */
}
public synchronized void answerCall() throws SipException {
@@ -362,6 +370,13 @@
}
public synchronized void continueCall() throws SipException {
+ if (!mHold) return;
+ if (mRtpSession != null) {
+ mHold = false;
+ mRtpSession.startSending();
+ mRtpSession.startReceiving();
+ }
+ /*
try {
if (mChangingSession) return;
mChangingSession = true;
@@ -370,6 +385,7 @@
} catch (Throwable e) {
throwSipException(e);
}
+ */
}
private SessionDescription createOfferSessionDescription() {