#!/bin/bash
DN="\Z1\ZrDN\Z0\ZR";
UP="\Zr\Z2UP\Z0\ZR";
if hostname -I > /etc/hostip; then
_IP="Private IP: `cat /etc/hostip`"
if [ -f "/etc/pbx/.phone" ]; then
_PHONE="Ph: `cat /etc/pbx/.phone`"
else
_PHONE=" "
fi
_PUBLIC="Public IP: `curl -s -S --user-agent "Mozilla/4.0" http://myip.incrediblepbx.com | awk 'NR==2'` $_PHONE"
else
_IP=""
_PUBLIC=""
fi
version=`cat /etc/pbx/.version`
astversion=`asterisk -rx "core show version" | grep -m 2 ^ | tail -1 | cut -f 2 -d " "`
fpbxversion=`cat /var/www/html/admin/modules/core/module.xml | grep version | head -n 1 | cut -f 2 -d ">" | cut -f 1 -d "<"`
OSrelease=`cat /etc/os-release | grep "PRETTY_NAME" | cut -f 2 -d "=" | sed "s|\"||g" | sed "s|(Core)|Core|"`
#OSrelease=" `cat /etc/os-release | cut -f 1 -d "(" | sed 's|Scientific Linux release|Scientific Linux|'`"
test=`cat /etc/os-release | grep "Scientific Linux"`
if [[ -z $test ]]; then
TITLE="Incredible PBX $version for Raspberry Pi 2/3"
else
TITLE=" Incredible PBX $version for Scientific Linux"
fi
test=`asterisk -rx "cdr show status" | grep Enabled`
if [[ -z $test ]]; then
asterisk="$DN"
else
asterisk="$UP"
fi
test=`service apache2 status | grep running`
if [[ -z $test ]]; then
apache="$DN"
else
apache="$UP"
fi
test=`ps aux | grep -c mysqld`
if [ "$test" -lt "2" ]; then
mysql="$DN"
else
mysql="$UP"
fi
test=`service webmin status | grep -c running`
if [[ -z $test ]]; then
webmin="$DN"
else
webmin="$UP"
fi
test=`service ssh status | grep -c running`
if [[ -z $test ]]; then
ssh="$DN"
else
ssh="$UP"
fi
test=`asterisk -rx "module show like sccp" | grep -c Running`
if [[ -z $test ]]; then
sccp="$DN"
else
sccp="$UP"
fi
test=`ps aux | grep -c sendmail`
if [ "$test" -lt "2" ]; then
sendmail="$DN"
else
sendmail="$UP"
fi
test=`ps aux | grep -c faxgetty`
if [ "$test" -lt "2" ]; then
faxgetty="$DN"
else
faxgetty="$UP"
fi
test=`ps aux | grep -c iaxmodem`
if [ "$test" -lt "2" ]; then
iaxmodem="$DN"
else
iaxmodem="$UP"
fi
test=`service fail2ban status | grep running`
if [[ -z "$test" ]]; then
fail2ban="$DN"
else
fail2ban="$UP"
fi
test=`ps aux | grep -c ntpd`
if [ "$test" -lt "2" ]; then
ntpd="$DN"
else
ntpd="$UP"
fi
test=`iptables -nL | grep DROP`
if [[ -z $test ]]; then
IPtables="$DN"
else
IPtables="$UP"
fi
#IPPORT=`ifconfig | head -1 | cut -f 1 -d ":"`
IPPORT=`ifconfig | grep inet | head -1 | cut -f 2 -d ":" | cut -f 1 -d " "`
#IPPORT='eth0'
test=`/sbin/ifconfig | grep -c inet`
if [ "$test" -lt "2" ]; then
eth0="$DN"
else
eth0="$UP"
fi
test=`cat /etc/pbx/.version`
if [[ "$test" < "13-12.17" ]]; then
gvoauth="$UP"
else
gvoauth="$UP"
fi
test=`ps aux | grep -c hfaxd`
if [ "$test" -lt "2" ]; then
hfax="$DN"
else
hfax="$UP"
fi
test=`ps aux | grep -c nrservice`
if [ "$test" -lt "2" ]; then
nrclient="$DN"
else
nrclient="$UP"
fi
test=`asterisk -rx "module show like chan_dongle" | grep -c Running`
if [[ -z $test ]]; then
chan_dongle="$DN"
else
chan_dongle="$UP"
fi
revision=`cat /proc/cpuinfo | grep Revision | cut -f 2 -d ":"`
if [ "$revision" = " a21041" ]; then
model="2B"
elif [ "$revision" = " a01041" ]; then
model="2B"
elif [ "$revision" = " a02082" ]; then
model="3B"
elif [ "$revision" = " a22042" ]; then
model="2B"
elif [ "$revision" = " a01040" ]; then
model="2B"
elif [ "$revision" = " a02082" ]; then
model="3B"
elif [ "$revision" = " a22082" ]; then
model="3B"
elif [ "$revision" = " a32082" ]; then
model="3B"
elif [ "$revision" = " 9000c1" ]; then
model="ZeroW"
elif [ "${revision:0:3}" = " 00" ]; then
model="1"
elif [ "$revision" = " 900092" ]; then
model="0"
else
model="3"
fi
TITLE="Incredible PBX $version for Raspberry Pi $model"
RAM=`free | tr -s " " | grep -m 2 ^ | tail -1 | cut -f 4 -d " "`
if [ -z "$RAM" ]; then
RAM="`free | grep -m 2 ^ | tail -1 | cut -f 18 -d " "`"
if [ -z "$RAM" ]; then
RAM=" `free | grep -m 2 ^ | tail -1 | cut -f 19 -d " "`"
fi
fi
DISK=`df -h | tr -s ' ' |grep " /" | head -n 1 | cut -f 4 -d " "`
#DISK=`df -h | grep -m 2 ^ | tail -1 | cut -f 15 -d " "`
if [ -z "$DISK" ]; then
DISK=" `df -h | grep -m 2 ^ | tail -1 | cut -f 9 -d " "`"
fi
if [ "${#DISK}" -eq "4" ]; then
DISK=" $DISK"
fi
NOW=`date`
#Temperature
TEMP=`/opt/vc/bin/vcgencmd measure_temp | cut -d '=' -f2 | sed 's/..$//'`
TEMPINT=`printf '%.*f\n' 0 $TEMP`
if ((TEMPINT <= 40)); then
TEMP="4\ZB$TEMP°C"
elif ((TEMPINT >= 40 && TEMPINT <= 50)); then
TEMP="2\ZB$TEMP°C"
elif ((TEMPINT >= 50 && TEMPINT <= 60)); then
TEMP="3$TEMP°C!"
elif ((TEMPINT >= 60)); then
TEMP="1$TEMP°C!!"
fi
#chan_dongle
devs=0
IFS=$'\n'
dongles=`asterisk -rx "dongle show devices" | sed -n '1!p'`
for don in $dongles
do
devs=$((devs+1))
DEV=`echo $don | cut -c 1-13`
RSTATE=`echo $don | cut -c 20-30 | sed 's/ //g'`
PROV=`echo $don | cut -c 49-59 | sed 's/[^ ]\+/\L\u&/g'`
RSSI=`echo $don | cut -c 31-32 | sed 's/ //g'`
if ((RSSI <= 2)); then
RSSI="\Z1OOOO"
elif ((RSSI >= 2 && RSSI <= 9)); then
RSSI="\Z1●OOO"
elif ((RSSI >= 10 && RSSI <= 14)); then
RSSI="\Z3●●OO"
elif ((RSSI >= 15 && RSSI <= 19)); then
RSSI="\Z6●●●O"
elif ((RSSI >= 20)); then
RSSI="\Z2●●●●"
fi
PROV="$PROV$RSSI "
case "$RSTATE" in
Free)
state="\Z2Free";;
Dialing)
state="\Z4Dialing";;
Outgoing)
state="\Z6Outgoing call";;
Notconnec)
state="\Z1Not Connected";;
Incoming)
state="\Z5Incoming call";;
esac
cdmsg="$cdmsg$DEV$PROV\Zr$state\ZR\Z0\n"
headers="\nDevice Provider Ɏ State\n\ZB"
done
unset IFS
#end of chan_dongle
MSGLEN=`echo ${#TEMP}`
TOP="\n\ZbAsterisk\ZB: $asterisk \ZbApache\ZB: $apache \Zb MariaDB\ZB: $mysql\n\ZbSendMail\ZB: $sendmail \ZbIPtables\ZB: $IPtables \ZbSSH\ZB: $ssh\n\ZbLAN port\ZB: $eth0 \ZbFail2Ban\ZB: $fail2ban \ZbWebmin\ZB: $webmin\n\ZbGV OAUTH\ZB: $gvoauth \Zb Chan-SCCP\ZB: $sccp \ZbNR VPN\ZB: $nrclient\n\ZbFaxGetty\ZB: $faxgetty \Zb IAX Modem\ZB: $iaxmodem \ZbHylaFax\ZB: $hfax\n"
#DNG="\Z0\ZbChDongle\ZB: $chan_dongle \ZbDevices: $devs\n$cdmsg\Z$TEMP\n\Zr\Z4\Zb"
if [[ $MSGLEN > 7 ]]; then
DNG="\Z0\ZbTemp \Z$TEMP \Z0\ZbChan_Dongle\ZB: $chan_dongle \ZbDevices: $devs\n$cdmsg\n\Zr\Z4\Zb"
else
DNG="\Z0\ZbTemp: \Z$TEMP \Z0\ZbChan_Dongle\ZB: $chan_dongle \ZbDevices: $devs\n$cdmsg\n\Zr\Z4\Zb"
fi
MID="RAM\ZB:$RAM Raspbian (Jessie) \ZbDisk\ZB:$DISK\ZR\Z0\n\n\Z5\Zb"
BOT="Asterisk $astversion + GUI ver. $fpbxversion\ZB\Z0\n\n\ZR\Zb$_IP\n\n$_PUBLIC\ZB\n\n\Zb\Z4System Time: $NOW"
MSGLEN=`echo ${#MID}`
if [ "$MSGLEN" -gt "95" ]; then
# MID2=`echo $MID| sed -e 's/ / /g'`
MID2=$MID
MID=`echo $MID2| sed -e 's/Disk/ Disk/g'`
MID2=`echo $MID| sed -e 's/: /:/g'`
fi
MSG="$TOP$DNG$MID$BOT"
lines=$((22 + devs))
dialog --no-lines --colors --title "$TITLE" --msgbox "$MSG" $lines 47
clear
Not currently, and I don't expect to see one anytime soon, unless @wardmundy has been keeping it a secret.Is there a Stretch version of PIAF for Raspberry Pi 3B ?
cd /root
wget http://incrediblepbx.com/gvsip-naf-raspi.tar.gz
tar zxvf gvsip-naf-raspi.tar.gz
rm -f gvsip-naf-raspi.tar.gz
cd gvsip-naf-raspi
./install-gvsip.sh
We're ready for the RasPi Pioneers that want to try out the Google Voice implementation with PJSIP. Just follow this week's Nerd Vittles tutorial and substitute the following installation components to get started. MAKE A BACKUP IMAGE BEFORE YOU BEGIN! Do NOT use a 4GB microSD card! Feedback welcomed!
Code:cd /root wget http://incrediblepbx.com/gvsip-naf-raspi.tar.gz tar zxvf gvsip-naf-raspi.tar.gz rm -f gvsip-naf-raspi.tar.gz cd gvsip-naf-raspi ./install-gvsip.sh
wpa_cli -i wlan0 reconfigure
Failed to connect to non-global ctrl_ifname: wlan0 error: No such file or directory
File /etc/wpa_supplicant/wpa_supplicant.conf
country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
mkdir /var/run/wpa_supplicant
chown root:netdev /var/run/wpa_supplicant
chmod 775 /var/run/wpa_supplicant
ls -al /var/lib/dhcpcd5/dhcpcd*
-rw-r--r-- 1 root root 278 Jul 3 00:30 /var/lib/dhcpcd5/dhcpcd-eth0.lease
-rw-r--r-- 1 root root 278 Jul 3 00:25 /var/lib/dhcpcd5/dhcpcd-wlan0.lease
/sbin/wpa_supplicant -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 \
-D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf
Successfully initialized wpa_supplicant
wlan0: Trying to associate with 18:90:d8:ad:8a:87 (SSID='SKY355F7' freq=2462 MHz)
wlan0: Associated with 18:90:d8:ad:8a:87
wlan0: WPA: Key negotiation completed with 18:90:d8:ad:8a:87 [PTK=CCMP GTK=CCMP]
wlan0: CTRL-EVENT-CONNECTED - Connection to 18:90:d8:ad:8a:87 completed [id=0 id_str=SKY355F7-PBX.A13.G12]
wlan0: CTRL-EVENT-REGDOM-CHANGE init=COUNTRY_IE type=COUNTRY alpha2=GB
^C (did a ctrl+C on hang to terminate)
wlan0: CTRL-EVENT-DISCONNECTED bssid=18:90:d8:ad:8a:87 reason=3 locally_generated=1
wlan0: CTRL-EVENT-TERMINATING
ifup wlan0
pbxstatus
ls -al /var/run/wpa_supplican*
-rw-r--r-- 1 root root 6 Jul 3 00:25 /var/run/wpa_supplicant.wlan0.pid
/var/run/wpa_supplicant:
total 0
drwxr-x--- 2 root netdev 60 Jul 3 00:25 .
drwxr-xr-x 24 root root 900 Jul 3 00:33 ..
srwxrwx--- 1 root netdev 0 Jul 3 00:25 wlan0
ls -ald /var/run/wpa_supplicant
drwxr-x--- 2 root netdev 60 Jul 3 01:30 /var/run/wpa_supplicant
When you run the install script above, it will upgrade Asterisk to 13.21.1 as part of the install. 13.21.1 is required.
Link up your team and customers Phone System Live Chat Video Conferencing
Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.
Check your inbox!
We’ve sent you an email. Click on the button in the email body to verify your email address – (if you can not find it, check your spam folder).
Upon verification you will be directed to the 3CX setup wizard.