Outgoing route switching to control costs

Infinitel

Silver Partner
Basic Certified
Joined
Jun 5, 2017
Messages
10
Reaction score
2
Hello,
We currently have a client which has an outgoing call montly flat rate up to 9000 minutes through an specific voice provider, once he has consumed it, the cost per minute is quite high. He also has a second provider which has a better cost per minute for this kind of calls.

Is it posible to change/disable/switch outgoing routes after the flat rate has been consumed to start using the other provider until the next billing cycle?. Then switch back to the flat rate provider.

If 3CX can do this natively it would be great, but we don´t mind if we have to use an external agent, development or software to have this feature on 3CX.

Any ideas?

Thanks for your help.
 
As you know, the trunk used by outbound calls is based on your outbound rules. There is no built-in way of automatically alter your rules once you have reached 9000 minutes. Today, you would have to manually monitor your minutes and update your rules. However, with some custom development, it is possible to automate the entire process.

Step 1: The first step is to configure 3CX to create CDR files, one file for each phone call. The CDR data provides all the information you need to calculate the total minutes used for the month. The CDR files are created the instant a phone call is completed, so it is nearly real time.

Step 2: To collect the CDR file data, you need a process that can automatically detect new files, parse the data, and place the data into a database (SQL Server for example). The CDR files reside on the 3CX server, so if your 3CX server is hosted, getting remote access to files can be a little challenging. Some may suggest using an IP socket connection to subscribe to CDR events, but I have always felt this approach has a significant risk of losing data if your connection goes down for software maintenance, internet outage, IP socket program crash, etc. I have an automated solution for this step below.

Step 3: Once you have the data in a database, the CDR data can easily be queried by date range, external inbound/outbound calls. and sum the total number of minutes. Because CDR files are created AFTER the call is complete, you may want to set your threshold to something less than the 9000 minutes so you don't go over the limit.

Step 4: Once your minutes have reached the threshold, use an API to update the existing outbound rules to route new calls to the second trunk. When the first of the month arrives, you can use the API to swap the trunk back. You may be able to accomplish this with the new 3CX XAPI (I have not tried), but you absolutely can with our VoIPTools REST API.

Based on the description above, I think you will conclude that, while possible, it would probably be difficult to cost-justify the effort if you had to build a solution from scratch Happily, the most complicated part of this project is easily handled by our 3CX Exporter tool. Exporter subscribes to new CDR events, downloads the files, parses the data, and saves the information into your database.
 

Latest Posts

Forum statistics

Threads
111,964
Messages
590,000
Members
164,869
Latest member
hpgitsupport