Rules¶
Overview¶
This section let you configure rules to control your SIM cards, send notifications (email, SMS, push API, etc.) or perform actions (e.g. change rate plan, change SIM Card status), when the rule triggers.
You can configure three types of rules:
- Event Rules - handles specific events (e.g. New Device, New Call Detail Record, etc.), that happen during the life cycle of the selected SIM cards.
- Usage Rules - handles the usage (e.g. data, SMS, etc.) of the selected SIM Cards, you can customize how the total usage is calculated.
The rules are applicable to all SIM cards, a list of selected SIM Cards or filtered by the selected tags, depending on your choice.
Rules Page¶
To access the Rules sections, select the options Rules in the sidebar MENU. In the rule section, the main view has three panels, one for each rule type (see picture below), with a table inside that shows the rules created.
Each row contain the basic information (Label, Type, Date Created) for each rule. In the column Actions you can select if you want to View or Delete the rule.
In the upper right side of each panel there is a ‘+’ sign, that let you create new Rules for that type.
At the end of this view, there is the History button that redirects you to the rules triggered page.
Create Rules¶
To create new rules, go to the main Rules page view and click the ‘+’ sign on each panel to select which type of rule you want to create. You will be redirected to a wizard form that helps you create new rules, divided in five steps:
- Label
- Rules Triggers
- SIM Card(s)
- Actions
- Notifications
Step 2 - Rules Triggers¶
In this step, you configure the triggers that rule needs to check to perform the actions or send the notifications. Each rule type has their own configuration, which are described in the next subsections.
Event Rules¶
First, chose the event you want to configure.
There are currently, six event types to configure:
- New Data Session
- New Platform Simple Short Message (SMS)
- New Device
- New Location
- New SIM Card State
Each options has their own settings to configure.
- New Data Session
When you configure the New Data Session event, you need to chose when you want to receive the notification, at the start of the session or at the end.
- New Platform Simple Short Message (SMS)
When you configure the New Platform Simple Short Message (SMS) event, the rule triggers when the selected SIM Cards receives a SMS from the platform or send a SMS to the platform.
- New Device
When you configure the New Device event, the rule triggers when the selected SIM Cards have a new IMEI attached. Depending on the rule configuration you can lock SIM Cards to a specific IMEI, or create an IMEI range preventing the SIM Cards to attache to other devices. See below examples for possible configurations:
Note
The IMEI prefix must at least have 8 digits.
Note
This example is a good way for you to lock SIM Cards to a specific IMEI range. You can choose to suspend the SIM Card, when the rule triggers, preventing from using in other devices.
Note
This example is a good way for you to lock SIM Cards to any IMEI already attach. You can choose to suspend the SIM Card, when the rule triggers, preventing from using in other devices.
- New Location
When you configure the New Location event, the rule triggers when the selected SIM Cards enter a new country or network, depending on your choice.
- New SIM Card State
When you configure the New SIM Card State event, the rule triggers when the selected SIM Cards changes from one state to another, depending on your choice. See below examples for possible configurations:
Note
This example is a good way to send an email notifications when a SIM Card is Activated.
Usage Rules¶
First, chose the usage you want the rule to control. From the five possible options:
- Inbound Call(s)
- Outbound Call(s)
- Outbound SMS
- Data Usage
- Number of Data Connection
The second option let you choose how the rule counts the usage. There are two option:
- “Each SIM Card” - the rule tracks the usage for each SIM Card.
- “All selected SIM Card(s)” - the rule tracks the usage sum of all SIM Card(s).
The third option let you type the usage amount cap, in order to trigger the rule.
The units and the total amount change depending on usage type. See the table below for more information:
Units | Usage Type | Max value |
---|---|---|
KB | Data Usage | 4294967295 |
MB | Data Usage | 4194303 |
SMS(s) | SMS Usage | 4294967295 |
Seconds | Voice Usage | 4294967295 |
Minutes | Voice Usage | 71582788 |
Hours | Voice Usage | 1193046 |
The fourth option let you choose the period in which the rule gatherers information to calculate to total usage.
Period | Comment |
---|---|
Calendar Month | Uses the data of the current month |
Billing Cycle | Uses the data of the current billing cycle of the triggered SIM Card |
Calendar Week | Uses the data of the current week |
Calendar Day | Uses the data of the current day |
Past 24 Hours | Uses the data from the last 24 hours |
Past 7 Days | Uses the data from the last 7 days |
Past 14 Days | Uses the data from the last 14 days |
Past 30 Days | Uses the data from the last 30 days |
Custom Period | Uses the data from the custom select period, counted in minutes or hours |
Last Session | Uses the data from the last session |
Note
If you select Custom Period it will show the following box:
Step 3 - SIM Card(s)¶
In this step, you select the SIM Card(s) for the rule. There are three possible choices:
- SIM Card(s)
- Tags
- All SIM Cards
SIM Card(s)¶
Manually select the list of SIM Card(s) from your inventory. Use Ctrl key (or Cmd key in Mac) to select the SIM Card(s) you want to use or not.
Note
If your inventory has more then 1000 SIM Card(s), this feature is disable. Apply tags to your SIM Card() and create rules with them (see below).
Tags¶
If you use the Tags option, the rule will use the SIM Card(s) that have all of the Tags selected. You can create more tags using the Tags section.
All SIM Card(s)¶
If you use this option, the rules uses all SIM Cards in your account.
Step 4 - Actions¶
After selecting the SIM Cards, choose which actions you want the rule to perform in the SIM card(s) if it triggers. You can leave the options blank and the rule will jump this step.
For all rule types you can choose to change the SIM Card status. For examples, if one SIM Card triggers a scpecifc Rule triggers it will suspend the SIM Card(s) in question.
Step 5 - Notifications¶
After selecting or not the actions, choose which notifications you want the rule to send when it triggers. You can leave the options blank and the rule will jump this step.
There are currently four types of notification to send:
- SMS
- Webhook (Push notification)
Sends an email with a default message to the selected email.
- SMS
Sends a message to the selected number.
The selected number can be the Triggered Number or a Custom Number.
Note
SMS’s can only be sent to Truphone numbers.
The message sent can be the default message (select Default Message) or customizable (select Custom Message).
The following figures shows possible configurations:
- Webhook (Push notification)
Sends a push notification to the selected server.
View Rule Details¶
You can click in the View button to view the details of a specific rule. The new page will show in a single page the triggers, SIM cards, the actions adn the notifications. You can click Edit to start editing the page.
History¶
You can click in the History button to view all the list of all the triggered rules and the actions.
To export the information you can click “Export” and choose the method to export the information, see Rules History Export for more information.