# Quick install of required apps    v.2.0.4               2007-12-03
# This file is a supplement to the BASE_INSTALL document giving you simple copy/
# paste installation shell commands for required and helper apps for VICIDIAL
# might need:   echo '/* Linuxthreads */' >> /usr/include/pthread.h

cd /usr/local
wget http://mirrors.kernel.org/gnu/make/make-3.81.tar.gz
gunzip make-3.81.tar.gz
tar xvf make-3.81.tar
cd make-3.81
./configure
make
make install

cd /usr/local
wget http://mirror.trouble-free.net/mysql_mirror/Downloads/MySQL-4.0/mysql-4.0.27.tar.gz
gunzip mysql-4.0.27.tar.gz
tar xvf mysql-4.0.27.tar
cd mysql-4.0.27
groupadd mysql
useradd -g mysql mysql
./configure --prefix=/usr/local/mysql --enable-large-files --enable-shared=yes --with-readline
make
make install
scripts/mysql_install_db
chown -R root  /usr/local/mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql
cp support-files/my-medium.cnf /etc/my.cnf
/usr/local/mysql/bin/mysqld_safe --user=mysql &
ln -s /tmp/mysql.sock /var/run/mysql/mysql.sock


perl -MCPAN -e shell
install MD5
install Digest::MD5
install Digest::SHA1
install readline
install Bundle::CPAN
install DBI
force install DBD::mysql
install Net::Telnet
install Time::HiRes
install Net::Server
install Unicode::Map
install Jcode
install Spreadsheet::WriteExcel
install OLE::Storage_Lite
install Proc::ProcessTable
install IO::Scalar
install Spreadsheet::ParseExcel
quit


cd /usr/local
wget http://asterisk.gnuinter.net/files/asterisk-perl-0.08.tar.gz
gunzip asterisk-perl-0.08.tar.gz
tar xvf asterisk-perl-0.08.tar
cd asterisk-perl-0.08
perl Makefile.PL
make all
make install


cd /usr/local
wget http://easynews.dl.sourceforge.net/sourceforge/sox/sox-12.17.9.tar.gz
gunzip sox-12.17.9.tar.gz
tar xvf sox-12.17.9.tar
cd sox-12.17.9
./configure
make
make install


cd /usr/local
wget http://ftp.gnu.org/gnu/screen/screen-4.0.2.tar.gz
gunzip screen-4.0.2.tar.gz
tar xvf screen-4.0.2.tar
cd screen-4.0.2
./configure
make
make install


cd /usr/local
wget http://www.daveltd.com/src/util/ttyload/ttyload-0.4.4.tar.gz
gunzip ttyload-0.4.4.tar.gz
tar xvf ttyload-0.4.4.tar
cd ttyload-0.4.4
make
ln -s /usr/local/ttyload-0.4.4/ttyload /usr/bin/ttyload


cd /usr/local
wget http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.2p3.tar.gz
gunzip ntp-4.2.2p3.tar.gz
tar xvf ntp-4.2.2p3.tar
cd ntp-4.2.2p3
./configure
make
make install
/usr/local/bin/ntpdate -u 18.145.0.30


cd /usr/local
wget http://www.tcpdump.org/release/libpcap-0.9.4.tar.gz
gunzip libpcap-0.9.4.tar.gz
tar xvf libpcap-0.9.4.tar
cd libpcap-0.9.4
./configure
make
make install
cd /usr/local
wget http://www.ex-parrot.com/~pdw/iftop/download/iftop-0.17.tar.gz
gunzip iftop-0.17.tar.gz
tar xvf iftop-0.17.tar
cd iftop-0.17
./configure
make
make install


cd /usr/local
wget http://www.zlib.net/zlib-1.2.3.tar.gz
gunzip zlib-1.2.3.tar.gz
tar xvf zlib-1.2.3.tar
cd zlib-1.2.3
./configure
make
make install
cd /usr/local
wget http://gulus.usherbrooke.ca/pub/appl/ssh/OpenSSH/portable/openssh-4.7p1.tar.gz
gunzip openssh-4.7p1.tar.gz
tar xvf openssh-4.7p1.tar
cd openssh-4.7p1
./configure
make
make install


cd /usr/local
wget http://www.openssl.org/source/openssl-0.9.8g.tar.gz
gunzip openssl-0.9.8g.tar.gz
tar xvf openssl-0.9.8g.tar
cd openssl-0.9.8g
./config
make
make install


cd /usr/local
wget http://subversion.tigris.org/downloads/subversion-1.3.2.tar.gz
gunzip subversion-1.3.2.tar.gz
tar xvf subversion-1.3.2.tar
cd subversion-1.3.2
./configure
make
make install


cd /usr/local	
wget http://ploticus.sourceforge.net/download/pl232src.tar.gz
gunzip pl232src.tar.gz
tar xvf pl232src.tar
cd pl232src/src/
make clean
make
make install


cd /usr/local
wget http://apache.secsup.org/dist/httpd/httpd-2.0.61.tar.gz
gunzip httpd-2.0.61.tar.gz
tar xvf httpd-2.0.61.tar
wget http://us2.php.net/distributions/php-4.4.7.tar.gz
gunzip php-4.4.7.tar.gz
tar xvf php-4.4.7.tar
cd httpd-2.0.61
./configure --prefix=/usr/local/apache2 --enable-ssl --enable-setenvif --enable-so --with-apxs2 --enable-dav --enable-maintainer-mode
make
make install
mkdir /usr/local/apache2/conf/ssl.key
mkdir /usr/local/apache2/conf/ssl.crt
mkdir /usr/local/apache2/conf/ssl.crl
openssl req -new -x509 -days 1200 -keyout /usr/local/apache2/conf/ssl.key/server.key.cpy -out /usr/local/apache2/conf/ssl.crt/server.crt -subj '/CN=10.10.10.15'


openssl rsa -in /usr/local/apache2/conf/ssl.key/server.key.cpy -out /usr/local/apache2/conf/ssl.key/server.key


cd ../php-4.4.7
./configure --with-mysql=/usr/local/mysql --enable-inline-optimization --enable-memory-limit --enable-track-vars --enable-libgcc --with-xml --enable-versioning --enable-sysvsem --with-openssl --disable-debug --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib
make
make install
cp php.ini-dist /usr/local/lib/php.ini
vi /usr/local/apache2/conf/httpd.conf


	add the following lines:
		"AddType application/x-httpd-php .php .phtml"
		"LoadModule php4_module libexec/libphp4.so"
		  or
		"LoadModule php4_module module/libphp4.so"
	modify the index.html line and add index.php to the list


vi /usr/local/lib/php.ini


      modify the following line:
            "memory_limit = 8M"
        and change it to:
            "memory_limit = 48M"


/usr/local/apache2/bin/apachectl startssl


cd /usr/local
wget http://bart.eaccelerator.net/source/0.9.5/eaccelerator-0.9.5.zip
unzip eaccelerator-0.9.5.zip
cd eaccelerator-0.9.5
export PHP_PREFIX="/usr/local"
$PHP_PREFIX/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
make
make install
vi /usr/local/lib/php.ini


    Add the following lines to the dynamic extensions section of php.ini:
     (you may need to change the extension location depending on your install of php)
extension="../../../usr/local/eaccelerator-0.9.5/modules/eaccelerator.so"
eaccelerator.shm_size="48"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"


mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
php -v


cd /usr/local
wget http://superb-east.dl.sourceforge.net/sourceforge/mtop/mtop-0.6.6.tar.gz
gunzip mtop-0.6.6.tar.gz
tar xvf mtop-0.6.6.tar
cd mtop-0.6.6
cpan 


install Curses
install Getopt::Long
install Net::Domain
quit


perl Makefile.PL
make
make install
/usr/local/bin/mtop --dbuser=root --seconds=3


cd /usr/local
wget http://download.berlios.de/sipsak/sipsak-0.9.6-1.tar.gz
gunzip sipsak-0.9.6-1.tar.gz
tar xvf sipsak-0.9.6-1.tar
cd sipsak-0.9.6
./configure
make
make install
/usr/local/bin/sipsak --version




#### OPTIONAL NEWEST VERSIONS OF ASTERISK ####

mkdir /usr/src/asterisk
cd /usr/src/asterisk
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.24.tar.gz
wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.21.tar.gz
wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.5.tar.gz
gunzip asterisk-1.2.24.tar.gz
tar xvf asterisk-1.2.24.tar
gunzip zaptel-1.2.21.tar.gz
tar xvf zaptel-1.2.21.tar
gunzip libpri-1.2.5.tar.gz
tar xvf libpri-1.2.5.tar
cd ./zaptel-1.2.21
wget http://www.freedomphones.net/files/newt-0.51.6.tar.gz
gunzip newt-0.51.6.tar.gz
tar xvf newt-0.51.6.tar
cd newt-0.51.6
./configure
make
make install
cd ../
ln -s /usr/lib/libnewt.so.0.51.6 /usr/lib/libnewt.so.0.51
make clean
make zttool
make
make install
cd ../libpri-1.2.5
make clean
make
make install
cd ../asterisk-1.2.24
cd apps
wget http://www.eflo.net/files/app_amd2.c
mv app_amd2.c app_amd.c
vi Makefile


  replace this line(line 32):
       app_mixmonitor.so app_stack.so
  with this line:
       app_mixmonitor.so app_stack.so app_amd.so


wget http://www.eflo.net/files/amd2.conf
mkdir /etc/asterisk
mv amd2.conf /etc/asterisk/amd.conf
wget http://www.eflo.net/files/meetme_DTMF_passthru-1.2.23.patch
patch -p1 < ./meetme_DTMF_passthru-1.2.23.patch


	- File to patch: app_meetme.c


wget http://www.eflo.net/files/meetme_volume_control_1.2.16.patch
patch -p1 < ./meetme_volume_control_1.2.16.patch

	
	- File to patch: app_meetme.c


cd ../
wget http://www.eflo.net/files/cli_chan_concise_delimiter.patch
patch -p1 < ./cli_chan_concise_delimiter.patch

	
	- File to patch: cli.c


wget http://www.eflo.net/files/app_waitforsilence.c
mv app_waitforsilence.c apps/app_waitforsilence.c
wget http://www.eflo.net/files/enter.h
wget http://www.eflo.net/files/leave.h
mv -f enter.h apps/enter.h
mv -f leave.h apps/leave.h

make clean
make
make install

make samples

cd /var/lib/asterisk/mohmp3/
mpg123 -s --rate 44100 --mono /var/lib/asterisk/mohmp3/fpm-sunshine.mp3 > /var/lib/asterisk/mohmp3/fpm-sunshine.raw
sox -r 44100 -w -s -c 1 fpm-sunshine.raw -r 8000 -c 1 fpm-sunshine.wav
sox fpm-sunshine.wav -t gsm -r 8000 -b -c 1 fpm-sunshine.gsm
sox fpm-sunshine.wav -t ul -r 8000 -b -c 1 fpm-sunshine.pcm
mpg123 -s --rate 44100 --mono /var/lib/asterisk/mohmp3/fpm-calm-river.mp3 > /var/lib/asterisk/mohmp3/fpm-calm-river.raw
sox -r 44100 -w -s -c 1 fpm-calm-river.raw -r 8000 -c 1 fpm-calm-river.wav
sox fpm-calm-river.wav -t gsm -r 8000 -b -c 1 fpm-calm-river.gsm
sox fpm-calm-river.wav -t ul -r 8000 -b -c 1 fpm-calm-river.pcm
mpg123 -s --rate 44100 --mono /var/lib/asterisk/mohmp3/fpm-world-mix.mp3 > /var/lib/asterisk/mohmp3/fpm-world-mix.raw
sox -r 44100 -w -s -c 1 fpm-world-mix.raw -r 8000 -c 1 fpm-world-mix.wav
sox fpm-world-mix.wav -t gsm -r 8000 -b -c 1 fpm-world-mix.gsm
sox fpm-world-mix.wav -t ul -r 8000 -b -c 1 fpm-world-mix.pcm
rm -f *.raw
mkdir ../orig-mp3
mv -f *.mp3 ../orig-mp3/



############# INSTRUCTIONS FOR Asterik 1.4 release ####################

NOTE: If you want to use Asterisk 1.4, you will need to make sure that you set
the servers table "asterisk_version" field to the proper version number and you
can use the docs/conf_examples/extensions.conf.sample-1.4 file for your default
dialplan

### If upgrading from 1.2.X Asterisk, run the following lines first:
rm -f /usr/lib/asterisk/modules/app_curl.so
rm -f /usr/lib/asterisk/modules/app_cut.so
rm -f /usr/lib/asterisk/modules/app_enumlookup.so
rm -f /usr/lib/asterisk/modules/app_eval.so
rm -f /usr/lib/asterisk/modules/app_groupcount.so
rm -f /usr/lib/asterisk/modules/app_math.so
rm -f /usr/lib/asterisk/modules/app_md5.so
rm -f /usr/lib/asterisk/modules/app_setcidname.so
rm -f /usr/lib/asterisk/modules/app_setcidnum.so
rm -f /usr/lib/asterisk/modules/app_setrdnis.so
rm -f /usr/lib/asterisk/modules/app_txtcidname.so
rm -f /usr/lib/asterisk/modules/chan_features.so
rm -f /usr/lib/asterisk/modules/format_au.so
rm -f /usr/lib/asterisk/modules/format_pcm_alaw.so
rm -f /usr/lib/asterisk/modules/pbx_functions.so


mkdir /usr/src/asterisk-1.4
cd /usr/src/asterisk-1.4
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.4.14.tar.gz
wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.4.6.tar.gz
wget http://ftp.digium.com/pub/libpri/releases/libpri-1.4.2.tar.gz
gunzip asterisk-1.4.14.tar.gz
tar xvf asterisk-1.4.14.tar
gunzip zaptel-1.4.6.tar.gz
tar xvf zaptel-1.4.6.tar
gunzip libpri-1.4.2.tar.gz
tar xvf libpri-1.4.2.tar
cd ./zaptel-1.4.6
./configure
make
make install
cd ../libpri-1.4.2
make clean
make
make install
cd ../asterisk-1.4.14
wget http://www.eflo.net/files/enter.h
wget http://www.eflo.net/files/leave.h
mv -f enter.h apps/enter.h
mv -f leave.h apps/leave.h
./configure
make
make install






#### pureftpd FTP server installation instructions ####

cd /usr/local
wget ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.20.tar.gz
gunzip pure-ftpd-1.0.20.tar.gz
tar xvf pure-ftpd-1.0.20.tar
cd pure-ftpd-1.0.20
groupadd ftpgroup
useradd -g ftpgroup -d /dev/null -s /etc ftpuser
./configure --with-everything --with-largefile --with-virtualchroot
make install-strip
pure-pw useradd cron -u ftpuser -d /home/cron
/usr/local/sbin/pure-ftpd &
