From c6548fd9eda7b58f5a2e2a9c01e3c7cafd42fafb Mon Sep 17 00:00:00 2001 From: Hung-ying Tyan Date: Tue, 5 Oct 2010 13:00:13 +0800 Subject: SIP: add SERVER_UNREACHABLE error code. Let SipSession return it when UnknownHostException is caught. Add DisconnectCause.SERVER_UNREACHABLE in Connection and have SipPhone report it when receiving SERVER_UNREACHABLE from SipSession. http://b/issue?id=3061691 Change-Id: I944328ba3ee30c0a9386e89b5c4696d4d9bde000 --- telephony/java/com/android/internal/telephony/Connection.java | 1 + telephony/java/com/android/internal/telephony/sip/SipPhone.java | 3 +++ 2 files changed, 4 insertions(+) (limited to 'telephony') diff --git a/telephony/java/com/android/internal/telephony/Connection.java b/telephony/java/com/android/internal/telephony/Connection.java index 0d983b5..07f90cd 100644 --- a/telephony/java/com/android/internal/telephony/Connection.java +++ b/telephony/java/com/android/internal/telephony/Connection.java @@ -40,6 +40,7 @@ public abstract class Connection { MMI, /* not presently used; dial() returns null */ INVALID_NUMBER, /* invalid dial string */ NUMBER_UNREACHABLE, /* cannot reach the peer */ + SERVER_UNREACHABLE, /* cannot reach the server */ INVALID_CREDENTIALS, /* invalid credentials */ OUT_OF_NETWORK, /* calling from out of network is not allowed */ SERVER_ERROR, /* server error */ diff --git a/telephony/java/com/android/internal/telephony/sip/SipPhone.java b/telephony/java/com/android/internal/telephony/sip/SipPhone.java index 5d8fe1d..4fd4cdd 100755 --- a/telephony/java/com/android/internal/telephony/sip/SipPhone.java +++ b/telephony/java/com/android/internal/telephony/sip/SipPhone.java @@ -875,6 +875,9 @@ public class SipPhone extends SipPhoneBase { public void onError(SipAudioCall call, int errorCode, String errorMessage) { switch (errorCode) { + case SipErrorCode.SERVER_UNREACHABLE: + onError(Connection.DisconnectCause.SERVER_UNREACHABLE); + break; case SipErrorCode.PEER_NOT_REACHABLE: onError(Connection.DisconnectCause.NUMBER_UNREACHABLE); break; -- cgit v1.1