Upgrade 3CX to v18 and get it hosted free!

LCDC: the Least Cost Dialplan Compiler

Author image

Synopsis

Shell script to compile rate files for PSTN termination providers into a dialplan fragment. It does NOT require AGI or external applications at runtime.

Description

The compiler uses as input the same ratefiles and/or “p_” and “c_” files as the LCDial.sh AGI script, and configuration files similar (but not identical) to the one in LCDial.sh AGI script. It is run with the command line:

lcdc [-v] lcdialmacro

where “lcdialmacro” is the user-chosen name of the macro that will replace the Dial() command in the dialplan entries. For instance, if “lcdialmacro” is “lcd”, running:

lcdc -v lcd

will read an lcd.conf configuration file (located in /etc/asterisk/lcdialsh, but this may be changed by editing the first lines of the script) and will produce an lcd.inc file (in the same directory) which can be used by placing in extensions.conf:

  1. include lcdialsh/lcd.inc

That file will also contain the definition of a [macro-lcd] macro context, and the Least Cost Dial function will then be available for invokation in the dialplan with lines such as:

exten => _X.,1,Macro(lcd,${EXTEN}[,extra parameters...])

For full documentation, see the comments in the script body.

Getting it

Here is an ipkg package for installation on embedded platforms such as OpenWRT; it may also be opened e.g. with “tar -zxf” or, under Windows, 7Zip and installed manually. It includes documentation, sample configuration file and a few sample rates files. The package also includes three “ratefile gatherers” which can be invoked by a cron job to retrieve the rates published by three inexpensive PSTN termination providers (VoipJet, TelIAX and GloboTech Communications). It also contains a “finareafreecoverage” script printing the table of free destinations offered by some Finarea-related service providers, based on the current content of “p_” files and “c_” files (see sample on Finarea SA‘s page).

Help

Feel free to holler at the author Enzo Michelangeli

See also


Asterisk | Asterisk cmd Dial


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.