How do PUSH notifications work with PortSIP PBX?
A Voice over Internet Protocol (VoIP) app lets users make and receive phone calls by using an Internet connection instead of the device’s cellular service. Since VoIP app relies heavily on network, it’s not surprising that making calls usually results in high power consumption.
A VoIP app has to maintain persistent network connection with a server to receive incoming calls and other data. This means writing complex code that send periodic messages back and forth between the app and server to keep the connection alive, even when the app is not in use. This technique resulted in frequent device wakes that wasted energy. It also means if a user exits the VoIP app, calls from the server could no longer be received.
With PUSH notifications, a VoIP app does't require to be running in foreground or background. Whenever a push notification is received, the VoIP app could display an alert, and provide an option to accept or reject the call.
There are many advantages to use PUSH notifications:
- The device is woken only when PUSH notification occurs, saving energy.
- PUSH notifications are regarded as high-priority notifications and are delivered without delay.
- Usually VoIP pushes can include more data than what is provided with standard push notifications.
- Your app is automatically relaunched if it’s not running when a VoIP push is received.
- Your app will be given runtime to process a push message, even if your app is operating in the background or was forced out.
PortSIP PBX supports mobile PUSH notifications for iOS and Android from V9.0. All PortSIP users will benefit from this new feature.
1. Architecture of PortSIP PBX PUSH notification
Below architecture demonstrates how PortSIP PBX provides the PUSH notifications.
2. The call flows for send PUSH notifications
- App requests a device token from Apple Push Notification Service (APNS)/Google FCM.
- The app receives the token, which functions as the address to send a push notification to.
- The app registers to PortSIP PBX with SIP REGISTER message. There must be a "x-p-push" header added into REGISTER message, with the device token and other necessary information inclusive into this header to inform PortSIP PBX that app would like to receive PUSH notifications for this extension, for example extension 101.
- Now the user forces terminate the app.
- When someone calls to 101, PortSIP PBX will send an INVITE message to appropriate contact address if the 101 registration is not expired, and sends a push notification with a device token to the APNS/FCM.
- Since the app is terminated, the INVITE message will not be received by the app.
- APNS/FCM will send a push notification to the device.
- The iOS/Android device receives that push notification and alerts the mobile device user the call is coming. User accepts the call.
- The app will be launched and registered to PortSIP PBX automatically.
- After successful registration, PBX will send INVITE message to the contact address which get from the new registration.
- Now the app receives INVITE message and answers the call.
Same process for Instant Messaging.
The example of "x-p-push" header in the REGISTER message.