; *99: ; 99 bottles of beer on the wall. exten => *99,1,Noop(99 Bottles of beer on the wall) exten => *99,n,Answer() exten => *99,n,Set(bottles=99) exten => *99,n(loop),Noop(There are ${bottles} bottles of beer on the wall) exten => *99,n,SayNumber(${bottles}) exten => *99,n,Noop(Take one done and pass it round and there's) exten => *99,n,Set(bottles=$[${bottles}-1]) exten => *99,n,Noop(${bottles} bottles of beer on the wall) exten => *99,n,SayNumber(${bottles}) exten => *99,n,GotoIf($["${bottles}" > "0"]?loop) exten => *99,n,Noop(We're out of beer!) exten => *99,n,Hangup() Too much dial plan mashing this morning and I rememberd this site: http://99-bottles-of-beer.net/ Gordon
DUD! THIS KICKS ASS! (I know I am getting into trouble, but hey! it's already in our PBX!) On Thursday 16 August 2007 11:35, Gordon Henderson wrote:> ; *99: > ; 99 bottles of beer on the wall. > > exten => *99,1,Noop(99 Bottles of beer on the wall) > exten => *99,n,Answer() > exten => *99,n,Set(bottles=99) > exten => *99,n(loop),Noop(There are ${bottles} bottles of beer on the wall) > exten => *99,n,SayNumber(${bottles}) > exten => *99,n,Noop(Take one done and pass it round and there's) > exten => *99,n,Set(bottles=$[${bottles}-1]) > exten => *99,n,Noop(${bottles} bottles of beer on the wall) > exten => *99,n,SayNumber(${bottles}) > exten => *99,n,GotoIf($["${bottles}" > "0"]?loop) > exten => *99,n,Noop(We're out of beer!) > exten => *99,n,Hangup() > > Too much dial plan mashing this morning and I rememberd this site: > > http://99-bottles-of-beer.net/ > > Gordon > > _______________________________________________ > --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
Gordon Henderson wrote:> ; *99: > ; 99 bottles of beer on the wall. > > exten => *99,1,Noop(99 Bottles of beer on the wall) > exten => *99,n,Answer() > exten => *99,n,Set(bottles=99) > exten => *99,n(loop),Noop(There are ${bottles} bottles of beer on the wall) > exten => *99,n,SayNumber(${bottles}) > exten => *99,n,Noop(Take one done and pass it round and there's) > exten => *99,n,Set(bottles=$[${bottles}-1]) > exten => *99,n,Noop(${bottles} bottles of beer on the wall) > exten => *99,n,SayNumber(${bottles}) > exten => *99,n,GotoIf($["${bottles}" > "0"]?loop) > exten => *99,n,Noop(We're out of beer!) > exten => *99,n,Hangup() > > Too much dial plan mashing this morning and I rememberd this site: > > http://99-bottles-of-beer.net/And now, in AEL! (This is untested, I just wanted to see how it would look.) context silly { *99 => { NoOp(99 Bottles of beer on the wall); Answer(); bottles=99; while (${bottles} > 0) { NoOp(${bottles} bottles of beer on the wall, ${bottles} bottles of beer); SayNumber(${bottles}); NoOp(Take one down, pass it around); bottles=${bottles} - 1; NoOp(${bottles} bottles of beer on the wall); } NoOp(We're out of beer!); Hangup(); } } -- Russell Bryant Software Engineer Digium, Inc.
On 8/21/07, Steve Edwards <asterisk.org at sedwards.com> wrote:>> "To control the tv in this room, press 1. To control a tv in another> room, press 2. To control the outside lights, press 3. To control the> sprinklers, press 4, ...">Before this thread I already had a Firecracker on the server, a fair assortment of lights and the sprinklers are on an X10Pro Irrigation Controller. Damn, now I'm gonna be up all night..... - dbc. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070821/291de399/attachment.htm