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

499 views

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 http://kmpeterson.com/special/bblisa-asterisk .

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.comhttp://kmpeterson.com/special/bblisa-asterisk
  2. 2. http://kmpeterson.com/special/bblisa-asterisk
  3. 3. http://kmpeterson.com/special/bblisa-asterisk• The current network (the PSTN) was engineered specifically forvoice• Design and implementation were performed in a very differentenvironment• TDM vs. Packet Switching
  4. 4. http://kmpeterson.com/special/bblisa-asterisk• 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. http://kmpeterson.com/special/bblisa-asterisk• 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. http://kmpeterson.com/special/bblisa-asterisk
  7. 7. http://kmpeterson.com/special/bblisa-asterisk
  8. 8. http://kmpeterson.com/special/bblisa-asteriskPBX Features for Subscribers:Analog Telephone Sets Distributed Functionality
  9. 9. http://kmpeterson.com/special/bblisa-asteriskIP PhonesPBXThe rest of it is just the usual stuff.
  10. 10. http://kmpeterson.com/special/bblisa-asterisk
  11. 11. http://kmpeterson.com/special/bblisa-asteriskCisco SPA112IP Phone (Polycom Soundpoint IP550)Audiocodes Mediant-600 Media GatewayFeatures:
  12. 12. http://kmpeterson.com/special/bblisa-asteriskOnce again, countless:Two parts of a phone callSIP: Session Initiation ProtocolSDP: Session Description ProtocolRTP: Real Time Protocol
  13. 13. http://kmpeterson.com/special/bblisa-asteriskRegistration: Response:
  14. 14. http://kmpeterson.com/special/bblisa-asterisk
  15. 15. http://kmpeterson.com/special/bblisa-asterisk
  16. 16. http://kmpeterson.com/special/bblisa-asteriskFirewallsSIP/RTP 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. http://kmpeterson.com/special/bblisa-asteriskRequirements 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. http://kmpeterson.com/special/bblisa-asterisk
  19. 19. http://kmpeterson.com/special/bblisa-asterisk
  20. 20. http://kmpeterson.com/special/bblisa-asterisk
  21. 21. http://kmpeterson.com/special/bblisa-asterisk
  22. 22. http://kmpeterson.com/special/bblisa-asteriskata 192.168.0.12phone1 192.168.0.11ast 192.168.0.10192.168.0.1
  23. 23. http://kmpeterson.com/special/bblisa-asteriskConfiguration (Files)
  24. 24. http://kmpeterson.com/special/bblisa-asterisk
  25. 25. http://kmpeterson.com/special/bblisa-asteriskServer-based ProvisioningConfigurability
  26. 26. http://kmpeterson.com/special/bblisa-asteriskSIP configuration for IP Phonefriend user peerContexts and Extensionscontextprogressinbandmailboxdirectmediaqualifysecret
  27. 27. http://kmpeterson.com/special/bblisa-asteriskSIP configuration for IP Phonefriend user peercontextprogressinbandmailboxdirectmediaqualify
  28. 28. http://kmpeterson.com/special/bblisa-asteriskConfiguration for SIP providerallowguestregistertype peerhostcontext
  29. 29. http://kmpeterson.com/special/bblisa-asteriskAsterisk “Programming”▸ Careful with call flow through contexts;[context]exten=>extension prioritysame=>n
  30. 30. http://kmpeterson.com/special/bblisa-asteriskLocal extensions that can be dialed by our phonesx201x202x500x811HangupAnswer
  31. 31. http://kmpeterson.com/special/bblisa-asteriskDialing out, in the US_NXXNXXXXXXEXTEN[speedDial]
  32. 32. http://kmpeterson.com/special/bblisa-asteriskTarget contexts for our local phones and incominglocalHomeincomingTrunk
  33. 33. http://kmpeterson.com/special/bblisa-asteriskMenu our incoming calls go into180it
  34. 34. http://kmpeterson.com/special/bblisa-asteriskActually making the phone ring
  35. 35. http://kmpeterson.com/special/bblisa-asterisk•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. http://kmpeterson.com/special/bblisa-asterisk• 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. http://kmpeterson.com/special/bblisa-asterisk1. 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. http://kmpeterson.com/special/bblisa-asterisk• 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. http://kmpeterson.com/special/bblisa-asterisk• 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. http://kmpeterson.com/special/bblisa-asteriskAsterisk™: 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.comhttp://kmpeterson.com/special/bblisa-asterisk

×