PushNotification
Documentation based on repostory git version commit 2.3.3-47-g7d82ea0b
Module PushNotification
This module performs push notifications to mobile phone notification systems: apple, android, as well as a generic http get/post to a custom server to which actual sending of the notification is delegated. The push notification is sent when an INVITE or MESSAGE request is not answered by the destination of the request within a certain period of time, configurable hereunder by 'timeout' parameter. The PushNotification has an implicit dependency on the Router module, which is in charge of creating the incoming and outgoing transactions and the context associated with the request forking process. No push notification can hence be sent if the Router module isn't activated. The time-to-live of the push notification depends on event for which the push notification is generated. - if it is for a call (INVITE), it will be set equal 'call-fork-timeout' property of the Router module, which corresponds to the maximum time for a call attempt.
- if it is for an IM (MESSAGE or INVITE for a text session), then it will be set equal to the 'message-time-to-live' property.
----
Configuration options:
Name | Description | Default Value | Type |
---|---|---|---|
enabled | Indicate whether the module is activated. | false | Boolean |
filter | A request/response enters module if the boolean filter evaluates to true. Ex: from.uri.domain contains 'sip.linphone.org', from.uri.domain in 'a.org b.org c.org', (to.uri.domain in 'a.org b.org c.org') && (user-agent == 'Linphone v2'). You can consult the full filter documentation here : https://wiki.linphone.org/xwiki/wiki/public/view/Flexisip/Configuration/Filter%20syntax/ | BooleanExpr | |
timeout | Number of seconds to wait before sending a push notification to device. A value lesser or equal to zero will make the push notification to be sent immediately, which is recommended since most of the time devices can't have a permanent connection with the Flexisip server. | 0 | Integer |
message-time-to-live | Time to live for the push notifications related to IM messages, in seconds. The default value '0' is interpreted as using the same value as for message-delivery-timeout of Router module. | 0 | Integer |
max-queue-size | Maximum number of notifications queued for each push notification service | 100 | Integer |
retransmission-count | Number of push notification request retransmissions sent to a client for a same event (call or message). Retransmissions cease when a response is received from the client. Setting a value of zero disables retransmissions. | 0 | Integer |
retransmission-interval | Retransmission interval in seconds for push notification requests, when a retransmission-count has been specified above. | 5 | Integer |
call-remote-push-interval | Default interval between to subsequent PNs when remote push notifications are used to notify a call invite to a clients that haven't published any token for VoIP and background push notifications. In that case, several PNs are sent subsequently until the call is picked up, declined or canceled. This parameter can be overridden by the client by using the 'pn-call-remote-push-interval' push parameter. | 0 | Integer |
display-from-uri | If true, the following key in the payload of the push request will be set: If false, the keys will be set but as empty. | false | Boolean |
apple | Enable push notification for apple devices | true | Boolean |
apple-certificate-dir | Path to directory where to find Apple Push Notification service certificates. They should bear the appid of the application, suffixed by the release mode and .pem extension. For example: org.linphone.dev.pem org.linphone.prod.pem com.somephone.dev.pem etc... The files should be .pem format, and made of certificate followed by private key. | /etc/flexisip/apn | String |
no-badge | Set the badge value to 0 for Apple push | false | Boolean |
firebase | Enable push notification for Android devices. | true | Boolean |
firebase-projects-api-keys | List of pairs of <Firebase Project Number>:<Firebase Cloud Messaging API (Legacy) Server Key> for each Android project that supports push notifications. | StringList | |
firebase-service-accounts | List of pairs of <Firebase Project Number>:<Path to service account json file> for each Android project that supports push notifications. | StringList | |
firebase-token-expiration-anticipation-time | Represents the time in seconds to execute the access token refresh operation just before the current access token expires. This parameter is used to control overlapping access token lifetimes. | 300 | Integer |
firebase-default-refresh-interval | Default interval in seconds to execute the access token refresh operation in the event that the access token has not been successfully obtained. | 60 | Integer |
external-push-uri | Instead of having Flexisip sending the push notification directly to the Google/Apple/Microsoft push servers, send an http request to a server with all required information encoded in the URL, to which the actual sending of the push notification is delegated. The following arguments can be substituted in the http request uri, with the following values: | String | |
external-push-method | Method for reaching external-push-uri, typically GET or POST | GET | String |
external-push-protocol | Protocol used for reaching external-push-uri, http2 or http (deprecated) | http2 | String |
register-wakeup-interval | Send service push notification every n minutes to all devices that are about to expire and should wake up to REGISTER back. 0 to disable. Recommended value: 30 | 0 | Integer |
register-wakeup-threshold | Start sending wake-up push notifications to contacts when they pass that percentage of their lifetime. | 50 | Integer |