Debian Lenny, Asterisk & FreePBX Script

:!: October 30 2009

The script has been updated with the latest Asterisk versions (1.4) and now has some basic error checking for when the script is interrupted. There should be no need for manual workarounds with the new script. If it is interrupted, simply restart the script and it should recover.

  • took all the suggestions from those listed below and incorporated them into the script
  • Fixed a few typos
  • fixed dependencies with Dahdi hardware

This script will download and install Asterisk, freePBX on a debian system (currently Lenny 5.0). Have a look at the script, you will need to make sure that the versions of Asterisk listed in the script are current. If you dont change them, the script will still work, you just wont have the most recent version of Asterisk installed.

The goal was to make this as easy as possible with the least amount of user interaction.

Enjoy!

Install Debian

installing_debian_etch

download the script to your box

:!: Current Version

asterisk-freepbx_0.7_dahdi_en_mod_2009-09-09.tar.gz (4.67 KiB, 3046 downloads)

extract the archive

 tar xzf ./asterisk-freepbx_0.7_dahdi_en_mod_2009-09-09.tar.gz

make the script executable

 chmod +x ./asterisk-freepbx_0.7_dahdi_en_mod_2009-09-09.sh

run the script

 ./asterisk-freepbx_0.7_dahdi_en_mod_2009-09-09.sh

follow the prompts

Please give your feedback.

Older versions of the script

asterisk-freepbx_0.6_dahdi_en_mod_2009-03-3.tar.gz (4.23 KiB, 2079 downloads)

Discussion

Florian, 2009/03/18 02:51

Installer works great. But there is one package missing when you want to install a real card to use with dahdi. You need to include the linux-header in the installation.

Thank you florian

Matt, 2009/10/30 09:03

Thanks Florian, the new script is released with this fix.

Michal, 2009/04/15 21:18

Great script! Works like a charm. Perhaps putting some info to console between mysql commands would be good - when you run the script it prompts for password 4 times in a row, got me a bit confused if I am typing correctly :)

echo “create database asteriskcdrdb;” | mysql -u root -p

echo “create database asterisk;” | mysql -u root -p

echo “GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';” | mysql -u root -p

echo “GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';” | mysql -u root -p

Matt, 2009/10/30 09:04

Thanks Michal, released the new script with a fix re your suggestion.

Mango, 2009/07/11 12:11

Thanks for working on the script, But ive hit into a hurdle during the script, it first mentions that it cannot find eth0 while installing freepbx, which leads me to believe that your script is invoking something from the generic eth0. I am however using a virtual machine and my adapter is venet0:0. And due to this, i cannot start freepbx, i also get the message error : amportal binary can not be found (/usr/local/sbin/amportal)

Cheers

TheOne, 2009/08/28 12:26

Nice script !!! Was checking the way it is build up :-)

I think you have to go in to the script and find the line LOCAL_IP=`/sbin/ifconfig eth0` Change this into LOCAL_IP=`/sbin/ifconfig venet0:0`

Also check: That you have the right software version. You will find this also in the script. Good Luck.

Go in the script and look for those version numbers. And change them to the newest found on the web… Its a nice script just debug it and fix the details and it will work for you …

# you need to update these version numbers from the Asterisk download site to make sure # the current version is being installed (www.asterisk.com/downloads)

VER_ASTERISK=“1.4.23.1”; VER_DAHDI_LINUX=“2.1.0.3”; VER_DAHDI_TOOLS=“2.1.0.2”; VER_LIBPRI=“1.4.7”; VER_ADDONS=“1.4.7”; VER_FREEPBX=“2.5.1”;

Matt, 2009/10/30 09:06

Mango, you are right, the script assumes ETH0, just make the change as suggested by TheOne

ezzadin, 2009/09/18 04:59

Thanks for he scripts…

this worked ok for me without any error message until the last part (starting asterisk/freepbx)

I get same error as Mango: amportal binary can not be found (/usr/local/sbin/amportal)

anyone else got this? Mago, did you manage to fix this?

Matt, 2009/10/30 09:07

ezzadin, this error happens when the script is interupted usually by an Internet dropout. The new script will recover from this error if you run it again.

ezzadin, 2009/09/18 06:05

I managed to fix amportal binary can not be found (/usr/local/sbin/amportal) issue by re-compiling the Asterisk Add-on…

and then re-run the /usr/src/freepbx-2.5.1/install_amp this actually fixed it

so: # cd /usr/src/asterisk-addons-1.4.7

# make clean

# make install

# make samples

and then #/usr/src/freepbx-2.5.1/install_amp

of course make sure that Asterisk in running…

for some reason I was missing cdr_mysql and that's why freepbx wasn't installing correctly… after I did the above steps the issue was resolved…

hope this will help you

Giacomo, 2009/11/04 20:58

I have just used your new script, but I have problems with amportal. The script ends sucesfully but when Debian starts there is the message “amportal binary can not be found (usr/locl/sbin/amportal)”, and amportal command doesn't work. I seem to have made all correctly.

Thank you!

Matt, 2009/11/04 21:31

Giacomo, try running this command /usr/src/freepbx-2.5.2/install_amp which will reinstall the freePBX component. It should fix this error. Let me know what happens as it may be an issue that I need to give more attention to during the running of the script.

Giacomo, 2009/11/08 04:04

I have tried the command but doesn't work. So I have maked another installation, on a new Lenny, and I have changed only mysql root password, and it works correctly. Of course on the system status panel there are the two warnings: “Default SQL Password Used” and “Default Asterisk Manager Password Used”. What is the procedure to change these passwords?

Thank You!

marius, 2009/12/19 11:14

Hi, I used your script on a fresh debian lenny Kernel 2.6.30.1, vserver. The script ran through, mysql and apache startet but ”/etc/init.d/freepbx start” gives an error: “amportal binary can not be found (/usr/local/sbin/amportal)” Indeed there is no amportal in usr/local/sbin/

A htlml call of my site gives: “It works!”

==⇒ the Kernal Version 2.6.30.1 seems not yet to be supported

So what can i do to make the script working?

kind regards

betehess, 2010/01/06 15:57

Hi, I have the same problem than some other persons in the comments: the addons do not compile!

Regards.

 
debian_asterisk_freepbx_script.txt · Last modified: 2009/10/30 08:57 by administrator
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki