Table of Contents
Push Notification
Push Notification Payload Format
The IXNX sends the push notification in a specific format (custom JSON object) to the GCM and APN services. The application needs to understand this format so it can react correctly upon receiving the push notification.
For APN:
{
"aps":{
"alert":{
"body":"Binan calling",
"title":"Incoming call"
},
"badge":1,
"category":"CALL_ACTION",
"sound":"$soundFileName"
},
"data":{
"data":{
"from":"Binan",
"time": $timestamp
},
"type":"call"
}
}
Where Binan is an example of the caller's username which appears on the screen concatenated with "calling" when the push message is received and displayed to the user.
For Android:
{
"data": {
"message": {
"type": "call",
"data": {
"from": "from Binan",
"time": $timestamp
}
}
},
"to": "$TokenValue",
"priority": "high",
"time_to_live": 20,
"notification": {
"click_action": "CALL_ACTION",
"sound": "$soundFileName"
}
}
Information about the message fields:
GCM and APN developer portal:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html
Push Notification Requirement
The RTCgate application that wants to be pushed on call, need to send the same CID in the 'Iam' message all the time till the application is uninstalled from the device.
The IXNX maintains the user who sent the "registertoken" message under the push availability time (configured in the client template) even if the app becomes offline under this period. When the app is offline for a time longer than the push availability time, the IXNX will automatically delete the user. This also can happen when the app overwrite the push availability time by specifying the remaining time in the “telExp” optional parameter in the rest token. The “telExp” is interpreted only when the parameter “telnr” exists. In this way the SP can free the IXNX from any registered number.
Push Notification Configuration
We have two places to configure the push.
To configure the push accounts we go to (more services → Push Notification).
To configure the behavior of the IXNX push we go to the client template:
There you can configure these:
- Push availability time.
- Push mode: [Push if no ringback after 3s, Push always, Push when igDoze connected, Push out Femto Cell Need, Never Push].
- Service Tolerence:
- 0= Disaster Recovery; No authentication, use WS instead of WSS (also settable in GUI with your battery driven laptop after the Solar Flare eruption)
- 1= Very Tolerant; incoming and outgoing service during PNW availability time (current and default)
- 2=Incoming Tolerant; allow incoming service during PNW availability time
- 3=Always Require Token not expired
For more information see the help page of SIP > WebRTC > Client templates.
Background about Push Notification
The Google Cloud Messaging (GCM) is the Google mobile free service for sending data or notification to android devices. Apple Push Notification (APN) is the Apple mobile service (not free) for sending notifications or data to Apple devices. In addition to the original push notification, APN supports what is called VOIP push notification where the push notification message has priority over other push notifications so it can reach the device in real time. GCM also supports the priority as a field in the message itself and not as a type of service offered to the customer as APN. So if the GCM push notification has high priority, it will reach the device quickly but it costs the device more power whereas if it has normal priority, it could not reach in real time but costs less power consumption. In IXNX we use high priority because we need to wake up the device to receive a call.
Google now supports APN (I.e. sending push notifications to Apple devices via GCM). But in IXNX we talk to the corresponding service directly so we talk to APN directly and we talk to GCM directly.