[Asterisk-Dev] Dialplan syntax changes.. Option: work on a radically different design..

Brett Schwarz brett_schwarz at yahoo.com
Wed May 18 11:43:45 MST 2005


--- Steve Kann <stevek at stevek.com> wrote:
> 
> Here's my opinion, as an observer (personally, most
> of this doesn't 
> matter much to me at the moment, as my dialplans are
> stunningly simple, 
> mostly because I handle most things via FastAGI).
> 
> Taking a step back, and re-examining the problem..
> 
> [I'll do a rumsfeld-style ask myself questions and
> answer them thing here]:
> 
> What is the dialplan?  It's really a procedural
> language, it seems.
> 
> Do we already have well defined syntax(es) that
> would fit?
> 
> Sure we do -- and most of them stem from the syntax
> of C in one way or 
> another.
> 
> So, can it make sense to make the Dialplan look more
> like C?
> 
> I think it does.
> 
> Here's an example (based on some stuff in
> configs/extensions.conf.sample
> 
> ==== snip ====
> 
>   static=yes
>   writeprotect=no
>   autofallthrough=yes
> 
> CONSOLE=Console/dsp                             ;
> Console interface for demo
> ;CONSOLE=Zap/1
> ;CONSOLE=Phone/phone0
> IAXINFO=guest                                   ;
> IAXtel username/password
> ;IAXINFO=myuser:mypass
> TRUNK=Zap/g2                                    ;
> Trunk interface
> 
> 
> macro LocalDial (dialed) {
>     Dial($dialed);
>     switch($?) {
>     }
>     return something;
> }
> 
> context mycontext {
>     extension 2125551212 () {
>          
> Dial(SIP/Grandstream1,DIAL_RINGBACK|DIAL_ARGUMENT)
>           switch ($?) {
>              case NOANSWER {
>                 2125551333 ();
>              }
>              case CONGESTION {
>                 Play(busy);
>              }
>              default {}
>          }          
>     }
>     extension _212555XXXX () {
>           Dial(Local/$EXTEN);
>     }
> }
> ============
> 

Reed Wade had put something together about a year ago,
that is very similiar to this. He used Tcl as an
interface to the extension config. Not sure what
happened with the code, but maybe his post can be used
as a point of reference:

http://lists.digium.com/pipermail/asterisk-dev/2004-April/003649.html


    --brett

--brett



More information about the asterisk-dev mailing list