瀏覽代碼

Update the dev branch freebsd install script and export script.

Mark Crane 13 年之前
父節點
當前提交
5524341d33
共有 2 個文件被更改,包括 39 次插入21 次删除
  1. 33 20
      install/centos6/install_fusionpbx_postgres_9.2.sh
  2. 6 1
      upgrade/r1877-export.php

+ 33 - 20
install/centos6/install_fusionpbx_postgres_9.2.sh

@@ -31,15 +31,15 @@
 #   The FreeSWITCH, FusionPBX and PostgreSQL Crews without them, none of this would be possible
 #  
 ###############################################
-VERSION="0.7"
+VERSION="0.8"
 
 ###########################################
 ##  Set Defaults for Variables
 
 defSUPPORTNAME='Helia Technologies'
 defSUPPORTEMAIL='[email protected]'
-defPUBLICHOSTNAME='voice.mexi-can.ca'
-defDOMAINNAME='mexi-can.ca'
+defPUBLICHOSTNAME='voice.example.com'
+defDOMAINNAME='example.com'
 
 ###########################################
 
@@ -76,35 +76,35 @@ else
 SUPPORTEMAIL="$defSUPPORTEMAIL"
 fi
 
-read -p "Public Hostname [$defPUBLICHOSTNAME]: " -e t1
+read -p "Domain Name [$defDOMAINNAME]: " -e t1
 if [ -n "$t1" ]
 then
-PUBLICHOSTNAME="$t1"
+DOMAINNAME="$t1"
 else
-PUBLICHOSTNAME="$defPUBLICHOSTNAME"
+DOMAINNAME="$defDOMAINNAME"
 fi
 
-read -p "Domain Name [$defDOMAINNAME]: " -e t1
+defPUBLICHOSTNAME='voice.${DOMAINNAME}'
+
+read -p "Public Hostname [$defPUBLICHOSTNAME]: " -e t1
 if [ -n "$t1" ]
 then
-DOMAINNAME="$t1"
+PUBLICHOSTNAME="$t1"
 else
-DOMAINNAME="$defDOMAINNAME"
+PUBLICHOSTNAME="$defPUBLICHOSTNAME"
 fi
 
 
-
 read -r -p "Are you sure? [Y/n] " response
 if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
 then
-    echo "Here we go..."
+echo "Here we go..."
 else
-    echo "Aborting"
-    exit
+echo "Aborting"
+exit
 fi
 
 
-
 ###########################################3
 #dz  Install OpenSSL for TLS and SRTP support
 yum -y install openssl-devel
@@ -219,7 +219,7 @@ cd freeswitch
 /bin/sed -i -e s,'#endpoints/mod_dingaling','endpoints/mod_dingaling', /usr/src/freeswitch/modules.conf
 /bin/sed -i -e s,'#applications/mod_lcr','applications/mod_lcr', /usr/src/freeswitch/modules.conf
 /bin/sed -i -e s,'#applications/mod_blacklist','applications/mod_blacklist', /usr/src/freeswitch/modules.conf
-mod_cidlookup requires additional configuration which is not yet in this script
+#mod_cidlookup requires additional configuration which is not yet in this script
 /bin/sed -i -e s,'#applications/mod_cidlookup','applications/mod_cidlookup', /usr/src/freeswitch/modules.conf
 #/bin/sed -i -e s,'#asr_tts/mod_pocketsphinx','asr_tts/mod_pocketsphinx', /usr/src/freeswitch/modules.conf
 /bin/sed -i -e s,'#applications/mod_voicemail_ivr','applications/mod_voicemail_ivr', /usr/src/freeswitch/modules.conf
@@ -254,7 +254,7 @@ FS_HOME=/usr/local/freeswitch
 EOT
 
 
-#configure mod_cidlookup
+configure mod_cidlookup
 #dz need to install UnixODBC first
 # see http://wiki.freeswitch.org/wiki/Using_ODBC_in_the_core
 
@@ -281,11 +281,11 @@ EOT
 chown  apache:apache /usr/local/freeswitch/conf/autoload_configs/cidlookup.conf.xml 
 
 #dz Change Sofia to use Postgres
-/bin/sed -i -e s,'<!--<param name="odbc-dsn" value="dsn:user:pass"/>-->','<param name="odbc-dsn" value="freeswitch:freeswitch:"/>','/usr/local/freeswitch/conf/sip_profiles/internal.xml'
-/bin/sed -i -e s,'</settings>','<param name="odbc-dsn" value="freeswitch:freeswitch:"/></settings>','/usr/local/freeswitch/conf/sip_profiles/external.xml'
+/bin/sed -i -e s,'</settings>','<param name="odbc-dsn" value="freeswitch:freeswitch:"/></settings>', /usr/local/freeswitch/conf/sip_profiles/internal.xml
+/bin/sed -i -e s,'</settings>','<param name="odbc-dsn" value="freeswitch:freeswitch:"/></settings>', /usr/local/freeswitch/conf/sip_profiles/external.xml
 
 #dz Use Postgres for voicemail
-/bin/sed -i -e s,'<!--<param name="odbc-dsn" value="dsn:user:pass"/>-->','<param name="odbc-dsn" value="freeswitch:freeswitch:"/>','/usr/local/freeswitch/conf/autoload_configs/voicemail.conf.xml'
+/bin/sed -i -e s,'<!--<param name="odbc-dsn" value="dsn:user:pass"/>-->','<param name="odbc-dsn" value="freeswitch:freeswitch:"/>', /usr/local/freeswitch/conf/autoload_configs/voicemail.conf.xml
 
 
 # sym link fs_cli into /usr/local/bin so we don't have to adjust paths
@@ -317,6 +317,16 @@ chmod 660 `find . -type f`
 # add apache to the freeswitch Group
 usermod -a -G freeswitch apache
 
+# dz20120614  Freeswitch should be in the apache group.  Freeswitch is a 
+#    more critical service and apache is more public.  Therefore we should 
+#   not allow apache access to the freeswitch files.  Conf files that 
+#   are modified by the web interface should be owned by the apache group 
+#   and freeswitch should have access to it.
+
+# add freeswitch to the apache group
+usermod -a -G apache freeswitch
+
+
 ## Install EPEL so we can get monit and ngrep 
 rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
 
@@ -460,7 +470,7 @@ sudo -u postgres createuser -s -e fusionpbx
 sudo -u postgres createdb -E UTF8 -O fusionpbx fusionpbx
 
 
-# dz create a script to do a backup of the postgres databases (to disk).  Assuming you have another
+# dz create a script to do a backup of the postgre databases (to disk).  Assuming you have another
 # script that backs the freeswitch and fusionpbx folder up
 wget -P /usr/local/freeswitch/scripts/ http://helia.ca/a/fusionpbx/pb_backup_rotated.sh
 chmod 755 /usr/local/freeswitch/scripts/pb_backup_rotated.sh
@@ -523,6 +533,9 @@ iptables -I INPUT -p tcp -m tcp --dport 5060 -j ACCEPT
 iptables -I INPUT -p udp -m udp --dport 5080 -j ACCEPT
 iptables -I INPUT -p tcp -m tcp --dport 5080 -j ACCEPT
 
+# NTP time port for phones
+iptables -I INPUT -p udp -m udp --dport 123 -j ACCEPT
+
 
 # FreeSwitch ports internal SIPS profile
 iptables -I INPUT -p tcp -m tcp --dport 5061 -j ACCEPT

+ 6 - 1
upgrade/r1877-export.php

@@ -35,7 +35,7 @@ else {
 }
 
 //user defined settings
-	$export_type = "sql"; //default sql;
+	$export_type = "sql"; //sql, db (for sqlite)
 	$debug = false;
 	$invoices = false; //default false;
 	$db_type = "sqlite"; //pgsql, sqlite, mysql
@@ -45,6 +45,11 @@ else {
 		echo "<pre>\n";
 	}
 
+//create the destination database object
+	if ($export_type == "db") {
+		$dest_db = new PDO('sqlite:/tmp/fusionpbx.db');
+	}
+
 //set the headers
 	if ($export_type == "sql" && !$debug) {
 		header('Content-type: application/octet-binary');