[asterisk-dev] European Asterisk Developer's Meet-Up: Last Call

Benny Amorsen benny+usenet at amorsen.dk
Wed Apr 29 05:45:13 CDT 2009


Matthew Nicholson <mnicholson at digium.com> writes:

> Also I think there should be an optional argument for how much to
> inc/dec (${INC(VAR,2)}).

That syntax looks like you're using it as a function, not as an
application. Does the function as written increase the value of VAR as a
side effect, or does it just return the value of VAR + 2? Does it
preincrement or postincrement?

If this ends up being implemented, please just make it an application
with the syntax INC(VAR,2), and don't let it return anything.

The only reason why this application has any use is that Asterisk's use
of brackets is so funky that they're really hard to get right. If you
could do:

 exten => _X,n,Set VAR = VAR + 1

instead of

 exten => _X,n,Set(VAR=$[${VAR}+1])

This would be much less of a problem.

By the way, I only just realized that Asterisk has a SET function. What
does it return?


/Benny




More information about the asterisk-dev mailing list