--- scripts/detectdahdi.sh.orig	2009-05-12 19:37:57.000000000 +0200
+++ scripts/detectdahdi.sh	2009-05-12 19:38:13.000000000 +0200
@@ -2,7 +2,7 @@
 
 # script to detect whether zaptel/dahdi was installed & generate an include file for GUI
 
-OUTPUTFILE="/etc/asterisk/dahdi_guiread.conf"
+OUTPUTFILE="/opt/local/etc/asterisk/dahdi_guiread.conf"
 
 echo "" > ${OUTPUTFILE}
 echo "[general]" >> ${OUTPUTFILE}
--- scripts/dldsoundpack.orig	2009-05-12 19:39:24.000000000 +0200
+++ scripts/dldsoundpack	2009-05-12 19:39:35.000000000 +0200
@@ -7,7 +7,7 @@
 SOUNDS_EXTRA_VERSION=1.4.7
 SOUNDS_LANGUAGE="en"
 SOUND_FORMATS="ulaw alaw gsm g722 g729"
-SOUND_BASE="/var/lib/asterisk/sounds"
+SOUND_BASE="/opt/local/var/lib/asterisk/sounds"
 SOUND_LOC="$SOUND_BASE"
 DO_EXTRA="yes"
 
@@ -82,6 +82,6 @@
 echo "=${SOUNDS_EXTRA_VERSION}" >>${SOUND_LOC}/cf-version.txt
 
 
-echo "DoneDoneDone" >> /var/lib/asterisk/static-http/config/sysinfo_output.html
+echo "DoneDoneDone" >> /opt/local/var/lib/asterisk/static-http/config/sysinfo_output.html
 sync; sync; sync
 
--- scripts/editzap.sh.orig	2009-05-12 19:40:51.000000000 +0200
+++ scripts/editzap.sh	2009-05-12 19:41:27.000000000 +0200
@@ -8,13 +8,13 @@
 # Quick script for applying zaptel settings from the GUI.
 
 if [ -e /dev/zap ]; then
-	ZAPCONF="/etc/zaptel.conf"
+	ZAPCONF="/opt/local/etc/zaptel.conf"
 fi
 
 if [ -e /dev/dahdi ]; then
-	ZAPCONF="/etc/dahdi/system.conf"
+	ZAPCONF="/opt/local/etc/dahdi/system.conf"
 fi
 
-FILENAME="/etc/asterisk/applyzap.conf"
+FILENAME="/opt/local/etc/asterisk/applyzap.conf"
 grep -v '\;' ${FILENAME} | sed 's/\[general\]//g' > ${ZAPCONF}
 
--- scripts/listfiles.orig	2009-05-12 19:41:54.000000000 +0200
+++ scripts/listfiles	2009-05-12 19:42:10.000000000 +0200
@@ -1,5 +1,5 @@
 #!/bin/sh
-SYSINFO_OUTPUT="/var/lib/asterisk/static-http/config/sysinfo_output.html"
+SYSINFO_OUTPUT="/opt/local/var/lib/asterisk/static-http/config/sysinfo_output.html"
 
 #/bin/echo "<div id=list_files>" > $SYSINFO_OUTPUT
 /bin/mkdir -p $1
--- scripts/mastercsvexists.orig	2009-05-12 19:42:36.000000000 +0200
+++ scripts/mastercsvexists	2009-05-12 19:43:35.000000000 +0200
@@ -1,16 +1,16 @@
 #!/bin/bash
 
-MASTERCSV="/var/log/asterisk/cdr-csv/Master.csv"
-STATICHTTP="/var/lib/asterisk/static-http/"
+MASTERCSV="/opt/local/var/log/asterisk/cdr-csv/Master.csv"
+STATICHTTP="/opt/local/var/lib/asterisk/static-http/"
 
 if [ `whoami` != "root" ]; then
 	echo "Error: You must be root to run this script."
 	exit 1
 fi
 
-if [ -f /var/log/asterisk/cdr-csv/Master.csv ]; then
+if [ -f /opt/local/var/log/asterisk/cdr-csv/Master.csv ]; then
 	if [ ! -f $STATICHTTP`basename $MASTERCSV` ]; then
-		ln -s $MASTERCSV /var/lib/asterisk/static-http/config/`basename $MASTERCSV`
+		ln -s $MASTERCSV /opt/local/var/lib/asterisk/static-http/config/`basename $MASTERCSV`
 	fi
 fi
 
--- scripts/registerg729.sh.orig	2009-05-12 19:43:58.000000000 +0200
+++ scripts/registerg729.sh	2009-05-12 19:44:22.000000000 +0200
@@ -6,8 +6,8 @@
 ####################################################################
 
 # script for generating regtool compatible tab delimited file from a gui config file.
-INPUTFILE="/etc/asterisk/g729reginfo.conf"
-OUTPUTFILE="/etc/asterisk/g729reginfo_tabs.conf"
+INPUTFILE="/opt/local/etc/asterisk/g729reginfo.conf"
+OUTPUTFILE="/opt/local/etc/asterisk/g729reginfo_tabs.conf"
 rm ${OUTPUTFILE}
 
 TABBEDVALUES=`grep -v '\;' ${INPUTFILE} | sed 's/\[general\]//g' | sed 's/ = /\\t/g'`
--- scripts/takebackup.orig	2009-05-12 19:45:09.000000000 +0200
+++ scripts/takebackup	2009-05-12 19:46:03.000000000 +0200
@@ -1,6 +1,6 @@
 #!/bin/sh
-/bin/tar -cf $1 /etc/asterisk /etc/localtime
+/usr/bin/tar -cf $1 /opt/local/etc/asterisk /etc/localtime
 if [ "$2" = "YES" ]; then
 	SF=`echo "$1" | cut -d '.' -f 1`
-	/bin/tar -cf "${SF}"_sounds.tar /var/lib/asterisk/sounds/voicemail /var/lib/asterisk/sounds/record
+	/usr/bin/tar -cf "${SF}"_sounds.tar /opt/local/var/lib/asterisk/sounds/voicemail /opt/local/var/lib/asterisk/sounds/record
 fi
--- config/js/index.js.orig	2009-05-12 21:51:57.000000000 +0200
+++ config/js/index.js	2009-05-12 21:52:46.000000000 +0200
@@ -151,7 +151,7 @@
 				pu = true;
 			}
 			if( !http_conf.post_mappings.hasOwnProperty('uploads') ){
-				u.new_action('append', 'post_mappings' , 'uploads', '/var/lib/asterisk/sounds/imageupdate' ) ;
+				u.new_action('append', 'post_mappings' , 'uploads', '/opt/local/var/lib/asterisk/sounds/imageupdate' ) ;
 				pu = true;
 			}
 			if( !http_conf.post_mappings.hasOwnProperty('backups') ){
@@ -251,10 +251,10 @@
 		// onLogInFunctions.setGUI_Paths()
 		var ASTERISK_CONF = context2json({ filename:'asterisk.conf' , context : 'directories' , usf:1 });
 		if( ASTERISK_CONF === null ){ ASTERISK_CONF = new ASTGUI.customObject ; } // if context 'directories' not found in asterisk.conf
-		sessionData.directories.asteriskConfig =  ASTERISK_CONF.getProperty('astetcdir') ||  '/etc/asterisk/' ;
-		sessionData.directories.astvarlibdir = ASTERISK_CONF.getProperty('astvarlibdir') || '/var/lib/asterisk/' ;
-		sessionData.directories.AGIBIN = ASTERISK_CONF.getProperty('astagidir') || '/var/lib/asterisk/agi-bin/' ;
-		sessionData.directories.astspooldir = ASTERISK_CONF.getProperty('astspooldir') || '/var/spool/asterisk/' ;
+		sessionData.directories.asteriskConfig =  ASTERISK_CONF.getProperty('astetcdir') ||  '/opt/local/etc/asterisk/' ;
+		sessionData.directories.astvarlibdir = ASTERISK_CONF.getProperty('astvarlibdir') || '/opt/local/var/lib/asterisk/' ;
+		sessionData.directories.AGIBIN = ASTERISK_CONF.getProperty('astagidir') || '/opt/local/var/lib/asterisk/agi-bin/' ;
+		sessionData.directories.astspooldir = ASTERISK_CONF.getProperty('astspooldir') || '/opt/local/var/spool/asterisk/' ;
 
 		if( !sessionData.directories.asteriskConfig.endsWith('/') ){ sessionData.directories.asteriskConfig = sessionData.directories.asteriskConfig + '/' ; }
 		if( !sessionData.directories.astvarlibdir.endsWith('/') ){ sessionData.directories.astvarlibdir = sessionData.directories.astvarlibdir + '/' ; }
@@ -283,7 +283,7 @@
 		sessionData.directories.script_detectdahdi = 'sh ' + sessionData.directories.scripts + 'detectdahdi.sh';
 
 		sessionData.directories.app_DahdiScan = 'dahdi_scan > ' + sessionData.directories.asteriskConfig + ASTGUI.globals.dahdiScanOutput ;
-		sessionData.directories.app_dahdi_genconf = 'dahdi_genconf'; // generates new /etc/dahdi/system.conf
+		sessionData.directories.app_dahdi_genconf = 'dahdi_genconf'; // generates new /opt/local/etc/dahdi/system.conf
 		sessionData.directories.app_mISDNscan = 'misdn-init scan' ;
 		sessionData.directories.app_flashupdate = 'flashupdate' ;
 	},
--- scripts/editmisdn.sh.orig	2009-06-16 13:35:12.000000000 +0200
+++ scripts/editmisdn.sh	2009-06-16 13:37:10.000000000 +0200
@@ -7,6 +7,6 @@
 
 # Quick script for applying misdn settings from the GUI.
 
-MISDNCONF="/etc/misdn-init.conf"
-MISDNFILE="/etc/asterisk/applymisdn.conf"
+MISDNCONF="/opt/local/etc/misdn-init.conf"
+MISDNFILE="/opt/local/etc/asterisk/applymisdn.conf"
 grep -v "\[general\]" ${MISDNFILE} | grep -v "\;" | sed 's/ = /=/g' > ${MISDNCONF}
