]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/init.d/asterisk
Added option for firewall adjustment on blue
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / asterisk
1 #!/bin/sh
2 ########################################################################
3 # Begin $rc_base/init.d/asterisk
4 #
5 # Description : Asterisk Script
6 #
7 # Authors : Michael Tremer (mitch@ipfire.org)
8 #
9 # Version : 01.00
10 #
11 # Notes :
12 #
13 ########################################################################
14
15 . /etc/sysconfig/rc
16 . ${rc_functions}
17
18 case "${1}" in
19 start)
20 boot_mesg "Starting Asterisk PBX..."
21 /sbin/modprobe zaptel
22 /sbin/modprobe ztdummy
23 loadproc /usr/sbin/asterisk
24 ;;
25
26 stop)
27 boot_mesg "Stopping Asterisk PBX..."
28 asterisk -rx "stop gracefully" >/dev/null 2>&1
29 evaluate_retval
30 ;;
31
32 reload)
33 boot_mesg "Reloading Asterisk PBX..."
34 asterisk -rx "reload" >/dev/null 2>&1
35 evaluate_retval
36 ;;
37
38 restart)
39 ${0} stop
40 sleep 1
41 ${0} start
42 ;;
43
44 status)
45 statusproc /usr/sbin/asterisk > /tmp/ast 2>&1
46 STAT=$(cat /tmp/ast)
47 /bin/rm -f /tmp/ast
48 echo $STAT
49 EX_Z=$(echo $STAT | grep "not" | wc -l)
50 exit $EX_Z
51 ;;
52
53 remod)
54 case "${2}" in
55 sip)asterisk -rx "sip reload" >/dev/null 2>&1 ;;
56 iax)asterisk -rx "iax2 reload" >/dev/null 2>&1 ;;
57 ext)asterisk -rx "dialplan reload" >/dev/null 2>&1 ;;
58 *) echo "Usage: ${0} remod {sip|iax|ext}"; exit 1 ;;
59 esac
60 ;;
61
62 test) touch /tmp/test$$
63 ;;
64
65 *)
66 echo "Usage: ${0} {start|stop|reload|restart|status|remod}"
67 exit 1
68 ;;
69 esac
70
71 # End $rc_base/init.d/asterisk