Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Download & build:

Code Block

wget [http://ftp.digium.com/pub/asterisk/releases/asterisk-1.4.1.tar.gz]
wget [http://ftp.digium.com/pub/zaptel/zaptel-1.2.15.tar.gz]
wget [http://ftp.digium.com/pub/libpri/libpri-1.4.0.tar.gz]

tar zxvf zaptel-1.2.15.tar.gz

cd zaptel-1.2.15/

make

make install

cd ..

tar zxvf libpri-1.4.0.tar.gz

cd libpri-1.4.0/

make

make install

cd ..

tar zxvf asterisk-1.4.1.tar.gz

cd asterisk-1.4.1/

./configure

make menuconfig


 
                                                                 Asterisk Module Selection

                                                                     Press 'h' for help.
                                                              \---> 1.  Applications
                                                                    2.  Call Detail Recording
                                                                    3.  Channel Drivers
                                                                    4.  Codec Translato
                                                                    5.  Format Interpreters
                                                                    6.  Dialplan Functions
                                                                    7.  PBX Modules
                                                                    8.  Resource Modues
                                                                    9.  Voicemail Build Options
                                                                   10. Compiler Flags
                                                                   11. Module Embedding
                                                                   12. Core Sound Packages
                                                                   13. Music On Hold File Packages
                                                                   14. Extras Sound Packages
\\
\---------------------------------------------------------------------------------------------------------Navigate with these commands:
scroll        => up/down arrows
(de)select    => Enter
select all    => F8
deselect all  => F7
back          => left arrow
quit          => q
save and quit => x
Most of the *make menuconfig* options are self-explanatory, provided you know what the various applications or modules are for. When in doubt, accept the defaults. At worst you'll install something you don't need, or have to go back and add something later

In the bottom of menu you will see the dependences of the module you are selecting.
\\

Exit and save with x and write:
\\

make
\\

If you want samples and documentation:
\\

make samples

make progdocs
\\

And finally installation:
\\

make install
\\
\\

...

This file follows the general syntax in configuration files. They are composed by sections, variables and values in this way:

[SECTION1]

Variable1=value1

...

Variable1=value1

Variable2=value2

....

There is a [general] section where you can define the general parameters of sip channels. For example:
general
port = 5060 ; Port to bind to
bindaddr = 0.0.0.0 ; Address to bind to
context = sip ;default 'sip' context for incoming calls

You have to define one section for each sip telephone so:

Code Block

[phone1]
type=friend
host=dynamic
defaultip=192.168.1.4
;username=blah
;secret=blah
dtmfmode=rfc2833 ; Choices are inband, rfc2833, or info
mailbox=1000 ; Mailbox for message waiting indicator
context=sip
callerid="Me" <2124>

 
[phone2]
type=friend
;secret=blah
host=dynamic
defaultip=192.168.1.3
dtmfmode=rfc2833 ; Choices are inband, rfc2833, or info
mailbox=1000 ; Mailbox for message waiting indicator
context=sip
callerid="Mini Me" <2123>

...

One of the most important ideas behind Asterisk is: an extension is a program that defines what will happen when a number is called. And this is done in extensions.conf that implements the dialing plan.

The syntax is similar to sip.conf with several sections:

...

  • When you define the extensions within a context, you may not only use literal numbers, not only alphanumeric names, but also you may define extensions that match whole sets of dialed numbers by using extension patterns.

The general syntax of extensions is:

exten => extension number, command priority, command

  • Where exten if fixed
  • Extension number is the number called
  • Command priority is the order the commands are to be run
  • Command is what is going to be done

Example:exten => 1,1,Dial(SIP/phone1,20,tr)
exten => 2,1,Dial(SIP/phone2,20,tr)
exten => 1000,1,Dial(SIP/phone1&SIP/phone2,20,tr)
* When somebody calls 1 the sip phone1 will ring for 20 seconds if nobody answer the call will fail. This sip phone has to be defined in sip.conf.

  • When somebody calls 2 the sip phone2 will ring for 20 seconds if nobody answer the call will fail.
  • If somebody call 1000 then the phone1 and phone2 will ring in parallel until one of them answer or 20 secons period finish. Since an extension may have a number of commands there may be multiple entries for an extension.

The complete extensions.conf file is:

Code Block

[general]
;
; If static is set to no, or omitted, then the pbx_config will rewrite
; this file when extensions are modified. Remember that all comments
; made in the file will be lost when that happens.
;
; XXX Not yet implemented XXX
;
static=yes
;
; if static=yes and writeprotect=no, you can save dialplan by
; CLI command 'save dialplan' too
;
writeprotect=no
; If clearglobalvars is not set, then global variables will persist
; through reloads, and even if deleted from the extensions.conf or
; one of its included files, will remain set to the previous value.
;
clearglobalvars=no
;
; User context is where entries from users.conf are registered. The
; default value is 'default'
;
userscontext=sip
;
; The "Globals" category contains global variables that can be referenced
; in the dialplan with the GLOBAL dialplan function:
; $

{GLOBAL(VARIABLE)}\\
\\
\\
\\
\\
\\
\\
\\

; ${${GLOBAL(VARIABLE)}} or ${text${GLOBAL(VARIABLE)}} or any hybrid

; Unix/Linux environmental variables can be reached with the ENV dialplan

; function: $
\\
{ENV(VARIABLE)}\\
\\
\\
\\
\\
\\
\\
\\

;
[globals]
CONSOLE=Console/dsp                     ; Console interface for demo
; Context sip
[sip]
exten => 1,1,Dial(SIP/phone1,20,tr)
exten => 2,1,Dial(SIP/phone2,20,tr)
exten => 1000,1,Dial(SIP/phone1&SIP/phone2,20,tr)
\\
\\
\\

...

If you installed Asterisk in /usr/sbin, then to run it write:

#/usr/sbin/asterisk

To enter in CLI interface run:

Code Block

\#/usr/sbin/asterisk \-rcvvvv

Asterisk 1.4.0, Copyright (C) 1999 - 2006 Digium, Inc. and others.

Created by Mark Spencer <markster@digium.com>

Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.

This is free software, with components licensed under the GNU General Public

License version 2 and other licenses; you are welcome to redistribute it under

certain conditions. Type 'core show license' for details.

=========================================================================

== Parsing '/etc/asterisk/asterisk.conf': Found

== Parsing '/etc/asterisk/extconfig.conf': Found

Connected to Asterisk 1.4.0 currently running on lab2 (pid = 2448)

\-\- Remote UNIX connection

Verbosity is at least 15

lab2*CLI>
\\

...

  • sip reload: Reloads the SIP channel module.This is the equivalent of performing a reload chan_sip.so. Reloading the SIP channel is required to load changes to sip.conf and sip_notify.conf into memory. Active SIP channels are not dropped during a sip reload.
  • stop gracefully: Stops the system when all currently active calls have completed, and does not accept new calls.
  • stop now: Stops immediately, terminating all active calls.
  • stop when convenient: Stops the system when all currently active calls have completed.New calls are accepted, and the system will stop only when there are no longer any active calls.Using this command is not a good idea, since you have no real way of knowing when the necessary condition for stopping the system will occur.

Basic ASTERISK installation (1.4.1)

...