Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

VoIP and Asterisk - A Technical Overview


Published on

The near-universal provision of voice services and their terminals (called "telephones") predates the Internet. While on some level, voice traffic via TCP/IP is just another protocol, there are challenges in making it "just work" like the traditional phones that we are all used to. There are the technical issues of the nature of the data, interfacing with the still robust telephone network, and of course the UI expectations and experience.

That means that the protocols involved - SIP and the related suite - were developed in the setting of a preexisting, mature, and complex switched network. I found that from the perspective of a systems administrator or network engineer there are complications, terminology, and conventions that aren't necessarily obvious.

This talk provides insight into the these technologies from that perspective to allow you to grasp the protocols and the context in which they interoperate, using an example implementation of Asterisk.

Configurations and other formats of this presentation are available at .

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

VoIP and Asterisk - A Technical Overview

  1. 1. 1kmp@kmpeterson.com
  2. 2.
  3. 3.• The current network (the PSTN) was engineered specifically forvoice• Design and implementation were performed in a very differentenvironment• TDM vs. Packet Switching
  4. 4.• Everyone knows how telephones work.• Service is universal, along with numbering.• The Internet is not reliable. (See: jitter, latency, routing)• Entrenched interests (“The Phone Compan(-ies)”)• Cost• Features
  5. 5.• Understand enough of the technology to ask good questions• Implement it yourself• Help your organization/colleagues• Where to go next• Costs• Functionality• Services
  6. 6.
  7. 7.
  8. 8. Features for Subscribers:Analog Telephone Sets Distributed Functionality
  9. 9. PhonesPBXThe rest of it is just the usual stuff.
  10. 10.
  11. 11. SPA112IP Phone (Polycom Soundpoint IP550)Audiocodes Mediant-600 Media GatewayFeatures:
  12. 12. again, countless:Two parts of a phone callSIP: Session Initiation ProtocolSDP: Session Description ProtocolRTP: Real Time Protocol
  13. 13. Response:
  14. 14.
  15. 15.
  16. 16. are UDP▸ Application Layer Gateway (ALG) can replace incorrect fields.▸ More efficient, lighter-weight▸ Protocols such at STUN can determine global IP address, allowendpoints to construct SDP messages with correct addresses.
  17. 17. for Voice Traffic▸ Lessons about QoS: traffic shaping, rate limiting, measurement▸ Raise network engineering tasks to another level: you’ll know if yournetwork is working well.▸ “Buffer Bloat” and the counterintuitive strategy of speeding up byapplying the brakes.
  18. 18.
  19. 19.
  20. 20.
  21. 21.
  22. 22.
  23. 23. (Files)
  24. 24.
  25. 25. ProvisioningConfigurability
  26. 26. configuration for IP Phonefriend user peerContexts and Extensionscontextprogressinbandmailboxdirectmediaqualifysecret
  27. 27. configuration for IP Phonefriend user peercontextprogressinbandmailboxdirectmediaqualify
  28. 28. for SIP providerallowguestregistertype peerhostcontext
  29. 29. “Programming”▸ Careful with call flow through contexts;[context]exten=>extension prioritysame=>n
  30. 30. extensions that can be dialed by our phonesx201x202x500x811HangupAnswer
  31. 31. out, in the US_NXXNXXXXXXEXTEN[speedDial]
  32. 32. contexts for our local phones and incominglocalHomeincomingTrunk
  33. 33. our incoming calls go into180it
  34. 34. making the phone ring
  35. 35.•the asterisk console: /usr/sbin/asterisk -r•backup services•Support for E911 from commercial providers•SELinux•Network Monitoring•beware of misuse•Consider fail2ban•Security monitoring (consider volume)
  36. 36.• Users don’t understand the Internet• Monitoring strategies• Still not sure about the media stream• Not too bad under CentOS• Needed additional support for ODBC, SNMP
  37. 37. Hadn’t really use ATA intensively2. Found out at some point, couldn’t initiate calls and get audio3. Spent a lot of time looking at packets on wire, reading up aboutNAT-related issues and SIP protocol.4. No serious differences between configurations for ATA andPhone.5. Tried defining port ranges - but they matched between ATA andPhone, and still no sound.6. Noticed “host unreachable replies” only for ATA voice traffic; thennoticed that Asterisk always talked to Phone earlier in sessionthan it did to ATA.7. Turned of host firewall - iptables - and sound worked. But why...?
  38. 38.• Set up mailbox for friends of in-laws to send their wishes• Have several configured. Great way to learn aboutimplementations.• Add friends to whitelist to avoid initial menu, also have moreoptions if not answered.• Implemented option to send call to Mobile.• Mobile programed to send call back if no answer there.• Asterisk “remembers” numbers if they get sent back.
  39. 39.• If CID is local emergency number, play short message (“your callis being recorded”), route call to speaker on phone• Audio copied to sound file; file emailed to me and SMS pagesent.
  40. 40.™: The Definitive GuideBy: Leif Madsen; Jim Van Meggelen; Russell BryantPublisher: OReilly Media, Inc.Pub. Date: April 28, 2011 Most Recent EditionPrint ISBN-13: 978-0-596-51734-2
  41. 41. 41kmp@kmpeterson.com