Limit the total duration to mobile numbers

Hi I want to know if there is a way to limit the total duration of calls made to mobile numbers of a specific extension or group . I have from my provider unlimeted local number calls and about 50 hours of calls to mobiles and when this is passed the charge is really big and I want to stop that .
Any suggestions will be very appreciated
Thanks in advance

First, you have to be able to define what a “mobile number” actually is.

In the U.S., this is impossible. So I assume that you are outside the U.S.

Next, you have to track total call volume for calls to the mobile numbers.

Assuming that you have an set of prefixes or something that you know are mobile numbers, you can create an outbound route for those prefixes.

You will also have to parse out the CDR for those calls with some type of script and then create a custom context to use as the destination to send the outbound route through to reject the calls if the CDR total is above your threshold.

Third party module here:

Hasnt been touched in years, it may work with current versions of FreePBX.


A few additional comments: Based on your other thread, I’m assuming that this system is in Greece, so anything beginning with 6 is a mobile number.

In countries where mobile and fixed numbers share the same area codes, you can query an external database to determine the carrier. Though usually not free, it’s very inexpensive. For US and Canada I use CallWithUs; cost is $0.0003 per lookup (about 33 queries for a penny). See .

If you have a problem with frivolous calls, e.g. your guys are calling their wives or girlfriends when they should be working, IMO you should deal with this administratively. Technical solutions to social problems usually don’t work out well. OTOH, if these calls have a legitimate business purpose, once your 50 hours is spent you should route them to an alternate trunk provider, using the module recommended by @lgaetz . I don’t know whom to recommend for Greece mobile but my current providers may be a good place to start. Take a look at Voxbeam (on Platinum route Vodafone $0.058/min.; Cosmote and Wind $0.0633) or AnveoDirect (all carriers $0.072). Both provide a small credit at signup, so you can test without making a payment.

If you have really heavy traffic to mobiles, a GSM gateway may cost less than a SIP trunk.

BTW, did you ever get the HT503 working properly? If so, please post the solution in that thread, so others may benefit.

Hello @papas_17,

I would use an A2Billing server for that purpose(

Treat your office as a prepaid account with a special call plan that would stop traffic if the funds will ran out. Then, once a month, set the account balance to your limit again.

Thank you,

Daniel Friedman
Trixton LTD.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.