18
Installing Installing Asterisk Asterisk Carl Davis Carl Davis Chief Architect, Stellar Chief Architect, Stellar System Technologies System Technologies Alex Vishnev Alex Vishnev Chief Technical Officer, ACN Chief Technical Officer, ACN

Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

Embed Size (px)

Citation preview

Page 1: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

Installing AsteriskInstalling Asterisk

Carl Davis Carl Davis Chief Architect, Stellar System Chief Architect, Stellar System

TechnologiesTechnologiesAlex VishnevAlex Vishnev

Chief Technical Officer, ACNChief Technical Officer, ACN

Page 2: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

PREREQUISITESPREREQUISITES

• Asterisk distribution – asterisk-1.2.3.tar Asterisk distribution – asterisk-1.2.3.tar provides SIP based VoIPprovides SIP based VoIP

• Zaptel library – zaptel-1.2.2.tar Digium Zaptel library – zaptel-1.2.2.tar Digium hardware supporthardware support

• PRI library – libpri-1.2.2.tar supports PRI library – libpri-1.2.2.tar supports ISDN PRI interfacesISDN PRI interfaces

• Asterisk Sounds distribution – asterisk Asterisk Sounds distribution – asterisk sounds-1.1.1.tar provides professionally sounds-1.1.1.tar provides professionally recorded prompts for use in your asterisk recorded prompts for use in your asterisk system. system.

Page 3: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

PREREQUISITESPREREQUISITES

• Linux distributionLinux distribution– RedHat Fedora Core (used in this RedHat Fedora Core (used in this

presentation)presentation)– DebianDebian– SuSESuSE– GentooGentoo– SlackwareSlackware– FreeBSDFreeBSD– And many more…And many more…

Page 4: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

PREREQUISITESPREREQUISITES

• GNU Compiler Collection (GCC), v3.0 or GNU Compiler Collection (GCC), v3.0 or higherhigher

• Make and bison – comes with most systemsMake and bison – comes with most systems• C library headers – glibc-devel packageC library headers – glibc-devel package• Curses graphics library – ncurses-devel Curses graphics library – ncurses-devel

packagepackage• Secure Socket library – openssl-develSecure Socket library – openssl-devel• Zlib Compression library – zlib-develZlib Compression library – zlib-devel• Newt Windowing Toolkit – libnewt-devel for Newt Windowing Toolkit – libnewt-devel for

use with zttool and ztcfg, very useful use with zttool and ztcfg, very useful utilitiesutilities

• Doxygen documentation tool - doxygenDoxygen documentation tool - doxygen

Page 5: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

PREREQUISITESPREREQUISITES

• Root login permissionsRoot login permissions• Local or remote terminal console – Local or remote terminal console –

telnet sessions work fine as long as telnet sessions work fine as long as the server allows root login from a the server allows root login from a telnet session.telnet session.

• General Knowledge of Linux General Knowledge of Linux commandscommands– tar, vi, emacs, pico, etc, ftp and other tar, vi, emacs, pico, etc, ftp and other

administrative commandsadministrative commands

Page 6: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

PREREQUISITESPREREQUISITES• Now, with all that said, you really don’t Now, with all that said, you really don’t

need knowledge of all that. Get the book need knowledge of all that. Get the book “Asterisk: The Future of Telephony” from “Asterisk: The Future of Telephony” from asteriskdocs.org, go to chapter 3 and type asteriskdocs.org, go to chapter 3 and type in each thing they have written. When in each thing they have written. When you get into trouble, go to the Asterisk you get into trouble, go to the Asterisk wiki at voip-info.org. You haven’t done wiki at voip-info.org. You haven’t done anything that someone else hasn’t already anything that someone else hasn’t already done. If you have, try for a prize done. If you have, try for a prize ..

Ready to Start?Ready to Start?

Page 7: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

Obtaining the Source Obtaining the Source CodeCode

• FTP from asterisk.orgFTP from asterisk.org• These generally resolve to ftp.digium.comThese generally resolve to ftp.digium.com• Mirror sites are availableMirror sites are available• Current stable version of Asterisk is Current stable version of Asterisk is

1.2.3(01/26/2006)1.2.3(01/26/2006)• Asterisk 2.0 is in betaAsterisk 2.0 is in beta• The transfer supplies “tarballs”, tar.gz files The transfer supplies “tarballs”, tar.gz files

containing source archivescontaining source archives• Refer to asterisk.org for source code access Refer to asterisk.org for source code access

via the Subversion source control systemvia the Subversion source control system

Page 8: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

Extracting the Source Extracting the Source CodeCode

• Copy the tar.gz archives into /usr/srcCopy the tar.gz archives into /usr/src• Change directory to /usr/srcChange directory to /usr/src• Extract the source code from the Extract the source code from the

archivesarchives– tar zxvf zaptel-*.tar.gztar zxvf zaptel-*.tar.gz– tar zxvf libpri-*.tar.gztar zxvf libpri-*.tar.gz– tar zxvf asterisk-*.tar.gztar zxvf asterisk-*.tar.gz– tar zxvf asterisk-*.tar.gztar zxvf asterisk-*.tar.gz

• The files will be extracted into their The files will be extracted into their respective directories.respective directories.

Page 9: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

Building ZaptelBuilding Zaptel• cd /usr/src/zaptel-*cd /usr/src/zaptel-*• make cleanmake clean[root@stellar zaptel-1.2.2]# make clean[root@stellar zaptel-1.2.2]# make clean

– rm -f torisatool makefw tor2fw.h radfw.hrm -f torisatool makefw tor2fw.h radfw.h– rm -f ztcfg torisatool makefw ztmonitor ztspeed zttool rm -f ztcfg torisatool makefw ztmonitor ztspeed zttool

zttest fxotunezttest fxotune– rm -f *.o ztcfg tzdriver sethdlc sethdlc-newrm -f *.o ztcfg tzdriver sethdlc sethdlc-new

• makemake[root@stellar zaptel-1.2.2]# make[root@stellar zaptel-1.2.2]# make

– cc -I. -O4 -g -Wall -DBUILDING_TONEZONE -cc -I. -O4 -g -Wall -DBUILDING_TONEZONE -DSTANDALONE_ZAPATA -DZAPTEL_CONFIG=\"/etc/zaptel.conf\" DSTANDALONE_ZAPATA -DZAPTEL_CONFIG=\"/etc/zaptel.conf\" -c -o gendigits.o gendigits.c -c -o gendigits.o gendigits.c

– cc -o gendigits gendigits.o -lmcc -o gendigits gendigits.o -lm– ./gendigits./gendigits– ZAPTELVERSION="" build_tools/make_version_h > version.h.tmpZAPTELVERSION="" build_tools/make_version_h > version.h.tmp– if cmp -s version.h.tmp version.h ; then echo; else \if cmp -s version.h.tmp version.h ; then echo; else \– mv version.h.tmp version.h ; \mv version.h.tmp version.h ; \

• make installmake install

Page 10: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

Building libpriBuilding libpri• cd /usr/src/libpri-*cd /usr/src/libpri-*• make cleanmake clean• [root@stellar zaptel-1.2.2]# cd ../libpri-*[root@stellar zaptel-1.2.2]# cd ../libpri-*• [root@stellar libpri-1.2.2]# make clean[root@stellar libpri-1.2.2]# make clean

– rm -f *.o *.so *.lo *.so.1 *.so.1.0rm -f *.o *.so *.lo *.so.1 *.so.1.0– rm -f testpri testprilib libpri.a libpri.so.1.0rm -f testpri testprilib libpri.a libpri.so.1.0– rm -f pritest pridumprm -f pritest pridump– rm -f .dependrm -f .depend

• makemake– CC=gcc ./mkdep -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g `ls *.c`CC=gcc ./mkdep -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g `ls *.c`– gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o copy_string.o copy_string.cgcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o copy_string.o copy_string.c– gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o pri.o pri.cgcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o pri.o pri.c– gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o q921.o q921.cgcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o q921.o q921.c– gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o prisched.o prisched.cgcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o prisched.o prisched.c– gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o q931.o q931.cgcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o q931.o q931.c– gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o pri_facility.o pri_facility.cgcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o pri_facility.o pri_facility.c– ar rcs libpri.a copy_string.o pri.o q921.o prisched.o q931.o pri_facility.oar rcs libpri.a copy_string.o pri.o q921.o prisched.o q931.o pri_facility.o– CC=gcc ./mkdep -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g `ls *.c`CC=gcc ./mkdep -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g `ls *.c`– gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o copy_string.o copy_string.cgcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o copy_string.o copy_string.c– gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o pri.o pri.cgcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o pri.o pri.c– gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o q921.o q921.cgcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o q921.o q921.c– gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o prisched.o prisched.cgcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o prisched.o prisched.c– gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o q931.o q931.cgcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o q931.o q931.c– gcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o pri_facility.o pri_facility.cgcc -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -c -o pri_facility.o pri_facility.c– ar rcs libpri.a copy_string.o pri.o q921.o prisched.o q931.o pri_facility.oar rcs libpri.a copy_string.o pri.o q921.o prisched.o q931.o pri_facility.o

• make installmake install

Page 11: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

Building AsteriskBuilding Asterisk

• cd /usr/src/asterisk-*cd /usr/src/asterisk-*• make cleanmake clean• makemake• make installmake install

Page 12: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

Installing AsteriskInstalling Asterisk• +---- Asterisk Installation Complete ------------------------------++---- Asterisk Installation Complete ------------------------------+• + ++ +• + YOU MUST READ THE SECURITY DOCUMENT + + YOU MUST READ THE SECURITY DOCUMENT + • + ++ +• + Asterisk has successfully been installed. ++ Asterisk has successfully been installed. +• + If you would like to install the sample ++ If you would like to install the sample +• + configuration files (overwriting any ++ configuration files (overwriting any +• + existing config files), run: ++ existing config files), run: +• + ++ +• + make samples ++ make samples +• + ++ +• +----------------- or ----------------------------------------------------++----------------- or ----------------------------------------------------+• + ++ +• + You can go ahead and install the asterisk ++ You can go ahead and install the asterisk +• + program documentation now or later run: ++ program documentation now or later run: +• + ++ +• + make progdocs ++ make progdocs +• + ++ +• + **Note** This requires that you have ++ **Note** This requires that you have +• + doxygen installed on your local system + + doxygen installed on your local system + • +-------------------------------------------------------------------------++-------------------------------------------------------------------------+

Page 13: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

Installing AsteriskInstalling Asterisk

• make samplesmake samples– Installs the sample configuration files in the Installs the sample configuration files in the

/etc/asterisk directory/etc/asterisk directory

• make progdocsmake progdocs– Installs the Asterisk program documentation. Installs the Asterisk program documentation.

This uses doxygen to generate the This uses doxygen to generate the documentation from the source and some areas documentation from the source and some areas are documented better than othersare documented better than others

• make configmake config– Configures the Linux system to execute Configures the Linux system to execute

Asterisk automatically on system startupAsterisk automatically on system startup

Page 14: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

Commonly Used CLI Commonly Used CLI OptionsOptions

• -c– Console. This allows you to connect to the

Asterisk CLI. Example: asterisk -c

• -v– Verbosity. This is used to set the amount of

output for CLI debugging. Example: asterisk –vc or asterisk -vvvvvvc

• -r– Remote. This is used to reconnect remotely to

an already running Asterisk process. Example: asterisk -vr

Page 15: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

Starting AsteriskStarting Asterisk• [root@stellar asterisk-1.2.2]# asterisk -vvvc[root@stellar asterisk-1.2.2]# asterisk -vvvc

== Parsing '/etc/asterisk/asterisk.conf': Found== Parsing '/etc/asterisk/asterisk.conf': Found == Parsing '/etc/asterisk/extconfig.conf': Found== Parsing '/etc/asterisk/extconfig.conf': FoundAsterisk 1.2.2, Copyright (C) 1999 - 2006 Digium, Inc. and othersAsterisk 1.2.2, Copyright (C) 1999 - 2006 Digium, Inc. and othersCreated by Mark Spencer <[email protected]>Created by Mark Spencer <[email protected]>Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show warranty' for Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show warranty' for

details.details.This is free software, with components licensed under the GNU General PublicThis is free software, with components licensed under the GNU General PublicLicense version 2 and other licenses; you are welcome to redistribute it underLicense version 2 and other licenses; you are welcome to redistribute it undercertain conditions. Type 'show license' for details.certain conditions. Type 'show license' for details.==============================================================================================================

================== Parsing '/etc/asterisk/logger.conf': Found== Parsing '/etc/asterisk/logger.conf': FoundAsterisk Event Logger Started /var/log/asterisk/event_logAsterisk Event Logger Started /var/log/asterisk/event_log== Parsing '/etc/asterisk/dnsmgr.conf': Found== Parsing '/etc/asterisk/dnsmgr.conf': FoundAsterisk Dynamic Loader loading preload modules:Asterisk Dynamic Loader loading preload modules:== Parsing '/etc/asterisk/modules.conf': Found== Parsing '/etc/asterisk/modules.conf': Found== Manager registered action Ping== Manager registered action Ping== Manager registered action Events== Manager registered action Events== Manager registered action Logoff== Manager registered action Logoff== Manager registered action Hangup== Manager registered action HangupAsterisk Ready.Asterisk Ready.

Page 16: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

Getting HelpGetting Help

• *CLI> help*CLI> help

! Execute a shell command! Execute a shell command

abort halt Cancel a running haltabort halt Cancel a running halt

add extension Add new extension into contextadd extension Add new extension into context

add ignorepat Add new ignore patternadd ignorepat Add new ignore pattern

add queue member Add a channel to a add queue member Add a channel to a specified queuespecified queue

ael debug contexts Enable AEL contexts debugael debug contexts Enable AEL contexts debug

ael debug macros Enable AEL macros debugael debug macros Enable AEL macros debug

……

Page 17: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

Starting Asterisk ServiceStarting Asterisk ServiceRe-Attaching to Asterisk Re-Attaching to Asterisk

ConsoleConsoleIf you ran the make config command earlier or manually If you ran the make config command earlier or manually

copied the initialization scripts, use them to start copied the initialization scripts, use them to start Asterisk. Otherwise, run the executable from /usr/sbin.Asterisk. Otherwise, run the executable from /usr/sbin.

• [root@stellar asterisk-1.2.2]# /etc/rc.d/init.d/asterisk start[root@stellar asterisk-1.2.2]# /etc/rc.d/init.d/asterisk startStarting asterisk: [ OK ]Starting asterisk: [ OK ]

• [root@stellar asterisk-1.2.2]# asterisk -vvvr[root@stellar asterisk-1.2.2]# asterisk -vvvr == Parsing '/etc/asterisk/asterisk.conf': Found== Parsing '/etc/asterisk/asterisk.conf': Found == Parsing '/etc/asterisk/extconfig.conf': Found== Parsing '/etc/asterisk/extconfig.conf': Found

Asterisk 1.2.2, Copyright (C) 1999 - 2006 Digium, Inc. and others.Asterisk 1.2.2, Copyright (C) 1999 - 2006 Digium, Inc. and others.Created by Mark Spencer <[email protected]>Created by Mark Spencer <[email protected]>Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show warranty' for Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show warranty' for details.details.This is free software, with components licensed under the GNU General This is free software, with components licensed under the GNU General PublicPublicLicense version 2 and other licenses; you are welcome to redistribute it License version 2 and other licenses; you are welcome to redistribute it underundercertain conditions. Type 'show license' for details.certain conditions. Type 'show license' for details.

==================================================================================================================Connected to Asterisk 1.2.2 currently running on stellar (pid = 20077)Connected to Asterisk 1.2.2 currently running on stellar (pid = 20077)remote UNIX connection Verbosity is at least 3remote UNIX connection Verbosity is at least 3stellar*CLI>stellar*CLI>

Page 18: Installing Asterisk Carl Davis Chief Architect, Stellar System Technologies Alex Vishnev Chief Technical Officer, ACN

Q&AQ&A• Alex VishnevAlex Vishnev• Chief Technical Officer, Chief Technical Officer,

VoIPVoIP• 13620 Reese Blvd. Ste. 13620 Reese Blvd. Ste.

400400• Huntersville, NC 28078Huntersville, NC 28078• Office (704) 632-3682Office (704) 632-3682• Mobile (704) 778-7260Mobile (704) 778-7260• Fax (704) 947-7112Fax (704) 947-7112• Email Email

[email protected]@acninc.com• Website Website http://http://

www.acninc.comwww.acninc.com

• Carl DavisCarl Davis• Chief ArchitectChief Architect• Stellar System Stellar System

TechnologiesTechnologies• 35 Pinecrest Dr.35 Pinecrest Dr.• Rochester, NY 14617-Rochester, NY 14617-

22212221• (585) 317-4170(585) 317-4170• Email Email

carl_davis@[email protected]

• Website Website http://www.stellarsystehttp://www.stellarsystech.comch.com