Asterisk Workshop 2011

Post on 09-Mar-2015

400 views 2 download

description

Asterisk Workshop Guide 2011, asterisk 1.8 complete installation on Ubuntu 10.04.2 LTS

Transcript of Asterisk Workshop 2011

AsterConference Jakarta 2011By

Anton Raharja

Basic of Linux Operating System◦ Ubuntu Server preparation and installation

Network card configuration

About Asterisk and DAHDI

Using Ubuntu Server 10.04.2 LTS◦ Install properly for ISO (burn to a CD)◦ Configure correct hostname, username and IP◦ Configure proper disk partitions Use 1 GB for SWAP

Use 10 GB at most for /

Use just about enough for /home

Use the rest of the space for /var

◦ Select nothing but OpenSSH server as a start◦ Prepare development environment

# apt-get update

# apt-get install build-essential linux-headers-`uname –r` libnewt-dev libusb-dev libncurses5-dev libmysqlclient15-dev libxml-dev libmpg123-dev zlib1g-dev

Linux CLI (Command Line Interface)◦ List : ls, lsmod, lsusb, lspci

◦ Process : ps, top

◦ Files : cd, cp, mv, rm, ln

◦ Read : cat, grep, tee, tail, more, less

◦ Editor : vi, mc, mcedit, nano

Use single or multiple network cards

Each may have lots of virtual IPs

Linux treats all IPs, virtual or physical, pretty much the same

Configure proper IP, route and DNS◦ IP configurations in file /etc/network/interfaces

◦ DNS configurations in file /etc/resolv.conf

Asterisk, an IP PBX software◦ Supports multi-protocol: SIP, IAX2, H.323, and

others

◦ Supports multi-codec: G711, G729, H264, and others

◦ Supports various standard PBX features

◦ Supports CTI

◦ Website: http://www.asterisk.org

Digium/Asterisk Hardware Device Interface◦ Open source device interface used to control

Digium and other telephony interface cards

◦ When you need to use voice cards with Asterisk, you need DAHDI. Or vendors drivers

◦ Most vendors used DAHDI or slightly modified DAHDI version

Pre-requisites for DAHDI

Pre-requisites for Asterisk

Asterisk installation from source codes

Basic Asterisk administration

Get dahdi-linux-complete 2.4.1.2 from http://www.asterisk.org

PRI device requires libpri (1.4.11.5), get it also from http://www.asterisk.org

Extract, compile and install libpri first

Extract, compile and install dahdi-linux-complete

Installation process will download firmware files from Internet

Get latest asterisk 1.8.4.3 from http://www.asterisk.org

Extract, compile and install asterisk◦ Sounds are downloaded from installation script

◦ Add-ons are configured from installation script

◦ Installation process will download sound files and some other libraries (iLBC and MP3 if selected) from Internet

LibPRI◦ # tar –zxf libpri-1.4.11.5.tar.gz◦ # cd libpri-1.4.11.5◦ # make && make install

DAHDI Linux Complete◦ # tar –zxf dahdi-linux-complete.-2.4.1.2tar.gz◦ # cd dahdi-linux-complete-2.4.1.2◦ # make◦ # make install◦ # make config

Asterisk◦ # tar –zxf asterisk-1.8.4.3.tar.gz◦ # cd asterisk-1.8.4.3◦ # ./configure◦ # make menuconfig◦ # make◦ # make install◦ # make samples

Asterisk configuration files

Asterisk context

SIP and IAX2 account

Asterisk folders◦ /etc/asterisk

◦ /var/spool/asterisk

◦ /var/log/asterisk

◦ /var/lib/asterisk

◦ /usr/lib/asterisk

Configuration files◦ All configuration files are inside /etc/asterisk

Dialplans : extensions.conf

Accounts : sip.conf, iax.conf

Voicemail : voicemail.conf

Contexts are the heart of asterisk configurations

Context is a grouping label for a set of options

Context may have multiple interpretation, it is depend on where the context reside◦ In sip.conf contexts are accounts◦ In extensions.conf contexts are group of dialplans

Context format:[context]

option=value

option=value

SIP accounts are configured in sip.conf IAX2 accounts are configured in iax.conf Context format are used to define a peer, a user or a

friend Account type peer are defining trunks, the other end is a

gateway or not a user Account type user are defining the other end is a user

agent (UA). UA will be registered to our asterisk Account type friend are defining both a peer and a user Example:

[voiprakyat]username=10001secret=mypwd123type=peercontext=from-trunk

Dialplan

Asterisk console

Logging and debugging

Configuration file: /etc/asterisk/extensions.conf

Each context is a group of dialplan sets

Format:[context]

exten = extension,priority,command

Example:[from-trunk]

exten = _9X.,1,Dial(DAHDI/g0/${EXTEN:1})

Entering asterisk console:◦ Type on Linux console: asterisk -r

Asterisk console commands:◦ System commands: core stop now core stop when convenient core restart now core restart when convenient Core show channels help

◦ SIP commands: sip show peer <peer/ext. number> sip show user <user/ext. number> sip show peers sip show users sip set debug <options>

Configuration file: /etc/asterisk/logger.conf◦ Remove comment mark in front of ‘full’ line for full

log messages

Log files: /var/log/asterisk

Realtime debugging◦ # tail –f /var/log/asterisk/full | tee x1.log

◦ Save x1.log for later reviews, or send it to experts when you need to

Thank you