summaryrefslogtreecommitdiffhomepage
path: root/contrib/asterisk-xip/files/macros/clock.conf
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/asterisk-xip/files/macros/clock.conf')
-rw-r--r--contrib/asterisk-xip/files/macros/clock.conf23
1 files changed, 23 insertions, 0 deletions
diff --git a/contrib/asterisk-xip/files/macros/clock.conf b/contrib/asterisk-xip/files/macros/clock.conf
new file mode 100644
index 0000000000..3250b396a8
--- /dev/null
+++ b/contrib/asterisk-xip/files/macros/clock.conf
@@ -0,0 +1,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)