diff options
author | Brad Fitzpatrick <bradfitz@android.com> | 2011-03-29 08:53:48 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-03-29 08:53:48 -0700 |
commit | 397de169e5462bf0c62506827819f93336b3f123 (patch) | |
tree | 1e54bf618f07565402bd46bb101e62a1ee972569 | |
parent | 37c1bbb51a5013f4319447106f834a4a9e0511cb (diff) | |
parent | fae5e2894ff3c09f27efac2a7ee6b9cfd4ed14b0 (diff) | |
download | frameworks_base-397de169e5462bf0c62506827819f93336b3f123.zip frameworks_base-397de169e5462bf0c62506827819f93336b3f123.tar.gz frameworks_base-397de169e5462bf0c62506827819f93336b3f123.tar.bz2 |
am fae5e289: am 6f67e7bf: am 2e383bc6: Merge "Making it possible to call SIP calls with special allowed chars."
* commit 'fae5e2894ff3c09f27efac2a7ee6b9cfd4ed14b0':
Making it possible to call SIP calls with special allowed chars.
-rw-r--r--[-rwxr-xr-x] | telephony/java/com/android/internal/telephony/sip/SipPhone.java | 5 | ||||
-rw-r--r-- | voip/java/com/android/server/sip/SipHelper.java | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/telephony/java/com/android/internal/telephony/sip/SipPhone.java b/telephony/java/com/android/internal/telephony/sip/SipPhone.java index 7373cbb..5471289 100755..100644 --- a/telephony/java/com/android/internal/telephony/sip/SipPhone.java +++ b/telephony/java/com/android/internal/telephony/sip/SipPhone.java @@ -40,6 +40,7 @@ import com.android.internal.telephony.PhoneNotifier; import java.text.ParseException; import java.util.List; +import java.util.regex.Pattern; /** * {@hide} @@ -386,8 +387,8 @@ public class SipPhone extends SipPhoneBase { Connection dial(String originalNumber) throws SipException { String calleeSipUri = originalNumber; if (!calleeSipUri.contains("@")) { - calleeSipUri = mProfile.getUriString().replaceFirst( - mProfile.getUserName() + "@", + String replaceStr = Pattern.quote(mProfile.getUserName() + "@"); + calleeSipUri = mProfile.getUriString().replaceFirst(replaceStr, calleeSipUri + "@"); } try { diff --git a/voip/java/com/android/server/sip/SipHelper.java b/voip/java/com/android/server/sip/SipHelper.java index ac580e7..4ee86b6 100644 --- a/voip/java/com/android/server/sip/SipHelper.java +++ b/voip/java/com/android/server/sip/SipHelper.java @@ -27,6 +27,8 @@ import java.text.ParseException; import java.util.ArrayList; import java.util.EventObject; import java.util.List; +import java.util.regex.Pattern; + import javax.sip.ClientTransaction; import javax.sip.Dialog; import javax.sip.DialogTerminatedEvent; @@ -215,9 +217,11 @@ class SipHelper { String tag) throws ParseException, SipException { FromHeader fromHeader = createFromHeader(userProfile, tag); ToHeader toHeader = createToHeader(userProfile); + + String replaceStr = Pattern.quote(userProfile.getUserName() + "@"); SipURI requestURI = mAddressFactory.createSipURI( - userProfile.getUriString().replaceFirst( - userProfile.getUserName() + "@", "")); + userProfile.getUriString().replaceFirst(replaceStr, "")); + List<ViaHeader> viaHeaders = createViaHeaders(); CallIdHeader callIdHeader = createCallIdHeader(); CSeqHeader cSeqHeader = createCSeqHeader(requestType); |