Koozali.org: home of the SME Server

Asterisk on SME7 (me again)

Offline arne

  • *****
  • 1,116
  • +0/-4
Asterisk on SME7 (me again)
« Reply #105 on: February 02, 2006, 05:49:55 PM »
About the Clarkconnect.. I have only tested on the free dowloadable home edition. Of course no one got the right to complanin about something that is free. Also actually, I think that the developers of the CC has done realy a great job trough the last revisions. It's only a mather of "taste". For me the CC apear to be something a little bit "Microsoft alike" (But it might not be fair to say that at all, and it might not be right.)

When I think it over. You are right that there is some Contribs that put the web things on some unstandard places. (I don't now at all how to handle this at the moment, but it might not be to difficult ?)

But then it might not be to difficult at all to install the newest A@H to the SME server ?? (For the CC Home 3.2 it went just right in. No problems at all.)

By the way, I'm testing one other asterisk variant now, astlinux. It can run from a 32 MB Flash memory. Really a impressive piece of software. It might not be obvious that the ip telephony and the web server should be on the same box. Don't know. http://www.astlinux.org/ (But astlinux requires manual configuration of the asterisk server.)
......

Offline NickCritten

  • *
  • 245
  • +0/-0
Asterisk on SME7 (me again)
« Reply #106 on: February 08, 2006, 12:59:43 PM »
Hi Everyone..

Is there any chance some lovely person could summarise all this good information into the pre-prepared WIKI for asterisk here: http://no.longer.valid/phpwiki/index.php/Asterisk%20on%20SME%20Server

I'd love to install asterisk, but i just don't have the time to wade through 8 Pages of forum!  :-)

Failing this, is there a Howto somewhere, or would anyone be willing to provide help and I will be happy to produce a howto for everyone else?
...
Nick

"No good deed goes unpunished." :-x...

raymondw

Asterisk on SME7 (me again)
« Reply #107 on: February 11, 2006, 11:49:58 AM »
oké, after watching this forum for some time this will be my first post ;-)

After a night with  :pint: i was ready to do some brainless a@s troubleshooting.
Starting with the script install and looking at the logs i've created a working install script.
After all very simple...  :-?

What I did:
============================
enable the standard centos yum repository
- vi /etc/yum.conf
Change
- [base]
- enabled=0 to 1
run script
============================

After adding the standard yum rep the install finished WITHOUT a error.

Have fun and hope this helps others  :hammer:

/edit 1
Used PRE1 in a VM, which I upgraded to PRE2 after the install

/edit 2
To be sure I did a fresh install of Pre2 and it gave a couple of errors.
Looks like a yum problem, will test a couple of things.... again....   :-(

raymondw

Asterisk on SME7 (me again)
« Reply #108 on: February 12, 2006, 01:41:37 PM »
After a couple of test installs and a cups of coffee : tada.wav ;-)
It works  :-P

You can save the code parts to the A7SME7 dir and run the install.sh
No need to change other files!


Here are the scripts

INSTALL.SH
Code: [Select]
#!/bin/sh
# Install all

echo ""
echo " --------------------------------------------------------"
echo "|   Installing Asterisk                                  |"
echo "|                                                        |"
echo "|   This can take some time...                           |"
echo "|   This install may need some files from the Internet   |"
echo " --------------------------------------------------------"
echo ""

echo "Installing Asterisk dependencies..."

# Add ate repository to sme db
if ! /sbin/e-smith/db yum_repositories show | grep "ate=repository" >/dev/null 2>&1; then
db yum_repositories set ate repository \
 BaseURL http://centos.ate.info/yam/cnt4-i386/RPMS.ate \
 EnableGroups 1\
 GPGCheck 0 \
 Name 'ate RPM Repository fo Centos 4.1' \
 status disabled
fi
/sbin/e-smith/db yum_repositories setprop ate status enabled
/sbin/e-smith/db yum_repositories setprop base status enabled
/sbin/e-smith/expand-template /etc/yum.conf

echo "" 2>&1 | tee /root/install_asterisk.log
echo "Installing Asterisk@Home..." 2>&1 | tee -a /root/install_asterisk.log
echo "" 2>&1 | tee -a /root/install_asterisk.log
date 2>&1 | tee -a /root/install_asterisk.log
echo "" 2>&1 | tee -a /root/install_asterisk.log

sh install_parts.sh 2>&1 | tee -a /root/install_asterisk.log


INSTALL_PARTS.SH
Code: [Select]
#!/bin/bash
LOAD_LOC=pwd
echo "*********************************************************"
echo "** install addon ****************************************"
echo "*********************************************************"

echo "-------------------------------------------"
echo "installing misc RPM"
echo "-------------------------------------------"

rpm --import $LOAD_LOC/RPM-GPG-KEY-CentOS-4.1
rpm -i lame-3.96.1-2.2.el4.rf.i386.rpm
rpm -i ngrep-1.43-1.2.el4.rf.i386.rpm
yum -y install festival

echo "-------------------------------------------"
echo "installing Web Voicemail"
echo "-------------------------------------------"

#load web voicemail access
cp $LOAD_LOC/vmail.cgi /var/www/cgi-bin/
chmod 4755 /var/www/cgi-bin/vmail.cgi

echo "-------------------------------------------"
echo "installing Web GUI"
echo "-------------------------------------------"

#load Asterisk Web UI
cd /var/www/html
mkdir /var/www/upload
chmod 777 /var/www/upload
tar xzvf $LOAD_LOC/webapps.tar.gz
cp $LOAD_LOC/asterisk.reload /bin
chmod 777 /bin/asterisk.reload

echo "-------------------------------------------"
echo "installing Asterisk Perl"
echo "-------------------------------------------"

#install astersik-perl
cd /usr/src
tar xzvf $LOAD_LOC/asterisk-perl-0.08.tar.gz
cd /usr/src/asterisk-perl-0.08
perl Makefile.PL
make all
make install

echo "-------------------------------------------"
echo "Configuring MySQL"
echo "-------------------------------------------"

#create SQL table for storing CDRs
/usr/bin/mysqladmin create asteriskcdrdb
/usr/bin/mysql < $LOAD_LOC/asteriskcdr.sql

echo "-------------------------------------------"
echo "installing mpg123"
echo "-------------------------------------------"

yum -y install mpg123

echo "-------------------------------------------"
echo "installing scripts"
echo "-------------------------------------------"

cd /usr/local/sbin
tar xvfz $LOAD_LOC/scripts.tar.gz
ln -s /usr/local/sbin/backup_asteriskathome.sh /etc/cron.daily/backup

#echo "-------------------------------------------"
#echo "installing sipsak"
#echo "-------------------------------------------"

#cd /usr/src
#tar zxf $LOAD_LOC/sipsak-0.8.11.tar.gz
#cd /usr/src/sipsak-0.8.11
#./configure
#make install

#cp $LOAD_LOC/resetmwi /usr/local/bin
#chmod 777 /usr/local/bin/resetmwi

echo "-------------------------------------------"
echo "installing Perl Mods"
echo "-------------------------------------------"

yum -y install perl-Data-UUID

# install mime-construct
cd /usr/src
tar xzvf $LOAD_LOC/mime-construct-1.8.tar.gz
cd /usr/src/mime-construct-1.8
perl Makefile.PL
make install

echo "*********************************************************"
echo "** install Asterisk *************************************"
echo "*********************************************************"

echo "-------------------------------------------"
echo "installing Asterisk and sub components"
echo "-------------------------------------------"
groupadd asterisk
useradd -c "Asterisk PBX" -d /var/lib/asterisk -u 5060 -g asterisk asterisk
usermod -Gasterisk www

echo "-------------------------------------------"
echo "installing Zaptel Driver"
echo "-------------------------------------------"

yum -y install zaptel

echo "" > /etc/udev/permissions.d/60-zaptel.permissions
echo "# zaptel devices -- set permissions to run Asterisk as user asterisk" >> /etc/udev/permissions.d/60-zaptel.permissions
echo "zap/*:asterisk:asterisk:660" >> /etc/udev/permissions.d/60-zaptel.permissions

rm -f /etc/zaptel.conf
cp $LOAD_LOC/zaptel.conf /etc/
rm -f /etc/sysconfig/zaptel.conf
cp $LOAD_LOC/zaptel /etc/sysconfig/
ln -s /etc/rc.d/init.d/zaptel /etc/rc7.d/S41zaptel

echo "-------------------------------------------"
echo "installing libpri driver"
echo "-------------------------------------------"

yum -y install libpri

echo "-------------------------------------------"
echo "installing Asterisk with FAX support..."
echo "-------------------------------------------"

yum -y install spandsp

yum -y install asterisk

chmod 775 /var/lib/asterisk/sounds
mkdir /var/spool/asterisk/fax
chown asterisk:asterisk /var/spool/asterisk/fax
chown asterisk:asterisk /usr/sbin/asterisk
chown -R asterisk:asterisk /usr/lib/asterisk
mkdir /var/run/asterisk
chown -R asterisk:asterisk /var/run/asterisk
chmod 775 /usr/sbin/safe_asterisk

echo "-------------------------------------------"
echo "installing Asterisk Addons"
echo "-------------------------------------------"

yum -y install asterisk-addons

echo "-------------------------------------------"
echo "Loading Asterisk@Home config files"
echo "-------------------------------------------"

mv /etc/asterisk* /etc/asterisk
mkdir /etc/asterisk/default
mv /etc/asterisk/* /etc/asterisk/default
cd /etc/asterisk
tar xvf $LOAD_LOC/asterisk_config.tar

chmod 775 /etc/asterisk/*
chown -R asterisk:asterisk /etc/asterisk/*

echo "-------------------------------------------"
echo "installing voicepulse pub cert"
echo "-------------------------------------------"

cp $LOAD_LOC/voicepulse01.pub /var/lib/asterisk/keys

echo "-------------------------------------------"
echo "installing AGI scripts"
echo "-------------------------------------------"

mv /usr/local/sbin/festival-weather-script.pl /var/lib/asterisk/agi-bin/
mv /usr/local/sbin/festival-script.pl /var/lib/asterisk/agi-bin/
mv /usr/local/sbin/weather.agi /var/lib/asterisk/agi-bin/


chown -R asterisk:asterisk /var/lib/asterisk/agi-bin/
chmod u+x /var/lib/asterisk/agi-bin/*.agi
chmod u+x /var/lib/asterisk/agi-bin/*.pl

mkdir /var/lib/asterisk/sounds/tts
chmod 775 /var/lib/asterisk/sounds/tts

echo "-------------------------------------------"
echo "setup log rotation"
echo "-------------------------------------------"

cp $LOAD_LOC/asterisk.logrotate /etc/logrotate.d/asterisk

echo "-------------------------------------------"
echo "Asterisk install Done."
echo "-------------------------------------------"

chown -R asterisk:asterisk /var/lib/asterisk
chmod -R 775 /var/lib/asterisk
chown -R asterisk:asterisk /etc/asterisk
chmod -R 775 /etc/asterisk
chown -R asterisk:asterisk /usr/lib/asterisk
chmod -R 775 /usr/lib/asterisk
chown -R asterisk:asterisk /var/lib/asterisk
chmod -R 775 /var/lib/asterisk
chown -R asterisk:asterisk /var/spool/asterisk
chmod -R 775 /var/spool/asterisk
chown -R asterisk:asterisk /var/run/asterisk
chmod -R 775 /var/run/asterisk
chown -R asterisk:asterisk /var/log/asterisk
chmod -R 775 /var/log/asterisk
/usr/sbin/safe_asterisk -U asterisk -G asterisk

echo "*********************************************************"
echo "** install addon 2***************************************"
echo "*********************************************************"

echo "-------------------------------------------"
echo "installing xPL stuff"
echo "-------------------------------------------"

#Install xPL hub
mkdir /usr/src/xplhub
cd /usr/src/xplhub
tar xvf $LOAD_LOC/xplhub.tar
./install.sh
ln -s /etc/rc.d/init.d/xplhub /etc/rc7.d/S55xplhub

#Install xPL Software
cd /usr/src/
tar xvfz $LOAD_LOC/xplast.tar.gz
/etc/init.d/xplhub start

echo "-------------------------------------------"
echo "installing Wakeup call"
echo "-------------------------------------------"

mkdir /var/spool/asterisk/wakeups
chown -R asterisk:asterisk /var/spool/asterisk/wakeups

mv /usr/local/sbin/wakeup.php /var/lib/asterisk/agi-bin/
mv /usr/local/sbin/wakeup-ext.php /var/lib/asterisk/agi-bin/
mv /usr/local/sbin/run_wakeups /var/lib/asterisk/agi-bin/
chmod +x /var/lib/asterisk/agi-bin/*
chown asterisk:asterisk /var/lib/asterisk/agi-bin/*

if ! grep run_wakeups /etc/crontab >/dev/null 2>&1; then
mkdir -p /etc/e-smith/templates-custom/etc/crontab
echo "* * * * * root /var/lib/asterisk/agi-bin/run_wakeups" >> /etc/e-smith/templates-custom/etc/crontab/70run_wakeups
/sbin/e-smith/expand-template /etc/crontab
fi

echo "*********************************************************"
echo "** install AMP ******************************************"
echo "*********************************************************"

echo ""
echo "*** Installing AMP dependencies"

#install IPC-Signal
cd /usr/src
tar xzvf $LOAD_LOC/IPC-Signal-1.00.tar.gz
cd /usr/src/IPC-Signal-1.00
perl Makefile.PL
make install

#install Net-Telnet
cd /usr/src
tar xzvf $LOAD_LOC/Net-Telnet-3.03.tar.gz
cd /usr/src/Net-Telnet-3.03
perl Makefile.PL
make install

#install Proc-WaitStat
cd /usr/src
tar xzvf $LOAD_LOC/Proc-WaitStat-1.00.tar.gz
cd /usr/src/Proc-WaitStat-1.00
perl Makefile.PL
make install

#untaring AMP
echo " *** untaring AMP"
cd /usr/src
tar xzvf $LOAD_LOC/AMP.tar.gz
cd /usr/src/AMP

#create SQL table for AMP
/usr/bin/mysqladmin create asterisk

#Setting Permissions

/usr/bin/mysql < $LOAD_LOC/permissions_amp.sql

#install asterisk db
echo " *** loading asterisk db in MySQL"
mysql asterisk < /usr/src/AMP/SQL/newinstall.sql

echo " *** Installing AMP app"
mkdir -p /etc/e-smith/templates-custom/etc/amportal.conf
cp $LOAD_LOC/amportal.conf /etc/e-smith/templates-custom/etc/amportal.conf/
/sbin/e-smith/expand-template /etc/amportal.conf


./install_amp

mkdir /var/lib/asterisk/sounds/custom

touch /var/www/html/panel/op_buttons_additional.cfg
touch /var/www/html/panel/op_buttons_custom.cfg

echo " *** setting permissions and default values"
sh apply_conf.sh

cp $LOAD_LOC/op_server.cfg /var/www/html/panel

touch /var/log/asterisk/cdr-csv/Master.csv
chmod 777  /var/log/asterisk/cdr-csv/Master.csv

if ! grep amportal /etc/rc.d/rc.local >/dev/null 2>&1; then
echo "/usr/sbin/amportal start" >> /etc/rc.d/rc.local
fi

echo "-----------------------------------------------------"
echo "AMP Installed."
echo "-----------------------------------------------------"

echo "-------------------------------------------"
echo "installing Asterisk extra sounds"
echo "-------------------------------------------"

yum -y install asterisk-sounds php-mbstring

echo "*********************************************************"
echo "** Post Install *****************************************"
echo "*********************************************************"
echo ""

echo "-------------------------------------------"
echo "Set permissions"
echo "-------------------------------------------"

chmod 664 /etc/zaptel.conf
chmod 664 /etc/amportal.conf

chown -R asterisk:asterisk /var/www/html/
chown -R asterisk:asterisk /etc/asterisk
chown -R asterisk:asterisk /usr/lib/asterisk/modules
chown -R asterisk:asterisk /var/lib/asterisk
chown -R asterisk:asterisk /var/lib/asterisk/agi-bin
chown -R asterisk:asterisk /var/spool/asterisk
chown -R asterisk:asterisk /var/run/asterisk
chown -R asterisk:asterisk /var/log/asterisk

echo "-------------------------------------------"
echo "install e-smith specific files"
echo "-------------------------------------------"

cp $LOAD_LOC/amp /etc/e-smith/web/functions/
cd /etc/e-smith/web/panels/manager/cgi-bin
ln -s ../../../functions/amp amp
cd /etc/e-smith/web/functions
chown root:admin amp
chmod 4750 amp

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/
cp $LOAD_LOC/98amp /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/
cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/
chown root:root *
chmod 644 *
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf

echo "-------------------------------------------"
echo "Clean up"
echo "-------------------------------------------"
/usr/local/sbin/backup_asteriskathome.sh

echo "-------------------------------------------"
echo "Auto-config Hardware"
echo "-------------------------------------------"

/usr/local/sbin/genzaptelconf

echo "** Cleanup done."
echo "-------------------------------------------"
echo "Installation done."
echo ""
/sbin/e-smith/db yum_repositories setprop ate status disabled
/sbin/e-smith/db yum_repositories setprop base status disabled
/sbin/e-smith/expand-template /etc/yum.conf
/sbin/e-smith/signal-event post-upgrade
/sbin/e-smith/signal-event reboot

Offline arne

  • *****
  • 1,116
  • +0/-4
Asterisk on SME7 (me again)
« Reply #109 on: February 12, 2006, 03:22:39 PM »
Wery nice and very cool  :-D

I think I will try it as soon as I have some time.

I try to read the script, and I think I understand a little of it, but absolutely not everything.

One or two things I am vondering about ..

1. There will not be any permanent change in the sme yum repositories, so the update of the sme server will work like normal after the installation of the AAH ?! Right !?

2. Where does the script actually download the asterisk server iself from (which line in the script) ? It is a download of sorce code packages that will be compiled during the installation or what ? I also wonder which revision of the asterisk server it will install (I try to read the script, but I don't undersand it on that point.)

3. I have installed Asteris@Home at a Clarkconnect server. On this one I had to download diverse aditional software before I was able to compile the asterisk source code. It this installation according to the script based on precompiled rpms or what ? (And then which AAH revision ??)

I will try to find time to do a test installation myself, but until then I would be very interested in any information (to make things more easy to unserstand.)  :-)
......

Offline arne

  • *****
  • 1,116
  • +0/-4
Asterisk on SME7 (me again)
« Reply #110 on: February 12, 2006, 03:26:41 PM »
Qustion 3 were if it is based on rpms or source codes and eventuelally which revision og the rpms (and then one hidden question: how to upgrade later on.)
......

raymondw

Asterisk on SME7 (me again)
« Reply #111 on: February 12, 2006, 05:30:44 PM »
All,
It is the script from cyr tweaked to install on SME7 PreX

1. True, after the install every yum change will be undone.

2. The RPM is comming from the *ate* repository.

3. The RPM is created from CVS 08-08-2005, more info can be found *here*

Asterisk "show version" gives the following output
Asterisk CVS-HEAD built by patrick@pbx.puzzled.xs4all.nl on a i686 running Linux on 2005-08-08

Future upgrade's is something i'm asking myself also...
I think well see what happens when SME7 goes Gold...

Offline arne

  • *****
  • 1,116
  • +0/-4
Asterisk on SME7 (me again)
« Reply #112 on: February 12, 2006, 07:54:58 PM »
Thanks for great work. I had some thought about trying to something like that but I did not have the guts even to try ..

One other and different way for a future solution might be to modfy the original installation script from the asterisk@home download (the tar.gz file) so it will fit with the script above and the sme server.

Just an idea .. If such a mod vere possible (and to install via source code), then the asterisk@sme installation could easily follow the revisions of the asterisk@home project, .. just an idea.

(Such an installation (asterisk@home from new sourccode) works by default on a Clarkconnect server (after installing some aditional software to make it possible to compile the asterisk software), and I believe that with some of the adjustments contained in your script above, it could also work on a sme server.)

Once more thanks for the mod, so it is now possible to make a reasonable updated asterisk installation on the sme server  :-)
......

raymondw

Asterisk on SME7 (me again)
« Reply #113 on: February 12, 2006, 10:47:35 PM »
Quote from: "arne"

Just an idea .. If such a mod vere possible (and to install via source code), then the asterisk@sme installation could easily follow the revisions of the asterisk@home project, .. just an idea.


That is not a big problem, the install scripts are adepted easily.
The thing is that I would like to keep my install as clean as possible.
If I compile it from source I need a lot more files, don't think that will be a good idea... :-?

A other option is using a other RPM. I've allready tried a few, without any luck.

organetic

Missing files in raymondw script
« Reply #114 on: February 15, 2006, 07:49:28 PM »
Hi raymondw!

You've done a nice job on the script.
I'm just trying to use it but it seems that some files are missing at the repository you indicated.
This is not a big deal, since I've found most part of missing files on other repositories. The ones i can't find, are the specific SME configuration files for AMP:

permissions_amp.sql
amp
98amp

Could you please post a place were we can get them or send me an email?

Regards,
Organetic

raymondw

Asterisk on SME7 (me again)
« Reply #115 on: February 15, 2006, 09:27:07 PM »
Organetic,
Did you only use my script or did you also downloaded the original file?
My script only a installer working on 7 PreX installations.

The original file can be found here : *LINK*
And is created by cyr

Replace the files in the script with my files.  :-D

organetic

Raymondw Install script for Asterisk on SME7
« Reply #116 on: February 16, 2006, 06:39:30 PM »
Hi raymondw,

I don't understand what you mean with "PreX". Do you refer to a tweaked version of SME7 with X installed or just any Pre-Release version?

Regarding your script, I've just downloaded the file stated on cyr website.
Now, I just don't know wich path should I take. Should I follow cyr instructions or use the files together with your script? Is there any difference at all?

Oh, about the repository you use on your script. Some files simply aren't there no more. I managed to find most of them, but not these ones :

permissions_amp.sql
amp
98amp

Regards,

org

raymondw

Asterisk on SME7 (me again)
« Reply #117 on: February 16, 2006, 07:26:13 PM »
Organetic,
Here is a short howto :-)

- Install SME7 Pre-release 1,2 or 3
- unpack A4SME7 tar from Cyr
- Replace the install.sh and install_parts.sh with my files
- start the Asterisk install by running "sh install.sh"

I tried it here and there is no file missing  8-)

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Asterisk on SME7 (me again)
« Reply #118 on: February 16, 2006, 08:48:19 PM »
Quote from: "raymondw"
Organetic,
Here is a short howto :-)

- Install SME7 Pre-release 1,2 or 3
- unpack A4SME7 tar from Cyr
- Replace the install.sh and install_parts.sh with my files
- start the Asterisk install by running "sh install.sh"

I tried it here and there is no file missing  8-)


There are missing pieces, and maybe your system is configured to check other yum repositories that have these files.

raymondw

Asterisk on SME7 (me again)
« Reply #119 on: February 16, 2006, 09:42:25 PM »
:hammer:   :roll:
I've seen the errors....

Looks like a DNS problem, think my SME has a cached DNS resolver.

I'm working on a "local" mirror...

edit
Oke, it was a long day for me...
Made a couple of mistakes and not happy anymore....

I'm going to bed and look at the script over the weekend.
Was thinking about upgrading the script to Asterisk 1.2.4 mayby a good time to begin with that.  :roll: