This is the section where DID are added to the system. The DID has to added to a group. If that group is selected against the customer, then the customer can add DID from the list of DID in that group.

The DID is brought into A2Billing from the Asterisk Dial Plan using the DID switch. This can be manually configured, or brought in using inbound routes in FreePBX. The A2Biling context will look something like this:-

exten => _X.,1,deadAGI(a2billing.php|1|did)
exten => _X.,2,Hangup

Note that the number delivered into A2Billing from Asterisk needs to be an exact match with the DID you enter into the DID.

The process is as follows: -

  1. Test the DID in Asterisk to ensure that it is turning up as expected.
  2. Pass the call into A2Billing with the DID switch.
  3. Add the DID in this screen
  4. Set the destination in Add Destination.


Enter the DID exactly as received by Asterisk

Billing Type

This is where the billing type is set.

  • Fix per Month + Dial out rate - Charge a monthly subscription, and make a charge for all calls which go out via a trunk. The rate charged will depend on the customers rate plan. Calls that are made to VoIP destinations (not via a trunk) are not able to be charged. - there is a methodology of charging for voip calls, search the forum for a solution.
  • Fixed - Charge only a fixed monthly charge. All calls to any destinations are not charged.
  • Dial Out Rate - Charge only when the call is delivered via a trunk at the rate dictated in the customers call plan.
  • Free - Charge Nothing.

Start and Expiry Date

Set a start date and expiry date for the DID.

DID Group

Set the group that the DID belongs to.


The country label used for identification of the DID for the customer.


Yes or no.

Monthly Rate

Set the monthly rate in the base currency. In order for this to be charged and applied, a cron job has to be set up in the system. See the comments in /var/lib/asterisk/agi-bin/libs_a2billing/crontjob/a2billing_bill_diduse.php for more information on setting this up.

DID ON-Net Charges

Set the rate and connect charge to be applied for one A2Billing customer to call another A2Billing customer. The call is routed internally, not via a carrier.

DID Ingress Charges

Set the A-Leg rate to apply to the owner of the DID for calls that are being delivered to an endpoint. The rate applied here will be added to the B-Leg.


Submit the changes