The topic is current. For me, as a corporate telephonist five or ten years ago, there was always the task of setting up the ARS function on the Panasonic TDA100 / 200/600 or LCR on the LG LDK100 / 300. In general, to make it cheaper to call. But times are changing, and now many companies use Asterisk, and I no longer configure Panasonic, LG and other PBX systems.
In Asterisk, we all know, all routing is done in dialplan. But if the operator has many directions and the price for each of them is different, then in the dialplan there are footcloths of several pages. Different solutions: someone splits dialplan into different files, uses macros, someone connects to the database, someone renders to a separate service.
I want to share my decision: to make a search for the operator with the lowest cost of a given direction to a third-party application on node.js, with which Asterisk interacts through AGI. ')
Task
Get a simple and fast solution to determine the operator who has the lowest cost per minute of a call, which is also quickly installed and configured.
On the one hand, the Asterisk should interact with the application, passing the direction of the call and requesting the operator with the lowest cost. On the other hand, the user interacts with the application through the web interface, which adds service providers, directions and their cost.
Scheme
LCR Finder
Detailed installation in the description of the project on githabe . But we will use the lcr-finder-app application (we clone, install dependencies and run the application).
The installed application opens two ports for connections, one for Asterisk - requests for AGI, the other for the web interface.
Then configure Asterisk in the extensions.conf file, just run a request to AGI and make a call on the result.
Also, after a request to AGI to the LCR Finder, the variables LCR_STATUS, LCR_RESULT, LCR_SEQUENCE are set. LCR_STATUS - FAILED, SUCCESS depending on the search result, LCR_RESULT is the name of the lowest-cost operator, LCR_SEQUENCE is a comma-separated list of all operators, sorted in ascending order. LCR_SEQUENCE allows for failover, if the lowest-cost operator does not miss a call, then you can take the following.
In the web interface, which my colleague Anatoly quickly folded on angular.js, everything is rather laconic: we add an operator, we add directions and cost to it. In the search tab, you can check the cost direction from the operators.
Question to asteriskers: is it necessary to develop this system? Would you use it in your installations with Asterisk? Now there is no download of Excel files with directions (I first load directions in a team in mongodb, because I have a small script for this, and then in the web interface, I or the customer change prices as necessary). There is also an idea with the weight of the operator, because Sometimes the price is not the only parameter affecting the choice of the operator.
Are there any similar systems? Of course yes. For example, I know that some people use A2Billing for LCR, there is still a LCDial.sh project (I don’t know if anyone is using it), someone uses such scripts .
I hope for constructive criticism and suggestions for improvement. I think that will help someone to save additional funds for development in our difficult time.