summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/asterisk-xip/files/macros/clock.conf
blob: 3250b396a82c2d0699075726da08e2c234ac9730 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
; Talking clock by Michael Geddes
; Borrowed from bits here and there.
[macro-talkingclock] ; (TimeFormat, DateFormat, Zone)
exten => s,1,Answer
exten => s,n,set(tcTimeFormat=${ARG1})
exten => s,n,GotoIf($["${tcTimeFormat}" = ""]?:tfOK)
exten => s,n,set(tcTimeFormat=HM\'vm-and\'S\'seconds\')
exten => s,n(tfOK),set(tcDateFormat=${ARG2})
exten => s,n,GotoIf($["${tcDateFormat}" = ""]?:dfOK)
exten => s,n,set(tcDateFormat=AdBY)
exten => s,n(dfOK),set(tcZone=${ARG3})
exten => s,n,GotoIf($["${tcZone}" = ""]?:znOK)
exten => s,n,set(tcZone=${TalkingClockZone})
exten => s,n(znOK),SayUnixTime(,${tcZone},${tcDateFormat})
exten => s,n(again),Wait(2)
exten => s,n,Set(FutureTime=$[${EPOCH} + 6])
exten => s,n,Playback(misc/at-tone-time-exactly)
exten => s,n,SayUnixTime(${FutureTime},${tcZone},${tcTimeFormat})
; Wait to say the beep.
exten => s,n(waitforit),noop
exten => s,n,GotoIf($[ ${EPOCH} < ${FutureTime} ]?waitforit:)
exten => s,n,playback(beep)
exten => s,n,goto(again)