#!/bin/bash

URL=http://www.bluecrow.net/files/asterisk/asterisk-1.4-redfone

for i in asterisk-1.4.4.tar.gz asterisk-addons-1.4.1.tar.gz get libpri-1.4.0.tar.gz zaptel-1.4.2.1-ztcfg-fixed-for-tdmoe.tar.gz asterisk-sounds-1.2.1.tar.gz zaptel.init zaptel.sysconfig fonulator-0.2.4d.tar.gz; do
	wget $URL/$i
done

URL=http://www.bluecrow.net/files/asterisk/perl/

for i in BIGNetworks-Asterisk.tar.gz Text-CSV-0.01.tar.gz WWW-Curl-3.02.tar.gz; do
	wget $URL/$i
	if [ -f $i ]; then
		tar zxvf $i
#		if [ -d `basename $i .tar.gz` ]; then
#			cd /usr/src/asterisk/`basename $i .tar.gz`
#			perl Makefile.pl
#			make
#			make install
#			cd ..
#			rm -rf `basename $i .tar.gz` $i
#		fi
	fi
done

wget http://www.bluecrow.net/files/asterisk/asterisk-watchdog/install-watchdog

bash install-watchdog
/root/bin/asterisk-watchdog-disable

mv zaptel.init /etc/init.d/zaptel
chkconfig --add zaptel
chkconfig zaptel off

mv zaptel.sysconfig /etc/sysconfig/zaptel

for i in *.tar.gz; do tar zxvf $i; done


