[asterisk-users] MATH

2010-02-02 Thread Thomas Perron
I want to allow users to dial my DID
Then, hear my ginger3 intro
Then, depending on the number that they press, provide a total via MATH.
Comments.  Will this work?


exten = 866,1,Goto(tommath,s,1)
[tommath]
exten = s,1,Read(NUMBER,ginger3,2,skip,5)
exten = s,n,Gotoif($[${NUMBER} = 14]?onefour)
exten = s,n,Gotoif($[${NUMBER} = 24]?twofour)
exten = s,n,Gotoif($[${NUMBER} = 34]?threefour)
exten = s,n,Gotoif($[${NUMBER} = 20]?done)
exten = s,playback(system) - error message
exten = s,n,Set(TOTAL=0)
exten = s,n(onefour),Set(TOTAL1=${MATH(${TOTAL}+500,int)})
exten = s,n,Goto(tommath,s,1)
exten = s,n(twofour),Set(TOTAL2=${MATH(${TOTAL+TOTAL1}+200,int)})
exten = s,n,Goto(tommath,s,1)
exten = s,n(threefour),Set(TOTAL3=${MATH(${TOTAL+TOTAL1+TOTAL2}+300,int)})
exten = s,n,Goto(tommath,s,1)
exten = s,n(done),SayNumber(${TOTAL=TOTAL1+TOTAL2+TOTAL3})
exten = s,n,playback(vm-goodbye)
exten = s,n,hangup

-- 
_
-- 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


Re: [asterisk-users] MATH

2010-02-02 Thread Steve Edwards
On Tue, 2 Feb 2010, Thomas Perron wrote:

 I want to allow users to dial my DID
 Then, hear my ginger3 intro
 Then, depending on the number that they press, provide a total via MATH.
 Comments.  Will this work?

[snip]

You've been asking this and related questions for days. Wouldn't it be 
faster to try it yourself?

-- 
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

-- 
_
-- 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


Re: [asterisk-users] MATH

2010-02-02 Thread Thomas Perron
hi Steve,
I am trying it and I am using the feedback from the group.
In my view, that is the purpose; try, test, talk.
Thanks for your interest.


On Tue, Feb 2, 2010 at 7:15 PM, Steve Edwards asterisk@sedwards.com wrote:
 On Tue, 2 Feb 2010, Thomas Perron wrote:

 I want to allow users to dial my DID
 Then, hear my ginger3 intro
 Then, depending on the number that they press, provide a total via MATH.
 Comments.  Will this work?

 [snip]

 You've been asking this and related questions for days. Wouldn't it be
 faster to try it yourself?

 --
 Thanks in advance,
 -
 Steve Edwards       sedwa...@sedwards.com      Voice: +1-760-468-3867 PST
 Newline                                              Fax: +1-760-731-3000

 --
 _
 -- 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


Re: [asterisk-users] MATH

2010-02-02 Thread --[ UxBoD ]--
- Thomas Perron thomas.per...@gmail.com wrote:

 hi Steve,
 I am trying it and I am using the feedback from the group.
 In my view, that is the purpose; try, test, talk.
 Thanks for your interest.
 
 
 On Tue, Feb 2, 2010 at 7:15 PM, Steve Edwards
 asterisk@sedwards.com wrote:
  On Tue, 2 Feb 2010, Thomas Perron wrote:
 
  I want to allow users to dial my DID
  Then, hear my ginger3 intro
  Then, depending on the number that they press, provide a total via
 MATH.
  Comments.  Will this work?
 
  [snip]
 
  You've been asking this and related questions for days. Wouldn't it
 be
  faster to try it yourself?
 

So what was the outcome when you tested that dial plan extension ?


-- 
Thanks, Phil

-- 
_
-- 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

Re: [asterisk-users] MATH

2010-02-01 Thread Danny Nicholas
There's nothing wrong with this per se;  it just needs to be in a context;
try it this way;
- exten =  8284,1,Goto(domath,s,1)
[domath]
Exten = s,1,play(to-call-num-press)
- exten =  4,1,Set(TOTAL=${MATH(${TOTAL}+500,int)})
- exten =  4,n,WaitExten(3)
- exten =  4,n,Goto(domath,s,1)
- exten =  2,1,Set(TOTAL=${MATH(${TOTAL}+200,int)})
- exten =  2,n,Waitexten(3)
- exten =  2,n,Goto(domath,s,1)
- exten =  3,1,Set(TOTAL=${MATH(${TOTAL}+300,int)})
- exten =  3,n,WaitExten(3)
- exten =  3,n,Goto(domath,s,1)
- exten =  9,1,SayNumber(${TOTAL})
- exten = 9,n,Play(vm-goodbye)
- exten = 9,n,hangup
--
Danny Nicholas
--

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Matt Riddell
Sent: Sunday, January 31, 2010 5:11 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] MATH

On 31/01/10 6:27 PM, Thomas Perron wrote:
 what is wrong with this please:

 ;exten =  4,1,WaitExten(3)
 exten =  4,1,Set(TOTAL=${MATH(${TOTAL}+500,int)})
 exten =  4,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})

Heh, you might need to say what you're expecting and what you're getting :D

Straight off, all I can see is that 2 does 200, 3 does 300 and 4 does 500.

-- 
Cheers,

Matt Riddell
Managing Director
___

http://www.venturevoip.com/news.php (Daily Asterisk News)
http://www.venturevoip.com/exchange.php (Full ITSP Solution)
http://www.venturevoip.com/st.php (SmoothTorque Predictive Dialer)

-- 
_
-- 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


Re: [asterisk-users] MATH

2010-02-01 Thread Danny Nicholas
This is my feeble attempt at explaining this;
DTMF is processed by two dial-plan commands that I'm familiar with (there
are more but I'm trying to speak from my knowledge)
Waitexten reads 1 or more DTMF digits and goes to an extension in the
dialplan.
Example
- exten = s,1,playback(welcome)
- exten = s,n,Waitexten(10,m)
- exten = 0,1,verbose(operator)
- exten = 100,1,verbose(call extension 100)
- exten = 200,1,verbose(call extension 200)

The other command is read - example
- exten = 101,1,read(foobar,message,5,skip,1,9)
- exten = 101,n,verbose(you entered ${foobar})
- exten = 101,n,playback(vm-goodbye)
- exten = 101,n,hangup
HTH
--
Danny Nicholas
--


-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Cary Fitch
Sent: Sunday, January 31, 2010 2:55 PM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: Re: [asterisk-users] MATH

Clue, 

If a caller keys in 4 5 3 will some variable return 453?

I ASSume yes, since you can make menu selections with DTMF, obviously you
can process the results further or in other ways than that.

Cary




-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Steve Edwards
Sent: Sunday, January 31, 2010 2:29 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] MATH

On Sun, 31 Jan 2010, Thomas Perron wrote:

 does dtmf any any variable that i can capture and use w/ some logic
 like in the case of a gotoif

Anyone have a clue what this means? Anyone? Anyone?

-- 
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

-- 
_
-- 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


Re: [asterisk-users] MATH

2010-02-01 Thread Thomas Perron
Thank you.
I was also thinking of using the READ application to store dtmp variabes.
Then total them up at the end.
More to follow.
P



On Mon, Feb 1, 2010 at 9:20 AM, Danny Nicholas da...@debsinc.com wrote:
 There's nothing wrong with this per se;  it just needs to be in a context;
 try it this way;
 - exten =  8284,1,Goto(domath,s,1)
 [domath]
 Exten = s,1,play(to-call-num-press)
 - exten =  4,1,Set(TOTAL=${MATH(${TOTAL}+500,int)})
 - exten =  4,n,WaitExten(3)
 - exten =  4,n,Goto(domath,s,1)
 - exten =  2,1,Set(TOTAL=${MATH(${TOTAL}+200,int)})
 - exten =  2,n,Waitexten(3)
 - exten =  2,n,Goto(domath,s,1)
 - exten =  3,1,Set(TOTAL=${MATH(${TOTAL}+300,int)})
 - exten =  3,n,WaitExten(3)
 - exten =  3,n,Goto(domath,s,1)
 - exten =  9,1,SayNumber(${TOTAL})
 - exten = 9,n,Play(vm-goodbye)
 - exten = 9,n,hangup
 --
 Danny Nicholas
 --

 -Original Message-
 From: asterisk-users-boun...@lists.digium.com
 [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Matt Riddell
 Sent: Sunday, January 31, 2010 5:11 PM
 To: Asterisk Users Mailing List - Non-Commercial Discussion
 Subject: Re: [asterisk-users] MATH

 On 31/01/10 6:27 PM, Thomas Perron wrote:
 what is wrong with this please:

 ;exten =  4,1,WaitExten(3)
 exten =  4,1,Set(TOTAL=${MATH(${TOTAL}+500,int)})
 exten =  4,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})

 Heh, you might need to say what you're expecting and what you're getting :D

 Straight off, all I can see is that 2 does 200, 3 does 300 and 4 does 500.

 --
 Cheers,

 Matt Riddell
 Managing Director
 ___

 http://www.venturevoip.com/news.php (Daily Asterisk News)
 http://www.venturevoip.com/exchange.php (Full ITSP Solution)
 http://www.venturevoip.com/st.php (SmoothTorque Predictive Dialer)

 --
 _
 -- 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


Re: [asterisk-users] MATH

2010-02-01 Thread Danny Nicholas
Here's how I would do this based on the post below (it's below in outlook
express)
Exten = 866,1,Goto(tommath,s,1)
[tommath]
- exten = s,1,Read(NUMBER,instruct,2,skip,5)
- exten = s,n,Gotoif($[${NUMBER} = 1]?one)
- exten = s,n,Gotoif($[${NUMBER} = 2]?two) 
- exten = s,n,Gotoif($[${NUMBER} = 3]?three)
- exten = s,n,Gotoif($[${NUMBER} = 20]?done)
- exten = s,playback(system) - error message
- exten = s,n,Goto(tommath,s,1)
- exten = s,n(one),Set(TOTAL=${MATH(${TOTAL}+500,int)})
- exten = s,n,Goto(tommath,s,1)
- exten = s,n(two),Set(TOTAL=${MATH(${TOTAL}+200,int)})
- exten = s,n,Goto(tommath,s,1)
- exten = s,n(three),Set(TOTAL=${MATH(${TOTAL}+300,int)})
- exten = s,n,Goto(tommath,s,1)
- exten = s,n(done),SayNumber(${TOTAL})
- exten = s,n,playback(vm-goodbye)
- exten = s,n,hangup
Regards,
Danny Nicholas
--

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Thomas Perron
Sent: Saturday, January 30, 2010 7:48 AM
To: asterisk-users@lists.digium.com
Subject: [asterisk-users] MATH

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


Re: [asterisk-users] MATH

2010-01-31 Thread Håkon Nessjøen
You probably have to do a

exten = s,1,n,Set(TOTAL=0)

in the start of the call, to initialize the TOTAL variable

On Sun, Jan 31, 2010 at 4:29 AM, Thomas Perron thomas.per...@gmail.comwrote:

 thanks for the response.
 I tried to simplify and am now tuning the following, but it is not
 responding with anything.
 something wrong with timing?
 here is what I have:

 exten = 1625,1,Answer()
 exten = 1625,n,Set(TOTAL=${MATH(${TOTAL}+500,int)})
 exten = 1625,n,WaitExten(3)
 exten = 9625,1,Answer()
 exten = 9625,n,SayNumber(${TOTAL})


 output from the console 

 [Jan 30 22:25:16] WARNING[22987]: func_math.c:194 math: '' is not a valid
 number
-- Executing [1...@default:2] Set(SIP/64.85.162.137-c00d10e0,
 TOTAL=) in new stack
-- Executing [1...@default:3]
 WaitExten(SIP/64.85.162.137-c00d10e0, 3) in new stack
 [Jan 30 22:25:19] WARNING[22987]: pbx.c:7855 pbx_builtin_waitexten:
 Timeout but no rule 't' in context 'default'
  == Spawn extension (default, 1625, 3) exited non-zero on
 'SIP/64.85.162.137-c00d10e0'


 2010/1/30 Håkon Nessjøen haa...@avelia.no:
  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.per...@gmail.com
  wrote:
 
  total up for current call.
  then read back the number
 
 
 
  2010/1/30 Håkon Nessjøen haa...@avelia.no:
   For all calls combined, or for the current call?
  
   On Sat, Jan 30, 2010 at 2:48 PM, Thomas Perron 
 thomas.per...@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
 
 
  --
  _
  -- 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

Re: [asterisk-users] MATH

2010-01-31 Thread Thomas Perron
hi
i don't claim to be a star at this but there must be some obvious part missing;
my dial plan is below.  out put from cli follows.

exten = 3011,1,Answer()
exten = 3011,n,Set(TOTAL=0)
exten = 3011,n,Set(TOTAL=${Math(${TOTAL}+300,int)})
exten = 3011,n,WaitExten(3)
exten = 988,1,SayNumber(${TOTAL})

[Jan 31 10:21:35] ERROR[1318]: pbx.c:2770 ast_func_read: Function Math
not registered
-- Executing [3...@default:3] Set(SIP/64.85.162.137-c0132f50,
TOTAL=) in new stack
-- Executing [3...@default:4]
WaitExten(SIP/64.85.162.137-c0132f50, 3) in new stack
[Jan 31 10:21:38] WARNING[1318]: pbx.c:7855 pbx_builtin_waitexten:
Timeout but no rule 't' in context 'default'
  == Spawn extension (default, 3011, 4) exited non-zero on
'SIP/64.85.162.137-c0132f50'
localhost*CLI  Function Math not registered
No such command ' Function Math not registered' (type 'help Function
Math' for other possible commands)



2010/1/31 Håkon Nessjøen haa...@avelia.no:
 You probably have to do a

 exten = s,1,n,Set(TOTAL=0)

 in the start of the call, to initialize the TOTAL variable

 On Sun, Jan 31, 2010 at 4:29 AM, Thomas Perron thomas.per...@gmail.com
 wrote:

 thanks for the response.
 I tried to simplify and am now tuning the following, but it is not
 responding with anything.
 something wrong with timing?
 here is what I have:

 exten = 1625,1,Answer()
 exten = 1625,n,Set(TOTAL=${MATH(${TOTAL}+500,int)})
 exten = 1625,n,WaitExten(3)
 exten = 9625,1,Answer()
 exten = 9625,n,SayNumber(${TOTAL})


 output from the console 

 [Jan 30 22:25:16] WARNING[22987]: func_math.c:194 math: '' is not a valid
 number
    -- Executing [1...@default:2] Set(SIP/64.85.162.137-c00d10e0,
 TOTAL=) in new stack
    -- Executing [1...@default:3]
 WaitExten(SIP/64.85.162.137-c00d10e0, 3) in new stack
 [Jan 30 22:25:19] WARNING[22987]: pbx.c:7855 pbx_builtin_waitexten:
 Timeout but no rule 't' in context 'default'
  == Spawn extension (default, 1625, 3) exited non-zero on
 'SIP/64.85.162.137-c00d10e0'


 2010/1/30 Håkon Nessjøen haa...@avelia.no:
  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.per...@gmail.com
  wrote:
 
  total up for current call.
  then read back the number
 
 
 
  2010/1/30 Håkon Nessjøen haa...@avelia.no:
   For all calls combined, or for the current call?
  
   On Sat, Jan 30, 2010 at 2:48 PM, Thomas Perron
   thomas.per...@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
 
 
  --
  _
  -- 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



Re: [asterisk-users] MATH

2010-01-31 Thread Tzafrir Cohen
On Sun, Jan 31, 2010 at 10:37:29AM -0500, Thomas Perron wrote:
 hi
 i don't claim to be a star at this but there must be some obvious part 
 missing;
 my dial plan is below.  out put from cli follows.
 
 exten = 3011,1,Answer()
 exten = 3011,n,Set(TOTAL=0)
 exten = 3011,n,Set(TOTAL=${Math(${TOTAL}+300,int)})
 exten = 3011,n,WaitExten(3)
 exten = 988,1,SayNumber(${TOTAL})
 
 [Jan 31 10:21:35] ERROR[1318]: pbx.c:2770 ast_func_read: Function Math
 not registered

Function names are CaSe SenSitive, and are normally ALL CAPS. You should
use 'MATH' instead of 'Math'.

/me is done shouting for today, hopefully.

-- 
   Tzafrir Cohen
icq#16849755  jabber:tzafrir.co...@xorcom.com
+972-50-7952406   mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com  iax:gu...@local.xorcom.com/tzafrir

-- 
_
-- 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


Re: [asterisk-users] MATH

2010-01-31 Thread Thomas Perron
ok.
that worked
thanks!!


On Sun, Jan 31, 2010 at 10:50 AM, Tzafrir Cohen
tzafrir.co...@xorcom.com wrote:
 On Sun, Jan 31, 2010 at 10:37:29AM -0500, Thomas Perron wrote:
 hi
 i don't claim to be a star at this but there must be some obvious part 
 missing;
 my dial plan is below.  out put from cli follows.

 exten = 3011,1,Answer()
 exten = 3011,n,Set(TOTAL=0)
 exten = 3011,n,Set(TOTAL=${Math(${TOTAL}+300,int)})
 exten = 3011,n,WaitExten(3)
 exten = 988,1,SayNumber(${TOTAL})

 [Jan 31 10:21:35] ERROR[1318]: pbx.c:2770 ast_func_read: Function Math
 not registered

 Function names are CaSe SenSitive, and are normally ALL CAPS. You should
 use 'MATH' instead of 'Math'.

 /me is done shouting for today, hopefully.

 --
               Tzafrir Cohen
 icq#16849755              jabber:tzafrir.co...@xorcom.com
 +972-50-7952406           mailto:tzafrir.co...@xorcom.com
 http://www.xorcom.com  iax:gu...@local.xorcom.com/tzafrir

 --
 _
 -- 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


Re: [asterisk-users] MATH

2010-01-31 Thread Thomas Perron
does dtmf any any variable that i can capture and use w/ some logic
like in the case of a gotoif

so, if caller enters a certain number then gotoif matches XX
otherwise go to YY.



On Sun, Jan 31, 2010 at 10:58 AM, Thomas Perron thomas.per...@gmail.com wrote:
 ok.
 that worked
 thanks!!


 On Sun, Jan 31, 2010 at 10:50 AM, Tzafrir Cohen
 tzafrir.co...@xorcom.com wrote:
 On Sun, Jan 31, 2010 at 10:37:29AM -0500, Thomas Perron wrote:
 hi
 i don't claim to be a star at this but there must be some obvious part 
 missing;
 my dial plan is below.  out put from cli follows.

 exten = 3011,1,Answer()
 exten = 3011,n,Set(TOTAL=0)
 exten = 3011,n,Set(TOTAL=${Math(${TOTAL}+300,int)})
 exten = 3011,n,WaitExten(3)
 exten = 988,1,SayNumber(${TOTAL})

 [Jan 31 10:21:35] ERROR[1318]: pbx.c:2770 ast_func_read: Function Math
 not registered

 Function names are CaSe SenSitive, and are normally ALL CAPS. You should
 use 'MATH' instead of 'Math'.

 /me is done shouting for today, hopefully.

 --
               Tzafrir Cohen
 icq#16849755              jabber:tzafrir.co...@xorcom.com
 +972-50-7952406           mailto:tzafrir.co...@xorcom.com
 http://www.xorcom.com  iax:gu...@local.xorcom.com/tzafrir

 --
 _
 -- 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


Re: [asterisk-users] MATH

2010-01-31 Thread Steve Edwards
On Sun, 31 Jan 2010, Thomas Perron wrote:

 does dtmf any any variable that i can capture and use w/ some logic
 like in the case of a gotoif

Anyone have a clue what this means? Anyone? Anyone?

-- 
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

-- 
_
-- 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


Re: [asterisk-users] MATH

2010-01-31 Thread Philipp von Klitzing

  does dtmf any any variable that i can capture and use w/ some logic like
  in the case of a gotoif
 
 Anyone have a clue what this means? Anyone? Anyone?

How about this:

does dtmf transmit any variable that i can capture and use w/ some logic 
like [in the case of a] gotoif

Philipp


-- 
_
-- 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


Re: [asterisk-users] MATH

2010-01-31 Thread Cary Fitch
Clue, 

If a caller keys in 4 5 3 will some variable return 453?

I ASSume yes, since you can make menu selections with DTMF, obviously you
can process the results further or in other ways than that.

Cary




-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Steve Edwards
Sent: Sunday, January 31, 2010 2:29 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] MATH

On Sun, 31 Jan 2010, Thomas Perron wrote:

 does dtmf any any variable that i can capture and use w/ some logic
 like in the case of a gotoif

Anyone have a clue what this means? Anyone? Anyone?

-- 
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

-- 
_
-- 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


Re: [asterisk-users] MATH

2010-01-31 Thread Matt Riddell
On 31/01/10 6:27 PM, Thomas Perron wrote:
 what is wrong with this please:

 ;exten =  4,1,WaitExten(3)
 exten =  4,1,Set(TOTAL=${MATH(${TOTAL}+500,int)})
 exten =  4,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})

Heh, you might need to say what you're expecting and what you're getting :D

Straight off, all I can see is that 2 does 200, 3 does 300 and 4 does 500.

-- 
Cheers,

Matt Riddell
Managing Director
___

http://www.venturevoip.com/news.php (Daily Asterisk News)
http://www.venturevoip.com/exchange.php (Full ITSP Solution)
http://www.venturevoip.com/st.php (SmoothTorque Predictive Dialer)

-- 
_
-- 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


[asterisk-users] MATH

2010-01-30 Thread Thomas Perron
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


Re: [asterisk-users] MATH

2010-01-30 Thread Håkon Nessjøen
For all calls combined, or for the current call?

On Sat, Jan 30, 2010 at 2:48 PM, Thomas Perron thomas.per...@gmail.comwrote:

 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

Re: [asterisk-users] MATH

2010-01-30 Thread Thomas Perron
total up for current call.
then read back the number



2010/1/30 Håkon Nessjøen haa...@avelia.no:
 For all calls combined, or for the current call?

 On Sat, Jan 30, 2010 at 2:48 PM, Thomas Perron thomas.per...@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


Re: [asterisk-users] MATH

2010-01-30 Thread Håkon Nessjøen
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.per...@gmail.comwrote:

 total up for current call.
 then read back the number



 2010/1/30 Håkon Nessjøen haa...@avelia.no:
  For all calls combined, or for the current call?
 
  On Sat, Jan 30, 2010 at 2:48 PM, Thomas Perron thomas.per...@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

-- 
_
-- 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

Re: [asterisk-users] MATH

2010-01-30 Thread Thomas Perron
thanks for the response.
I tried to simplify and am now tuning the following, but it is not
responding with anything.
something wrong with timing?
here is what I have:

exten = 1625,1,Answer()
exten = 1625,n,Set(TOTAL=${MATH(${TOTAL}+500,int)})
exten = 1625,n,WaitExten(3)
exten = 9625,1,Answer()
exten = 9625,n,SayNumber(${TOTAL})


output from the console 

[Jan 30 22:25:16] WARNING[22987]: func_math.c:194 math: '' is not a valid number
-- Executing [1...@default:2] Set(SIP/64.85.162.137-c00d10e0,
TOTAL=) in new stack
-- Executing [1...@default:3]
WaitExten(SIP/64.85.162.137-c00d10e0, 3) in new stack
[Jan 30 22:25:19] WARNING[22987]: pbx.c:7855 pbx_builtin_waitexten:
Timeout but no rule 't' in context 'default'
  == Spawn extension (default, 1625, 3) exited non-zero on
'SIP/64.85.162.137-c00d10e0'


2010/1/30 Håkon Nessjøen haa...@avelia.no:
 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.per...@gmail.com
 wrote:

 total up for current call.
 then read back the number



 2010/1/30 Håkon Nessjøen haa...@avelia.no:
  For all calls combined, or for the current call?
 
  On Sat, Jan 30, 2010 at 2:48 PM, Thomas Perron thomas.per...@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


 --
 _
 -- 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


[asterisk-users] MATH

2010-01-30 Thread Thomas Perron
what is wrong with this please:

;exten = 4,1,WaitExten(3)
exten = 4,1,Set(TOTAL=${MATH(${TOTAL}+500,int)})
exten = 4,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})

-- 
_
-- 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


[asterisk-users] MATH function

2006-12-19 Thread Rilawich Ango

I try to use function MATH or GoToIf for checking the negative value
but CLI shows an error as following.

exten = s,11,Set(bt=${MATH(-10)})
func_math.c:164 builtin_function_math: '' is not a valid number

exten = s,11,GoToIf($[-1  0]?20)
WARNING[12926]: ast_expr2.y:729 op_negate: non-numeric argument

It seems both functions can't accept negative number for comparison.
What function can I use to compare negative number?
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users