Wednesday, April 15, 2009

add callshop & realtime billing feature to your a2billing

If you have a a2billing working already, you may want to add some more features, like make it work as a hosted callshop, here we’ll introduce how to add callshop feature using asterbilling.

1. add a new conf in your a2billing

add a new conf like [agi-conf2] in a2billing.conf, make sure you have the changed the following options:

; Manage the answer on the call

answer_call = NO
play_audio = NO
use_dnid = YES
number_try = 1
say_balance_after_auth = NO
say_balance_after_call = NO
say_rateinitial = NO
say_timetocall = NO
cid_enable = NO
cid_auto_assign_card_to_cid = NO

anyway, disable all prompt & announcement

2. add new dialplan in asterisk extensions

by default, sip peer generated by a2billing will use context a2billing, so we add

[a2billing]
; for asterbilling booth
exten => _X.,1,DeadAGI,a2billing.php|2

sc-2

3. add costomer in a2billing

then we add a customer in a2billing, make sure you enabled sip or iax account, then click the “generate” button and click “reload” link

also u may want to set this customer as “postpay” and a big number for the limit coz you would not charge customer in a2billing, just make sure this customer could make calls with no problem

4. set your ip phone

go to “List Sip-friend” or “List iax-friend” get the username/secret for your phone, then try make a call, if everything goes well, u should make a call successfully

sc-4

5. add clid in asterbilling

go to asterbilling and create clid using the username(if there’s callerid defined for this customers, use callerid instead) in sip-friends

sc-1

6 login as groupadmin/operator and enjoy :)

sc-3

Posted by solo at 17:36:00 | Permalink | No Comments »

Sunday, November 23, 2008

Rates setting in asterbilling for asterisk billing

There are three rates in asterBilling, reseller rate, callshop rate and customer rate.

  • reseller rate: the rate admin sell to reseller
  • callshop rate (group rate): the rate reseller sell to callshop (group)
  • customer rate: the rate callshop sell to customers

Rates in asterBilling could be inherited, for example, here’s two records in resellerrate

dialpreifx = 0086
number length = 0
connect charge = 0.2
init block = 60
rate = 0.2
billing block = 60
resellerid = 0

dialpreifx = 0049
number length = 0
connect charge = 0.4
init block = 60
rate = 0.4
billing block = 60
resellerid = 0

Because we dont specify which reseller is this rate for (resellerid = 0), this rate could be used for all resellers.  So what if some resellers want to change this rate rather than use this “default” rate? quite simple, just add another rate for the reseller:

dialpreifx = 0086
number length = 0
connect charge = 0.2
init block = 60
rate = 0.2
billing block = 60
resellerid = 1

so for this reseller (resellerid=1), when customer dial a number begin with 0086, it will use this new rate, we  can call it “overwrite”, but for other resellers who dont set their rate, it would use the one admin setted.

Just like reseller rate, group rate could also be inherited.

A:
dialpreifx = 0086
number length = 0
connect charge = 0.2
init block = 60
rate = 0.2
billing block = 60
resellerid = 1
grouprid = 1

B:


dialpreifx = 0086
number length = 0
connect charge = 0.4
init block = 60
rate = 0.4
billing block = 60
resellerid = 1
grouprid = 0

C:

dialpreifx = 0086
number length = 0
connect charge = 0.4
init block = 60
rate = 0.4
billing block = 60
resellerid = 0
groupid = 0

so rate C is a rate for all reseller and all group,  rate B is for all groups in reseller 1, rate A is only for group 1.

Through inherit rate, admin could be much easier to control the rates, like just set one rate for all resellers, and adjust some when they require some difference, also reseller could just set one rate for his callshops, and only do minor change to provide different rate plan.

Posted by solo at 04:57:55 | Permalink | No Comments »

asterbilling and asterisk2billing (a2billing) for asterisk billing

a2billing is a widly used billing system, so what’s the difference between a2billing and asterbilling?

system theory:

a2billing work with asterisk through AGI, each call would be handled by a2billing.agi, so you need change your astierks context so that when your phone make calls it will go to a2billing.agi, of course you need to copy a2billing scripts to your asterisk server.

asterbilling runs as linux daemons, connect to asterisk via AMI over tcp,  no need change anything on your asterisk, asterbilling can bill it. Even asterbilling could work with a2billing.

license & free:

a2billing: 100% open source and free to use.

asterbilling: only web scripts are open source, and provides 5 free simultaneous channels, have to purchase when need more channels.

performance:

a2billing: like 100 simultaneous calls on single server? i didnt test, :(

asterbilling: passed 240 simultaneous calls testing, but didnt test more.

best usage:

a2billing: calling card, callback or wholesale solutions

asterbilling: billing for embedded astiersk, pbx (like all freepbx based system), callshop, hosted callshop soltution

other keywords:

a2billing: openser

asterbilling: realtime billing, reseller

Posted by solo at 04:55:33 | Permalink | No Comments »