[Asterisk-Dev] Asterisk channel variable access: a proposal

Brian Cuthie brian at systemix.com
Wed Aug 18 11:32:46 MST 2004


David Pollak wrote:

> Folks,
>
> This is a nice molehill for me to make a mountain out of...
>
> There are a lot of diverse ways to control Asterisk -- both initiating 
> and responding to a call.  There's the Manager API.  There's the Dial 
> Plan.  There's the AGI. There's the internal C API.  Each seems to 
> provide similar, but not 100% overlapping functionality of the other.
>
> The Dial Plan is an interesting beast.  I've written a couple of 
> scripting languages in my time (I reimplemented the 1-2-3 macro 
> language in a spreadsheet; I wrote a new scripting language in a 
> spreadsheet by extending the spreadsheet's parsing and evaluation 
> engine to handle variable assignment, variable retrieval, and 
> branching; I integrated REXX into a spreadsheet so that REXX could be 
> the macro language -- the latter was the most robust solution.)  It's 
> interesting to see the organic evolution of a scripting language 
> happens.  It's happening to Dial Plan... it happened to macros within 
> Lotus 1-2-3 and WordPerfect.  Once someone layers GotoToIf  and 
> variable get/set on top of a keystroke replayer, you get a Turing 
> complete programming language.  The problems are (1) nobody wants to 
> call it a programming language (2) it sucks for doing anything complex 
> and (3) the longer people shoe-horn complex things into it, the harder 
> it is to get people to use another mechanism to program their system.  
> It took Excel and Visual Basic macros to displace 1-2-3's keyboard 
> macro language, however, at least through Excel 97, one could still 
> run 1-2-3 macros in Excel -- yes, there was a translator that took 
> strings like "/ssfoo.xls" and converted them into the appropriate 
> Excel command.
>
> So, how can we all work together to help Asterisk avoid the multiple 
> API and creeping macro language issues?
>
> I propose that we form a working group with the goal to unify the 
> events, state information, the way commands are issued, and the way 
> extensions are made within Asterisk.  6 or 8 of us spend 45 days 
> developing:
>
>     * a unified approach to collecting/distributing events to
>       listeners inside and outside the Asterisk address space
>     * a unified approach to accessing state information such that Dial
>       Plan, AGI, etc. has access to the same state information that a
>       C program does (the subject of the original post)
>     * a unified approach to issuing commands to channels such that an
>       application, an AGI, the Manager API, and internal C routines
>       all issue commands to running channels the same way
>     * a unified approach to extending Asterisk such that new events,
>       state structures, etc. can be added and they become available in
>       the same way to Dial Plans, etc.
>
> The end goal would be the ability to plug a Python or Perl interpreter 
> into Asterisk and have the Python or Perl script run in parallel with 
> a Dial Plan rather than being called out from the Dial Plan.
>
> Asterisk is a totally cool system.  Helping it to mature based on what 
> a  lots of people have learned over the years will make it an even 
> better product.
>
> Thoughts?

Here, here!  I couldn't agree more with everything you've said.

Please let me know if I can help.

-brian




More information about the asterisk-dev mailing list