This patch assumes that for the same network type,
there MUST be a DISCONNECTED between two CONNECTEDs.
Also removes the Wi-Fi scanning since the framework
already handles this when a WifiLock is held.
Bug: 4283795
Change-Id: I08481e70c651cffcbb516c8cc6584c919078fa4f
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
There can be three expiry times in the same message header. We
choose the smaller value in Expires header and Contact header,
and then we obey the value defined in Min-Expires header. If
none of them is set, the default value is used.
Bug: 5178284
Change-Id: Ie9d4a48c93863e82e5197bb4a0db3f4fec56857c
Some SipService methods may return null, in such cases like no Wi-Fi
connection. Added minimum check to prevent NullPointerExceptions.
Change-Id: Ia7fae57ee893f2564cbfdedb6dc614938ab60ff7
Signed-off-by: Masahiko Endo <masahiko.endo@gmail.com>
The current implementation always starts with default minimum interval when
the measurement process starts. By keeping last known good interval, we can
save the time in re-measurement.
Change-Id: I8f1720acafaa7e101855fe0c66d5c7b0e578e0d7
to fix the race of two threads that change mPendingIntent; one assigns a new one
and the other nullifies it.
Change-Id: I5e01f83ea1ac437811d2073839adef9bd0a30ec9
In two ways:
(1) When there's a session timeout, restart the measurement at a later time
instead of just stalling.
(2) When there's a port change, do not re-measure the interval if the current
interval works well in the past. We keep success count and decrement it
by half when there's a port change. When the count is below a threshold,
we restart the measurement process.
Change-Id: I7256464435a5e2d2a239bfccaa004e9ceb1d9ce5
so that the callee can send signals (on-hold or bye) back to the caller.
Without the keepalive, the NAT port for the caller will be timed out during the
call. And the signals will be dropped by the NAT device.
Change-Id: I21848d73469045b2ed9e7281556ab184c594c362
Misc keepalive fixes including:
+ Restart NAT port timeout measurement when keepalive fails. The max interval
is set to the current keepalive interval.
+ When exception occurs during sending a keepalive, restarts registration.
+ When exception occurs during measurement, retry for a limited times before
giving up.
Change-Id: I7aa787a5ec7c4c9b4334aa1017371d9049b3520c
Events are sorted by periods. So events of larger periods may have trigger
time (i.e., when the event should be processed) earlier than the ones of smaller
periods. So need to scan the whole queue looking for due events. The scan takes
O(n) time but we expect the queue size to be small.
Change-Id: I08bd3bd9d4bb8decb78f3c91c943396463ca023a
Reuse the new component in the original keepalive process and the NAT port
mapping timeout measurement process.
This is the foundation for fixing the following bug.
Bug: 3464181
Change-Id: If7e951c000503fa64843942ad062c4d853e20c8d
This is to prepare to move keepalive process to SipSessionGroup before fixing
the following bug.
Bug: 3464181
Change-Id: I57d8f6effad76706b5a76e1269c53d558db88ae4
bug:458435
This will temporarily start a thread for answering calls, we are
going to add a handler thread to handle this soon.
Change-Id: I9079038d671e1b1631c6e663fc2c3de297d97428
Since String.replaceFirst uses regex and since SIP user names are
allowed to include regex charaters such as '+', the code must
fist convert the string to a literal pattern String before using
replaceFirst method.
Change-Id: I25eac852bd620724ca1c5b2befc023af9dae3c1a
This change unhides RTP related classes including AudioCodec,
AudioGroup, AudioStream, and RtpStream. This allows developers
to control audio streams directly and also makes conference
calls possible with the combination of the public SIP APIs.
Change-Id: Idfd4edf65a1cbf3245ec2786fbc03b06438b0fb3
The previous implementation registers receivers when SipService starts up.
If the user doesn't use SIP at all, SipService will still process connecivity
and wifi state change events, which involves holding wake lock and thus
consumes power unnecessarily.
With this CL, SipService is completely idle if the user doesn't use SIP at all.
It registers receivers only when at least one account is opened.
Bug: 3326998
Change-Id: Idea43747f8204b0ccad3fc05a1b1c0b29c9b2557
The previous implementation registers receivers when SipService starts up.
If the user doesn't use SIP at all, SipService will still process connecivity
and wifi state change events, which involves holding wake lock and thus
consumes power unnecessarily.
With this CL, SipService is completely idle if the user doesn't use SIP at all.
It registers receivers only when at least one account is opened.
Bug: 3326998
Change-Id: Ib70e0cf2c808e0ebab4c3c43dcab5532d24e5eeb