Main Menu (suckerfish)

Install Asterisk 1.2 auto install script for CentOS 4 and CentOS 5

I created an auto install script to install Asterisk 1.2 for CentOS 4 and CentOS 5. This script will install the following:

  • Zaptel
  • Libpri
  • Asterisk
  • Asterisk Addons
  • Open Source G729 Codec

Before running these script, you must install the some software needed to compile Asterisk.
For CentOS 4:

yum install gcc kernel kernel-devel bison openssl-devel

For CentOS 5:

yum install gcc kernel kernel-devel bison openssl-devel libtermcap-devel ncurses-devel

kernel-smp-devel (instead of kernel-devel) is necessary if you are using a dual core processor.

  1. #!/bin/sh
  2. #Asterisk Download page
  3. ZAPTEL="http://downloads.digium.com/pub/zaptel/releases/zaptel-1.2.25.tar.gz"
  4. ASTERISK="http://downloads.digium.com/pub/asterisk/releases/asterisk-1.2.28.tar.gz"
  5. ASTERISKADDONS="http://downloads.digium.com/pub/asterisk/releases/asterisk-addons-1.2.8.tar.gz"
  6. #Asterisk Package
  7. ZAPPACKAGE="zaptel-1.2.25.tar.gz"
  8. ASTPACKAGE="asterisk-1.2.28.tar.gz"
  9. ASTADDONSPACKAGE="asterisk-addons-1.2.8.tar.gz"
  10. #Asterisk Folder
  11. ZAPFOLDER="zaptel-1.2.25"
  12. ASTFOLDER="asterisk-1.2.28"
  13. ASTADDONSFOLDER="asterisk-addons-1.2.8"
  14. ##########Do not edit from here##################################################
  15. #################################################################################
  16. echo "Downloading and extracting zaptel and asterisk source"
  17. cd /usr/src
  18. wget $ZAPTEL
  19. wget $ASTERISK
  20. wget $ASTERISKADDONS
  21. tar -zxvf $ZAPPACKAGE
  22. tar -zxvf $ASTPACKAGE
  23. tar -zxvf $ASTADDONSPACKAGE
  24.  
  25. echo "Installing zaptel"
  26. cd $ZAPFOLDER
  27. make clean
  28. make
  29. make install
  30. cd ..
  31.  
  32. echo "Installing asterisk"
  33. cd $ASTFOLDER
  34. make clean
  35. make
  36. make install
  37. make samples
  38. cd ..
  39.  
  40. echo "Installing lammp server"
  41. echo "Installing rpmforge-release package"
  42. wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.i386.rpm
  43. rpm -Uvh rpmforge-release-0.3.6-1.el4.rf.i386.rpm
  44. yum --enablerepo=centosplus -y install httpd php php-gd php-mbstring php-mcrypt php-mysql mysql-client mysql-server mysql-devel phpmyadmin
  45.  
  46. echo "Installing asterisk-addons"
  47. cd $ASTADDONSFOLDER
  48. make clean
  49. make
  50. make install
  51.  
  52. echo "Loading ztdummy driver"
  53. modprobe zaptel
  54. modprobe ztdummy
  55.  
  56. echo "adding rules to /etc/rc.local"
  57.  
  58. echo "modprobe zaptel
  59. modprobe ztdummy
  60. asterisk -g" >> /etc/rc.local
  61.  
  62. echo "Downloading open source g729 codec"
  63. cd /usr/lib/asterisk/modules/
  64. wget http://asterisk.hosting.lv/bin12/codec_g729-ast12-gcc4-glibc-pentium4.so
  65.  
  66. echo "Running Asterisk"
  67. asterisk -g
  68.  
  69. echo "***********************************************************************"
  70. echo "*             INSTALLATION SUCCESSFUL                                 *"
  71. echo "***********************************************************************"
  72. echo "* You can test if Asterisk installed successfully using               *"
  73. echo "* asterisk -ncrvvv and start configuring your dial plan               *"
  74. echo "***********************************************************************"
  75. exit

Asterisk 1.2 auto install script for CentOS 4
  1. #!/bin/sh
  2. #Asterisk Download page
  3. ZAPTEL="http://downloads.digium.com/pub/zaptel/releases/zaptel-1.2.25.tar.gz"
  4. ASTERISK="http://downloads.digium.com/pub/asterisk/releases/asterisk-1.2.28.tar.gz"
  5. ASTERISKADDONS="http://downloads.digium.com/pub/asterisk/releases/asterisk-addons-1.2.8.tar.gz"
  6. #Asterisk Package
  7. ZAPPACKAGE="zaptel-1.2.25.tar.gz"
  8. ASTPACKAGE="asterisk-1.2.28.tar.gz"
  9. ASTADDONSPACKAGE="asterisk-addons-1.2.8.tar.gz"
  10. #Asterisk Folder
  11. ZAPFOLDER="zaptel-1.2.25"
  12. ASTFOLDER="asterisk-1.2.28"
  13. ASTADDONSFOLDER="asterisk-addons-1.2.8"
  14. ##########Do not edit from here##################################################
  15. #################################################################################
  16. echo "Downloading and extracting zaptel and asterisk source"
  17. cd /usr/src
  18. wget $ZAPTEL
  19. wget $ASTERISK
  20. wget $ASTERISKADDONS
  21. tar -zxvf $ZAPPACKAGE
  22. tar -zxvf $ASTPACKAGE
  23. tar -zxvf $ASTADDONSPACKAGE
  24.  
  25. echo "Installing zaptel"
  26. cd $ZAPFOLDER
  27. make clean
  28. make
  29. make install
  30. cd ..
  31.  
  32. echo "Installing asterisk"
  33. cd $ASTFOLDER
  34. make clean
  35. make
  36. make install
  37. make samples
  38. cd ..
  39.  
  40. echo "Installing lammp server"
  41. echo "Installing rpmforge-release package"
  42. wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
  43. rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
  44. yum -y install httpd php php-gd php-mbstring php-mcrypt php-mysql mysql-client mysql-server mysql-devel phpmyadmin
  45.  
  46. echo "Installing asterisk-addons"
  47. cd $ASTADDONSFOLDER
  48. make clean
  49. make
  50. make install
  51.  
  52. echo "Loading ztdummy driver"
  53. modprobe zaptel
  54. modprobe ztdummy
  55.  
  56. echo "adding rules to /etc/rc.local"
  57.  
  58. echo "modprobe zaptel
  59. modprobe ztdummy
  60. asterisk -g" >> /etc/rc.local
  61.  
  62. echo "Downloading open source g729 codec"
  63. cd /usr/lib/asterisk/modules/
  64. wget http://asterisk.hosting.lv/bin12/codec_g729-ast12-gcc4-glibc-pentium4.so
  65.  
  66. echo "Running Asterisk"
  67. asterisk -g
  68.  
  69. echo "***********************************************************************"
  70. echo "*             INSTALLATION SUCCESSFUL                                 *"
  71. echo "***********************************************************************"
  72. echo "* You can test if Asterisk installed successfully using               *"
  73. echo "* asterisk -ncrvvv and start configuring your dial plan               *"
  74. echo "***********************************************************************"
  75. exit

Asterisk 1.2 auto install script for CentOS 5

You can download the script for CentOS 4 here and for CentOS 5 here.

To run the script just type:

./install-asterisk-1.2.el5.sh

If you run any of these script and it returns:

sh/bin bad interpreter: No such file or directory

Try to run:

dos2unix install-asterisk-1.2.el5.sh

Comments and suggestions are welcomed. Please help me improve these scripts.


Your rating: None
asterisk 1.2 with realtime ldap driver | Tea Break's picture

Pingback

[...] have created an auto install script based on http://www.cahilig.org/install-asterisk-12-auto-install-script-centos-4-... to install Asterisk 1.2 with ldap realtime driver support (modified original script to enable [...]

asterisk 1.2 with realtime ldap driver « everythin's picture

Pingback

[...] 28, 2008 I have created an auto install script based on http://www.cahilig.org/install-asterisk-12-auto-install-script-centos-4-... to install Asterisk 1.2 with ldap realtime driver support (modified original script to enable [...]

Installing a web-based Asterisk CDR analyzer | Open mind's picture

Pingback

[...] To install asterisk-stat, you need to install HTTP server, PHP and MySQL database. I assume that you are running CentOS 4.4 or higher and have Asterisk 1.2 installed in you server. To install Asterisk 1.2, checkout this tutorial http://www.cahilig.org/install-asterisk-12-centos-4-and-centos-5 or download the auto install script form http://www.cahilig.org/install-asterisk-12-auto-install-script-centos-4-.... [...]

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may quote other posts using [quote] tags.

More information about formatting options