[asterisk-users] MATH

Håkon Nessjøen haakon at avelia.no
Sat Jan 30 08:24:28 CST 2010


Try something like:

exten => 1,1,WaitExten(3)
exten => 1,1,Set(TOTAL=${MATH(${TOTAL}+500,int)})
exten => 1,n,WaitExten(3)
exten => 2,1,Set(TOTAL=${MATH(${TOTAL}+200,int)})
exten => 2,n,WaitExten(3)
exten => 3,1,Set(TOTAL=${MATH(${TOTAL}+300,int)})
exten => 3,n,WaitExten(3)
exten => 9,1,SayNumber(${TOTAL})

Or something. Never used either math or saynumber before, but according to
the documentation, something like this should work..


On Sat, Jan 30, 2010 at 3:06 PM, Thomas Perron <thomas.perron at gmail.com>wrote:

> total up for current call.
> then read back the number
>
>
>
> 2010/1/30 Håkon Nessjøen <haakon at avelia.no>:
> > For all calls combined, or for the current call?
> >
> > On Sat, Jan 30, 2010 at 2:48 PM, Thomas Perron <thomas.perron at gmail.com>
> > wrote:
> >>
> >> I want to create a script for IVR that compiles responses, aggregates
> >> them to a total number.
> >> Then, run an equation based on the result.
> >>
> >> Press 1 for X (X is a positive number 500)
> >> Press 2 for Y (Y is a positive number 200)
> >> Press 3 for Z (Z is a positive number 300)
> >>
> >> Press 20 to calculate the results
> >> = 500+200+300 =1000
> >> then,
> >> exten => s,n,Read(NUMBER,,1000)
> >> exten => s,n,SayDigits(${NUMBER})
> >>
> >> --
> >> _____________________________________________________________________
> >> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> >>
> >> asterisk-users mailing list
> >> To UNSUBSCRIBE or update options visit:
> >>   http://lists.digium.com/mailman/listinfo/asterisk-users
> >
> >
> > --
> > _____________________________________________________________________
> > -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> >
> > asterisk-users mailing list
> > To UNSUBSCRIBE or update options visit:
> >   http://lists.digium.com/mailman/listinfo/asterisk-users
> >
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100130/6e55de0a/attachment.htm 


More information about the asterisk-users mailing list