ABillS Help and Tips

In this article I will write some information about ABillS, which will be useful for operators and system administrators.

Starting from version ABillS 0.82 in the settings of tariffs, access servers, etc. FreeRadius parameters must be specified separated by commas with a space, if the version is lower than 0.82, then separated by commas without a space.

For each administrator, there is a history of actions that can be seen in the “Report” – “Events” menu.

To enable debugging of SQL queries, you need to find dbdebug in the configuration file and uncomment it, after which the SQL query and its execution time will be displayed at the end of each billing page.

Logs of incorrect connections of administrators, SQL queries and other settings changes can be seen in the “Report” – “Settings” menu.

When adding NAS server, “NAS Alive” should be equal to “DHCP Lease Time”, when changing NAS server settings, you must re-enter the password.

To enable an Internet user for free, for example, for a promotion, you need to specify 100 in the “Discount” field and opposite to the right to indicate the end date of the discount, and in order to not disconnect user with a zero balance, in the tariff settings we specify a credit of 0.01.

A subscriber’s credit is placed without a minus and it is necessary to indicate opposite the end date, after this date it will be reset, if the date is not specified, the credit will always be until it is removed manually.

If it is necessary to prohibit a client from accessing the credit button, you can create a group without access to a loan (“Clients” – “Groups”, uncheck “Allowed Credit”) and add a user to this group.

In order not to scroll the information on the page in page mode, but to display everything, you can specify the number of displayed lines in the administrator profile or add &PAGE_ROWS=50000 at the end of the link

In case of errors, you can see more debugging information by adding at the end of the link:
&DEBUG=10

Sometimes in order to restart the access server, for example Accel-ipoe, it is necessary to clear the active sessions so that after starting the access server new ones rise quickly, otherwise there will be doubles and they will rise for a long time. To do this, open the menu “Monitoring +” – “Internet +”, make “Zap ALL”, then open the list of Zap sessions, check all the first tick and remove. I had such that after the Zap All in the list the access server disappeared and the zap session was not visible, in this case we’ll add &ZAPED=1 to the link, for example
https://ixnfo.com:9443/admin/index.cgi?index=155&NAS_ID=11&ZAPED=1

The stub page with information about negative balance should be run on a separate web server and on NGINX, if you run it on the same Apache2 web server where billing is done, then at the slightest load, for example, when you reach 250 default connections due to flooding client viruses, billing will stop opening in the browser, and I see no point in optimizing Apache2 for this page, since nginx does better, or you can configure HAProxy before Apache2.
See my articles:
Install and configure Nginx
How to configure IP access in nginx
Installing and configuring HAProxy

In the new versions of ABillS, the functions of the dv, dhcphost, ipn, and vlan modules have been transferred to the Internet+ module, so these modules should not be activated.

If a user has entered the wrong password many times, has blocked and needs to unblock it, then you can delete the entries in the “Report” – “User portal”.

Through the universal search it is more convenient to search than through the usual one, for example:
street 15,5
str*15*5
last name*first name
Through a global search, you can search by MAC, IP, phone number, text in the comments, etc.
  Through the usual search in the field name you need to add at the beginning and at the end of the word *
  To see customers who have more than 1 service added, open “Clients” – “Logins” – “Internet” and when searching in the “Advanced” section where “Services” we specify >1

If you need to change the tariff rate for certain clients, then we will search for the services of these clients through the menu “Client” – “Logins” – “Internet +”, then at the bottom of the list there will be a tab “Multi-user operations”, in which you will tick the “Tariff plan” and select new tariff plan. With such a change in subscription fee, the activation date is not removed and no other action other than, a direct change to the tariff plan, does not occur.

When changing the status of the service to “Active” with daily charge rates, money is not written off as the service was suspended for half a day and turned on also for half a day, billd will be charged at night the next day.

In the user service, in the “Speed (kb)” field you can specify an individual speed, the priority of which is higher than the tariff plan, the speed is indicated by one number in both directions, for example, 50000, in the “Filter” field, you can specify individual Radius parameters for the client, for example download speed, and outgoing speed will remain at the rate, since it is not specified:

RAD: PPPD-Downstream-Speed-Limit=20000

With accel-ipoe, billing disables and enables clients for 5-10 minutes, it depends on the periodic “billd” task in cron, it usually runs every 5 minutes, and also on the lease time of the IP address via DHCP, that is, if the client service was disconnected and the client replenished the bill, billd will complete the guest session, and when the client sends a request to extend the lease, accel-ipoe will respond with DHCP Nak, which will force the client to send a DHCP Request and, as a result, the new work session will rise.

The new tariff is applied when authorizing a client, and if he was already on the network, then for 5-10 minutes, the time also depends, as described above, on billd and the time it takes to lease the IP address via DHCP.

Billing will not allow subscribers to specify the same IP address, but you can specify the same MAC address, for example, if you set up a binding to the switch port or VLAN per user, then clients can receive different IP addresses, even if they all have the same MAC addresses, but in different VLAN, if authorization is only by MAC address and clients are in one VLAN, then only the one who connected first will work on the Internet and there will be problems.

The report of payments, general and for each operator can be seen in “Report” – “Payments” (select “Type: Administrators”), also in “Report” – “Documents” – “Receipts” (in the “Administrator:” field you can specify operator login).
In the “Report” – “Payment” you can also see the payment by district or street, as well as other criteria.

The report of connection errors can be viewed in the menu “Report” – “Internet +” – “Last connection”, on the start page of the billing administrator you can set up an individual block with top errors, which is convenient to detect problems.

In the administrator rights settings, modules do not need to be ticked if you need to give access to all (when no module is checked, this is similar to when all are checked), you can mark only when you need to deny access to some, then check those that need to be allowed and do not mark those to be banned.

If you need to create, for example, an annual tariff, then when creating a tariff, we specify “Lifetime: 365”, and where “Tariff Plan The next accounting period:” we specify the rate that will apply after the “Lifetime” expires.

If the billing shows that the user is Online, then he is now online or has been online in the last X minutes (X=NASAlive*3). that is, if the user has turned off his device and is offline, the billd script will transfer the session to zap after nas alive*3.
Opposite the session, its duration is displayed; when the session ends, this information is included in the statistics.

If a client has several IP addresses, then a separate subscription fee will be charged for each IP, or you can set a special tariff, for example, “Additional IP” with a cost of 0.01, but it is desirable that only one IP address be entered per customer, especially if you configure QinQ, and if more is needed, let the client install the router.

I will give an example of a direct link to view sessions with certain IP addresses, for example, I watch guest sessions of unknown and non-accessed devices like this:
https://ixnfo.com:9443/admin/index.cgi?get_index=internet_online&header=1&NAS_ID=&FILTER=10.55.56.*&FILTER_FIELD=CLIENT_IP&REFRESH=0&SHOW=Show
Similarly, you can open other pages, for example Maps2:
https://ixnfo.com:9443/admin/index.cgi?header=1&get_index=maps2_main
get_index can be found in the config files of each module:

find /usr/abills/ -name config

So that the script “periodic” does not send reports to email, you can specify “NO_ADM_REPORT = 1”, for example:
/usr/abills/libexec/periodic monthly NO_ADM_REPORT=1 > /dev/null 2>&1

You can limit the user registration process for an administrator, for example, displaying only the first step or the first and setting up a service:

$conf{REG_WIZARD}="user_form::Добавить Пользователя;";
$conf{REG_WIZARD}="user_form::Добавить Пользователя;internet_user:Internet:Internet+;";

If you need to restart the MySQL server, you will also need to restart Freeradius since it will lose the connection to the database.

The Abills logo is not a picture, but just a text, for example, to change it, you need to edit header.tpl and form_client_main.tpl through the menu in the billing Settings – Other – Templates.

There are two address maintenance schemes in ABillS, the old one is when street name is in address_street, etc. (outdated in versions 0.5x) and new, through the address log. Only the location_id that matches the address of the house is taken into account. When I wrote a sql query to select clients by addresses, I connected them with houses, streets and districts in the query by location_id.

For tests, the already installed Abills is in the docker container, which can be downloaded at the link:
http://abills.net.ua:8090/plugins/servlet/mobile?contentId=11403447#content/view/11403447

In the “Setup” – “Other” – “Information fields” I added some additional fields, for example: “Connection type”: Ethernet, GPON, WiFi, etc. “, then checkbox “Actual phone”, thanks to this field My scripts for sending SMS to clients were checked to whom to send, and who were not. Employees at the checkout can check the relevance of a mobile phone when a client comes to pay for Internet services, and you can uncheck those who do not want to receive SMS.

You can terminate sessions using autozh.pl, for example:

cd /usr/abills/misc/
./autozh.pl help
./autozh.pl DEBUG=1 HANGUP=1
./autozh.pl DEBUG=2 NEGATIVE_DEPOSIT=1

If you specify debug>7, then operations are not performed, but information is simply displayed.

For the guest mode to work, the configuration must specify:

$conf{INTERNET_STATUS_NEG_DEPOSIT}=1;

Rotation of payments, withdrawals, documents and statistics for previous periods (SELECT – displaying deleted data without deletion, DELETE – deleting data, ROTATE – moving data into separate tables, SHOW – viewing deletion requests, SHOW_SUMMARY – viewing statistics of rows for deletion):

/usr/abills/misc/mysql/clear_db.pl SELECT DATE=2018-08-01
/usr/abills/misc/mysql/clear_db.pl SHOW DATE=2018-08-01
/usr/abills/misc/mysql/clear_db.pl SHOW_SUMMARY DATE=2018-08-01

Check the CID and CPE MAC fields (for example, so that you can enter only numbers and small letters a-f in the MAC address format):

$conf{INTERNET_CID_FORMAT}="^(([0-9a-f]{2}[:]){5}([0-9a-f]{2});?){1,}\$";

Check the “Phone” and “Mobile Phone” fields (for example, 0980001122 so that you can enter only 10 digits):

$conf{PHONE_FORMAT}='^\d{10}$';
$conf{CELL_PHONE_FORMAT}='^\d{10}$';

You can add a PING button on the user page:

$conf{INTERNET_EXTERNAL_DIAGNOSTIC}='PING:ping -c 15 -i 0.2 -s 1024 %FRAMED_IP_ADDRESS%';

To allow users to enter their personal account without entering a password (the last option indicates that only those who have “Too small deposit” and “Suspension” status should be allowed):

$conf{PASSWORDLESS_ACCESS}=1;
$conf{PASSWORDLESS_GUEST_ACCESS}='3;5';

To specify the period in days, after which the statistics of client ipoe sessions will be cleared (s_detail_* tables):

$conf{INTERNET_DETAIL_CLEAN_PERIOD}=180;

If it is necessary to remove the write-off of money for a certain day and write off again, then do:

/usr/abills/bin/abm_console FEES=1 DEL=1 METHOD=1 DATE="2019-08-16"
/usr/abills/libexec/periodic daily DATE="2019-08-16"
/usr/abills/libexec/periodic monthly DATE="2019-08-16"

View deductions for a certain day:

/usr/abills/bin/abm_console FEES=1 DATE="2019-08-16" METHOD=1

On the client page, in the “Access Server” menu, you can select the access server so that the client can log in only on it and cannot log in to other access servers, or you can bind the tariff to the access server in the tariff settings.

The order in which modules are located in config.pl affects the order in which they are displayed in the web interface and in the execution of periodic tasks.

Sometimes when you connect a payment system that can work on different protocols or supports free OSMP, you can connect it through an existing plug-in or OSMP in the examples below:

$conf{PAYSYS_SUCCESSIONS}="192.168.2.2:46:FcSistema:FcSis:osmp_payments";
$conf{PAYSYS_SUCCESSIONS}="192.168.3.3:85:Name:ShortName:City24.pm";

If several intervals with different speeds are configured in the tariff, then you need to add a script to the interval border in cron, for example:

1     17     *    *     *   root /usr/abills/libexec/billd checkspeed NAS_ID=11 > /dev/null 2>&1
30     23     *    *     *   root /usr/abills/libexec/billd checkspeed NAS_ID=11 > /dev/null 2>&1

You can just see the current speed of clients like this:

/usr/abills/libexec/billd checkspeed SHOW_SPEED=1 NAS_IDS=11

If you use TrinityTV and activate more than 4 devices for one client, then Trinity Accounting will consider it as two clients.

In order for the system to monitor duplicate sessions, we indicate the option below in the configuration file, and also fill in the “Simultaneously” parameter in the tariff settings:

$conf{hard_simultaneously_control}=1;
update tarif_plans set logins=1

In order to mark percentages on the optical divider in Maps2+Cablecat, select the necessary switching, left-click on the divider, select “Change” and in the “Attenuation” field specify percentages in the form 50/50.

If you specify a Cyrillic apostrophe in the name of the communication node in Maps2, then in the future the cables will no longer appear on the map (the problem was noticed in ABillS 0.83).

If dynamic ippools are used, then for best performance it is recommended to enable the GET_IP2 option, for static ippools it is not needed, to enable it you need to re-save existing ippools, specify the option below in the configuration file and restart freeradius:

$conf{GET_IP2}=1;

One dynamic ippool can be linked to several access servers at the same time.

If you need to find users who have been registered for a certain period of time, then on the search page in the Registration field, we will indicate for example:
2019-01-01/2020-01-01

Viewing the total number of rows to be deleted or rotated before the specified date (from the payments, fees, internet_log tables):

cd /usr/abills/misc/mysql
./clear_db.pl SHOW_SUMMARY DATE=2019-01-01

See also my articles:
How to run periodic on January 2
Using and configuring CRON
Configuring L4-Redirect-ipset for Accel-ipoe and ABillS
My other articles about ABillS

Leave a comment

Leave a Reply