Every event handler provisions a particular external system. You subscribe it to provisioning events that the system requires and the event handler monitors the event queue for these events. When an event occurs, the event handler triggers the API call in the external system to perform the action there (e.g., activate the SIM card).
This is how it works in detail:
- A database trigger is created for a particular table.
- The database automatically executes the trigger in response to the defined event and the trigger inserts an event record into the Event_Queue table. The trigger also inserts a record to the Event_Notifications table, which stores the event status and the retry counter. This enables you to subscribe several event handlers to provision the same event.
- The event record contains references to other tables with certain fields that can be provisioned to the external system (e.g., i_env, ID, and balance of an account).
- A handler subscribed for this event reads the record from the Event_Queue table and processes it by retrieving the required account or customer information from PortaBilling via the API. This information differs for each external system (e.g., an HSS requires SIM card details while an IPTV platform requires a channel package name).
- The handler provisions both the event and its data to the external system and receives a return code (whether the event was processed successfully or not) from it.
- If the return code is successful, then ESPF changes the event status to "finished" for this handler in the Event_Notifications table. Otherwise, the handler tries to provision the event again until it is either provisioned or the amount of retries reaches its limit.
- When all handlers provision this event, the ESPF cleans up the Event_Notifications table and removes the processed event from the Event_Queue table.
If an issue occurs during event provisioning, the corresponding error is written to the provisioning.log file. In addition, administrators can receive email notifications about provisioning event failures. On the Configuration server, they must specify an email address for the Provisioning.AlertRecipient option.
Also, the administrator can see the provisioning status of events (e.g., all, failed, queued, successful) and check event logs directly on the PortaBilling web interface. If the provisioning to an external application fails, an administrator can re-start the provisioning in one click.
To provision a specific event to an external system, follow these steps:
- Enable the ESPF on the Configuration server web interface.
- Check what handler supports the required events in Appendix E. Events that ESPF handlers support.
- Add and configure the required event handler on the PortaBilling web interface.
- Subscribe an event handler to specific events. By default, each event handler is subscribed to all supported events. You can disable specific events and re-enable them if needed. The administrator can check event subscriptions supported by added handlers on the Event subscriptions panel.