09 March, 2008
Discovering Asterisk

I started playing around with Asterisk last week and discovered the amazing power and limitless list of possibilities that the open source PBX has to offer. I'll be documenting my installation sometime soon and I'll post it under the projects section. In the meantime I thought I'd share a little snipit of my extensions.conf file that might be useful to someone.
I spent most of yesterday building a voice prompt that would correctly speak a perfectly synchronized Zulu time. The extensions code is pretty simple, it speaks a time that is 10 seconds ahead of the start of the playback. When the playback is over it waits in a loop until the time is exactly as read and then plays the sync tone.
exten => 1,n,Answer
exten => s,n,Ringing
exten => s,n,Wait(3)
exten => s,n,Playback(at-tone-time-exactly)
exten => s,n,Set(tonetime=$[${EPOCH}+10])
exten => s,n,SayUnixTime(${tonetime},Zulu,R \'and\' S \'seconds\' \'phonetic/zulu\')
exten => s,n,While($[${EPOCH} < ${tonetime}])
exten => s,n,EndWhile
exten => s,n,SendDTMF(C,120)
exten => s,n,Wait(2)
exten => s,n,Hangup

0 Comments:
Post a Comment
<< Home