Forums

×

Warning

JUser: :_load: Unable to load user with ID: 21536
Ilari
Ilari
Offline
Resolved
0 votes
Guys,

Followed these instructions http://www.asterisk.org/downloads/yum to add Asterisk and Digium repositories and gave a command:
[root@pgw ~]# yum install asterisk16

Sadly this craps out, as any of the repositories do not contain packages for ClearOS 5.1, or rather the dependencies look incorrect to me, as the actual kernel in the system is kernel-PAE. Following error smell like hardcoding. :(
Error: Missing Dependency: kernel-i686 = 2.6.18-164.11.1.el5 is needed by package kmod-dahdi-linux
Error: Missing Dependency: kernel-i686 = 2.6.18-164.11.1.el5 is needed by package kmod-dahdi-linux-fwload-vpmadt032

[root@pgw ~]# uname -r
2.6.18-164.6.1.v5PAE
[root@pgw ~]# cat /etc/redhat-release
CentOS release 5.4 (Final)
[root@pgw ~]# cat /etc/release
ClearOS Enterprise Edition release 5.1
[root@pgw ~]#

Well, I looked into the kmod-dahdi-linux.spec as well, and confirms the hardcoding of kernel version. Anyone compiled the binary rpm for those dahdi modules?
Monday, March 08 2010, 06:08 PM
Share this post:
Responses (17)
  • Accepted Answer

    Thursday, January 15 2015, 07:19 AM - #Permalink
    Resolved
    0 votes
    :ohmy: How is there not an app on the Market Place for this!?! There could also be an entire category for CRMs.
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, June 28 2014, 08:09 AM - #Permalink
    Resolved
    0 votes
    Help please! I try to install asterisk, but in repositories of the version of files were updated. what files to point to downloading in a script more mainly?

    I thank for any given help
    The reply is currently minimized Show
  • Accepted Answer

    ssedono
    ssedono
    Offline
    Sunday, March 20 2011, 02:18 PM - #Permalink
    Resolved
    0 votes
    How to install asterisk step by step on ClearOS 5.2 ?
    The reply is currently minimized Show
  • Accepted Answer

    Mark D
    Mark D
    Offline
    Friday, January 28 2011, 09:30 PM - #Permalink
    Resolved
    0 votes
    updated script some more - new dependency and asterisk changed path to a few downloads.

    If someone would spend the time to install freepbx in a different directory and avoid changing ownership of everything to asterisk, I would be very interested in getting an update on it.

    #!/bin/bash
    #
    # This script to install the Dahdi drivers, Asterisk and FreePBX
    # on a new install of ClarkConnet 5.2
    #
    # I noticed that the section where find was used to cd to new dir,
    # I was back in root directory; this was while doing a manual
    # copy&paste via ssh - Mark Dueck
    #
    # Must be run with superuser privileges.
    #
    # There is no error checking here, but it is known to work on a base
    # installs with downloaded versions:
    # asterisk-1.6.2
    # asterisk-addons-1.6.2
    # freepbx-2.8
    # libpri-1.4.11
    # Dahdi 2.4.0
    #
    # Sections of this script originally written for Ubuntu by Dr. Peter N. Steinmetz
    #
    # Created for Clark Connect 5.0 by Preston Moore - www.prestonmoore.com
    # Modified for Clear OS 5.2 by Wil Rotruck
    # Updated paths for downloads.asterisk.org and
    # added new dependency - libxml2-devel for asterisk - Mark Dueck 2011/01/28
    #

    # definitions of items to possibly change
    export IP_ADDRESS=10.10.10.10
    export FREEPBX_VERSION=2.8.0
    export MYSQL_ROOT_PW=passw0rd
    export ASTERISK_DB_PW=passw0rd
    export ASTERISK_MGR_PW=passw0rd
    export ARI_PW=passw0rd

    # install mysql server
    yum -y install app-mysql
    /etc/init.d/mysqld start
    chkconfig mysqld on

    # configure mysql root password
    mysqladmin -u root password ${MYSQL_ROOT_PW}

    # install packages needed beyond base install
    yum -y install kernel-devel
    yum -y install make bison flex gcc-c++ gcc cc-httpd php
    yum -y install php-cli php-mysql php-pear php-gd curl
    yum -y install sox ncurses-devel openssl-devel mysql-devel
    yum -y install libxml2-devel

    # install pear DB module
    pear install db

    # place source packages in standard place
    cd /usr/src

    ########## not sure why these 2 are commented - they still work when I tried
    ## download, make and install XML library for Google Talk
    #yum -y install gnutls-devel
    #wget http://iksemel.googlecode.com/files/iksemel-1.3.tar.gz
    #tar xfz iksemel-1.3.tar.gz
    #cd iksemel-1.3
    #./configure
    #make
    #make install
    #cd ..

    # download, make and install Speex codec
    #yum -y install libogg-devel
    #wget http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz
    #tar xfz speex-1.2rc1.tar.gz
    #cd speex-1.2rc1
    #./configure
    #make
    #make install
    #cd ..

    # download, make, install, and configure dahdi drivers
    wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-2.4.0+2.4.0.tar.gz
    tar xfz dahdi-linux-complete-2.4.0+2.4.0.tar.gz
    cd `find . -name "dahdi-linux-complete-2.4.0+2.4.0" -print`
    make all
    make install
    make config
    cd ..

    # download, make and install libpri
    wget http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz
    tar xfvz libpri-1.4-current.tar.gz
    cd `find . -name "libpri-1.4.*" -print`
    make
    make install
    cd ..

    # download, make and install asterisk and configuration files
    wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.6.2.16.1.tar.gz
    tar xfvz asterisk-1.6.2.16.1.tar.gz
    cd `find . -name "asterisk-1.6.2.16" -print`
    ./configure
    make
    make install
    make samples
    cd ..

    # download, make and install asterisk-addons
    wget http://downloads.digium.com/pub/telephony/asterisk/asterisk-addons-1.6.2-current.tar.gz
    tar xfvz asterisk-addons-1.6.2-current.tar.gz
    cd `find . -name "asterisk-addons-1.6.*" -print`
    ./configure
    make
    make install
    cd ..

    # download and install extra asterisk sounds
    mkdir asterisk-sounds
    cd asterisk-sounds
    wget http://downloads.digium.com/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz
    tar -zxf asterisk-extra-sounds-en-gsm-current.tar.gz
    cp -rf * /var/lib/asterisk/sounds
    cd ..

    # create asterisk user and group for apache server
    useradd -r -c "Asterisk PBX" -d /var/lib/asterisk asterisk

    # fix up apache configuration to run as asterisk user
    chown asterisk /var/lib/php/session/
    cp -v /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.original
    sed -i "s/User apache/User asterisk/" /etc/httpd/conf/httpd.conf
    sed -i "s/Group apache/Group asterisk/" /etc/httpd/conf/httpd.conf

    # add dummy timing device for asterisk
    modprobe dahdi_dummy

    # download and unpack freepbx
    wget http://mirror.freepbx.org/freepbx-${FREEPBX_VERSION}.tar.gz
    tar xfvz freepbx-${FREEPBX_VERSION}.tar.gz

    # configure freepbx
    cd freepbx-${FREEPBX_VERSION}

    # setup databases for freepbx use
    mysqladmin -u root -p${MYSQL_ROOT_PW} create asterisk
    mysqladmin -u root -p${MYSQL_ROOT_PW} create asteriskcdrdb
    mysql -u root -p${MYSQL_ROOT_PW} asterisk < SQL/newinstall.sql
    mysql -u root -p${MYSQL_ROOT_PW} asteriskcdrdb < SQL/cdr_mysql_table.sql
    mysql -u root -p${MYSQL_ROOT_PW} <<-END_PRIVS
    GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}";
    GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}";
    flush privileges;
    END_PRIVS

    # reconfigure php for freepbx
    cp -v /etc/php.ini /etc/php.ini-orig
    sed -i "s/\(upload_max_filesize *= *\)\(.*\)/\120M/" /etc/php.ini
    sed -i "s/\(memory_limit *= *\)\(.*\)/\1100M/" /etc/php.ini

    # fix up directory use and permissions for asterisk
    # mkdir /var/run/asterisk
    chown asterisk:asterisk -Rv /var/run/asterisk
    chown asterisk:asterisk -Rv /etc/asterisk
    chown asterisk:asterisk -Rv /var/lib/asterisk
    chown asterisk:asterisk -Rv /dev/dahdi
    chown asterisk:asterisk -Rv /var/log/asterisk
    chown asterisk:asterisk -Rv /var/spool/asterisk
    chown asterisk:asterisk -Rv /var/www/html
    sed -i "s|astrundir *=> */var/run|astrundir => /var/run/asterisk|" /etc/asterisk/asterisk.conf

    # configure amportal
    cp -v amportal.conf /etc/amportal.conf
    sed -i "s/# \(AMPDBUSER=asteriskuser\) */\1/" /etc/amportal.conf
    sed -i "s/# \(AMPDBPASS=\).*/\1${ASTERISK_DB_PW}/" /etc/amportal.conf
    sed -i "/#AMPWEBADDRESS=192.168.1.101/d" /etc/amportal.conf
    sed -i "s/AMPWEBADDRESS=/AMPWEBADDRESS=${IP_ADDRESS}/" /etc/amportal.conf
    sed -i "s/\(AMPMGRPASS=*\)\(.*\)/\1${ASTERISK_MGR_PW}/" /etc/amportal.conf
    sed -i "s/\(secret *= *\)\(.*\)/\1${ASTERISK_MGR_PW}/" /etc/asterisk/manager.conf

    # start asterisk
    ./start_asterisk start

    # install freepbx

    ########################## needed some help # had to manually do the username="" password=""
    ./install_amp

    # start apache web server
    /etc/init.d/httpd start
    chkconfig httpd on

    #
    # Modify CC webconfig menu
    echo "<?php" >> /var/webconfig/htdocs/admin/fop.php
    echo "header( 'Location: http://${IP_ADDRESS}/panel' ) ;" >> /var/webconfig/htdocs/admin/fop.php
    echo "?>" >> /var/webconfig/htdocs/admin/fop.php
    echo "<?php" >> /var/webconfig/htdocs/admin/ari.php
    echo "header( 'Location: http://${IP_ADDRESS}/recordings' ) ;" >> /var/webconfig/htdocs/admin/ari.php
    echo "?>" >> /var/webconfig/htdocs/admin/ari.php
    echo "<?php" >> /var/webconfig/htdocs/admin/freepbx.php
    echo "header( 'Location: http://${IP_ADDRESS}/admin' ) ;" >> /var/webconfig/htdocs/admin/freepbx.php
    echo "?>" >> /var/webconfig/htdocs/admin/freepbx.php

    echo "Software|PBX System|Administration|freepbx.php" > /var/webconfig/htdocs/menus/10-extra-freepbx.en_US
    echo "Software|PBX System|Operator Panel|fop.php" > /var/webconfig/htdocs/menus/10-extra-fop.en_US
    echo "Software|PBX System|Recordings|ari.php" > /var/webconfig/htdocs/menus/10-extra-ari.en_US
    chown -v webconfig:webconfig /var/webconfig/htdocs/menus/10-extra-freepbx.en_US
    chown -v webconfig:webconfig /var/webconfig/htdocs/menus/10-extra-fop.en_US
    chown -v webconfig:webconfig /var/webconfig/htdocs/menus/10-extra-ari.en_US

    # set ARI admin password
    sed -i "s/ari_password/${ARI_PW}/" /var/www/html/recordings/includes/main.conf.php

    # moh fix
    ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
    chown asterisk:asterisk /var/lib/asterisk/mohmp3

    # asterisk logrotate
    cat > /etc/logrotate.d/asterisk <<-END_ROTATE
    /var/log/asterisk/*log {
    missingok
    rotate 5
    weekly
    create 0640 asterisk asterisk
    postrotate
    /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
    endscript
    }
    /var/log/asterisk/full {
    missingok
    rotate 5
    daily
    create 0640 asterisk asterisk
    postrotate
    /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
    endscript
    }
    /var/log/asterisk/cdr-csv/*csv {
    missingok
    rotate 5
    monthly
    create 0640 asterisk asterisk
    }
    END_ROTATE

    # start amportal at boot
    echo "/usr/sbin/amportal start" >> /etc/rc.local

    # logo swap
    cd /var/www/html/admin/images/
    wget http://www.clearfoundation.com/images/stories/MediaCenter/ClearOS/ClearOS-Icon-xxs.png
    sed -i "s|AMPADMINLOGO=logo.png|AMPADMINLOGO=ClearOS-Icon-xxs.png|" /etc/amportal.conf

    # start freepbx
    /usr/local/sbin/amportal start
    The reply is currently minimized Show
  • Accepted Answer

    Monday, December 20 2010, 06:20 PM - #Permalink
    Resolved
    0 votes
    This is not to mention that the webroot is not the greatest place in the world to place FreePBX. Don't get me wrong; what Preston put together in the beginning was a nice package. It's been so long I can't remember everything I had to do, but I do remember it starting up pretty good. One of the biggest problems inevitably becomes the file permissions as time goes on, especially if you plan on hosting any website(s) like I eventually have done. You want Apache to have control of things when having a website and short of digging into a plethora of scripts you want the owner and group to be apache:apache; not asterisk:asterisk. It's not such a big deal changing the ownerships of the FreePBX directories so much as changing it's inherent scripts that automatically change the ownerships back to asterisk:asterisk. Once you find the right scripts to prevent this from happening you have to deal with any core upgrades to FreePBX changing the scripts back. It seems it may have been easier to put it somewhere else like maybe /var/webconfig/htdocs/FreePBX? I don't know; I ain't no guru. Maybe in the install scripts the permissions for asterisk and freepbx should be set for apache:apache if you're going to leave FreePBX in the webroot, although that won't take care of the core upgrades. I agree with Glen in that it's a lot of work to maintain Asterisk...a lot of work. Right now I've got an SIP adapter that used to work so so not working at all. I did have a go at installing SIPXecs as an alternative to Asterisk and FreePBX, but those scripts work at changing your http.conf and if you have websites that ain't so good. It also installs a different FTP server than proftp and proftp is what ClearOS works with. In the end SIPXecs requires maintenance too; just maybe not as much.
    The reply is currently minimized Show
  • Accepted Answer

    Riven
    Riven
    Offline
    Monday, December 20 2010, 03:19 PM - #Permalink
    Resolved
    0 votes
    Thanks, works great.


    Tried it though on my active server (not demo box) and got stuck at the " ./install_amp " part

    [root@****** freepbx-2.8.0]# ./install_amp
    PHP Warning: PHP Startup: mapi: Unable to initialize module
    Module compiled with module API=20050922, debug=0, thread-safety=0
    PHP compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
    in Unknown on line 0
    Checking for PEAR DB..OK
    Checking for PEAR Console::Getopt..OK
    Checking user..PHP Fatal error: Call to undefined function posix_getpwuid() in /usr/src/freepbx-2.8.0/install_amp on line 728
    [root@****** freepbx-2.8.0]#

    What could this be, and how do I fix this ?
    I also tried ./install_amp --force-version=2.1.3 as shown on http://www.freepbx.org/support/documentation/installation/upgrading-your-system but I get tha same error.

    Dirk
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, October 28 2010, 03:55 AM - #Permalink
    Resolved
    0 votes
    http://yourserver'sipaddressoryourdomainname/admin/config.php


    Your submitted script installs the Freepbx administration console in your webserver directory, so Apache has to be running. The script sets up access through the Webconfig gui of ClearOS, but the Webconfig links take the url from a secure server https url to a web server http url. This means that you should be able to access Freepbx in your Webconfig. Be forewarned: if you want to add other websites to your web server at a later date you'll have to mess with the httpd and Freepbx directories, scripts and permissions down the road.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, October 13 2010, 07:19 PM - #Permalink
    Resolved
    0 votes
    Updated script


    #!/bin/bash
    #
    # This script to install the Dahdi drivers, Asterisk and FreePBX
    # on a new install of ClarkConnet 5.2
    #
    # Must be run with superuser privileges.
    #
    # There is no error checking here, but it is known to work on a base
    # installs with downloaded versions:
    # asterisk-1.6.2
    # asterisk-addons-1.6.2
    # freepbx-2.8
    # libpri-1.4.11
    # Dahdi 2.4.0
    #
    # Sections of this script originally written for Ubuntu by Dr. Peter N. Steinmetz
    #
    # Created for Clark Connect 5.0 by Preston Moore - www.prestonmoore.com
    # Modified for Clear OS 5.2 by Wil Rotruck
    #

    # definitions of items to possibly change
    export IP_ADDRESS=192.168.1.101
    export FREEPBX_VERSION=2.8.0
    export MYSQL_ROOT_PW=Passw0rd
    export ASTERISK_DB_PW=Passw0rd
    export ASTERISK_MGR_PW=Passw0rd
    export ARI_PW=Passw0rd

    # install mysql server
    yum -y install app-mysql
    /etc/init.d/mysqld start
    chkconfig mysqld on

    # configure mysql root password
    mysqladmin -u root password ${MYSQL_ROOT_PW}

    # install packages needed beyond base install
    yum -y install kernel-devel
    yum -y install make bison flex gcc-c++ gcc cc-httpd php
    yum -y install php-cli php-mysql php-pear php-gd curl
    yum -y install sox ncurses-devel openssl-devel mysql-devel

    # install pear DB module
    pear install db

    # place source packages in standard place
    cd /usr/src

    ## download, make and install XML library for Google Talk
    #yum -y install gnutls-devel
    #wget http://iksemel.googlecode.com/files/iksemel-1.3.tar.gz
    #tar xfz iksemel-1.3.tar.gz
    #cd iksemel-1.3
    #./configure
    #make
    #make install
    #cd ..

    # download, make and install Speex codec
    # yum -y install libogg-devel
    # wget http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz
    # tar xfz speex-1.2rc1.tar.gz
    # cd speex-1.2rc1
    # ./configure
    # make
    # make install
    # cd ..

    yum install speex libxml2-devel

    # download, make, install, and configure dahdi drivers
    wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-2.4.0+2.4.0.tar.gz
    tar xfz dahdi-linux-complete-2.4.0+2.4.0.tar.gz
    cd `find . -name "dahdi-linux-complete-2.4.0+2.4.0" -print`
    make all
    make install
    make config
    cd ..

    # download, make and install libpri
    wget http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz
    tar xfvz libpri-1.4-current.tar.gz
    cd `find . -name "libpri-1.4.*" -print`
    make
    make install
    cd ..

    # download, make and install asterisk and configuration files
    wget http://downloads.digium.com/pub/asterisk/asterisk-1.6.2.13.tar.gz
    tar xfvz asterisk-1.6.2.13.tar.gz
    cd `find . -name "asterisk-1.6.13" -print`
    ./configure
    make
    make install
    make samples
    cd ..

    # download, make and install asterisk-addons
    wget http://downloads.digium.com/pub/asterisk/asterisk-addons-1.6.2-current.tar.gz
    tar xfvz asterisk-addons-1.6.2-current.tar.gz
    cd `find . -name "asterisk-addons-1.6.*" -print`
    ./configure
    make
    make install
    cd ..

    # download and install extra asterisk sounds
    mkdir asterisk-sounds
    cd asterisk-sounds
    wget http://downloads.digium.com/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz
    tar -zxf asterisk-extra-sounds-en-gsm-current.tar.gz
    cp -rf * /var/lib/asterisk/sounds
    cd ..

    # create asterisk user and group for apache server
    useradd -r -c "Asterisk PBX" -d /var/lib/asterisk asterisk

    # fix up apache configuration to run as asterisk user
    chown asterisk /var/lib/php/session/
    cp -v /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.original
    sed -i "s/User apache/User asterisk/" /etc/httpd/conf/httpd.conf
    sed -i "s/Group apache/Group asterisk/" /etc/httpd/conf/httpd.conf

    # add dummy timing device for asterisk
    modprobe dahdi_dummy

    # download and unpack freepbx
    wget http://mirror.freepbx.org/freepbx-${FREEPBX_VERSION}.tar.gz
    tar xfvz freepbx-${FREEPBX_VERSION}.tar.gz

    # configure freepbx
    cd freepbx-${FREEPBX_VERSION}

    # setup databases for freepbx use
    mysqladmin -u root -p${MYSQL_ROOT_PW} create asterisk
    mysqladmin -u root -p${MYSQL_ROOT_PW} create asteriskcdrdb
    mysql -u root -p${MYSQL_ROOT_PW} asterisk < SQL/newinstall.sql
    mysql -u root -p${MYSQL_ROOT_PW} asteriskcdrdb < SQL/cdr_mysql_table.sql
    mysql -u root -p${MYSQL_ROOT_PW} <<-END_PRIVS
    GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}";
    GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}";
    flush privileges;
    END_PRIVS

    # reconfigure php for freepbx
    cp -v /etc/php.ini /etc/php.ini-orig
    sed -i "s/\(upload_max_filesize *= *\)\(.*\)/\120M/" /etc/php.ini
    sed -i "s/\(memory_limit *= *\)\(.*\)/\1100M/" /etc/php.ini

    # fix up directory use and permissions for asterisk
    # mkdir /var/run/asterisk
    chown asterisk:asterisk -Rv /var/run/asterisk
    chown asterisk:asterisk -Rv /etc/asterisk
    chown asterisk:asterisk -Rv /var/lib/asterisk
    chown asterisk:asterisk -Rv /dev/dahdi
    chown asterisk:asterisk -Rv /var/log/asterisk
    chown asterisk:asterisk -Rv /var/spool/asterisk
    chown asterisk:asterisk -Rv /var/www/html
    sed -i "s|astrundir *=> */var/run|astrundir => /var/run/asterisk|" /etc/asterisk/asterisk.conf

    # configure amportal
    cp -v amportal.conf /etc/amportal.conf
    sed -i "s/# \(AMPDBUSER=asteriskuser\) */\1/" /etc/amportal.conf
    sed -i "s/# \(AMPDBPASS=\).*/\1${ASTERISK_DB_PW}/" /etc/amportal.conf
    sed -i "/#AMPWEBADDRESS=192.168.1.101/d" /etc/amportal.conf
    sed -i "s/AMPWEBADDRESS=/AMPWEBADDRESS=${IP_ADDRESS}/" /etc/amportal.conf
    sed -i "s/\(AMPMGRPASS=*\)\(.*\)/\1${ASTERISK_MGR_PW}/" /etc/amportal.conf
    sed -i "s/\(secret *= *\)\(.*\)/\1${ASTERISK_MGR_PW}/" /etc/asterisk/manager.conf

    # start asterisk
    ./start_asterisk start

    # install freepbx
    ./install_amp

    # start apache web server
    /etc/init.d/httpd start
    chkconfig httpd on

    #
    # Modify CC webconfig menu
    echo "<?php" >> /var/webconfig/htdocs/admin/fop.php
    echo "header( 'Location: http://${IP_ADDRESS}/panel' ) ;" >> /var/webconfig/htdocs/admin/fop.php
    echo "?>" >> /var/webconfig/htdocs/admin/fop.php
    echo "<?php" >> /var/webconfig/htdocs/admin/ari.php
    echo "header( 'Location: http://${IP_ADDRESS}/recordings' ) ;" >> /var/webconfig/htdocs/admin/ari.php
    echo "?>" >> /var/webconfig/htdocs/admin/ari.php
    echo "<?php" >> /var/webconfig/htdocs/admin/freepbx.php
    echo "header( 'Location: http://${IP_ADDRESS}/admin' ) ;" >> /var/webconfig/htdocs/admin/freepbx.php
    echo "?>" >> /var/webconfig/htdocs/admin/freepbx.php

    echo "Software|PBX System|Administration|freepbx.php" > /var/webconfig/htdocs/menus/10-extra-freepbx.en_US
    echo "Software|PBX System|Operator Panel|fop.php" > /var/webconfig/htdocs/menus/10-extra-fop.en_US
    echo "Software|PBX System|Recordings|ari.php" > /var/webconfig/htdocs/menus/10-extra-ari.en_US
    chown -v webconfig:webconfig /var/webconfig/htdocs/menus/10-extra-freepbx.en_US
    chown -v webconfig:webconfig /var/webconfig/htdocs/menus/10-extra-fop.en_US
    chown -v webconfig:webconfig /var/webconfig/htdocs/menus/10-extra-ari.en_US

    # set ARI admin password
    sed -i "s/ari_password/${ARI_PW}/" /var/www/html/recordings/includes/main.conf.php

    # moh fix
    ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
    chown asterisk:asterisk /var/lib/asterisk/mohmp3

    # asterisk logrotate
    cat > /etc/logrotate.d/asterisk <<-END_ROTATE
    /var/log/asterisk/*log {
    missingok
    rotate 5
    weekly
    create 0640 asterisk asterisk
    postrotate
    /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
    endscript
    }
    /var/log/asterisk/full {
    missingok
    rotate 5
    daily
    create 0640 asterisk asterisk
    postrotate
    /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
    endscript
    }
    /var/log/asterisk/cdr-csv/*csv {
    missingok
    rotate 5
    monthly
    create 0640 asterisk asterisk
    }
    END_ROTATE

    # start amportal at boot
    echo "/usr/sbin/amportal start" >> /etc/rc.local

    # logo swap
    cd /var/www/html/admin/images/
    wget http://www.clearfoundation.com/images/stories/MediaCenter/ClearOS/ClearOS-Icon-xxs.png
    sed -i "s|AMPADMINLOGO=logo.png|AMPADMINLOGO=ClearOS-Icon-xxs.png|" /etc/amportal.conf

    # start freepbx
    /usr/local/sbin/amportal start


    After doing this, I yet have to find out how to access the asterisk server :P But I'll RTFM.
    The reply is currently minimized Show
  • Accepted Answer

    Glen
    Glen
    Offline
    Thursday, October 07 2010, 04:23 AM - #Permalink
    Resolved
    0 votes
    The reason it doesn't work is because it can't possibly work after the passage of time. Asterisk removed the release used from its distro, and the "script" if that's what you call it - doesn't do ANY error checking and it won't stop if something fails. Plus if you have to run it again, it double-edits things.

    I'd recommend using it as a guideline for MANUALLY typing, line by line, each entry into your system and running the command to see if it works properly or not. Trying to play catch-up with this script is an exercise in futility. I never got it to work perfectly - in the end, best as I could get it, I had to manually run install_amp and fix a broken symlink in /etc/asterisk to /var/www/html/admin/modules/core/etc and a bad directory permission -- it's simply a mess. And if you clean it today, I guarantee it will break after a release or two of something. It's also impossible to test, as you really have to build a clean system to test the thing thoroughly.

    Anyway... it's a great script. Yeah.

    --glen
    The reply is currently minimized Show
  • Accepted Answer

    J Kelly
    J Kelly
    Offline
    Wednesday, September 29 2010, 07:36 PM - #Permalink
    Resolved
    0 votes
    I've had several issues so far.

    #1, when I copied and pasted from windows into nano, it made a file in MSDOS format.

    #2, I get an error from MySQL that root@localhost is not able to connect - access denied

    #3, I see a lot of various "package not found" errors, among other errors about things having been changed (pear, etc).

    And at the very end, a fatal error when it tries to start asterisk.

    Obviously there is something different between our two builds that keeps mine from installing using that script.

    But thanks for posting it! It was worth a try.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, September 14 2010, 09:34 PM - #Permalink
    Resolved
    0 votes
    Yep... I missed that change when updating the script. I'll edit the change in now.

    Nice catch :)

    W-
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, September 14 2010, 08:26 PM - #Permalink
    Resolved
    0 votes
    Quick question - should
    yum -y install cc-mysql
    read
    yum -y install app-mysql


    I thing cc- packages changed to app- packages either at CC 5.0 or ClearOS 5.1
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, September 14 2010, 07:49 PM - #Permalink
    Resolved
    0 votes
    Hello all:

    I have used Preston's script on a couple of boxes with great results. Many thanks to Preston Moore for his research and creation of the script.

    I recently updated my builds to Dahdi and figured I'd take a pass at freshening the script while I was at it. It should now be compatable with Clear OS 5.2 and give the most recent versions of Asterisk, FreePBX and Dahdi and correct an issue with the Asterisk PBX user account casused by a change between 5.0 & 5.1.

    Please note the instructions that Prestion gave for installation. These are still valid for this script and ignore them at your own peril. I would also reccomend upgrading to PHP 5.2. This can be done by following the instructions given here. Do this prior to running the script as the PHP upgrade will change settings made by the script and cost you an afternoon of trouble shooting. Thanks to Tim Burgess for the PHP 5.2 RPMs.

    -Wil

    EDIT: I'm not sure if the file attached or not. So, as I don't have an ftp site avalible to me, I have put the script in the body of this post.


    #!/bin/bash
    #
    # This script to install the Dahdi drivers, Asterisk and FreePBX
    # on a new install of ClarkConnet 5.2
    #
    # Must be run with superuser privileges.
    #
    # There is no error checking here, but it is known to work on a base
    # installs with downloaded versions:
    # asterisk-1.6.2
    # asterisk-addons-1.6.2
    # freepbx-2.8
    # libpri-1.4.11
    # Dahdi 2.4.0
    #
    # Sections of this script originally written for Ubuntu by Dr. Peter N. Steinmetz
    #
    # Created for Clark Connect 5.0 by Preston Moore - www.prestonmoore.com
    # Modified for Clear OS 5.2 by Wil Rotruck
    #

    # definitions of items to possibly change
    export IP_ADDRESS=192.168.1.101
    export FREEPBX_VERSION=2.8.0
    export MYSQL_ROOT_PW=Passw0rd
    export ASTERISK_DB_PW=Passw0rd
    export ASTERISK_MGR_PW=Passw0rd
    export ARI_PW=Passw0rd

    # install mysql server
    yum -y install app-mysql
    /etc/init.d/mysqld start
    chkconfig mysqld on

    # configure mysql root password
    mysqladmin -u root password ${MYSQL_ROOT_PW}

    # install packages needed beyond base install
    yum -y install kernel-devel
    yum -y install make bison flex gcc-c++ gcc cc-httpd php
    yum -y install php-cli php-mysql php-pear php-gd curl
    yum -y install sox ncurses-devel openssl-devel mysql-devel

    # install pear DB module
    pear install db

    # place source packages in standard place
    cd /usr/src

    ## download, make and install XML library for Google Talk
    #yum -y install gnutls-devel
    #wget http://iksemel.googlecode.com/files/iksemel-1.3.tar.gz
    #tar xfz iksemel-1.3.tar.gz
    #cd iksemel-1.3
    #./configure
    #make
    #make install
    #cd ..

    # download, make and install Speex codec
    # yum -y install libogg-devel
    # wget http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz
    # tar xfz speex-1.2rc1.tar.gz
    # cd speex-1.2rc1
    # ./configure
    # make
    # make install
    # cd ..

    # download, make, install, and configure dahdi drivers
    wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-2.4.0+2.4.0.tar.gz
    tar xfz dahdi-linux-complete-2.4.0+2.4.0.tar.gz
    cd `find . -name "dahdi-linux-complete-2.4.0+2.4.0" -print`
    make all
    make install
    make config
    cd ..

    # download, make and install libpri
    wget http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz
    tar xfvz libpri-1.4-current.tar.gz
    cd `find . -name "libpri-1.4.*" -print`
    make
    make install
    cd ..

    # download, make and install asterisk and configuration files
    wget http://downloads.digium.com/pub/asterisk/asterisk-1.6.2.11.tar.gz
    tar xfvz asterisk-1.6.2.11.tar.gz
    cd `find . -name "asterisk-1.6.11" -print`
    ./configure
    make
    make install
    make samples
    cd ..

    # download, make and install asterisk-addons
    wget http://downloads.digium.com/pub/asterisk/asterisk-addons-1.6.2-current.tar.gz
    tar xfvz asterisk-addons-1.6.2-current.tar.gz
    cd `find . -name "asterisk-addons-1.6.*" -print`
    ./configure
    make
    make install
    cd ..

    # download and install extra asterisk sounds
    mkdir asterisk-sounds
    cd asterisk-sounds
    wget http://downloads.digium.com/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz
    tar -zxf asterisk-extra-sounds-en-gsm-current.tar.gz
    cp -rf * /var/lib/asterisk/sounds
    cd ..

    # create asterisk user and group for apache server
    useradd -r -c "Asterisk PBX" -d /var/lib/asterisk asterisk

    # fix up apache configuration to run as asterisk user
    chown asterisk /var/lib/php/session/
    cp -v /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.original
    sed -i "s/User apache/User asterisk/" /etc/httpd/conf/httpd.conf
    sed -i "s/Group apache/Group asterisk/" /etc/httpd/conf/httpd.conf

    # add dummy timing device for asterisk
    modprobe dahdi_dummy

    # download and unpack freepbx
    wget http://mirror.freepbx.org/freepbx-${FREEPBX_VERSION}.tar.gz
    tar xfvz freepbx-${FREEPBX_VERSION}.tar.gz

    # configure freepbx
    cd freepbx-${FREEPBX_VERSION}

    # setup databases for freepbx use
    mysqladmin -u root -p${MYSQL_ROOT_PW} create asterisk
    mysqladmin -u root -p${MYSQL_ROOT_PW} create asteriskcdrdb
    mysql -u root -p${MYSQL_ROOT_PW} asterisk < SQL/newinstall.sql
    mysql -u root -p${MYSQL_ROOT_PW} asteriskcdrdb < SQL/cdr_mysql_table.sql
    mysql -u root -p${MYSQL_ROOT_PW} <<-END_PRIVS
    GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}";
    GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}";
    flush privileges;
    END_PRIVS

    # reconfigure php for freepbx
    cp -v /etc/php.ini /etc/php.ini-orig
    sed -i "s/\(upload_max_filesize *= *\)\(.*\)/\120M/" /etc/php.ini
    sed -i "s/\(memory_limit *= *\)\(.*\)/\1100M/" /etc/php.ini

    # fix up directory use and permissions for asterisk
    mkdir /var/run/asterisk
    chown asterisk:asterisk -Rv /var/run/asterisk
    chown asterisk:asterisk -Rv /etc/asterisk
    chown asterisk:asterisk -Rv /var/lib/asterisk
    chown asterisk:asterisk -Rv /dev/dahdi
    chown asterisk:asterisk -Rv /var/log/asterisk
    chown asterisk:asterisk -Rv /var/spool/asterisk
    chown asterisk:asterisk -Rv /var/www/html
    sed -i "s|astrundir *=> */var/run|astrundir => /var/run/asterisk|" /etc/asterisk/asterisk.conf

    # configure amportal
    cp -v amportal.conf /etc/amportal.conf
    sed -i "s/# \(AMPDBUSER=asteriskuser\) */\1/" /etc/amportal.conf
    sed -i "s/# \(AMPDBPASS=\).*/\1${ASTERISK_DB_PW}/" /etc/amportal.conf
    sed -i "/#AMPWEBADDRESS=192.168.1.101/d" /etc/amportal.conf
    sed -i "s/AMPWEBADDRESS=/AMPWEBADDRESS=${IP_ADDRESS}/" /etc/amportal.conf
    sed -i "s/\(AMPMGRPASS=*\)\(.*\)/\1${ASTERISK_MGR_PW}/" /etc/amportal.conf
    sed -i "s/\(secret *= *\)\(.*\)/\1${ASTERISK_MGR_PW}/" /etc/asterisk/manager.conf

    # start asterisk
    ./start_asterisk start

    # install freepbx
    ./install_amp

    # start apache web server
    /etc/init.d/httpd start
    chkconfig httpd on

    #
    # Modify CC webconfig menu
    echo "<?php" >> /var/webconfig/htdocs/admin/fop.php
    echo "header( 'Location: http://${IP_ADDRESS}/panel' ) ;" >> /var/webconfig/htdocs/admin/fop.php
    echo "?>" >> /var/webconfig/htdocs/admin/fop.php
    echo "<?php" >> /var/webconfig/htdocs/admin/ari.php
    echo "header( 'Location: http://${IP_ADDRESS}/recordings' ) ;" >> /var/webconfig/htdocs/admin/ari.php
    echo "?>" >> /var/webconfig/htdocs/admin/ari.php
    echo "<?php" >> /var/webconfig/htdocs/admin/freepbx.php
    echo "header( 'Location: http://${IP_ADDRESS}/admin' ) ;" >> /var/webconfig/htdocs/admin/freepbx.php
    echo "?>" >> /var/webconfig/htdocs/admin/freepbx.php

    echo "Software|PBX System|Administration|freepbx.php" > /var/webconfig/htdocs/menus/10-extra-freepbx.en_US
    echo "Software|PBX System|Operator Panel|fop.php" > /var/webconfig/htdocs/menus/10-extra-fop.en_US
    echo "Software|PBX System|Recordings|ari.php" > /var/webconfig/htdocs/menus/10-extra-ari.en_US
    chown -v webconfig:webconfig /var/webconfig/htdocs/menus/10-extra-freepbx.en_US
    chown -v webconfig:webconfig /var/webconfig/htdocs/menus/10-extra-fop.en_US
    chown -v webconfig:webconfig /var/webconfig/htdocs/menus/10-extra-ari.en_US

    # set ARI admin password
    sed -i "s/ari_password/${ARI_PW}/" /var/www/html/recordings/includes/main.conf.php

    # moh fix
    ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
    chown asterisk:asterisk /var/lib/asterisk/mohmp3

    # asterisk logrotate
    cat > /etc/logrotate.d/asterisk <<-END_ROTATE
    /var/log/asterisk/*log {
    missingok
    rotate 5
    weekly
    create 0640 asterisk asterisk
    postrotate
    /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
    endscript
    }
    /var/log/asterisk/full {
    missingok
    rotate 5
    daily
    create 0640 asterisk asterisk
    postrotate
    /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
    endscript
    }
    /var/log/asterisk/cdr-csv/*csv {
    missingok
    rotate 5
    monthly
    create 0640 asterisk asterisk
    }
    END_ROTATE

    # start amportal at boot
    echo "/usr/sbin/amportal start" >> /etc/rc.local

    # logo swap
    cd /var/www/html/admin/images/
    wget http://www.clearfoundation.com/images/stories/MediaCenter/ClearOS/ClearOS-Icon-xxs.png
    sed -i "s|AMPADMINLOGO=logo.png|AMPADMINLOGO=ClearOS-Icon-xxs.png|" /etc/amportal.conf

    # start freepbx
    /usr/sbin/amportal start
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, June 09 2010, 07:06 PM - #Permalink
    Resolved
    0 votes
    Try this (developed by preston moore for CC 5.0)

    1. Install CC 5.0
    2. Register system via the CC "Setup Wizard" GUI
    3. yum update and reboot the system
    4. wget http://www.prestonmoore.com/images/ccfreepbx50.sh
    5. nano ccfreepbx50.sh and change "passw0rd" and IP address
    6. sh ccfreepbx50.sh
    7. Finished

    I have included Google Talk and the speex codec in the script, but you need
    to uncomment those sections prior to execution.
    The reply is currently minimized Show
  • Accepted Answer

    Ilari
    Ilari
    Offline
    Tuesday, May 11 2010, 10:08 AM - #Permalink
    Resolved
    0 votes
    rpmbuild creates the rpm package from source code, .spec file is part of source package, which you need in order to compile. The Asterisk sources are here http://packages.asterisk.org/centos/5/current/SRPMS/
    The reply is currently minimized Show
  • Accepted Answer

    Riven
    Riven
    Offline
    Monday, May 10 2010, 08:13 PM - #Permalink
    Resolved
    0 votes
    Hi.

    When I run " rpmbuild --ba dahdi-linux-kmod.spec --define "kversion `uname -r`" --target=i686" I get
    "
    Building target platforms: i686
    Building for target i686
    error: failed to stat /root/dahdi-linux-kmod.spec: No such file or directory

    "

    What can I do to correct this ?
    The reply is currently minimized Show
  • Accepted Answer

    Ilari
    Ilari
    Offline
    Monday, March 08 2010, 06:16 PM - #Permalink
    Resolved
    0 votes
    Figured, I need to use following style to compile from sources:
    # rpmbuild --ba dahdi-linux-kmod.spec --define "kversion `uname -r`" --target=i686
    # rpmbuild --ba dahdi-firmware.spec --define "kversion `uname -r`" --target=i686

    ... and then manually install
    # rpm -i kmod-dahdi-linux-2.2.1-1_centos5.2.6.18_164.6.1.v5.i686.rpm
    # rpm -i dahdi-firmware-2.0.0-1_centos5.noarch.rpm
    # rpm -i dahdi-firmware-oct6114-064-1.05.01-1_centos5.noarch.rpm
    # rpm -i dahdi-firmware-oct6114-128-1.05.01-1_centos5.noarch.rpm
    # rpm -i dahdi-firmware-tc400m-MR6.12-1_centos5.noarch.rpm
    # rpm -i dahdi-firmware-vpmadt032-1.07-1_centos5.noarch.rpm

    ... then yum is satisfied with deps
    # yum install asterisk16 asterisk16-configs asterisk16-voicemail dahdi-linux dahdi


    Worked for me ! :woohoo:
    The reply is currently minimized Show
Your Reply