This is a very quick walk through for using A2Billing to offer wholesale or residential services. What this means is providing call services to another device, such as a SIP extension or Asterisk server.
This tutorial produced using a SysAdminMan VPS running Asterisk 1.6.2 and A2Billing 1.9.2
First we need to set up a trunk that will be used for our outbound calls. I am going to use voip.ms in this example, it’s free to sign up for an account with them.
First you need to find your SIP account details in the voip.ms control panel –
Now we are going to set up a trunk using FreePBX. This trunk could be configured by editing sip.conf if you don’t have FreePBX on the system.
First select Add a SIP trunk –
Now enter your voip.ms account details. All we need is a name and trunk details in Outgoing Settings –
Now we need to set the trunk up in A2Billing. All we need to enter is the name, the call type (SIP) and the name of the trunk we setup in FreePBX –
Next we need to create our rates. For this I’m going to download an Excel file with the rates from voip.ms. We’re only going to get the fields shown in the screenshot below –
The reason I downloaded an Excel file is that I need to modify the file a bit to get all the fields I need, and in the right order. We want to end up with the following 5 columns. I duplicated the rate column to create a ‘buy rate’ and a ‘sell rate’. At the moment they are the same value. It is important that these columns are in the correct order –
Make sure you save the Excel spreadsheet as a CSV using File, Save As.
Now create a new blank rate card in A2Billing –
Now to import the rates. You may find that A2Billing will not let you import a file ending in .csv, if this happens just rename it to .txt.
Select the 2 additional fields for import as shown below. The most important thing is that the fields selected and their order match those in your CSV file –
Now I’m going to add 10% to the ‘sell rate’ value. This will mean we make 10% markup on our calls. Under RATES/Rates select BATCH UPDATE and the Add 10% to the SELLING RATE column –
Next create a call plan. I’m going to select Remove Inter Prefix because the rates we imported do not begin with ’00’ so if someone dials that we want to take it off before passing to the rate card –
Next we need to edit the call plan and add the rate card we created to it. This is the part that many people forget to do –
Finally we’re going to create a customer account. Make sure you give the account a positive balance so that it can make a call and also select Yes to create SIP details –
Next, as we’re not using Asterisk Realtime, we need to click on VOIP Settings and create the Asterisk SIP files and reload Asterisk –
Now using the SIP account details for the customer we should be able to either create a trunk on a remote Asterisk system or enter the account details in a SIP extension/softphone. Here are the details we are going to use –
and here are the details enetered into x-lite where I could sucsessfully make a call –
There is definitely more you would want to do but following the above should get you a working system billing for calls with a markup for the rates.
One other thing to point out if you are doing this on your own A2Billing install (and not a SysAdminMan VPS) is that this setup has been completed which makes customers in the ‘a2billing-sip’ context use AGI-CONF2 in A2Billing. This agi-conf has been set up for sip customers such as the balance not being read out, the dialled number being used, etc …