summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/asterisk-xip/files/uci/talkclock
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-01-08 16:21:52 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-01-08 16:21:52 +0000
commitba66d54b5f4064664c69f614d55814cc6e862997 (patch)
tree2c762bcb0745ae549362698d69716de4988d3953 /contrib/package/asterisk-xip/files/uci/talkclock
parent2498f604961ebcf0bc8094bb72fd77d63670ee72 (diff)
contrib/package: move asterisk14-xip to feed
Diffstat (limited to 'contrib/package/asterisk-xip/files/uci/talkclock')
-rwxr-xr-xcontrib/package/asterisk-xip/files/uci/talkclock48
1 files changed, 48 insertions, 0 deletions
diff --git a/contrib/package/asterisk-xip/files/uci/talkclock b/contrib/package/asterisk-xip/files/uci/talkclock
new file mode 100755
index 000000000..20e36065f
--- /dev/null
+++ b/contrib/package/asterisk-xip/files/uci/talkclock
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+ast_add_module clock
+
+init_clock() {
+ ast_enable_type dialplanclock
+}
+
+add_dialplan_talkclock() {
+ local context=$1
+ local zone=${asterisk_zone}
+ [ ! -z "$3" ] && zone="$3"
+ local date_format="$4"
+ local time_format="$5"
+ logdebug 1 "Adding Dialplan talking clock $1 $2"
+ check_add_context "$context"
+ local ext="exten => $2,"
+ if [ "${dialplan_add_include_clock}" != 1 ] ; then
+ dialplan_add_include_clock=1
+ enable_format gsm
+ enable_module app_sayunixtime
+ append_include "macros/clock.conf"
+ fi
+ append dialplan_context_${context} "${ext}1,Macro(talkingclock,${time_format},${date_format},${zone})" "${N}"
+}
+
+handle_dialplanclock() {
+ check_add dialplanclock
+ option_cb() {
+ case $1 in
+ dialplan|extension|zone|timeformat|dateformat)
+ eval "dial_clock_$1=\"$2\"" ;;
+ esac
+ }
+}
+
+check_add_dialplanclock() {
+ if [ ! -z "${dial_clock_extension}" ] ; then
+ [ -z ${dial_clock_dialplan} ] && dial_clock_dialplan=default
+ add_dialplan_talkclock "${dial_clock_dialplan}" "${dial_clock_extension}" \
+ "${dial_clock_zone}" "${dial_clock_dateformat}" "${dial_clock_timeformat}"
+ fi
+ for i in dialplan extension zone timeformat dateformat ; do
+ eval "unset dial_clock_$i"
+ done
+}
+
+# vim: ts=2 sw=2 noet foldmethod=indent