When I setup my ratecard here I only created 1 rate to Leicester in the UK. Ok for testing but not much use in the real world! So how are we going to enter all of the rates we need – the answer is to import them. Many ITSP (Internet Telephony Service Providers) publish a rate file that you can download. I’m going to use the callwithus (my provider) rate file that you can download from here.
then I’ve extracted the zip file and saved it to my C drive –
I have also rename the file to .txt instead of .csv as there can be problems with it called .csv
Now I go to RATECARD, Create new Rate Card
Give your ratecard a name and a description. I like to include the date I am creating the ratecard
and click CONFIRM DATA
Now select the Import RateCard menu
Ensure the “Choose the ratecard to import” is set to the rate card you just created
Also the callwithus import file includes “BUYRATE MIN DURATION” and “BUYRATE BILLING BLOCK” information so I have moved those 2 fields over to the “Selected Fields” box
Click on Browse to select your import file then click “Import Ratecard”
helpfully a2billing shows us an example of what it’s going to import. This is the first record in the file.
Click “Continue to Import the Ratecard” if the example looks good
a2billing should now tell you how many rates have been imported
Unfortunately if we now go and look at one of these rates we’ll see that the callwithus file wasn’t particularly well formatted to be imported into a2billing as-is.
The buy rate is zero, the selling rate is our buying cost and “SELLRATE MIN DURATION / SELLRATE BILLING BLOCK” are both zero!
So we need to sort this out. What we could have done was edit the file in something like Excel before we imported it to get everything in the correct layout. This is probably the easiest option, however I’m going to edit my ratecard using SQL in the database. Be sure you know what you’re doing if you choose this option!
First I need to log into mysql. The default database name is mya2billing – yours may differ.
Next I need to find out the ID of the tarifplan I want to edit
Now I’m going to set the buy rate to be the sell rate that was loaded from the import file –
Now I’m going to add 20% on to my sell rate –
Now to set the “SELLRATE MIN DURATION” to the “BUYRATE MIN DURATION” that was loaded from the import file –
and finally to set “SELLRATE BILLING BLOCK” to the “BUYRATE BILLING BLOCK” that was loaded from the import file –
Now if we go and look at the rate we were looking at before it looks much better. The billing increments are all the same and my sell rate it 20% more than my buy rate!
Now I just need to go to my call plan and remove the test rate card created earlier and add my new callwithus rate card