[asterisk-users] LCR in Asterisk

Jay R. Ashworth jra at baylink.com
Wed Feb 13 11:45:34 CST 2008


On Wed, Feb 13, 2008 at 11:33:19AM -0600, Tilghman Lesher wrote:
> 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.

Having programmed in about 8 different languages over the last 25
years, I can see both points of view.  And admittedly, I haven't tried
to do non-trivial things with dialplan.

That said, my view of this interaction is that Tilghman has drunk the
Kool-Aid<tm>, and that Alex's view of the situation is much closer to
objective.

dialplan appears to have "jes' growed", and that never makes for a good
language design.  Ask the Python 3 team.  :-)

Cheers,
-- jra
-- 
Jay R. Ashworth                   Baylink                      jra at baylink.com
Designer                     The Things I Think                       RFC 2100
Ashworth & Associates     http://baylink.pitas.com                     '87 e24
St Petersburg FL USA      http://photo.imageinc.us             +1 727 647 1274

	     Those who cast the vote decide nothing.
	     Those who count the vote decide everything.
	       -- (Joseph Stalin)




More information about the asterisk-users mailing list