planetWayne Site Admin

Joined: 30 Jan 2003 Posts: 280
|
Posted: Sat Sep 18, 2004 11:27 pm Post subject: Speaking Clock |
|
|
This ones to get Asterisk to have its own speaking clock - BT have a service when you dial '123' from a landline.
I thought I could do somthing similar - and free!
I make use of a variable in this to hold the extention number - for ease of use (and to not confuse others in the house) its set to 123 (same as BT) but you can set this to whatever fits your dial plan.
Just a little note - make sure your Asterisk box actualy has ITS clock sync'ed with an atomic source somwhere (or via nntp) otherwise its kinda pointless
Code: | [globals]
SpeakingClock=123 |
the next bit is goes in your context were you want to be able to dial the clock.
Code: |
; Speaking clock
; Take a snapshot of the time - add 10 seconds (about the lenght of the anouncement) and use that as the basis of the time.
exten => ${SpeakingClock},1,Wait(1)
exten => ${SpeakingClock},2,setvar(FutureTime=$[${EPOCH} + 10])
exten => ${SpeakingClock},3,playback(at-tone-time-exactly)
exten => ${SpeakingClock},4,SayUnixTime(${FutureTime},,R)
exten => ${SpeakingClock},5,playback(vm-and)
exten => ${SpeakingClock},6,SayUnixTime(${FutureTime},,S)
exten => ${SpeakingClock},7,playback(seconds)
exten => ${SpeakingClock},8,playback(beep)
exten => ${SpeakingClock},9,wait(2)
exten => ${SpeakingClock},10,goto(1)
|
|
|