`
sbfwfn
  • 浏览: 16964 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Experience the Love of Ubuntu 8.04 & FreePBX 2.5

阅读更多
With my recent endeavor into the world of open-source PBX I decided to write up a step-by-step how to on how to setup Ubuntu 8.04 with FreePBX 2.5. All the how-to’s were out dated and when i setup something I like to have all the new stuff. I will cover Zaptel compiling (not configuration), Astrisk Compiling, Install of FreePBX and configuration. It is recommend that you have prior knowledge of how to use Linux and some Asterisk knowledge. To access a root shell on an Ubuntu system run sudo su. Install Base Ubuntu 8.04 Server.

Install Ubuntu 8.04 Server w/ LAMP server & SSHd

*THIS HOW-TO IS CURRENTLY A WORK IN PROGRESS*

Get the system all up to date
#aptitude upgrade

After that is finish with no errors reboot your system

I would not recommend installing zaptel or asterisk from apt. It will just cause problems.

Install Required Packages

# sudo aptitude install cvs build-essential automake autoconf bison flex libtool libncurses5-dev libssl-dev php5 php5-cli php5-curl php5-gd php5-mysql mysql-server php-pear php-db curl sox apache2 subversion libssl-dev libmysqlclient15-dev libcurl4-gnutls-dev

Compile & Installing Zaptel Modules

Next we want to prepare to build the zaptel modules to do we will need the following packages:

# uname -a

# sudo aptitude install linux-headers-$(uname -r)
# sudo ln -s /usr/src/linux-headers-$(uname -r) /usr/src/linux-2.6

# cd /usr/src/
# sudo wget http://downloads.digium.com/pub/zaptel/zaptel-1.4-current.tar.gz
# sudo tar -zxvf zaptel-1.4-current.tar.gz
# cd zaptel-1.4.12.1
# ./configure
# make clean
# make
# sudo make install
# sudo make config

I am not going to go in depth into Zaptel module configuration since there is a ton of great sites out there.
Edit the following config files to your needs: configure /etc/zaptel.conf and /etc/asterisk/zapata.conf
voip-info zaptel config

# sudo /etc/init.d/zaptel start
# sudo update-rc.d zaptel defaults 20 80

Ways to test your Zaptel
# lspci

should have something like this: 02:0a.0 Ethernet controller: Digium, Inc. Unknown device 8005 (rev 11)

# cat /proc/zaptel/*
output similar to:

Span 1: WCTDM/0 “Wildcard TDM410P Board 1″ (MASTER)
IRQ misses: 1

1 WCTDM/0/0 FXSKS (In use)
2 WCTDM/0/1 FXSKS (In use)
3 WCTDM/0/2 FXSKS (In use)
4 WCTDM/0/3 FXSKS (In use)

Testing once Asterisk IS INSTALLED

Access Asterisk CLI
# sudo asterisk -r

In asterisk command line enter : zap show channels
xxx*CLI> zap show channels

output similar to:

Chan Extension  Context         Language   MOH Interpret
pseudo            from-pstn                  default
1            from-pstn                  default
2            from-pstn                  default
3            from-pstn                  default
4            from-pstn                  default

In asterisk command line enter : zap show status
xxx*CLI> zap show status

output similar to:

Description                              Alarms     IRQ        bpviol     CRC4
Wildcard TDM410P Board 1                 OK         1          0          0

If you have stuff like this showing up your card should be working

Setting Up & Compile Asterisk with Curl Support

# sudo groupadd asterisk
# sudo useradd -c “asterisk PBX” -d /var/lib/asterisk -g asterisk asterisk
# sudo mkdir /var/run/asterisk
# sudo chown asterisk:asterisk /var/run/asterisk/
# cd /usr/src/
# sudo wget http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.22.tar.gz
# sudo tar -zxvf asterisk-1.4.22.tar.gz
# cd asterisk-1.4.22
# make clean
# ./configure –with-curl
# make
# sudo make install
# sudo make samples

Download Astrisk Add-ons
# cd ..
# sudo wget http://downloads.digium.com/pub/asterisk/asterisk-addons-1.4.7.tar.gz
# sudo tar -zxvf asterisk-addons-1.4.7.tar.gz
# cd asterisk-addons-1.4.7
# sudo perl -p -i.bak -e ’s/CFLAGS.*D_GNU_SOURCE/CFLAGS+=-D_GNU_SOURCE\nCFLAGS+=-DMYSQL_LOGUNIQUEID/’ Makefile
# ./configure
# make clean
# make
# sudo make install

Download Astrisk Sounds
# cd ..
# sudo mkdir asterisk-sounds
# cd asterisk-sounds
# sudo wget http://downloads.digium.com/pub/telephony/sounds/asterisk-core-sounds-en-wav-current.tar.gz
# sudo wget http://downloads.digium.com/pub/telephony/sounds/asterisk-extra-sounds-en-wav-current.tar.gz
# sudo wget http://downloads.digium.com/pub/telephony/sounds/asterisk-moh-freeplay-wav.tar.gz

# sudo tar -zxvf asterisk-core-sounds-en-wav-current.tar.gz
# sudo tar -zxvf asterisk-extra-sounds-en-wav-current.tar.gz
# sudo tar -zxvf asterisk-moh-freeplay-wav.tar.gz

copy all sounds to the asterisk directory
# sudo cp -rf * /var/lib/asterisk/sounds/

create sim link for MOH (Music on Hold) directory for FreePBX
# sudo ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3

Fix asterisk dir permissions
# chown asterisk:asterisk /etc/asterisk -R
# chown asterisk:asterisk /var/lib/asterisk -R
# chown asterisk:asterisk /var/log/asterisk -R
# chown asterisk:asterisk /var/spool/asterisk/ -R

# nano /etc/asterisk/asterisk.conf
Change astrundir to: /var/run/asterisk

Setting up FreePBX

# cd /usr/src/
# sudo wget http://mirror.freepbx.org/freepbx-2.5.0.tar.gz
# sudo tar -zxvf freepbx-2.5.0.tar.gz
# cd freepbx-2.5.0
# sudo mysql_install_db
# mysqladmin u root password ‘<chosen MySQL Password>’
# mysqladmin create asteriskcdrdb -p
# mysqladmin create asterisk -p
# mysql –user=root –password=<chosen MySQL Password> asterisk < ./SQL/newinstall.sql
# mysql –user=root –password=<chosen MySQL Password>asteriskcdrdb < ./SQL/cdr_mysql_table.sql
Enter Mysql command prompt
# mysql –user root -p
# GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY ‘amp109′;
<enter>
# GRANT ALL PRIVILEGES ON  asterisk.* TO asteriskuser@localhost IDENTIFIED BY ‘amp109′;
<enter>
# quit
<enter>

Configure Apache for FreePBX

# sudo nano /etc/apache/envvars
change : export APACHE_RUN_USER=www-data & export APACHE_RUN_GROUP=www-data
to: export APACHE_RUN_USER=asterisk & export APACHE_RUN_GROUP=asterisk

# sudo nano /etc/apache2/sites-enabled/000-default
change: AllowOveride None to AllowOverid All under both instances of /var/www

Configure PHP for FreePBX
# sudo nano /etc/php5/apache2/php.ini
change: upload_max_filesize to upload_max_filesize = 20M

# sudo nano /etc/php5/cli/php.ini
change: upload_max_filesize to upload_max_filesize = 20M

Set the php lib directory to be owned by asterisk so that it can make changes to the php.ini
# sudo chown asterisk:asterisk /var/lib/php5 -R

Set ownership of the /var/www directory to asterisk so it can write to files
# sudo chown asterisk:asterisk /var/www -R

Restart Apache
# sudo /etc/init.d/apache2 restart

In a web browser test http://<server-ip-addresss>/ if all is well you should get a page and your apache is installed and working properly

FreePBX install

# cd /usr/src/freepbx-2.5.0
bash fix for asterisk start script
# sudo ln -sf /bin/bash /bin/sh
# sudo ./start_asterisk start
# sudo ./install_amp
accept defaults on all questions except on:
Enter the path to use for your AMP web root: /var/www
IP address: <server-ip-addresss>

No point a web browser at http://<server-ip-addresss>/admin/ and click on the orange reload config banner at the top of the page

Astrisk Init Script

# sudo nano /etc/init.d/asterisk

paste the following
?View Code BASH

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

DESC="Asterisk"
NAME=amportal
DAEMON=/usr/local/sbin/$NAME
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

test -x $DAEMON || exit 0

d_start() {

        amportal start

}

d_stop() {

        amportal stop

}

d_reload() {

        amportal restart

}

case "$1" in

start)

        echo -n "Starting $DESC: $NAME"
        d_start
        echo "."
        ;;

stop)

        echo -n "Stopping $DESC: $NAME"
        d_stop
        echo "."
        ;;

restart|force-reload)

        echo -n "Restarting $DESC: $NAME"
        d_stop
        sleep 10
        d_start
        echo "."
        ;;

*)

        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        exit 3
        ;;

esac

exit 0

<save file>
# sudo chmod 755 /etc/init.d/asterisk
# sudo update-rc.d asterisk defaults 90 10

Activate FOP (Flash Operator Panel)
# sudo nano /etc/amportal.conf
change: FOPRUN=false to FOPRUN=true
*must restart asterisk to take effect in FreePBX

remove old astrisk configs
# sudo rm /etc/asterisk/*.0

Reboot your system and you should have a working Asterisk/FreePBX system up and running

Installing Other Goodies

TFTP server for phone updates and auto configurations

# sudo aptitude install tftpd-hpa tftp-hpa
# sudo nano /etc/default/tftpd-hpa
change: RUN_DAEMON to RUN_DAEMON=”yes”

I make a link to /tftpboot just to make it a little more accessible
# sudo ln -s /var/lib/tftpboot /tftpboot
# sudo /etc/init.d/tftpd-hpa start
# sudo update-rc.d tftpd-hpa defaults

Now put all your firmware updates, phone configs in the /tfptboot directory. Also if your phones use DHCP don’t forget to set the TFTP server address to this server ip so the phones get it automatically assigned.

Changing Mysql Asterisk Username or Password

If you change any of the mysql login cridentials you must update these two files with the new asterisk username and/or password

/etc/asterisk/cdr_mysql.conf
/etc/amportal.conf

Like this article? Please Digg it!
分享到:
评论

相关推荐

    ubuntu 8.04 安装g++

    Ubuntu 8.04 安装 G++ 详解 在 Ubuntu 8.04 系统中安装 G++ 编译器是非常必要的,特别是在配置 okl4 环境时。下面将详细介绍如何在 Ubuntu 8.04 中安装 G++。 首先,需要安装 build-essential 软件包,该软件包包...

    ubuntu8.04默认的源

    ubuntu8.04默认的源ubuntu8.04默认的源ubuntu8.04默认的源ubuntu8.04默认的源ubuntu8.04默认的源ubuntu8.04默认的源ubuntu8.04默认的源ubuntu8.04默认的源

    Ubuntu8.04安装教程

    Ubuntu 8.04,代号“Hardy Heron”(苍鹭),是Ubuntu Linux操作系统的一个重要版本,发布于2008年。这个版本带来了许多改进和新特性,为用户提供了更稳定、安全和易用的操作环境。下面将详细介绍Ubuntu 8.04的安装...

    详解:Vmware虚拟机下Ubuntu8.04安装.pdf

    Vmware虚拟机下Ubuntu 8.04安装 Vmware虚拟机下Ubuntu 8.04安装可以分为两个部分:Vmware虚拟环境的安装和Ubuntu系统的安装。在Vmware虚拟环境的安装中,我们需要首先安装Vmware Workstation,然后创建一个新的...

    ubuntu8.04使用手册

    ubuntu8.04使用手册,ubuntu8.04使用手册ubuntu8.04使用手册,ubuntu8.04使用手册,ubuntu8.04使用手册,

    ubuntu8.04优化指南

    ### Ubuntu 8.04优化指南详解 #### 一、引言 Ubuntu 8.04 Hardy Heron 是一款备受瞩目的 Linux 发行版,它不仅提供了丰富的功能和优秀的用户体验,还特别注重系统的稳定性和安全性。然而,随着系统功能的增强,对...

    ubuntu8.04速成手册1.0.pdf

    《Ubuntu 8.04 速成手册1.0》是一本专为初学者设计的指南,旨在帮助读者快速掌握Ubuntu 8.04(Hardy Heron)这一经典Linux发行版的使用技巧。Ubuntu 8.04是Ubuntu系列的一个重要版本,发布于2008年,它的稳定性和...

    Ubuntu8.04安装配置大全

    ### Ubuntu 8.04 安装与配置详解 #### 一、系统初始化 系统初始化是确保Ubuntu系统正常运行的基础步骤。此阶段涉及到的操作主要包括硬盘分区、安装过程中的选择(如语言、时区等),以及安装后的基础设置,如更新...

    Ubuntu 8.04桌面版安装教程

    Ubuntu 8.04,代号Hardy Heron,是Ubuntu Linux发行版的一个重要版本,于2008年4月24日正式发布。这个版本为桌面用户提供了长达3年的安全更新支持,对于服务器用户则提供了5年的支持期,因此它对广泛的用户群体都...

    ubuntu8.04速成手册1.0.rar ubuntu8.04 ubuntu8安装与配置

    《Ubuntu 8.04速成手册1.0》是一份专为初学者设计的指南,旨在帮助用户快速掌握Ubuntu 8.04的操作系统安装、配置和日常使用技巧。Ubuntu 8.04,代号“Hardy Heron”,是Ubuntu Linux发行版的一个重要版本,发布于...

    ubuntu8.04速成手册

    《Ubuntu 8.04 速成手册》是一本针对初学者和中级用户的指南,旨在帮助读者快速掌握Ubuntu 8.04(Hardy Heron)操作系统的基本操作和高级技巧。Ubuntu是基于Debian的开源Linux发行版,以其用户友好、稳定性和安全性...

    同事安装ubuntu8.04和windows

    标题中的“同事安装Ubuntu 8.04和Windows”指的是在一个计算机系统中同时安装Ubuntu 8.04(一个基于Linux的开源操作系统)和Windows(微软的商业操作系统)的双系统配置。这样的设置允许用户根据需求在两个操作系统...

    ubuntu8.04手册05

    ubuntu 8.04使用手册

    如何在ubuntu8.04中安装中文输入法

    ### 如何在ubuntu8.04中安装中文输入法 #### 概述 本文将详细介绍如何在Ubuntu 8.04系统中安装并配置中文输入法。对于初次接触Ubuntu的用户来说,这是一个非常实用的指南。Ubuntu 8.04(Hardy Heron)是一款非常...

    ubuntu8.04完全安装指南

    【Ubuntu 8.04 完全安装指南】 在安装Ubuntu 8.04时,可能会遇到各种问题,本文档是根据个人经验和网络资源整理出的一份详细安装指南,特别适用于使用Wubi安装方法。Wubi是一种允许在Windows内安装Ubuntu的简便方式...

    79905-Ubuntu 8.04 GDM-LIST.tar.gz

    【标题】"79905-Ubuntu 8.04 GDM-LIST.tar.gz"揭示了这个压缩包文件是专门为Ubuntu 8.04操作系统设计的一个图形桌面管理器(GDM)主题集合。GDM,全称Gnome Display Manager,是GNOME桌面环境下的默认登录管理器,...

    ubuntu8.04中配置java+tomcat+eclipseMyEclipse开发环境(更新)

    在Ubuntu 8.04中配置Java、Tomcat与Eclipse MyEclipse开发环境是一项针对Web应用程序开发者的专业技能。本文将深入解析如何在Ubuntu 8.04系统上搭建这套开发环境,涵盖Java环境的配置、Tomcat服务器的安装与启动、...

    Ubuntu 8.04 Server版 安装图解

    Ubuntu 8.04 Server版安装图解 很完整

Global site tag (gtag.js) - Google Analytics