Asterisk: Open Source your Phone System
Brian Kidney
March 11, 2008
Overview
- PBX
- VOIP
- VOIP Standards
- Telecom Terminology
- Asterisk
- Functions
- Setup
- Examples
- Demonstration
VOIP
- Private Branch eXchange
- "Dial 9 to get out."
- Allow groups to use more phones with limited number of lines.
- Features tied to the system, not the telecom providers.
VOIP
- Voice Over Internet Protocol
- A blanket name for many technologies.
- Basically: Using packet switch IP networks to transmit telecom data.
- Traditional Networks are circuit switched.
- Examples include Skype, Google Talk, Voyage
VOIP Standards
- Session Initialization Protocol
- Real Time Protocol
- SIP is for call setup and tear down.
- RTP is for data transmission.
- There is no data encryption defined in the standards.
Telecom Terminology
- FXS - Foreign eXchange Station
- FXS generates dialtone (i.e. telecom switch).
- FXO- Foreign eXchange Office
- FXO accepts dialtone (i.e. simple telephone handset).
- Signalling Methods
- GroundStart: Grounds a lead to request dialtone.
- LoopStart: Create a short to request dialtone. (Common in North America)
- KewlStart: Like LoopStart but with added intelligence. (Asterisk Perferred).
Asterisk
- Open source PBX and Telephony Platform.
- Design for Linux, but can run on Unix, OSX.
- Commmunity lead by Mark Spencer.
- Commercial support provided by Digium.
- www.asterisk.org
Asterisk - Features
- VoIP (SIP, IAX, Cisco Skinny, ...)
- Voicemail w/ Email Delivery
- Music On Hold
- Distinctive Ring
- E911
- Trunking
- Zapateller
Asterisk - Setup
- Software Components
- Asterisk
- Hardware Interface (Optional - Zaptel for Demo)
- Web Interface (Optional)
- Gentoo has E-Builds for Asterisk and Zaptel
- Web Interface available for Configuration
- But where is the fun in that?
Asterisk - Setup (Continued...)
- zaptel.conf - Hardware Interface Setup
- zapata.conf - Hardware Channels Setup
- sip.conf - SIP Channels Setup
- iax.conf - IAX Channels Setup
- extesions.conf - Dialpan Setup
- voicemail.conf - Voicemail Setup
- musiconhold.conf - Music On Hold Setup
Asterisk - Examples
[general]
context=Internal ; Default context for incoming calls
bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; Sample SIP Phone Setup
[brian]
type=friend
callerid="Brian Kidney" <1234>
host=dynamic ; This device needs to register
fromuser=brian
nat=yes ; X-Lite is behind a NAT router
canreinvite=no ; Typically set to NO if behind NAT
disallow=all
allow=ulaw
allow=alaw
secret=password
Asterisk - Examples
[Internal]
; Extension 1234 - SIP Phone
; Voice mail if no answer
; Different messages for busy/unavailable
exten => 1234,1,Verbose(1|Extension 1234)
exten => 1234,n,Dial(SIP/brian,10)
exten => 1234,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?busy:unavail)
exten => 1234,n(unavail),Voicemail(1234@default,u)
exten => 1234,n,Hangup()
exten => 1234,n(busy),VoiceMail(1234@default,b)
exten => 1234,n,Hangup()
Asterisk - Examples
- extensions.conf (continued...)
; Extension 2345 - SIP Phone
exten => 2345,1,Verbose(1|Extension 2345)
exten => 2345,n,Dial(SIP/geoff,10)
exten => 2345,n,Hangup()
; Check Voicemail - Extension 8500
exten => 8500,1,VoiceMailMain
; Listen to music on hold
exten => 8501,1,Answer()
exten => 8501,n,MusicOnHold()
exten => 8501,n,Hangup()
Asterisk - Examples
- extensions.conf (continued...)
; Listen to screeming Monkeys
exten => 8502,1,Answer()
exten => 8502,n,Playback(tt-monkeys)
exten => 8502,n,Hangup()
; Play Zapateller noise before passing off to SIP Phone
exten => 8503,1,Answer()
exten => 8503,n,Zapateller()
exten => 8503,n,Dial(SIP/brian,10)
exten => 8503,n,Hangup()
; "Dial 9 to get out"
; Matches any number that starts with 9
; Strips off 9 and dials number on outside line
exten => _9.,1,Dial(zap/g2/${EXTEN:1})
exten => _9.,2,Congestion
Asterisk - Examples
[general]
format=wav49|gsm|wav ; Supported sound formats
serveremail=root@batcave ; From field for sending emails
attach=yes ; Attach voicemail to email
skipms=3000
maxsilence=10
silencethreshold=128
maxlogins=3
emaildateformat=%A, %B %d, %Y at %r
sendvoicemail=yes ; Context to Send voicemail from [option 5 from the advanced menu]
[default]
; Voicemail for extesion 1234
; Password = 4242, Send voicemails to given email address
1234 => 4242,Brian Kidney,somebody@maildomain.com
Asterisk - Examples
[default]
mode=files
directory=/var/lib/asterisk/mohmp3 ; Put MOH files here
; valid mode options:
; quietmp3 -- default
; mp3 -- loud
; mp3nb -- unbuffered
; quietmp3nb -- quiet unbuffered
; custom -- run a custom application
; files -- read files from a directory in any Asterisk supported format
Asterisk - Demonstration
- Mulitple Line Example.
- Annoying Telemarketers.
- Asterisk in Action.