Wiki -VoIP Topics

Android SIP all-time availability



This article applies both for custom branded android softphone and MizuDroid.
To be able to accept calls, IM and other notifications, the server needs to be capable to deliver the SIP signaling messages to your application.
Normally your application is “connected” to your SIP server with an active UDP or TCP register session thus the SIP server is capable to send call connect, IM and other messages via these streams.
New Android OS versions heavily restricts apps running in the background and usual applications will just stop running when not in foreground or actively used by the user.

To be able to receive incoming call while your app is in background, closed, standby or the device is in doze or sleeping state, you have two options:

  • Run as a service
  • Enable voip push notifications

By default the app should automatically detect the best available method:

  • If your VoIP server has push notification support then the app will use push notifications (directly with your server).
  • If your VoIP server doesn't have push notifications, but it is public (reachable from the public internet) then the app can use push notifications via our SIP-Push proxy service
  • If none of the above are possible, then it will run a service to listen for incoming requests (run in background)

These can be also set manually (from Menu -> Settings -> Advanced settings -> General settings) with the "Enable push notification" and "Run In background" options.
If you set the app to run in background, then you should also white-list the app in your phone settings (to avoid killing it by the OS) and set it as a Foreground service.
It is also possible to enable both push notifications and running in the background.
More details about push notifications can be found here.