Вы находитесь на странице: 1из 5

How to Install and Configure Asterisk with Mysql on Centos

Aug

4

Related 1. How To Results Install and Configure Asterisk

w w w .Answ ered-Questions.com

Top LINUXGURRU answers for How To Install and Configure Asterisk with Mysql on Centos |

2. Looking for How To Install and Configure

w w w .InternetCorkBoard.com

Top LINUXGURRU answers for How To Install and Configure Asterisk with Mysql on Centos |

Chitika |

Opt out?

I N U X G U R R U answers for How To Install and Configure
I N U X G U R R U answers for How To Install and Configure

1) yumupdate

2) yuminstallgccgcc-c++makeopenssl-develnewt-develncurses-devellibtermcap-

devellibxml2-develkernel-develperlcurlcurl-devel

3) yuminstalllibtool-ltdllibtool-ltdl-develunixODBC-develmysqlmysql-devel mysql-servermysql-connector-odbc

4) yum-yinstallgccgcc-c++kernel-develbisonopenssl-devellibtermcap-devel

ncurses-develdoxygencurl-develnewt-develmlocatelynxtarwgetnmapbzip2mod_ssl

unixODBCunixODBC-devellibtool-ltdllibtool-ltdl-develmysql-connector-odbcmysql mysql-devel mysql-server php-mysql php-mbstring php-mcrypt flex screen libxml2

libxml2-devellibtifflibtiff-develgmimegmime-develnet-snmp-utilsnet-snmp-devel

neonlibxml2opensslopenssl-develgnutls-develgnutls-utils

5) cd/usr/src #mkdirasterisk #cdasterisk # wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-

1.6.2.0.tar.gz

#

1.6.2.0.tar.gz

#wgethttp://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-

complete-current.tar.gz

#wgethttp://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz

http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-addons-

wget

#tarzxvfasterisk-1.6.2.0.tar.gz

#tarzxvfasterisk-addons-1.6.2.0.tar.gz

#tarzxvfdahdi-linux-complete-current.tar.gz

#tarzxvflibpri-1.4-current.tar.gz

6) # cd /usr/src/asterisk/libpri-1.4.10.2

# make clean

# make

# make install

7) # cd /usr/src/asterisk/dahdi-linux-complete-2.2.1-rc2+2.2.1-rc2/

# make all

# make install

# make config

# chkconfig dahdi on

Be sure to run the mysql_secure_installation script after you start MySQL in order to set up a root password to protect your SQL databases!

Next, let’s setup our MySQL database for CDR (Call Detail Records) storage.

# service dahdi start

for CDR (Call Detail Records) storage. # service dahdi start Search Blogroll ITbunch Latest news on
Search
Search

Search

Recent Posts

# chkconfigmysqldon

# service mysqld start

# /usr/bin/mysql_secure_installation

# mysql –p

Run The Following sql quries.

SET SQL_MODE=”NO_AUTO_VALUE_ON_ZERO”;

CREATE

latin1_swedish_ci;

DATABASE

USE `asterisk`;

`asterisk`

DEFAULT

CHARACTER

CREATE TABLE IF NOT EXISTS `cdr` (

SET

latin1

COLLATE

`recid` mediumint(8) unsigned NOT NULL auto_increment COMMENT ‘Record ID’,

`calldate` datetime NOT NULL default ’0000-00-00 00:00:00′,

`clid` varchar(80) NOT NULL default ”,

`src` varchar(80) NOT NULL default ”,

`dst` varchar(80) NOT NULL default ”,

`dcontext` varchar(80) NOT NULL default ”,

`channel` varchar(80) NOT NULL default ”,

`dstchannel` varchar(80) NOT NULL default ”,

`lastapp` varchar(80) NOT NULL default ”,

`lastdata` varchar(80) NOT NULL default ”,

`duration` int(11) NOT NULL default ’0′,

`billsec` int(11) NOT NULL default ’0′,

`disposition` varchar(45) NOT NULL default ”,

`amaflags` int(11) NOT NULL default ’0′,

`accountcode` varchar(20) NOT NULL default ”,

`uniqueid` varchar(32) NOT NULL default ”,

`userfield` varchar(255) NOT NULL default ”,

PRIMARY KEY

(`recid`),

KEY `calldate` (`calldate`),

KEY `dst` (`dst`),

KEY `accountcode` (`accountcode`),

KEY `src` (`src`),

KEY `disposition` (`disposition`),

KEY `uniqueid` (`uniqueid`)

) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

Now create database user by running the following commands

CREATE USER ‘asterisk’@'localhost’ IDENTIFIED BY ‘PASSWORD’;

GRANT FILE ON * . * TO ‘asterisk’@'localhost’ IDENTIFIED BY ‘PASSWORD’ WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0

MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

GRANT INSERT ON `asterisk`.`cdr` TO ‘asterisk’@'localhost’;

Be sure to set your own password for the asterisk user (where I used ‘PASSWORD’ in the above block).

Now, we’ve got all the prerequisites installed. Let’s install Asterisk!

8) #cd/usr/src/asterisk/asterisk-1.6.2.0/ #makeclean #./configure #makemenuselect

This is where you select all of the modules, applications, resource modules, codecs, sound packages, etc, that you want installed with Asterisk. Move through menus using the up and down arrow keys, go to the options pane using tab, move up and down through the options and select items using the enter key, and then when you’re ready to save your selections, tab to the “Save and Exit” button and press enter again.

tab to the “Save and Exit” button and press enter again. # make # make install

# make

# make install

# make samples

# make config

# chkconfig asterisk on

9) # asterisk -vvvvc *CLI> core stop now Next, we need to install some of the options from the Asterisk-Addons download.

# cd /usr/src/asterisk/asterisk-addons-1.6.2.0

# make clean

# ./configure

# make menuselect

At this point, be sure to select at least the following items:

• Applications – app_addon_sql_mysql

• Call Detail Recording – cdr_addon_mysql

• Resource Modules – res_config_mysql

After you’ve got those selected, save and exit. Then proceed with the following steps:

# make

# make install

# make samples

Once we’ve got that done, we need to edit the cdr_mysql.conf file to enter the mysql username and password, database, and table we setup earlier.

# vi /etc/asterisk/cdr_mysql.conf [global] hostname=localhost dbname=asterisk table=cdr password=PASSWORD

user=asterisk

port=3306

sock=/var/lib/mysql/mysql.sock

userfield=1

loguniqueid=yes

You should read through several of the key configuration files in order to learn what’s changed, and also how to customize Asterisk for your installation. The files to look into would be:

/etc/asterisk/asterisk.conf

/etc/asterisk/extensions.ael

/etc/asterisk/extensions.conf

/etc/asterisk/sip.conf

/etc/asterisk/iax.conf

/etc/asterisk/voicemail.conf

/etc/asterisk/users.conf

The installation steps are complete and asterisk is running now

Now

extension.conf

we need to configure 2 files for setup first one is sip.conf and other one is

Sip.conf setting

[008] ; this is template. type=friend context=internal host=dynamic disallow=all allow=ulaw allow=alaw

allow=g723

allow=g729

dtmfmode=rfc2833

username=008

secret=008

Another Template

[007] ; this is template. type=friend context=internal host=dynamic disallow=all allow=ulaw allow=alaw

allow=g723

allow=g729

dtmfmode=rfc2833

username=007

secret=007

Just save it and then open extensions.conf file and add it [internal]

exten=> _XXX,1,Dial(SIP/${EXTEN})

exten=> _XXX,1,Dial(SIP/${EXTEN})

After that you can setup setting in your Xlite and connected successfully

Related Posts:

Related 1. How To Results Install and Configure Asterisk

2. Looking for How To Install and

3. Looking For How To Install and

4. Looking for How To Install and

5. Searching for How To Install and

How To Install and 4 . Looking for How To Install and 5 . Searching for

Chitika |

Opt out?

How To Install and 4 . Looking for How To Install and 5 . Searching for

Most Viewed Posts Today:

Submit Reply

RSS

Copyright © 2013 LINUXGURRU All rights reserved.