Chinaunix首页 | 论坛 | 博客
  • 博客访问: 267749
  • 博文数量: 82
  • 博客积分: 2477
  • 博客等级: 大尉
  • 技术积分: 725
  • 用 户 组: 普通用户
  • 注册时间: 2009-06-06 23:24
文章分类

全部博文(82)

文章存档

2013年(1)

2012年(3)

2011年(15)

2010年(36)

2009年(27)

分类: 系统运维

2009-07-08 14:30:54

 

只是debian 的设置,大家看看。

In this tutorial, I will describe how to install and configureAsterisk 1.6 on a Debian system to work with PostgreSQL in order tomanage (Call Detail Records) and .
For this we will use a clean and up-to-date Debian Etch/Lennysystem; the first step is to reconfigure the kernel with some newparameters so that it supports Asterisk optimally.
====安装软件包======

apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 build-essential

====下载 内核 2.6.26 ======
cd /usr/src

Download the kernel source, I will use 2.6.26:
wget
tar xfv linux-2.6.26.8.tar.gz
ln -s /usr/src/linux-2.6.26.8 /usr/src/linux
cd /usr/src/linux
make clean && make mrproper
cp /boot/config-`uname -r` ./.config
make menuconfig
选择内核选项:
Processor type and features >>
  • IRQ balancing
    Processor type and features >> Timer frequency = 1000 Hz.
    Processor type and features >>
  • High Resolution Timer Option
    Processor type and features >>
  • HPET Timer Support
    Device Drivers >> Character Devices >>
  • Enchanced Real Time Clock Support
    Library Routines >>
  • CONFIG_CRC_CCITT
    编译 内核

    Now compile and make a .deb package for the kernel:
    make-kpkg clean
    fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers
    安装内核:  
    cd /usr/src
    dpkg -i *.deb
    重新启动:
    reboot -t now!
    Ok, now we have the system fully optimized for best performance withVoIP. Now we prepare the machine for compiling Asterisk from thesources:

    =========安装软件包==========

    apt-get install build-essential libcurl3-dev libvorbis-dev libspeex-dev unixodbc unixodbc-dev libiksemel-dev
    apt-get install flex xsltproc odbc-postgresql libusb-dev libnewt-dev libxml2-dev bison
    apt-get install linux-headers-`uname -r` g++ libncurses5-dev libnewt-dev libusb-dev subversion git-core
    apt-get install postgresql-8.1 postgresql-contrib-8.1 postgresql-client-8.1 postgresql-dev
    下载 svn asterisk 代码 Asterisk 1.6, DAHDI, mISDN forISDN trunks:
    =========================

    cd /usr/src
    mkdir asterisk
    cd asterisk
    svn co asterisk

    svn co asterisk-addons

    svn co dahdi-linux
    svn co dahdi-tools
    svn co libpri

    ===下载 dahdi=======
    cd /usr/src/asterisk/dahdi-linux
    make&& make install

    cd /usr/src/asterisk/dahdi-tools
    ./configure
    make menuselect
    make
    make install
    make config

    ===安装 PRI, 如果需要的话===

    cd /usr/src/asterisk/libpri
    make && make install



    ====编译 postgres===
    cd /usr/src/asterisk
    wget
    su - postgres
    createuser -s -D -R -l -P -e asteriskcreatedb -O asterisk -e asteriskDB
    pgsql -U asterisk -h localhost -d asteriskDB < /usr/src/asterisk/realtime_pgsql.sql

    ===连接asterisk, postgres====

    echo "local     asteriskDB     asterisk     md5" >> /etc/postgresql/8.1/pg_hba.conf

    ====编辑 设置文件=========
    nano /etc/asterisk/cdr_pgsql.conf
    =====================
    [global]
    hostname=localhost
    port=5432
    dbname=asteriskDB
    password=password
    user=asterisk
    table=cdr
    ====================================
    nano /etc/asterisk/extconfig.conf
    ====================================
    [settings]
    extensions => pgsql,asteriskDB,extensions_conf
    sipuser => pgsql,asteriskDB,sip_conf
    sippeers => pgsql,asteriskDB,sip_conf
    sipregs => pgsql,asteriskDB,sip_conf
    voicemail => pgsql,asteriskDB,voicemail_users
    queues => pgsql,asteriskDB,queue_table
    queue_members => pgsql,asteriskDB,queue_member_table

    ==================================
    nano /etc/asterisk/res_pgsql.conf
    =================================
    [general]
    dbhost=127.0.0.1
    dbport=5432
    dbname=asteriskDB
    dbuser=asterisk
    dbpass=password
    requirements=warn



    =========启动 asterisk===========================
    /etc/init.d/asterisk restart
    =================================================
    资料来源:
    链接:



    to*
  • 阅读(1191) | 评论(0) | 转发(0) |
    给主人留下些什么吧!~~