For AI agents: this documentation is indexed for you in llms.txt, and all of it in /llms.txt. Every page is also available as markdown: append .md to its address.

Hooks configuration

Hooks allow TPOSS to send notifications to a pre-configured endpoint when specific events occur. You can enable or disable each such hook individually by setting the hooks.{HOOK}.enabled configuration parameter to true or false.

The following hooks are supported:

Events

All the hooks described above are triggered by a different event:

When an event occurs, TPOSS sends an HTTP call to the pre-configured HTTP endpoint. The endpoint is specified by the hooks.{HOOK}.url configuration parameter.

If the outgoing HTTP request fails, TPOSS may try to resend it. You can control this behaviour using the hooks.{HOOK}.attempts configuration parameter of each hook. To avoid the storm of requests, the hooks.{HOOK}.delay configuration option exists. It defines the delay (in milliseconds) between retries to send HTTP requests.

Balance threshold event

The balance threshold event is triggered when a subscriber's balance reaches a specified threshold. The threshold is defined by the hooks.balance_volume_threshold.level parameter, which can be set to a value between 0.0 and 1.0. This represents the percentage of the balance consumed before the event is triggered. You can specify multiple threshold values separated by a comma.

See the configuration example:

yaml

The content of the outgoing HTTP notification is as follows:

json

Charging rules change event

The charging rules change event is triggered when there is a change of a service session for the given subscriber. By default, TPOSS sends a notification to all subscribers. TPOSS may also send a notification only for subscribers with the specified mobile country codes. To achieve this, use the hooks.charging_rules_changed.mcc_whitelist configuration option. It contains a list of Mobile Country Codes (MCCs) separated by a comma for which the Charging Rules Change event is triggered.

See the configuration example:

yaml

The content of the outgoing HTTP notification is as follows:

json

MCC/MNC change event

The MCC/MNC change event is triggered when a subscriber’s MCC or MNC changes during the handling of RADIUS Accounting requests. TPOSS checks the value of the 3GPP-SGSN-MCC-MNC RADIUS AVP when handling each RADIUS Accounting-Interim-Request, and compares it with the MCC/MNC in the current network sessions. If they are different, TPOSS sends a notification.

See the configuration example:

yaml

The content of the outgoing HTTP notification is as follows:

json

First network attachment event

The first network attachment event is triggered when TPOSS receives a RADIUS Access-Request and the IMSI from the request is attached to the network for the first time.

See the configuration example:

yaml

The content of the outgoing HTTP notification is as follows:

json

All fields in the outgoing HTTP notification are mandatory, except for imeisv and imei. If the network session was created without an IMEISV (based on a RADIUS Access-Request or Accounting-Request without the 3GPP-IMEISV AVP), the values of these attributes are skipped in the notification payload.

Visited country change event

The visited country change event is triggered when there is a change of subscriber's visited country during the handling of RADIUS Accounting Requests.

See the configuration example:

yaml

The content of the outgoing HTTP notification is as follows:

json