[Asterisk-Dev] Function format

Jerris, Michael MI mjerris at ofllc.com
Tue May 17 13:50:09 MST 2005


> Leif Madsen - Certified Asterisk Consultant
\
> 
> On 5/16/05, Kevin P. Fleming <kpfleming at digium.com> wrote:
> > exten => 100,1,Set(temp=${DB(CFIM/200)}) exten => 
> 100,n,GotoIF(${temp} 
> > = "" ? novalue) exten => 100,n,...
> > exten => 100,n(novalue),...
> 
> I've been trying to figure out the best way of replacing the DBget()
> n+101 functionality in the IRC channel - thanks to MikeJ, jsmith and
> drumkilla for the help. I don't like the idea of having to 
> set a temporary variable, so here's a possibly better way of 
> handling the
> n+101 syntax (works like the ${DIALSTATUS} channel variable for the
> Dial() application).
> 
> exten => 100,1,Set(DB(foo/bar)=blah)
> exten => 100,n,GotoIf(${EXISTS(${DB(foo/bar)})}?:novalue)
> exten => 100,n,...
> exten => 100,n(novalue),...
> 
> Also of interest is that you don't actually need the GotoIf() 
> application at all, replace with:
> 
> exten => 100,n,Goto(${IF(${EXISTS(${DB(foo/bar)})})}?:novalue)
> 
> Nope, you won't get any argument from me that the syntax is 
> ugly and error prone - however the use of functions is very 
> powerful and a great addition - but I hate the syntax :)
>
OK time to rally on an easily parable replacement for the functions
format.  I know this one was the decision based upon parsability, but
the usability is BAD.  Can somone suggest an alternate format that would
not be a hit on parsing but is easier on usability.

Mike




More information about the asterisk-dev mailing list