summaryrefslogtreecommitdiffstats
path: root/voip
diff options
context:
space:
mode:
authorChia-chi Yeh <chiachi@android.com>2011-09-06 12:47:12 -0700
committerChia-chi Yeh <chiachi@android.com>2011-09-06 13:06:08 -0700
commit54eabd6c929c6f56da28421839b0ef2945cda876 (patch)
tree2ce5cc658af53e44cb66c2d56e86eb7a32be70e8 /voip
parent5f760064e1975a50e4abb63e560731c8b2c7b56c (diff)
downloadframeworks_base-54eabd6c929c6f56da28421839b0ef2945cda876.zip
frameworks_base-54eabd6c929c6f56da28421839b0ef2945cda876.tar.gz
frameworks_base-54eabd6c929c6f56da28421839b0ef2945cda876.tar.bz2
SIP: avoid extreme small values in Min-Expires headers.
If the expiry time cannot be found in Contact header or Expires header, use the default value of 3600 seconds, which is specified in RFC 3261. Change-Id: I2607a398b96743614b01713cfd9b28f40386fac1
Diffstat (limited to 'voip')
-rw-r--r--voip/java/com/android/server/sip/SipSessionGroup.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/voip/java/com/android/server/sip/SipSessionGroup.java b/voip/java/com/android/server/sip/SipSessionGroup.java
index 49effa8..eb5cce7 100644
--- a/voip/java/com/android/server/sip/SipSessionGroup.java
+++ b/voip/java/com/android/server/sip/SipSessionGroup.java
@@ -883,12 +883,15 @@ class SipSessionGroup implements SipListener {
if (expires != null && (time < 0 || time > expires.getExpires())) {
time = expires.getExpires();
}
+ if (time <= 0) {
+ time = EXPIRY_TIME;
+ }
expires = (ExpiresHeader) response.getHeader(MinExpiresHeader.NAME);
if (expires != null && time < expires.getExpires()) {
time = expires.getExpires();
}
Log.v(TAG, "Expiry time = " + time);
- return (time > 0) ? time : EXPIRY_TIME;
+ return time;
}
private boolean registeringToReady(EventObject evt)