• No results found

Asterisk. Michael Kershaw

N/A
N/A
Protected

Academic year: 2021

Share "Asterisk. Michael Kershaw"

Copied!
30
0
0

Loading.... (view fulltext now)

Full text

(1)

Asterisk

(2)

What Asterisk Can Do

● Voice Over IP (VOIP)

● Physical phone switch (PBX) ● Software phone switch

● Answering machine

(3)

VOIP

● Voice Over IP: Make telephone calls using the

Internet.

● Cheap (real phone calls) or free (VOIP to VOIP) ● Commercial/Semi-Commercial services like

Skype, Vonage.

● Like compressing a CD to MP3 files, the goal is

to make the voice data as small as possible without losing quality.

(4)

VOIP and Asterisk

● Asterisk supports several VOIP speech

compression codecs.

Will not work with commercial VOIP solutions

like Vonage or Skype (different networks)

● Asterisk can route VOIP calls:

– Over the Internet to other Asterisk users

– Over the Internet to VOIP gateway providers

– Into the real phone network, if you have the right

(5)

POTS – Plain Old Telephone System.

● Requires special hardware: FXS and FXO.

● FXS emulates the “phone system.” You can plug

a normal phone into a FXS adapter.

● FXO emulates a “phone device.” You can plug a

PC into the POTS network with a FXO adapter.

● High-end 'T' line interface hardware. Similar to

FXO but can trunk dozens of lines over a T1

(6)

Talking To Asterisk

● VOIP or “real” phone, you need a way to talk to

Asterisk.

● Analog phone to VOIP adapters: Ethernet on one

side, telephone jack on the other, lets you use any existing phone. Usually talk SIP protocol.

● FXS: Acts like a sound card in your Asterisk

server, lets you use any existing phone.

● Hardware VOIP phone: Looks like a real phone,

but talks SIP to Ethernet.

(7)

Installing Asterisk

● Download Asterisk from http://www.asterisk.org/

or look in your distribution for a package.

● Extract the source, compile, and install the

compiled code. Asterisk doesn't use the standard autoconfig tools, so a “./configure” is not needed.

tar xvf asterisk­1.0.9.tar.gz make

(8)

Asterisk Configuration Files

● System configurations live in /etc/asterisk.  

There are a lot of them. The most important ones are:

● sip.conf: controls SIP VOIP users.

● iax.conf: controls IAX VOIP connections.

● extensions.conf: controls phone numbers and call trees, both incoming and outgoing calls.

● voicemail.conf: controls voice mail boxes, passwords, etc.

(9)

Configuring Asterisk For SIP

● Most VOIP stuff uses SIP (software phones,

hardware adapters, etc)

● Needs a SIP configuration entry in sip.conf for

each SIP device.

● SIP entry defines type, extension context, name,

password, voicemail mailbox, and audio codecs allowed.

(10)

Example SIP User

[dragorn­grandstream] type=friend context=nycccp username=dragorn­grandstream fromuser=dragorn­grandstream secret=monkey callerid=Dragorn <1020> host=dynamic nat=no canreinvite=yes dtmfmode=info mailbox=1020@default disallow=all allow=ulaw

(11)

Things To Know About SIP

● Extremely basic protocol.

● Stream of UDP packets containing voice data. ● CAN pass through NAT, but doesn't do so very

well in all situations.

● Container around multiple audio codecs: ulaw,

alaw, gsm, and more.

● Different codecs have different speech quality.

(12)

SIP Devices

● Assorted software phones: kphone, linphone,

mythphone, gnophone to name a few. Look on http://www.freshmeat.net

● Hardware phones: Budgetone is cheap & decent ● Standalone FXS to SIP adapters

(13)

Asterisk Extensions Configuration

● Very complex file, but important for operation. ● Boring part of the presentation, but controls all

the neat things Asterisk can do.

● Config is divided into segments, aka calling

domains.

● Each extension can perform multiple actions:

– Dialing another extension – Playing background audio

(14)

* Extensions: Outbound Dialing

● Wildcard extension matches “outbound” numbers

(1-XXX-XXX-XXXX)

● Set our caller ID to 1-800-555-1212 (hah!)

● Direct it to the external provider via the IAX2

protocol (Asterisk to Asterisk protocol, supported by our example outbound dialing provider, and configured in iax.conf)

exten => _1NXXNXXXXXX,1,SetCallerID(8005551212) exten => _1NXXNXXXXXX,2,Dial,IAX2/foo/${EXTEN}

(15)

* Extensions: Local Phones

● Define a macro which calls the SIP address of the

specified phone, waits a maximum of 20 seconds, and then directs the call based on the status.

● Set an extension in our local phone domain and

link it to the SIP phone.

[macro­sipexten]

exten => s,1,Dial(SIP/${ARG1},20)

(16)

* Extensions: Calling Trees

● Include local phone domains. ● Set up background speech.

● Script the call tree and fall through to calling

local users if nothing else is entered.

[nycccp­incoming] include => nycccp_phones include => nycccp­vmdefaults exten => s,1,Background(nycccp­intro) exten => 2,1,Goto(nycccp­departments,s,1) exten => 3,1,Goto(nycccp­orginizations,s,1) exten => 4,1,Goto(nycccp­people,s,1) exten => 11,1,Goto(nycccp­toolkit,s,1) exten => 2,1,Dial(SIP/dragorn­grandstream&SIP/porkchop,10t)

(17)

* Extensions: CID Spoofing

● CID spoofing is trivial, depending on your VOIP

outbound provider.

● Match #*# and set the CID to the first number. ● Your provider may get unhappy with you doing

this a lot!

exten => _1NXXNXXXXXX*NXXNXXXXXX,1, SetCallerID(${EXTEN:­10}) 

(18)

Voicemail

● Builtin voicemail system.

● Per-extension mailbox and passwords.

● Incoming messages recorded as wav, mp3.

● Remotely checkable if you add the voicemail

system to your dialable extensions.

(19)

Voice Synthesis

● Asterisk can use realtime voice synthesis via

Festival.

● Unfortunately, Festival sucks to compile and

install the extra voices.

● Voice quality is passable but not great. Often

better to record your own messages.

(20)

IAX, Asterisk Protocol

● Two Asterisk installations can communicate

directly with each other.

● Multiple phone switches in one location can share

the load.

● Direct connections between your house and

others via the Internet: Free calls to your friends!

● Some clients talk IAX directly (gnophone). ● More robust than SIP but less widespread.

(21)

Going From VOIP To World

● Free World Dialup provides Free (imagine that)

numbers to reach other FWD members. http://www.freeworldialup.com

● VoipJet provides outbound connections to the

real phone network at very cheap rates

($0.001/min inside the US and $0.03/min average international). http://voipjet.com

● Stanaphone provides NY inbound phone

(22)

VoipJet Is Weird

● The first rule about VoipJet is you do not talk

about VoipJet.

● In many ways they seem very sketchy. EULA

prohibits talking about using them or disclosing that you use them.

● Service is still good and you can pay via PayPal. ● Weirdness is probably to avoid being taxed as a

(23)

Business-Level Asterisk

● T1 interface card.

● Use Asterisk as a real phone PBX to trunk

multiple extensions to the T1 line.

● VOIP to the desk, or FXS to standard phones. ● Much cheaper to run than a commercial PBX

system.

● Uses the ZapTel kernel modules to drive analog

(24)

Tricks With Asterisk + POTS

● Using a FXO card, connects to your home

telephone jack.

● Route incoming calls to a call tree. Amaze your

friends, annoy the telemarketers.

● Route outgoing calls over phone or VOIP

depending on area code to save money.

● Digital answering machine. MP3s of your

(25)

VOIP Legalisms

● Commercial VOIP providers are likely to be

treated as telecom providers (= taxes!)

● FCC/Feds are planning to require VOIP providers

make it wiretappable. (= spying!)

● 911 support becoming a major issue. How does

the 911 system know where you are?

● None of this applies to you at home building your

(26)

Stuff To Worry About

● If your only phone is VOIP (Asterisk or

commercial), what happens if your power goes out or your Internet link goes down?

● VOIP is really too high bandwidth for dialup.

Broadband of some sort is necessary.

● VOIP is sniffable. It's not legal, but that won't

stop it. Your phone is also tappable. Take your pick.

(27)

VOIP Quality

● VOIP speech quality is directly affected by the

available bandwidth. Stuttering and dropouts will happen if your line isn't fast enough.

● Packet shaping can help if your line is congested

by uploads and downloads.

● If you use Linux for packet shaping, a “PFIFO

Queue” is most appropriate: The short packet queue prevents VOIP data from backing up causing stuttering.

(28)

Asterisk Config Helpers

● http://www.freshmeat.net has links to many

Asterisk frontends and utilities

● LiveCD distros and specific modified distro

installs such as Xorcom

● Several PHP configuration and billing frontends ● http://www.asternic.com has live diagnostics and

(29)
(30)

Outro

● Asterisk: http://www.asterisk.org

● Incoming: http://www.stanaphone.com ● Outgoing: http://www.voipjet.com

● Info & Wiki: http://www.voip-info.org

● More Software: http://www.freshmeat.net ● Us: http://www.mhvlug.org

References

Related documents

(1973) have reported that thicker vane blades resulted in lower undrained shear strength values because of greater soil disturbance and also because of the induced increase in

More than 92% of these facilities are licensed by the CA Department of Social Services (CDSS), while the rest are residential facilities for Alcohol and Drug Treatment

Skype is a VoIP service that allows Users to chat, instant message, make or receive phone calls or transfer files worldwide over the Internet securely and free of charge.. Dialogue is

The objective of this paper is to examine the market and welfare effects of cooperative involvement in quality - enhancing innovation activity in the agri - food

Because there are few studies in this area in the national literature, the objectives of the present study were to determine the prevalence of diastasis of rectus

Title Ectopic cervical thymus associated with infant death: 2 case reports and literature review.. Author(s) Ishida, Tokiko; Kotani, Hirokazu; Miyao, Masashi; Abiru, Hitoshi;

Intel® System Debugger 2017– System Trace Release Notes 13 16:07:36 [ERROR] Cannot send message, target connection server is

Residential VoIP solution of Vox Switch allows providers to offer competitive VoIP services to end users who wish to make cheap long distance or international calls and thereby