Overview
A hotspot is a physical location where people may connect their phones, laptops and other devices over WiFi to access the Internet either for free or for a fee. Before they access the service, users land at the captive portal where they subscribe and/or login, accept the terms of use and can then select their service access options.
PortaBilling contains a captive portal for WiFi hotspot services. This enables you to configure WiFi access points in public places like cafes, libraries, airports, etc. plus generate revenue by selling WiFi vouchers to prepaid users.
The supplied captive portal interoperates only with Huawei BNG (Broadband Network Gateway) and is a sample model. It consists of a front-end web application and a back-end signup module that are both customizable. Your in-house or outsource developers can extend it to interoperate with other WiFi routers and access points that you use. Or, they can use it as the base when building your customized captive portal.
This chapter demonstrates how to configure PortaBilling to provide WiFi hotspot services to prepaid users via WiFi vouchers.
The BNG configuration is outside the scope of the present document, so please follow the Huawei configuration guidelines to configure BNG and provision the following information about the billing server to it:
- The server’s IP address;
- The authentication key for RADIUS communication;
- The authentication key for communication with the signup module via the Huawei portal protocol V2.0;
- The port for sending authorization requests (1812 by default);
- The port for sending accounting requests (1813 by default);
- The URL of the captive portal (by default, accessible at https://<your_web_server_IP>:443/captive_portal).
Scenario
Let’s say you provide WiFi hotspot services via a captive portal. To access the service, users must accept the terms of use and log in. New users sign up to the service by entering their name, email, gender and phone number. Upon signup, they are provided credentials for subsequent logins.
Your WiFi access options include the following:
- 30 minutes free per day;
- $10 vouchers for 1 hr. and
- $15 vouchers for 2 hrs.
Once the user is authorized for the service, they see their session status and their remaining time.
Checklist
Use this checklist to check off the operations you have completed while performing the system setup according to the instructions in this chapter. Please be sure to perform all of the operations in the order designated (all of the boxes should be checked), otherwise, the service will not work.
Operation |
Done |
General configuration |
|
Enable the NETACCESS service on the Configuration server |
|
Create a symbolic destination WiFi |
|
Network configuration |
|
Add Huawei BNG as a node |
|
Rating configuration (Vendor) |
|
Create a tariff A that describes your data transfer costs |
|
Insert rates in tariff A for a symbolic WiFi destination |
|
Create a vendor |
|
Create a connection for this vendor with the WiFi service type using tariff A |
|
Rating configuration (Customer) |
|
Create a tariff B, which will be applied to prepaid WiFi users |
|
Insert rates in tariff B for a symbolic WiFi destination |
|
Create a destination group set |
|
Create a destination group under the destination group |
|
Assign the WiFi prefix to this destination group |
|
Create a volume discount plan A that provides a daily quota of free minutes |
|
Define a daily quota within the volume discount plan A |
|
Create a volume discount plan B that provides prepaid service usage options |
|
Configure a service wallet within the volume discount plan B and define its top-up options |
|
Create a main product for WiFi access |
|
Create one rating entry in this product, using the node you created and tariff B |
|
Associate volume discount plan A with this product |
|
Create an add-on product for WiFi access and allow it to be used with the main product |
|
Associate volume discount plan B with this add-on product |
|
Create a main product with the Voucher account role. It will only be used for generating WiFi vouchers |
|
Account provisioning |
|
Create a customer who owns WiFi vouchers |
|
Generate batches of WiFi vouchers for this customer. The voucher opening balance must coincide with your service wallet top-up options |
|
Captive portal configuration |
|
Create a user with Root permissions that will be used to create accounts for users during signup |
|
Configure the captive portal on the Configuration server |
|
Testing |
|
Open the captive portal page, sign up and establish a WiFi session |
Enable the NetAccess service type
Enable the NetAccess Service on the configuration server web interface:
- In the Configuration Tree, click on the BillingEngine node.
- On the Groups panel, select the NetAccess group.
- For the Enabled option, select Yes.
- Click Save and then click Verify.
- Verify the new configuration and click Check/Apply.
Add a destination
- From the navigation tree on the left, select Service catalog, then Rate codes and click Destinations.
- Switch to the Create a destination panel and fill in the new destination details:
- Format – select Custom.
- Prefix – type in WiFi.
- Description – provide some descriptive information about this destination.
- Click Save.
Add a node
This step is only required if you have not entered your BNG into the system before.
A BNG is a trusted gateway and must therefore be entered as a node in PortaBilling. PortaBilling requires some key information about your network equipment such as an IP address, Node ID, RADIUS shared secret, etc.
- On the navigation menu, select Infrastructure. Go to the Billing data sources link and click Nodes.
- On
the Create node panel, fill in the node details:
- Name – a short descriptive name for this node (e.g., Huawei BNG).
- Node ID – the BNG host name (recommended hostname.domainname).
- IP – the IP address of the node.
- Manufacturer – select Huawei.
- Type – select BRAS.
- Click Save.
- On
the Communication with billing section use
the slider to enable the Communication with billing
option and fill in the node details:
- Client protocol – select RADIUS to enable the BRAS (node) to communicate with PortaBilling via RADIUS.
- RADIUS key – enter the RADIUS secret key you specified in the BNG configuration.
- RADIUS source IP – see the Node ID, IP and Radius source IP section of the PortaBilling Administrator Guide. Unless your node has multiple network interfaces, the value here will be the same as for the IP.
- Click Save.
Create a WiFi vendor
Follow the Create a vendor tariff, Enter rates, Create a vendor and Define connections steps from the Prepaid WiFi services handbook to add a vendor for WiFi services in PortaBilling.
Create a customer tariff
To provide WiFi access services to customers, create a tariff, which will be applied to WiFi users.
Follows these steps:
- On the navigation menu, select Service catalog and click Tariffs.
- On
the Create tariff panel, fill in the tariff details:
- Name – type in a short name for the tariff object; this is the name you’ll see in the select menus.
- Currency
– select the currency in which you will charge your customers.
The currency for the tariff is only chosen once and cannot be changed later.
- Service – select the WiFi service.
- Applied to – select Customer.
- Managed by – select Administrator only here.
- Click Save.
Enter rates
- On the customer tariff’s panel, click Rates.
- On
the Add rate panel, fill in rate details:
- Destination – type the WiFi destination directly or select it from the list.
- Rating mode – select Flat rate here.
- Interval – type in 1 here.
- Price – type in zero here as your internet provider doesn’t charge you based on session time.
- Effective
from – if you want this
rate to take effect sometime in the future, you can either type in a date
manually, or use the calendar (click on the DD-MM-YYYY link).
When using the calendar, you can specify that the date you are entering is in a different time zone than your present one. PortaBilling will then automatically adjust the time.
- Click Save.
Create a destination group set
At this stage you must create a destination group set to use for your volume discount plan configuration.
- On the navigation menu on the left, select Service catalog, Rate codes and click Destination group sets.
- On the Create destination group sets panel, fill in the required information:
- Click the Save button to save the destination group set.
Create a destination group
Now you need to create one destination group.
- After saving a destination group set, the Destination group page opens.
- On the Create destination group panel, type in the destination group name and provide a short description.
- Click the Save button to save the destination group.
Assign destinations
- On the Destination group page, click the default All destinations group.
- On the Search filters panel select Custom from the Format list, type in WiFi to find the desired destination and click Apply filters.
- On the Destination list panel select the WiFi prefix and click Assign to group.
- Select the destination group (WiFi in our example) and click Assign.
- Click Save.
Create a volume discount plan
A volume discount plan contains all quotas and/or service wallets that you provide your customers. At this stage, you need to create two volume discount plans: one to provide free quota and another to provide prepaid access options.
- On the navigation menu on the left, select Service catalog, then Bundles and click Volume discount plans.
- On
the Create discount plan panel, fill in the volume discount plan
details.
- Name – a short descriptive name for this volume discount plan.
- Currency
– select the currency you use to charge your customers.
The currency for the volume discount plan may only be chosen once (at creation) and cannot be changed later.
- Apply discounts to – leave the default value Individual combinations of Services/Destination Group here.
- Destination group set – choose the destination group set you created in the previous steps.
- Destination group lookup type – select Same destination as rate here.
- Managed by – leave the default Administrator only value here.
- Description – specify an extended discount description.
- Click Save.
Define a quota within the volume discount plan
- While on the Edit discount plan panel, click the VDP configuration link.
- On the Create volume discount group panel fill in the following information:
- Click Save. The Quota panel opens.
- Click Thresholds and specify 30 for the Peak period threshold.
- Switch to the Notifications panel and specify when a user receives a notification that the quota expires (e.g., 5 minutes before quota expiration).
- Click Save to save your changes.
Configure a service wallet
Paid service access options are available for users within a service wallet.
- Repeat the Create a volume discount plan step and create a volume discount plan to store the service wallet in.
- On the Create volume discount group panel fill in the following information:
- Click Save. The Service wallet panel opens.
- Click Top-up configurations and define top-up options (in our example, for 60 and 120 minutes).
- Click Save.
Create a main product
To access your services, accounts will be created for your users and assigned specific products. Products are a powerful tool to define different ways to bill an account. Product definition is always realized through these steps: product definition, service definition and configuration and then the rating list is created.
- On the navigation menu, select Service catalog and click Products.
- On the Create product panel,
fill in the product details:
- Name – type in a short name for the product object; this is the name you will then see in the select menus.
- Name visible to end users – Specify the name of this product that your customers will see on their self-care interface.
- Product type – select Main product here.
- Currency – choose a currency the product will be priced in.
- Managed by – select Administrator only here, since we are setting up a service without the involvement of resellers.
- Account default ACL – choose an Access Control List (ACL) for accounts with this product assigned. ACLs control which objects end users can gain access to and which actions they can perform.
- Account role – select Universal from the list.
- Click Save.
Included services
Define which service types are included in the product. A service type is a description of the physical service provided to end users.
To add a service type:
- On your product’s panel, click Services.
- On the Services panel, click Add a service.
- In the Select services to add dialog box, select WiFi access and click Add.
- Click the WiFi link to limit WiFi bandwidth. Specify maximum upload/download speed.
Usage charges
The rating list has two functions: it defines the access points permitted (nodes and access numbers) and specifies which tariff must be used for billing in each of these points.
- On your product’s panel, click Charges, then click Usage charges.
- On the Usage charges panel, click Add.
- Fill
in the required information:
- Service – select WiFi.
- Node – select the Huawei BRAS node.
- Access code – leave this field empty for the basic SIP service.
- Tariff – select the WiFi tariff you created before.
- Click Save.
- Click General info and associate the volume discount plan with the free quota with this product.
- Click Save to save the changes.
- Repeat steps 1-4 and create another main product with the Voucher account role. This product is only required to generate vouchers. Therefore, you can use the same tariff you created in previous steps for definitions of usage charges.
Create an add-on product
- Click the arrow icon to return to the Products panel.
- On the Create product panel,
fill in the product details:
- Name – type in a short name for the product object; this is the name you will then see in the select menus.
- Name visible to end users – specify the name of this product that your customers will see on their self-care interface.
- Product type – select Add-on product here.
- Priority – specify the product’s priority.
- Currency – choose the currency the product will be priced in.
- Managed by – select Administrator only here, since we are setting up a service without the involvement of resellers.
- Account default ACL – choose an Access Control List (ACL) for accounts with this product assigned. ACLs control which objects end users can gain access to and which actions they can perform.
- Account role – select Universal from the list.
- Click Save.
- On the product panel that opens, click Charges, then General info and select the volume discount plan with the service wallet from the Default discount plan list.
- Switch to the Additional information panel.
- Click the Add product button in the Add-on product is allowed with section and select the main product you just created.
- Click OK.
- Click Save to save the changes.
Create a customer
In this case, the customer record is used to store vouchers and accounts to be created for your WiFi users.
- On the navigation menu, select Sales, then select Customers.
- On
the Create customer panel, fill in the customer details:
- Name – type a short name for the customer object; this will be used on the web interface.
- Balance control – specify the way the customer will pay for the service. Select Prepaid in this field.
- Currency – choose the currency in which this customer will be billed.
- Available funds – since this customer is used as a placeholder for storing accounts, the number amount of available funds is insignificant. Type zero here.
- Business model – a business model defines what type of service is to be provided to the customer. Select Universal for this customer.
- Customer class – customer class allows you to define a policy for automated payment collection. Since you will not issue invoices nor collect payments for this customer, leave the Default customer class here.
- Billing period – choose a billing period for the customer. A billing period defines the frequency of invoicing for this customer. Leave the default monthly value here.
- Billing period time zone – choose a time zone where customer’s billing period will be closed and invoices will be generated.
- Click Save.
Generate vouchers
Vouchers grant users access to your paid access options. To differentiate between WiFi access options, generate vouchers in separate batches according to the top-up options you defined for your service wallet. Give descriptive names to these batches to keep your vouchers well organized (Examples of batch names: “$10 for 60 minutes”). The voucher opening balance must be the same as the fee value you defined within the service wallet top-up options.
For more information about batch management, please read the Provisioning Prepaid Accounts section.
In our example, we will generate two batches for vouchers, one for 60-minute access and another for 120-minute access. The voucher opening balances are $15 and $20, respectively.
- On the customer panel that opens, click Accounts.
- Switch to the Create account panel and click Account generator.
- Specify
the account generation parameters:
- Account role – select Voucher.
- Product – select the main product you created for voucher generation.
- Quantity – define the number of vouchers to generate.
- Batch – specify the batch name.
- Switch to the Optional configuration tab and define the Opening balance value (e.g., 10).
- Requires manual activation – leave this option disabled to generate vouchers with the active status.
- Service password – select Empty from the list.
- Life cycle – specify the activation/expiration dates for the vouchers using the calendar. By default, vouchers are active for 90 days after their activation date.
- Click
Generate.
Account generation tasks are executed every few minutes, so it may take a while to generate large numbers of accounts.
- Repeat step 3 and generate another batch of vouchers for 120 minutes of WiFi access. Specify $15 as the opening balance.
Create a root user
When a user registers for the service, the signup module creates an account for the user in PortaBilling via the API. To make this happen, you must provide the API access to the PortaBilling web server by creating the user with root permissions.
- From the navigation tree, select My company, Access control and then Users.
- On the Create user panel, fill in the new user details:
- Click Save. The User panel opens.
- Select Web self-care panel and enable the API token access option. The API token is now generated.
- Click Save.
Configure the captive portal on the Configuration server
- On the Configuration server web interface, clone the currently active configuration to modify it.
- From the Configuration tree, select ClusterSuite -> WebCluster.
- Select
the CaptivePortal group and configure these options:
- enabled – set Yes.
- nasHost – specify the IP address of your BNG.
- nasPort – specify the port on your BNG (the default one is 2000).
- nasSecret – specify the authentication key for communication with PortaBilling via Huawei portal protocol V2.0. It must be the same as the one you defined during the BNG configuration.
- pbAdminLogin – specify the login of the user you created for the API access to PortaBilling.
- pbAdminToken – specify the API token generated for the user.
- pbProductId – specify the internal ID of the main product (i_product) you created for WiFi access (WiFi signup in this example).
- pbAddonId – specify the internal ID of the add-on product (i_product) you created in the previous step (Paid options in this example).
- pbCustomerId – specify the internal ID of the WiFi card owner (i_customer).
- uiCompanyName – define your company name. Users will see it on the captive portal page.
- uiConditionsInfo
– specify your terms of use here.
TIP: To find the internal ID of the customer and products, connect to PortaBilling via the API and call these API methods:
To find the ID of the main product:
-curl https://<your_web_server>/rest/Product/get_product_list -d auth_info='{"session_id":"session_ID"}' -d params='{"name":"WiFi signup"}'
To find the ID of the add-on product:
-curl https://<your_web_server>/rest/Product/get_product_list -d auth_info='{"session_id":"session_ID"}' -d params='{"name":"WiFi access options""}'
To find the ID of the customer:
curl https:// <your_web_server>/rest/Product/get_product_list -d auth_info='{"session_id":"<session_ID>"}' -d params='{"name":"WiFi access options"}'
Alternatively, you can find the internal ID number via the web interface: they are the last digits in the URL when you open a record.
- Click Verify to verify the configuration.
- Click
Check/Apply to apply the configuration.
Note that the Apache service will need to be restarted, therefore apply the configuration during off-peak times.
Testing
- Connect to WiFi from your device.
- You are redirected to the captive portal page.
- Accept the terms of use.
- Enter your information for signup and click Sign Up.
- Your WiFi access credentials are returned. Store them somewhere so you can log in later and then click Close.
- Select the Use PIN option and enter a voucher PIN.
- Click Submit.
- You are now connected to WiFi and can see your remaining time.