Re: [asterisk-users] Dialplan loop

2007-08-14 Thread James Collier

I do something like this.  But I am using Realtime and 1.4

context185  1   Set caller_num=${CALLERID(num)}
context185  2   SetMusicOnHold  default
context185  3   Playbacksilence2
context185  4   AGI context1.php
context185  5   Set __FWCOUNT=0${FWCOUNT}
context185  6   Set __FWCOUNT=$[${FWCOUNT}+1]
context185  7   GotoIf  $[${FWCOUNT}10]?10
context185  8   DialSIP/ext1SIP/ext2|30|m
context185  9   Hangup  
context185  10  Congestion  

-Mensaje original-
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] nombre de Anselm
Martin Hoffmeister
Enviado el: domingo, 12 de agosto de 2007 12:35
Para: Asterisk Users Mailing List - Non-Commercial Discussion
Asunto: Re: [asterisk-users] Dialplan loop


Am Donnerstag, den 09.08.2007, 20:12 -0500 schrieb David Bandel:
 Folks,
 
 I'm trying to implement a simple loop in a dialplan.  The object is to
 set a counter, run through some IVR options, increment the counter,
 return to the start, then finally fall through to an operator or
 voicemail.

 exten = s,n,Set(loop = 0)

 ...
 exten = s,n,Set(loop = $[${loop} + 1])

 The above loop increment doesn't work.  The error message is:
 
 WARNING[14490]: ast_expr2.fl:398 ast_yyerror: ast_yyerror():  syntax
 error: syntax error, unexpected '+', expecting $end; Input:
  + 1
  ^
 WARNING[14490]: ast_expr2.fl:402 ast_yyerror: If you have questions,
 please refer to doc/channelvariables.txt in the asterisk source.
 

Try removing extra space characters around the =. Very similar example
from my dialplan

exten = _2XX,n,Set(I=1)
...
exten = _2XX,n,Set(EXTR=$[${I} + 1])

Works fine. Also assigning a variable a new value based on the old value
works OK here (although not calculated, but concatenated):

exten = _2XX,n,Set(D=${D}SIP/sip501)

I am using Asterisk 1.2 here, but I remember similar errors with stray
  characters.

BR
Anselm


___
--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] Dialplan loop

2007-08-12 Thread Anselm Martin Hoffmeister
Am Donnerstag, den 09.08.2007, 20:12 -0500 schrieb David Bandel:
 Folks,
 
 I'm trying to implement a simple loop in a dialplan.  The object is to
 set a counter, run through some IVR options, increment the counter,
 return to the start, then finally fall through to an operator or
 voicemail.

 exten = s,n,Set(loop = 0)

 ...
 exten = s,n,Set(loop = $[${loop} + 1])

 The above loop increment doesn't work.  The error message is:
 
 WARNING[14490]: ast_expr2.fl:398 ast_yyerror: ast_yyerror():  syntax
 error: syntax error, unexpected '+', expecting $end; Input:
  + 1
  ^
 WARNING[14490]: ast_expr2.fl:402 ast_yyerror: If you have questions,
 please refer to doc/channelvariables.txt in the asterisk source.
 

Try removing extra space characters around the =. Very similar example
from my dialplan

exten = _2XX,n,Set(I=1)
...
exten = _2XX,n,Set(EXTR=$[${I} + 1])

Works fine. Also assigning a variable a new value based on the old value
works OK here (although not calculated, but concatenated):

exten = _2XX,n,Set(D=${D}SIP/sip501)

I am using Asterisk 1.2 here, but I remember similar errors with stray
  characters.

BR
Anselm


___
--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] Dialplan loop

2007-08-11 Thread David Bandel
On 8/10/07, Tzafrir Cohen [EMAIL PROTECTED] wrote:
 On Thu, Aug 09, 2007 at 08:12:12PM -0500, David Bandel wrote:
[snip]
  ...
  exten = s,n,Set(loop = $[${loop} + 1])

 exten = s,n,Set(loop=$[${loop} + 1])


Thanx Tzafrir.  It works now.  I guess the documentation I read that
said that white space didn't matter was wrong as are the examples in
doc/channelvariables.txt.

Ciao,

David A. Bandel
-- 
Focus on the dream, not the competition.
- Nemesis Air Racing Team motto

___
--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] Dialplan loop

2007-08-10 Thread Tzafrir Cohen
On Thu, Aug 09, 2007 at 08:12:12PM -0500, David Bandel wrote:
 Folks,
 
 I'm trying to implement a simple loop in a dialplan.  The object is to
 set a counter, run through some IVR options, increment the counter,
 return to the start, then finally fall through to an operator or
 voicemail.
 
 Am using 1.4.10 and have reviewed doc/
 
 exten = s,1,Set(TIMEOUT(digit)=5)
 exten = s,n,Set(TIMEOUT(response)=20)
 exten = s,n,Set(loop = 0)
 exten = s,n,GotoIfTime(*|sun|*|*?night)
 exten = s,n,GotoIfTime(17:00-23:59|mon-fri|*|*?night)
 exten = s,n,GotoIfTime(12:00-23:59|sat|*|*?night)
 exten = s,n,GotoIfTime(00:00-07:59|mon-sat|*|*?night)
 exten = s,n,GosubIf($[${answermode} = holiday]?holiday)
 exten = s,n,Gosub(day)
 
 exten = s,n(night),Background(silence/1)
 exten = s,n,Background(welcome)
 exten = s,n,Background(our-business-hours-are)
 ...
 exten = s,n,Set(loop = $[${loop} + 1])

exten = s,n,Set(loop=$[${loop} + 1])

 exten = s,n,GotoIf(${loop} = 1 ?night)
 exten = s,n,Voicemail(1016)
 
 exten = s,n(day),Background(silence/1)
 
 The above loop increment doesn't work.  The error message is:
 
 WARNING[14490]: ast_expr2.fl:398 ast_yyerror: ast_yyerror():  syntax
 error: syntax error, unexpected '+', expecting $end; Input:
  + 1
  ^
 WARNING[14490]: ast_expr2.fl:402 ast_yyerror: If you have questions,
 please refer to doc/channelvariables.txt in the asterisk source.
 
 OK, and doc/channelvariables.txt shows:
 exten = 1,2,Set(koko=$[2 * ${lala}])
 as an example.
 
 So if anyone can see what the difference is between:
 exten = s,n,Set(loop = $[${loop} + 1])
 and
 exten = 1,2,Set(koko=$[2 * ${lala}])

-- 
   Tzafrir Cohen   
icq#16849755jabber:[EMAIL PROTECTED]
+972-50-7952406   mailto:[EMAIL PROTECTED]   
http://www.xorcom.com  iax:[EMAIL PROTECTED]/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


[asterisk-users] Dialplan loop

2007-08-09 Thread David Bandel
Folks,

I'm trying to implement a simple loop in a dialplan.  The object is to
set a counter, run through some IVR options, increment the counter,
return to the start, then finally fall through to an operator or
voicemail.

Am using 1.4.10 and have reviewed doc/

exten = s,1,Set(TIMEOUT(digit)=5)
exten = s,n,Set(TIMEOUT(response)=20)
exten = s,n,Set(loop = 0)
exten = s,n,GotoIfTime(*|sun|*|*?night)
exten = s,n,GotoIfTime(17:00-23:59|mon-fri|*|*?night)
exten = s,n,GotoIfTime(12:00-23:59|sat|*|*?night)
exten = s,n,GotoIfTime(00:00-07:59|mon-sat|*|*?night)
exten = s,n,GosubIf($[${answermode} = holiday]?holiday)
exten = s,n,Gosub(day)

exten = s,n(night),Background(silence/1)
exten = s,n,Background(welcome)
exten = s,n,Background(our-business-hours-are)
...
exten = s,n,Set(loop = $[${loop} + 1])
exten = s,n,GotoIf(${loop} = 1 ?night)
exten = s,n,Voicemail(1016)

exten = s,n(day),Background(silence/1)

The above loop increment doesn't work.  The error message is:

WARNING[14490]: ast_expr2.fl:398 ast_yyerror: ast_yyerror():  syntax
error: syntax error, unexpected '+', expecting $end; Input:
 + 1
 ^
WARNING[14490]: ast_expr2.fl:402 ast_yyerror: If you have questions,
please refer to doc/channelvariables.txt in the asterisk source.

OK, and doc/channelvariables.txt shows:
exten = 1,2,Set(koko=$[2 * ${lala}])
as an example.

So if anyone can see what the difference is between:
exten = s,n,Set(loop = $[${loop} + 1])
and
exten = 1,2,Set(koko=$[2 * ${lala}])

please point out my error.

Thanx,

David A. Bandel
-- 
Focus on the dream, not the competition.
- Nemesis Air Racing Team motto

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