[asterisk-dev] [Code Review] INCrement DECrement functionality for Asterisk
Nir Simionovich
nir.simionovich at gmail.com
Tue May 5 04:19:16 CDT 2009
Hi Tilghman,
I know you can't, there is a problem with the post-review script. The
patch is on the tracker, per KPF's recommendation.
Nir S
On Tue, May 5, 2009 at 1:49 AM, Tilghman Lesher <tlesher at digium.com> wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/243/#review765
> -----------------------------------------------------------
>
>
> I cannot view the diff.
>
> - Tilghman
>
>
> On 2009-05-04 04:00:15, greenfieldtech wrote:
> >
> > -----------------------------------------------------------
> > This is an automatically generated e-mail. To reply, visit:
> > http://reviewboard.digium.com/r/243/
> > -----------------------------------------------------------
> >
> > (Updated 2009-05-04 04:00:15)
> >
> >
> > Review request for Asterisk Developers.
> >
> >
> > Summary
> > -------
> >
> > Over the course of time, developing Asterisk dialplans becomes fairly
> cumbersome, especially when writing While() loops in the dialplan. Mainly,
> when we want to iterate a few times, the ever annoying Set(Var=$[${Var} +
> 1]) is really annoying.
> > INCrement and DECrement follow the old PASCAL functions, allowing to
> increment and decrement a variable.
> >
> > The functions are built to handle both numeric and alpha-numeric values.
> If an alpha-numeric value is given, the functions will simply bail out and
> issue a LOG_NOTICE accordingly.
> >
> > In order to implement this, i've added some functionality to func_math.c
> and added a new ast_is_numeric function to strings.h
> >
> > Please find attached patches for TRUNK under bug tracker issue 15025.
> >
> > For some reason, the post-review script doesn't work (kpf is aware of the
> issue).
> >
> >
> > This addresses bug N/A.
> > http://bugs.digium.com/view.php?id=N/A
> >
> >
> > Diffs
> > -----
> >
> > /funcs/funcs/func_math.c 191953
> >
> > Diff: http://reviewboard.digium.com/r/243/diff
> >
> >
> > Testing
> > -------
> >
> > The below dialplan illustrates the usage of these functions within a
> dialplan:
> >
> > [incdec]
> > exten => _X.,1,Answer
> > exten => _X.,n,Wait(1)
> > exten => _X.,n,Set(MyVar=10)
> > exten => _X.,n,Noop(${INC(MyVar)})
> > exten => _X.,n,Noop(MyVAR is Now: ${MyVar})
> > exten => _X.,n,Noop(${DEC(MyVar)})
> > exten => _X.,n,Noop(MyVAR is Now: ${MyVar})
> > exten => _X.,n,While($[DEC(MyVar) > 0])
> > exten => _X.,n,Noop(MyVAR is Now: ${MyVar})
> > exten => _X.,n,EndWhile
> > exten => _X.,n,Noop(${INC(NoVar)})
> > exten => _X.,n,Set(NewVar=ab)
> > exten => _X.,n,Noop(${INC(NewVar)})
> > exten => _X.,n,Noop(NewVAR is Now: ${NewVar})
> >
> >
> > Screenshots
> > -----------
> >
> > INC and DEC running
> > http://reviewboard.digium.com/r/243/s/1/
> >
> >
> > Thanks,
> >
> > greenfieldtech
> >
> >
>
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20090505/48b383b9/attachment.htm
More information about the asterisk-dev
mailing list