diff options
author | repo sync <cywang@google.com> | 2011-06-28 15:25:44 +0800 |
---|---|---|
committer | repo sync <cywang@google.com> | 2011-06-28 19:45:10 +0800 |
commit | 2093561a58e602450f6e4f2aae4831edd1b840f4 (patch) | |
tree | ca630646a0066ed77f454c978778364464625cfa | |
parent | 82155cfc88c9396de9159659cf246caeb08b5f43 (diff) | |
download | frameworks_base-2093561a58e602450f6e4f2aae4831edd1b840f4.zip frameworks_base-2093561a58e602450f6e4f2aae4831edd1b840f4.tar.gz frameworks_base-2093561a58e602450f6e4f2aae4831edd1b840f4.tar.bz2 |
Support INVITE w/o SDP.
bug:3326873
Change-Id: Ie29d2c61b237fee2d8637f4ba3d293a22469cced
-rw-r--r-- | voip/java/android/net/sip/SipAudioCall.java | 3 | ||||
-rw-r--r-- | voip/java/com/android/server/sip/SipSessionGroup.java | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/voip/java/android/net/sip/SipAudioCall.java b/voip/java/android/net/sip/SipAudioCall.java index 2666b69..c1affa6 100644 --- a/voip/java/android/net/sip/SipAudioCall.java +++ b/voip/java/android/net/sip/SipAudioCall.java @@ -26,6 +26,7 @@ import android.net.sip.SimpleSessionDescription.Media; import android.net.wifi.WifiManager; import android.os.Message; import android.os.RemoteException; +import android.text.TextUtils; import android.util.Log; import java.io.IOException; @@ -400,6 +401,7 @@ public class SipAudioCall { @Override public void onRinging(SipSession session, SipProfile peerProfile, String sessionDescription) { + // this callback is triggered only for reinvite. synchronized (SipAudioCall.this) { if ((mSipSession == null) || !mInCall || !session.getCallId().equals( @@ -730,6 +732,7 @@ public class SipAudioCall { } private SimpleSessionDescription createAnswer(String offerSd) { + if (TextUtils.isEmpty(offerSd)) return createOffer(); SimpleSessionDescription offer = new SimpleSessionDescription(offerSd); SimpleSessionDescription answer = diff --git a/voip/java/com/android/server/sip/SipSessionGroup.java b/voip/java/com/android/server/sip/SipSessionGroup.java index 6304369..c0c1b28 100644 --- a/voip/java/com/android/server/sip/SipSessionGroup.java +++ b/voip/java/com/android/server/sip/SipSessionGroup.java @@ -1007,7 +1007,13 @@ class SipSessionGroup implements SipListener { throws SipException { // expect ACK, CANCEL request if (isRequestEvent(Request.ACK, evt)) { - establishCall(false); + String sdp = extractContent(((RequestEvent) evt).getRequest()); + if (sdp != null) mPeerSessionDescription = sdp; + if (mPeerSessionDescription == null) { + onError(SipErrorCode.CLIENT_ERROR, "peer sdp is empty"); + } else { + establishCall(false); + } return true; } else if (isRequestEvent(Request.CANCEL, evt)) { // http://tools.ietf.org/html/rfc3261#section-9.2 |