From bfc58bc9aa8fe9a89424161c6a2163f1349c07cf Mon Sep 17 00:00:00 2001 From: drowe67 Date: Fri, 1 Jan 2010 01:49:54 +0000 Subject: [PATCH] initial import git-svn-id: https://svn.code.sf.net/p/freetel/code@79 01035d8c-6547-0410-b346-abe4f91aad63 --- easy-asterisk-gui/ajamdemo.html | 321 +++++++++++++++++++++++++++++++ easy-asterisk-gui/get_network.sh | 35 ++++ 2 files changed, 356 insertions(+) create mode 100644 easy-asterisk-gui/ajamdemo.html create mode 100755 easy-asterisk-gui/get_network.sh diff --git a/easy-asterisk-gui/ajamdemo.html b/easy-asterisk-gui/ajamdemo.html new file mode 100644 index 00000000..4b911ab5 --- /dev/null +++ b/easy-asterisk-gui/ajamdemo.html @@ -0,0 +1,321 @@ + + + + + + +Asterisk™ AJAM Demo + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +

Asterisk™ AJAM Demo

Username:
Secret:
+
+   +
+
+
+ +
+This is a demo of the Asynchronous Javascript Asterisk Manager interface. You can login with a +valid, appropriately permissioned manager username and secret. +
+ + + + + + + +
+
StaticDHCP
IP Address:
Netmask:
Gateway:
DNS:
+
+
+
+ + Copyright (C) 2006 Digium, Inc. Asterisk and Digium are trademarks of Digium, Inc. + +
+ diff --git a/easy-asterisk-gui/get_network.sh b/easy-asterisk-gui/get_network.sh new file mode 100755 index 00000000..f4d72620 --- /dev/null +++ b/easy-asterisk-gui/get_network.sh @@ -0,0 +1,35 @@ +#!/bin/sh -x +# get_network.sh +# +# Extracts network config into /etc/asterisk/network.conf in a form +# that the AJAM getconfig can read. + +F="/etc/asterisk/network.conf" +echo "[network]" > $F + +if [ -f /etc/rc.d/S10network ]; then + echo "dhcp=yes" >> $F + tmpipaddr=`ifconfig eth0 | sed -n 's/.*inet addr:\(.*\)\s*Bcast.*/\1/p'` + tmpnetmask=`ifconfig eth0 | sed -n 's/.*Mask:\(.*\)\s*/\1/p'` + tmpgateway=`route -n | awk '/^0.0.0.0/ {print $2}'` + tmpdns=`cat /etc/resolv.conf | awk '/^nameserver/ {print $2}'` + echo "ipaddress=$tmpipaddr" >> $F + echo "netmask=$tmpnetmask" >> $F + echo "gateway=$tmpgateway" >> $F + echo "dns=$tmpdns" >> $F +fi + +if [ -f /etc/rc.d/S10network-static ] +then + echo "dhcp=no" >> $F + + tmpipaddr=`sed -n 's/IPADDRESS="\(.*\)"/\1/p' /etc/init.d/network-static` + tmpnetmask=`sed -n 's/NETMASK="\(.*\)"/\1/p' /etc/init.d/network-static` + tmpgateway=`sed -n 's/GATEWAY="\(.*\)"/\1/p' /etc/init.d/network-static` + tmpdns=`sed -n 's/DNS="\(.*\)"/\1/p' /etc/init.d/network-static` + echo "ipaddress=$tmpipaddr" >> $F + echo "netmask=$tmpnetmask" >> $F + echo "gateway=$tmpgateway" >> $F + echo "dns=$tmpdns" >> $F +fi + -- 2.25.1