[asterisk-users] LCR in Asterisk

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Wed Feb 13 11:33:19 CST 2008


On Wednesday 13 February 2008 09:57:59 Alex Balashov wrote:
> Tilghman Lesher wrote:
> > Uh, why not?  You can do LCR quite easily in the dialplan, by using
> > func_odbc for each of the provider lookups, then use SORT() to get the
> > lowest cost. It's quite easy, and you do not need to resort to AGI.
>
> You can do almost anything in the dial plan with enough spiritual
> commitment in about the same way that you can do just about anything you
> need to do with a bash script, as opposed to Perl, Python, or any
> toolkits or frameworks.
>
> It's not syntactically terse, balloons quickly in semantic complexity,
> is objectively less efficient as the dial plan *is not a programming
> language* (despite having variables, control structures and other things
> characteristic of an execution environment of such), and otherwise
> unnecessarily complicated.  In implementing and extending the logic
> going forward (beyond naive "lookups") in accordance with evolving
> requirements in the business rules, you will find that you run into the
> limits of the algorithmic complexity that the dial plan can provide, and
> that whatever the approach, it's overly obfuscated.  The dial plan
> limits meaningful modularisation and functional decomposition that is
> available with outboard runtime environments.

Like any other language, you certainly can write in an obfuscated way, and
the dialplan does not discourage it.  That said, you certainly can write in a
modularized way.  I would guess that you simply aren't familiar with the
dialplan enough to make those decisions, but it is quite possible and doable.

> So, it's not that you couldn't - it's that you shouldn't.

In the same way that a PHP programmer should not attempt write Python the
way she writes PHP, I would agree with you.  However, if you're willing to
adapt to the ways the dialplan works, you can create dialplans which aren't
obfuscated at all.  Tcl and Lisp are close cousins to the dialplan in terms of
how they do things.  Not everybody is a Lisp programmer, and some people
absolutely detest it.  That doesn't make it any less of a good language.

-- 
Tilghman



More information about the asterisk-users mailing list