Philip Prindeville
2007-Dec-05 06:03 UTC
[asterisk-users] New feature: calling all bug marshals
Hi. I wanted to write a "popcorn" app for myself, both to learn how to script in extensions.conf, but also because it was something handy. Along the way, I found myself doing something like: [popcorn] exten => s,1,Set(FUTURETIME=$[${EPOCH} + 10]) ... exten => s,n,While(${EPOCH} < ${FUTURETIME}) exten => s,n,Wait(0.01) exten => s,n,EndWhile() exten => s,n,Play(beep) exten => s,n,Hangup() and hating myself for it (my Asterisk runs on a 500MHz Geode LX). So I decided it would be useful (in general, and educational for me in particular) to write a WaitUntil() application instead. Well, I've done that. I was going to file a bug and then post a "fix" to get their feature in, but the Bug guidelines seem to be pretty clear that this is not the way to go. So, I'm posting here instead. The example to paste into the documentation or extensions.conf is: [popcorn] exten => s,1,Answer() ; the amount of delay is set for English; you may need to adjust this time ; for other languages is there's no pause before the synchronizing beep. exten => s,n,Set(FUTURETIME=$[${EPOCH} + 11]) exten => s,n,SayUnixTime(${FUTURETIME},Zulu,HNS) exten => s,n,SayPhonetic(z) exten => s,n,SayUnixTime(${FUTURETIME},,HNS) exten => s,n,Playback(local) exten => s,n,WaitUntil(${FUTURETIME}) exten => s,n,Playback(beep) exten => s,n,Return() I invoke it as: exten => 712,1,Gosub(popcorn,s,1) exten => 712,n,Hangup() And lastly, attached is the source for app_waituntil.c. It's fairly straightforward, and not very big. But hopefully useful. Oh, before I forget: it does require the recording of one additional phrase, either "local" or "localtime". I've used "local" in my example above. And I read out the time first as GMT/UT (because I travel a lot), and then in the timezone of my PBX... -Philip -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: app_waituntil.c Url: http://lists.digium.com/pipermail/asterisk-users/attachments/20071204/e6583f67/attachment.txt
Steve Edwards
2007-Dec-05 06:22 UTC
[asterisk-users] New feature: calling all bug marshals
On Tue, 4 Dec 2007, Philip Prindeville wrote:> I wanted to write a "popcorn" app for myself, both to learn how to script inJust out of curiosity, what does this have to do with popcorn? Thanks in advance, ------------------------------------------------------------------------ Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
Philip Prindeville
2007-Dec-05 07:58 UTC
[asterisk-users] New feature: calling all bug marshals
Steve Edwards wrote:> On Tue, 4 Dec 2007, Philip Prindeville wrote: > > >> I wanted to write a "popcorn" app for myself, both to learn how to script in >> > > Just out of curiosity, what does this have to do with popcorn? > > Thanks in advance, > ------------------------------------------------------------------------ > Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST > Newline Fax: +1-760-731-3000 >You used to be able to dial "popcorn" (767-2676) in any area code (at least prior to 1982) and get the current time. -Philip
John Novack
2007-Dec-05 17:05 UTC
[asterisk-users] Popcorn ( was Re: New feature: calling all bug marshals )
Philip Prindeville wrote:> Steve Edwards wrote: > >> On Tue, 4 Dec 2007, Philip Prindeville wrote: >> >> >> >>> I wanted to write a "popcorn" app for myself, both to learn how to script in >>> >>> >> Just out of curiosity, what does this have to do with popcorn? >> >> Thanks in advance, >> ------------------------------------------------------------------------ >> Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST >> Newline Fax: +1-760-731-3000 >> >> > > You used to be able to dial "popcorn" (767-2676) in any area code (at > least prior to 1982) and get the current time. > > -Philip > >Not really ANY area code. That was mostly a Western US thing. In the Mid Atlantic US, C&P, later Bell Atlantic, later VeriZon, it was TI-4-2525. There was NO standard throughout the Bell System, and often not even offered by independents, though some time and weather along with a short commercial were sponsored by banks and such, often recorded on an Audichron system. John Novack -- Dog is my co-pilot
At 11:58 PM 12/4/2007, you wrote:>You used to be able to dial "popcorn" (767-2676) in any area code (at >least prior to 1982) and get the current time.I thought it was UL3-2121 when I was younger and occasionally if that was the only number in the UL3 prefix, dialing just UL3 was enough to get the time. Ira
Philip Prindeville
2007-Dec-07 02:34 UTC
[asterisk-users] New feature: calling all bug marshals
So, am I not summoning the bug marshals correctly? Or like druids and wizards, do they mystically sense when they are needed and emerge from the deep woods just in the nick of time? (Ever notice that whenever Batman is needed at night, it's always cloudly? How lucky is that! What if you need Batman, and it's a perfectly cloudless night? Or what if it were foggy?) Will they send me a sign if my feature gets approved? Should I look out the window towards downtown? ;-) Or... am I really supposed to file a bug after all? Philip Prindeville wrote:> Hi. > > I wanted to write a "popcorn" app for myself, both to learn how to > script in extensions.conf, but also because it was something handy. > > Along the way, I found myself doing something like: > > [popcorn] > exten => s,1,Set(FUTURETIME=$[${EPOCH} + 10]) > ... > exten => s,n,While(${EPOCH} < ${FUTURETIME}) > exten => s,n,Wait(0.01) > exten => s,n,EndWhile() > exten => s,n,Play(beep) > exten => s,n,Hangup() > > and hating myself for it (my Asterisk runs on a 500MHz Geode LX). > > So I decided it would be useful (in general, and educational for me in > particular) to write a WaitUntil() application instead. > > Well, I've done that. > > I was going to file a bug and then post a "fix" to get their feature > in, but the Bug guidelines seem to be pretty clear that this is not > the way to go. > > So, I'm posting here instead. > > The example to paste into the documentation or extensions.conf is: > > [popcorn] > exten => s,1,Answer() > ; the amount of delay is set for English; you may need to adjust this > time > ; for other languages is there's no pause before the synchronizing beep. > exten => s,n,Set(FUTURETIME=$[${EPOCH} + 11]) > exten => s,n,SayUnixTime(${FUTURETIME},Zulu,HNS) > exten => s,n,SayPhonetic(z) > exten => s,n,SayUnixTime(${FUTURETIME},,HNS) > exten => s,n,Playback(local) > exten => s,n,WaitUntil(${FUTURETIME}) > exten => s,n,Playback(beep) > exten => s,n,Return() > > > I invoke it as: > > exten => 712,1,Gosub(popcorn,s,1) > exten => 712,n,Hangup() > > And lastly, attached is the source for app_waituntil.c. > > It's fairly straightforward, and not very big. > > But hopefully useful. > > Oh, before I forget: it does require the recording of one additional > phrase, > either "local" or "localtime". I've used "local" in my example > above. And > I read out the time first as GMT/UT (because I travel a lot), and then > in the > timezone of my PBX... > > -Philip