From: drowe67 Date: Thu, 11 Feb 2010 00:28:45 +0000 (+0000) Subject: progressing multiple IP issue, IP0X solution working OK X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=30baa0f68085ca1f050e09800ceb73c80eb5dc88;p=freetel-svn-tracking.git progressing multiple IP issue, IP0X solution working OK git-svn-id: https://svn.code.sf.net/p/freetel/code@152 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/mini-asterisk-gui/README.txt b/mini-asterisk-gui/README.txt index 2593a17c..b0b988a7 100644 --- a/mini-asterisk-gui/README.txt +++ b/mini-asterisk-gui/README.txt @@ -146,6 +146,9 @@ The msh shell on the IP0X is fairly basic (no functions, several quirks). The shell script has been coded so that it runs OK on the IP0X, which is upwards compatable to x86. +You can customise Mini Asterisk by adding your own banner to in +banner.html. + [[install]] Installation ------------ @@ -272,11 +275,13 @@ cgi.assign = ( ".sh" => "/bin/sh",".pl" => "/usr/bin/perl" ) Contributions ------------- -I especially welcome sip.conf entries for your favourite ITSP (VOIP +. I especially welcome sip.conf entries for your favourite ITSP (VOIP service) to help populate the Provider field of the link:mini/voiplines.sh.html[Voip Line Screen]. -Suggestions and patches for new features are also very welcome. +. Suggestions and patches for new features are also very welcome. + +. Help making the web pages look nicer. [[support]] Support diff --git a/mini-asterisk-gui/cgi-bin/ipphones.sh b/mini-asterisk-gui/cgi-bin/ipphones.sh index eef21023..69d3b03d 100644 --- a/mini-asterisk-gui/cgi-bin/ipphones.sh +++ b/mini-asterisk-gui/cgi-bin/ipphones.sh @@ -16,7 +16,19 @@ if [ $? -eq 1 ]; then fi more=`echo "$QUERY_STRING" | grep -oe "more=[^&?]*" | sed -n "s/more=//p"` -ipaddress=`ifconfig | sed -n 's/.*inet addr:\(.*\) Bcast.*/\1/p' | head -n 1` + +# Build list of interface IPs based on what sort of machine we are +# running on. For IP0X we just print the IP of the first interface. +# For other machines the situation is a bit more complex so we print +# all of them. I figure anyone with multiple interfaces will know +# enough about what they are doing to figure out the right one to use. + +ipaddress=`ifconfig | sed -n 's/.*inet addr:\(.*\) Bcast.*/\1/p'` + +cat /proc/cpuinfo | grep "CPU:.*ADSP" > /dev/null +if [ $? -eq 0 ]; then + ipaddress=`echo $ipaddress | awk '{ print $1 }'` +fi # Construct the web page ------------------------------- diff --git a/mini-asterisk-gui/cgi-bin/phones.sh b/mini-asterisk-gui/cgi-bin/phones.sh index 8439124d..03a526d2 100644 --- a/mini-asterisk-gui/cgi-bin/phones.sh +++ b/mini-asterisk-gui/cgi-bin/phones.sh @@ -27,7 +27,18 @@ if [ $dns_packet_loss = "0" ]; then fi fi -ipaddress=`ifconfig | sed -n 's/.*inet addr:\(.*\) Bcast.*/\1/p' | head -n 1` +# Build list of interface IPs based on what sort of machine we are +# running on. For IP0X we just print the IP of the first interface. +# For other machines the situation is a bit more complex so we print +# all of them. I figure anyone with multiple interfaces will know +# enough about what they are doing to figure out the right one to use. + +ipaddress=`ifconfig | sed -n 's/.*inet addr:\(.*\) Bcast.*/\1/p'` + +cat /proc/cpuinfo | grep "CPU:.*ADSP" > /dev/null +if [ $? -eq 0 ]; then + ipaddress=`echo $ipaddress | awk '{ print $1 }'` +fi # Construct the web page ------------------------------- diff --git a/mini-asterisk-gui/cgi-bin/voiplines.pl b/mini-asterisk-gui/cgi-bin/voiplines.pl index 96166c65..7f21ae43 100644 --- a/mini-asterisk-gui/cgi-bin/voiplines.pl +++ b/mini-asterisk-gui/cgi-bin/voiplines.pl @@ -97,7 +97,7 @@ foreach (@providers) { print "hosts[\'$_\'] = \'$host{$_}\';\n"; print "users[\'$_\'] = \'$user{$_}\';\n"; print "passwords[\'$_\'] = \'$pass{$_}\';\n"; - print "comments[\'$_\'] = \"$comment{$_}\";\n"; + print "comments[\'$_\'] = \'$comment{$_}\';\n"; } print "\n"; diff --git a/mini-asterisk-gui/etc/asterisk/sip.conf b/mini-asterisk-gui/etc/asterisk/sip.conf index 733d1c81..7981f9ca 100644 --- a/mini-asterisk-gui/etc/asterisk/sip.conf +++ b/mini-asterisk-gui/etc/asterisk/sip.conf @@ -605,20 +605,20 @@ qualify=yes ;allow=ulaw,alaw ;qualify=yes -;[user] ; "OEG" mini-asterisk do not remove this comment -;; OEG are a South Australian ITSP -;host=voip.oeg.com.au -;secret=pass -;username=your user number -;fromdomain=voip.oeg.com.au -;fromuser=your user number -;insecure=port,invite -;type=friend -;disallow=all -;allow=ulaw,alaw -;dtmfmod=rfc2833 -;qualify=yes -;canreinvite=no +;[user] ; "Jazmin" mini-asterisk do not remove this comment +;; Jazmin are a South Australian ITSP +;host=sip.jazmin.net.au +;secret= +;username= +;fromdomain=sip.jazmin.net.au +;fromuser= +;insecure=port,invite +;type=friend +;disallow=all +;allow=ulaw +;allow=alaw +;dtmfmod=rfc2833 +;qualify=yes +;canreinvite=no ;nat=yes -;context=default