When mobile operators offer global data plans that include roaming – for example, 10 GB in 80+ countries for 30 days – data usage in some regions, like Pacific islands, can cost them far more than average. To prevent revenue loss, operators can define usage thresholds for these high-cost roaming zones. Once a subscriber reaches the defined limit in a specific region, PortaBilling can send a notification to the subscriber and an alert to an external application, which can instruct the mobile network to reduce data speed or temporarily block internet access.
This feature allows operators to protect their profits in high-cost countries, while subscribers receive clear notifications to control their usage.
An MVNO, Owl Mobile, offers a global data plan with 10 GB for 30 days, allowing subscribers to use the internet in many countries without changing their SIM card. The Owl Mobile’s admin configures PortaBilling to monitor roaming usage in high-cost zones, including Vanuatu (usage limit: 100 MB per hour). Owl Mobile uses middleware that receives HTTPS events from PortaBilling and updates the subscriber configuration in the mobile network.
Subscriber John Doe purchases this plan and travels to Vanuatu. After landing, he starts streaming videos on his phone. Within 20 minutes, PortaBilling detects that John’s usage in Vanuatu exceeds 100 MB and automatically:
- Notifies Owl Mobile’s middleware, which instructs the mobile network to reduce data speed for John.
- Sends an SMS to John informing him that his internet speed will be throttled while he’s in Vanuatu.
When John returns to his home country and reconnects to the domestic network, he can access the internet at full speed.
How it works
You can set a usage threshold per roaming zone for an hourly, daily, or weekly period (based on the customer’s time zone). A roaming zone is a group of mobile networks identified by MCC (Mobile Country Code) and MNC (Mobile Network Code).
When a subscriber connects to one of these networks and starts using data, PortaBilling calculates the usage for that roaming zone in real time.
You can configure either of these conditions for the threshold:
- Actual usage – PortaBilling detects when the subscriber’s data consumption reaches the defined limit. For example, if you set 100 MB per hour, PortaBilling sends a notification once the actual usage reaches 100 MB or more.
- Estimated usage – PortaBilling estimates the subscriber’s projected usage rate (based on current data consumption speed) and detects if they are likely to exceed the threshold before the period ends. For example, if the usage reaches 60 MB within the first 30 minutes (meaning that the consumption speed is 120 MB/hour), PortaBilling can warn the subscriber before the 100 MB/hour limit is actually reached. If the subscriber keeps using data and the actual usage reaches the 100 MB threshold, an additional notification is sent.
When the threshold condition is met, PortaBilling can trigger:
- A webhook (HTTPS request) to your preconfigured external application (middleware), which can then apply the QoS changes in the mobile network.
- A notification to the account, customer, and admin through the preconfigured channels (e.g., SMS or email).
Benefits
Prevent financial losses when offering roaming bundles.
Configuration
Set up data usage monitoring
- Create a custom rate match mode for the internet access service. Navigate to Service catalog > Rate match modes, click + Match mode, and fill in the details:
- Create a code group set. For this, navigate to Service catalog > Code group sets, click + Add, and fill in the details:
- Name – specify a descriptive name of the code group set, e.g., “High-cost roaming zones”
- Rate match mode – select the Rate match mode created at step 1
- Service type – select Internet access
- Type – select Regular
- Click Save
- Add a code group for each high-cost roaming zone
- Add rate codes in E.212 format to the code groups
You can upload the code groups with the corresponding rate codes from a file.
- Set up the usage monitoring in a service policy for internet access. For this, create a new service policy or open an existing one, navigate to Usage monitoring, and select the Code group set created at step 2.
To define data usage thresholds for a specific zone, click + Code group and fill in the details:
- Code group – select a roaming zone
- Accumulation period – choose the time interval for which PortaBilling accumulates data usage before evaluating it against the threshold (Hourly, Daily, or Weekly)
- Notify if – choose the trigger condition for sending alerts (Actual usage reaches or Usage estimates reaches)
- Threshold – specify the maximum allowed data volume (e.g., in MB) for the selected code group within the chosen period
- Assign the service policy to a product (Product > Services > turn on the Access policy toggle > select the policy). It’s also possible to assign the policy directly to an account.
You can monitor usage and see when thresholds were reached for the latest period, as well as review the history per zone under Account > Internet access > Access policy.
Set up the EventSender handler
Subscribe the EventSender handler to the following events:
If you use low-level ESPF events (Events v.1):
- Account/AccessPolicy/IntensiveUsageDetected
- Notification/Billing/IntensiveUsageDetected
If you use high-level ESPF events (Events v.2):
- SIM/Updated
- Subscriber/Updated
- Notification
Enable the required notification types
When setting up notifications, e.g., for subscribers, enable the new notification types in the corresponding notification set.
Specifics
- The data usage history is stored for the period defined in the Stats.Customer_History_Month option value on the Configuration server web interface (the default storage period is three years).
- The KB–MB–GB ratio is calculated as 1000, not 1024.
- The mobile network sends usage reports at set intervals (e.g., every 30 minutes). If the first report is below the threshold and the next exceeds it, PortaBilling triggers the alert after the second report. As a result, actual usage may exceed the defined limit. For example, let’s say the threshold is set to 100 MB. PortaBilling receives the first report showing that 90 MB has been used (the threshold has not yet been reached). Thirty minutes later, the next report adds 50 MB of usage, bringing the total to 140 MB. PortaBilling then detects that the threshold has been exceeded and triggers the alert, even though the actual usage is already 40 MB over the limit.
- Estimated usage is not calculated during the first 5% of the usage period (hour, day, or week). For example, for the weekly threshold, it is only activated after the first 8 (7*24*0.05) hours, and for the hourly period after the first 3 minutes.
- Updating a threshold during an active period does not have a retroactive effect. For example, if you increase a limit, any speed restriction already applied will remain in place until the next period.









