Skip to content

Commit

Permalink
Improved warning messages for bbb-conf
Browse files Browse the repository at this point in the history
  • Loading branch information
ffdixon committed Mar 4, 2012
1 parent 82c61a7 commit 6cb40fc
Showing 1 changed file with 67 additions and 40 deletions.
107 changes: 67 additions & 40 deletions bigbluebutton-config/bin/bbb-conf
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ check_tools() {
echo
exit 1
else
echo "# Development tools have been installed."
echo "# Found dev tools at $1"
fi
}

Expand All @@ -384,7 +384,7 @@ check_source() {
echo
exit 1
else
echo "# Found source at $1"
echo "# Found source at $1"
fi
}

Expand Down Expand Up @@ -785,7 +785,6 @@ export ANT_OPTS=\"-Xmx512m -XX:MaxPermSize=512m\"
"
fi


if [ $SETUPDEV == "client" ]; then
BBBCLIENTHOME=$HOME/dev/bigbluebutton/bigbluebutton-client
check_source $BBBCLIENTHOME
Expand Down Expand Up @@ -815,13 +814,13 @@ export ANT_OPTS=\"-Xmx512m -XX:MaxPermSize=512m\"
" | sudo tee /etc/bigbluebutton/nginx/client_dev > /dev/null 2>&1

fi
sudo rm /etc/bigbluebutton/nginx/client.nginx
sudo ln -s /etc/bigbluebutton/nginx/client_dev /etc/bigbluebutton/nginx/client.nginx
sudo ln -f -s /etc/bigbluebutton/nginx/client_dev /etc/bigbluebutton/nginx/client.nginx

if [ ! -L $BBBCLIENTHOME/client ]; then
ln -s $BBBCLIENTHOME/bin $BBBCLIENTHOME/client
fi


echo
sudo /etc/init.d/nginx restart

# xxx
Expand All @@ -843,7 +842,7 @@ export ANT_OPTS=\"-Xmx512m -XX:MaxPermSize=512m\"
# cd ${BBBCLIENTHOME}
# ant locales
#
# 2. Modify the source for the client. The source is locatedtat
# 2. Modify the source for the client. The source is locatedt at
#
# $BBBCLIENTHOME
#
Expand Down Expand Up @@ -1150,13 +1149,24 @@ check_state() {
#
if ! grep /var/www/bigbluebutton /etc/bigbluebutton/nginx/client.nginx > /dev/null; then
NEW_LOCATION=$(cat /etc/bigbluebutton/nginx/client.nginx | sed -n '/root/{s/[ \t]*root[ \t]*//;s/;//;p}' | head -n 1)
echo
echo "# Warning: nginx is not serving client from /var/www/bigbluebutton/."
echo "# The current setting is:"
echo "# Warning: nginx is not serving the client from /var/www/bigbluebutton/."
echo "# Instead, it's being served from"
echo "#"
echo "# $NEW_LOCATION"
echo "#"
echo "# (This is OK if you have setup a development environment on this server.) "
echo "# (This is OK if you have setup a development environment.) "
echo
fi

#
# Check if running development environment
#
if ! grep 8080 /etc/bigbluebutton/nginx/web.nginx > /dev/null; then
echo "# Warning: nginx is not serving BigBlueButton's web application"
echo "# from port 8080"
echo "#"
echo "# (This is OK if you have setup a development environment.) "
echo
fi


Expand Down Expand Up @@ -1218,25 +1228,25 @@ check_state() {
# Checking if voice app registered with Asterisk successfully
#
if cat /usr/share/red5/log/sip.log | grep -q "Failed to register with Sip Server"; then
echo
echo "# Error: The voice application failed to register with the sip server."
echo "# Try running: "
echo "#"
echo "# sudo bbb-conf --clean"
echo "#"
echo
fi

#
# check if sip.log has warnings where the user is not registered.
#

if cat /usr/share/red5/log/sip.log | tail -n1 | grep -q "Call request for default but not registered"; then
echo
echo "# Error: The voice app is not registered with SIP server. Audio might not be working correctly."
echo
fi
else
echo
echo "# Error: /usr/share/red5/log/sip.log"
echo
fi

#
Expand All @@ -1259,6 +1269,16 @@ check_state() {
echo "# No $RED5_DIR/log/bigbluebutton.log"
fi

#
# Check if the user is running their own bbb-web
#
if grep -q 8888 /etc/bigbluebutton/nginx/web.nginx; then
if ! netstat -ant | grep '8888' > /dev/null; then
echo "# Warning: There is no application server listening to port 8888."
echo
fi
fi


#
# Check if the local server can access the API. This is a common problem when setting up BigBlueButton behind
Expand All @@ -1267,107 +1287,117 @@ check_state() {
BBB_WEB=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | sed -n '/^bigbluebutton.web.serverURL/{s/.*\///;p}')
check_no_value server_name /etc/nginx/sites-available/bigbluebutton $BBB_WEB
if ! wget http://$BBB_WEB/bigbluebutton/api -O - --quiet | grep -q SUCCESS; then
echo
echo "# Error: This server could not connect to BigBlueButton through http://$BBB_WEB/"
echo "# Error: Could not connect to the configured hostname/IP address"
echo "#"
echo "# If you are setting up BigBlueButton behind a firewall, see the FAQ"
echo "# for steps to setup BigBlueButton behind a firewall."
echo "# http://code.google.com/p/bigbluebutton/wiki/FAQ"
echo "# http://$BBB_WEB/"
echo "#"
echo "# If your BigBlueButton server is behind a firewall, see FAQ:"
echo "#"
echo "# http://code.google.com/p/bigbluebutton/wiki/FAQ"
echo "#"
echo "# (See entry for setting up BigBlueButton behind a firewall.)"
echo
fi

#
# Check that BigBlueButton can connect to port 80, 1935, and 9123
#
if [ ! -z $NGINX_IP ]; then
if ! nc -z -w 3 $NGINX_IP 1935; then
echo
echo "# Error: Unable to connect to port 1935 (RTMP) on $NGINX_IP"
echo
fi

if ! nc -z -w 3 $NGINX_IP 9123; then
echo
echo "# Error: Unable to connect to port 9123 (desktop sharing) on $NGINX_IP"
echo
fi
fi

if dpkg -l | grep -q bbb-freeswitch-config; then
if [ "$VOICE_CONFERENCE" == "bbb-voice-asterisk.xml" ]; then
echo
echo "# Error: You have freeswitch installed, but the current voice conference set"
echo "# to asterisk. To switch to freeswitch, enter"
echo "#"
echo "# sudo bbb-conf --conference freeswitch"
echo
fi

SIP_SERVER_HOST=$(cat /usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties | sed -n '/sip.server.host=/{s/.*=//;s/;//;p}')
if [ $SIP_SERVER_HOST != "127.0.0.1" ]; then
if [ $SIP_SERVER_HOST != $IP ]; then
echo
echo "# Error: The setting of ($SIP_SERVER_HOST) for sip.server.host in"
echo "#"
echo "# /usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties"
echo "#"
echo "# does not match the local IP address ($IP)."
echo
fi

SIP_IP=$(netstat -ant | grep 5060 | head -n1 | awk -F" " '{print $4}' | cut -d: -f1)
if [ $SIP_SERVER_HOST != $SIP_IP ]; then
echo
echo "# Error: FreeSWITCH is listening on IP address $SIP_IP for SIP calls, but "
echo "# The IP address ($SIP_SERVER_HOST) set for sip.server.host."
echo "#"
echo "# If your audio is not working (users click the headset icon "
echo "# and don't appear in the Listeners window, try the command"
echo "#"
echo "# sudo bbb-conf --setfreeswitchip $SIP_IP"
echo "#"
echo
fi
fi
else
echo
echo "# Error: You don't have bbb-freeswitch-config installed. To install FreeSWITCH"
echo "#"
echo "# sudo apt-get install bbb-freeswitch-config"
echo "#"
echo
fi

#
# We've not done extensive testing of asterisk in BigBlueButton 0.8
#
if dpkg -l | grep -q bbb-voice-conference; then
if [ "$VOICE_CONFERENCE" == "bbb-voice-freeswitch.xml" ]; then
echo
echo "# You have asterisk installed, but the current voice conference set"
echo "# to freeswitch. To switch to asterisk, enter"
echo "#"
echo "# sudo bbb-conf --conference konference"
echo
fi

SIP_SERVER_HOST=$(cat /usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties | sed -n '/sip.server.host=/{s/.*=//;s/;//;p}')
if [ $SIP_SERVER_HOST != "127.0.0.1" ]; then
echo
echo "# The IP address ($SIP_SERVER_HOST) set for sip.server.host in"
echo "#"
echo "# /usr/share/red5/webapps/sip/WEB-INF/bigbluebutton-sip.properties"
echo "#"
echo "# should be 127.0.0.1 for Asterisk."
echo
fi
fi

PLAYBACK_IP=$(cat /usr/local/bigbluebutton/core/scripts/slides.yml | sed -n '/playback_host/{s/.*:[ ]*//;s/;//;p}')
if [ $PLAYBACK_IP != $IP ]; then
echo
echo "# Warning: The value ($PLAYBACK_IP) for playback_host in"
echo "#"
echo "# /usr/local/bigbluebutton/core/scripts/slides.yml"
echo "#"
echo "# does not match the local IP address ($IP)."
echo "# (This is OK if the value resolves to the above IP address.)"
echo
fi

if [ -d ${SERVLET_DIR}/demo ]; then
if test ${SERVLET_DIR}/demo.war -nt ${SERVLET_DIR}/demo; then
echo
echo "# Error: Tomcat6 didn't deploy the updated demo.war file. To fix:"
echo "#"
echo "# sudo touch ${SERVLET_DIR}/demo.war"
echo "#"
echo
fi
fi

if grep -q removeMeetingWhenEnded=false $SERVLET_DIR/bigbluebutton/WEB-INF/classes/bigbluebutton.properties; then
echo
echo "# Warning: In"
echo "#"
echo "# $SERVLET_DIR/bigbluebutton/WEB-INF/classes/bigbluebutton.properties"
Expand All @@ -1379,29 +1409,26 @@ check_state() {
echo "# You should set this value to true. It enables bbb-web to immediately purge a meeting from"
echo "# memory when receiving an end API call. Otherwise, users must wait about 2 minutes"
echo "# request before creating a meeting with the same meetingID but with different parameters."
echo
fi

if (( $MEM < 1990 )); then
echo
echo "# Warning: You are running BigBlueButton on a server with less than 2G of memory. Your"
echo "# performance may suffer."
echo
fi


if [ -f /var/lib/tomcat6/webapps/demo/demo1.jsp ]; then
BBB_WEB=$(cat ${SERVLET_DIR}/bigbluebutton/WEB-INF/classes/bigbluebutton.properties | sed -n '/^bigbluebutton.web.serverURL/{s/.*\///;p}')
echo
echo "# Warning: The API demos are installed and accessible from:"
echo "#"
echo "# http://$BBB_WEB/"
echo "# http://$BBB_WEB/demo/demo1.jsp"
echo "#"
echo "# Use the API demos test your BigBlueButton setup. To remove"
echo "#"
echo "# sudo apt-get purge bbb-demo"
echo "#"
echo "# You can easily integrate BigBlueButton with other systems."
echo "#"
echo "# http://www.bigbluebutton.org/open-source-integrations/"
echo
fi

exit 0
Expand Down Expand Up @@ -1462,7 +1489,7 @@ if [ $CHECK ]; then
API_IP=$(cat ${SERVLET_DIR}/demo/bbb_api_conf.jsp | sed -n '/String BigBlueButtonURL/{s/.*http:\/\///;s/\/.*//;p}' | tr -d '\015')
echo
echo "${SERVLET_DIR}/demo/bbb_api_conf.jsp (API demos)"
echo " bbb-web-api host: $API_IP"
echo " api url: $API_IP"
fi

if [ $VOICE_CONFERENCE == "bbb-voice-freeswitch.xml" ]; then
Expand Down

0 comments on commit 6cb40fc

Please sign in to comment.