Attention: All pages of this wiki depend on the pages that come before it, in order as they are listed on the Main Page. Please check for Dependencies.
Please also look at What You Need to Know Before Using This Wiki

Install Asterisk

Jump to: navigation, search

System Prep

  • apt-get install mysql-server libxml2-dev libsqlite3-dev ncurses-dev subversion linux-headers-$(uname -r) doxygen php5-mysql sudo apache2-mpm-itk libapache2-mod-php5 openssl libssl-dev libnewt-dev libbluetooth-dev libogg-dev libical-dev libspandsp-dev libdb-dev mpg123 php-pear php5-curl vsftpd build-essential
  • pear install DB

Obtain and Build UW-IMAP Client Libraries

Obtain and install DAHDI

Obtain and Install LibPRI

Obtain and install Asterisk

  • Find latest downloads here:
  • cd /usr/src
  • wget
  • tar zxf asterisk-11-current.tar.g
  • cd asterisk-11.5.0/
  • ./contrib/scripts/install_prereq install <= Note: Country code for Canada is 01
  • ./contrib/scripts/
  • ./configure --with-imap=/usr/src/imap-2007f/
  • make menuselect
    • Add-Ons => enable chan_mobile, format_mp3, res_config_mysql, and all the deprecated ones
    • Channel Drivers => disable chan_mgcp, chan_oss, chan_phone, chan_skinny, chan_unistim, chan_gtalk, chan_jingle
    • Resource Modules => disable res_calendar_ews res_calendar_exchange res_config_ldap res_config_pgsql res_config_sqlite res_odbc res_config_odbc
    • Voicemail Build Options => enable IMAP_STORAGE
    • Core Sound Packages => enable CORE-SOUNDS-EN-WAV, CORE-SOUNDS-EN-GSM
    • Music On Hold File Packages => enable MOH-OPSOUND-GSM, MOH-OPSOUND-WAV
    • Extras Sound Packages => enable EXTRA-SOUNDS-EN-WAV, EXTRA-SOUNDS-EN-GSM
    • Save and Exit
  • make && make install && make progdocs
  • for i in acl.conf udptl.conf cdr_custom.conf cel_custom.conf cli_aliases.conf res_ldap.conf res_config_sqlite3.conf users.conf phoneprov.conf; do cp /usr/src/asterisk-11.5.0/configs/$i.sample /etc/asterisk/$i; done
  • chown -R asterisk:asterisk /var/run/asterisk /etc/asterisk /var/{lib,log,spool}/asterisk /usr/lib/asterisk

Configure Mysql

  • mysql -u root -p
  • create database asterisk;
  • create database asteriskcdrdb;
  • GRANT ALL PRIVILEGES on asterisk.* to'pbx'@'localhost' identified by 'DBMinion';
  • GRANT ALL PRIVILEGES on asteriskcdrdb.* to'pbx'@'localhost' identified by 'DBMinion';
  • quit

Obtain and Install FreePBX

  • Find latest downloads here:
  • cd /usr/src
  • wget
  • tar zxf freepbx-2.11.0rc1.tar.gz
  • cd freepbx-2.11.0rc1/
  • mysql -u root -p asterisk < SQL/newinstall.sql
  • mysql -u root -p asteriskcdrdb < SQL/cdr_mysql_table.sql
  • ./start_asterisk start
  • mkdir /Computerisms/sites/
  • ln -s /Computerisms/sites/ /Computerisms/sites/html
  • sed -i 's!;date.timezone =!date.timezone = America/Whitehorse!' /etc/php5/cli/php.ini
  • ./install_amp --my-svn-is-correct --install-moh --webroot /Computerisms/sites/ --dbhost localhost --dbname asterisk --username pbx --password DBMinion
  • ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
  • sed -i 's!AMPWEBROOT=/Computerisms/sites/html!AMPWEBROOT=/Computerisms/sites/!' /etc/amportal.conf

Configure Apache

  • vi /etc/apache2/sites-available/
  • mkdir /var/log/apache2/
  • chown root:adm /var/log/apache2/
  • a2ensite
  • service apache2 reload
  • samba-tool dns add houselian pbx A

Configure Telephony Hardware

  • rtfm

Start Asterisk and Configure FreePBX

  • Note
  • amportal start
  • in a browser navigate to login as admin/admin
  • navigate to settings=>advanced settings=>Asterisk Manager=>change the password=>click the green checkmark on the right
  • Scroll Down to User Portal Admin Password=>Change the password=>Click the green checkmark on the right
  • Scroll up to Developer Mode and set it to false=>Click the green checkmark on the right
  • Set Leave Reload Bar Up to False=>Click the green checkmark on the right=>apply config
  • navigate to the connectivity tab and configure your trunks and routes=>apply config
  • navigate to admin=>Module Admin=>select Repositories and click check online
    • whatever else, get OSS PBX EndPoint Manager and Bulk Extensions

Configure EndPoint Manager

  • > /etc/vsftpd.conf; vi /etc/vsftpd.conf
  • /etc/init.d/vsftpd restart
  • sed -i 's/ftp:/ftpsecure:/' /etc/passwd
  • sed -i 's/ftp:/ftpsecure:/' /etc/shadow
  • passwd phnmngr
  • in the freepbx web gui, navigate to connectivity=>End Point Advanced Settings
  • set ip as, and config and firmware directory as /IPPhones=>Select Disable TFTP Server Check=>Click Update Globals
  • As required:
    • go to and download the package for your phone brand
    • navigate to connectivity=>oss Endpoint Advanced Settings=>Manual Endpoint Modules Upload/export and use it to upload the package for your phone brand
  • navigate to connectivity=>oss endpoint configuration=>click check for updates=>Select your phone brand and click install=>select your model and click enable=>apply config

Deploying Phones

  • Navigate to Applications=>Extensions
  • create an extension for a typical user=>submit=>apply config
  • navigate to Applications=>Bulk Extensions=>Click Export Extensions
  • Use whatever spreadsheet magic you know to populate all the extensions as you need them=>save the file
  • under Applications=>Bulk Extensions click choose file, navigate to your spread sheet and click load file
  • navigate to extensions=>while true; do (($EXTNUM++))=>Unpack the phone=>Enter mac address under end point manager section=>submit=>apply config
  • go plug phone in, it will probably take a little while, but it should grab the config and come up with the right name on the phone.

Enable Unified Messaging/IMAP Storage

  • Navigate to Settings=>voicemail admin=>system
  • Set imapflags=ssl/novalidate-cert
  • Set imapport=993
  • Set
  • Submit=>apply config

Required Reading