There is a problem with SIP OPTIONS keep alives on Android that when
3G(mobile internet) is used the app doesn't receive responses to those
requests. The stack is doing retry attempts which results in massive
badwidth usage and battery consumption. This takes place only when UDP
transport method is used.
It happens for most providers, but not for everyone. What's strange is
that REGISTER keep alives will work. It looks like OPTIONS are
blocked. INFO requests are coming through. When 3G connection is
shared to the PC then the behaviour is the same - OPTIONS do not work.
Does anyone have any clue maybe ? For now we've decided to use empty
/r/n packets instead of OPTIONS when UDP is used on Android. I'm
attaching a patch for it and ask you for a review as I'm not too
familiar with SIP stuff. Here are my doubts:
1. ListeneningPointExt interface is used directly to send null request
with sendHeartbeat() method. It's instance is obtained from the
provider for UDP transport.
2. Address and port where the request will be sent is obtained from
ProxyConnection returned by provider.getConnection(). I'm not sure if
this will be the right address and port.
3. Null requests are not logged as part of packets capture, because
nist stack doesn't log them through ServerLogging interface. Just
wanted to mention this fact, but I guess we can live with that.
null_request_keep_alive.patch (3.27 KB)