O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

VoIP Hacks

Book Description

Voice over Internet Protocol (VoIP) is gaining a lot of attention these days, as more companies and individuals switch from standard telephone service to phone service via the Internet. The reason is simple: A single network to carry voice and data is easier to scale, maintain, and administer. As an added bonus, it's also cheaper, because VoIP is free of the endless government regulations and tariffs imposed upon phone companies.

VoIP is simply overflowing with hack potential, and VoIP Hacks is the practical guide from O'Reilly that presents these possibilities to you. It provides dozens of hands-on projects for building a VoIP network, showing you how to tweak and customize a multitude of exciting things to get the job done. Along the way, you'll also learn which standards and practices work best for your particular environment. Among the quick and clever solutions showcased in the book are those for:

  • gauging VoIP readiness on an enterprise network
  • using SIP, H.323, and other signaling specifications
  • providing low-layer security in a VoIP environment
  • employing IP hardphones, analog telephone adapters, and softPBX servers
  • dealing with and avoiding the most common VoIP deployment mistakes

In reality, VoIP Hacks contains only a small subset of VoIP knowledge-enough to serve as an introduction to the world of VoIP and teach you how to use it to save money, be more productive, or just impress your friends. If you love to tinker and optimize, this is the one technology, and the one book, you must investigate.

Table of Contents

  1. Credits
    1. About the Author
    2. Contributors
    3. Acknowledgments
  2. Preface
    1. Why VoIP Hacks?
    2. How This Book Is Organized
      1. Conventions Used in This Book
    3. Using Code Examples
      1. Safari® Enabled
      2. How to Contact Us
      3. Got a Hack?
  3. 1. Broadband VoIP Services
    1. 1.1. Hacks 1–7: Introduction
    2. 1.2. VoIP-Based Phone Service Providers
    3. 1. Get Connected
    4. 2. Use Pure VoIP Dialing with Your TSP
    5. 3. Wire Your House Phones for VoIP
    6. 4. Use a Softphone with a VoIP TSP
      1. 1.6.1. Different TSPs, Different Policies
      2. 1.6.2. Install the Softphone
        1. 1.6.2.1. Setting up the basics.
      3. 1.6.3. Make the Call
    7. 5. Prioritize Packets to Improve Quality
      1. 1.7.1. Prioritize Packets on a Linksys Broadband Router
        1. 1.7.1.1. Prioritize RTP traffic.
        2. 1.7.1.2. Prioritize all the traffic from your VoIP ATA.
        3. 1.7.1.3. Prioritize all the traffic from an attached Ethernet switch.
      2. 1.7.2. Prioritize Traffic on a Standalone Switch
      3. 1.7.3. What Happens When VoIP Passes Your Router
    8. 6. Got 911?
      1. 1.8.1. The Problems with VoIP Emergency Dialing
      2. 1.8.2. Hack a Compromise Solution
        1. 1.8.2.1. Keep a Plain Old Telephone Service (POTS) line for 911 calls.
        2. 1.8.2.2. Program your VoIP device with speed dial to mimic 911.
        3. 1.8.2.3. Use a cell phone for 911.
        4. 1.8.2.4. Use a good old-fashioned permanent marker.
    9. 7. Update Your VoIP ATA Firmware
      1. 1.9.1. The Hack
        1. 1.9.1.1. Get the firmware update.
        2. 1.9.1.2. Locate your ATA.
  4. 2. Desktop Telephony
    1. 2.1. Hacks 8–27: Introduction
    2. 8. Access Next-Gen Voice Features
      1. 2.2.1. Vonage Users Can Call Any Outlook Contact with One Click?
      2. 2.2.2. BroadVoice Users Can Use a Web-Based Tool to Place and Manipulate Calls?
      3. 2.2.3. You Can Automatically Dump Unwanted Girlfriends and Boyfriends Using a VoIP-Based Service?
      4. 2.2.4. Broadvox Direct Users Can Use Find-Me-Follow-Me so that They Can Be Reached Wherever There’s a Phone?
    3. 9. Track Vonage Account Info on Your Desktop
      1. 2.3.1. Installing Yahoo! Widgets
      2. 2.3.2. Installing the Vonage Widget
      3. 2.3.3. Gauging Your Vonage Utilization
    4. 10. Pick a Desktop VoIP Client
      1. 2.4.1. Meet H.323, SIP, and IAX
        1. 2.4.1.1. H.323: the earliest VoIP standard.
        2. 2.4.1.2. SIP: the dominant VoIP standard.
        3. 2.4.1.3. IAX: a really cool VoIP protocol.
      2. 2.4.2. Understand VoIP Client Features
    5. 11. Sound Like Darth Vader While You VoIP
    6. 12. Grow Your Social Network with Gizmo
      1. 2.6.1. Extra Gizmo Features
        1. 2.6.1.1. Map It.
        2. 2.6.1.2. Record It.
        3. 2.6.1.3. Gauge It.
      2. 2.6.2. Share the Love
      3. 2.6.3. Also Worth Checking Out
    7. 13. Record VoIP Calls on Your Windows PC
    8. 14. Handle Calls with Windows Software
      1. 2.8.1. PhoneTray Free and PhoneTray Dialup
      2. 2.8.2. Call411
      3. 2.8.3. Call Soft and Call Soft Pro
    9. 15. Let Your Mac Answer and Log Your Calls
      1. 2.9.1. Pop-Up Caller ID Notifications
      2. 2.9.2. Custom Greetings
      3. 2.9.3. Answer Fax Calls
    10. 16. Run Phlink Even When Logged Off
    11. 17. Greet Callers Differently Each Day
    12. 18. Use Caller IDs in AppleScripts
    13. 19. Control iTunes from Phlink
      1. 2.13.1. Automatically Pause iTunes, Resume iTunes
    14. 20. VoIP While Fragging
      1. 2.14.1. Ventrilo
      2. 2.14.2. Teamspeak
      3. 2.14.3. Skype
      4. 2.14.4. The Skype Alternatives
      5. 2.14.5. The Hardware
    15. 21. Google for Telephony Info
      1. 2.15.1. Mine for Phone Numbers
      2. 2.15.2. Complete That Phone Number
      3. 2.15.3. Telephone Privacy Check
      4. 2.15.4. Research VoIP History on Google Groups
    16. 22. Telephonize a Sound File
    17. 23. Record an Audio Chat on Your Mac
    18. 24. Create Telephony Sounds with SoX
      1. 2.18.1. File Format Conversion
      2. 2.18.2. Adding Sound Effects
      3. 2.18.3. Resample and Re-Level Sounds
    19. 25. Mix the Perfect Announcement
    20. 26. Sound Like a Pro Announcer
    21. 27. Record a Videoconference
  5. 3. Skype and Skyping
    1. 3.1. Hacks 28–40: Introduction
      1. 3.1.1. How Skype Works
      2. 3.1.2. What It Does and Doesn’t Do
      3. 3.1.3. What About Security?
    2. 28. Get Skype and Make Some New Friends
      1. 3.2.1. Set Up Skype
      2. 3.2.2. Find Someone to Talk To
      3. 3.2.3. Still Don’t Know Whom to Call? Meet Kerli
      4. 3.2.4. A Solution for Those Inevitable Antisocial Moments
    3. 29. Skype Your Outlook Contacts
      1. 3.3.1. Your New Outlook Toolbar
      2. 3.3.2. Journal Your Skype Calls
    4. 30. Skype People from the OS X Address Book
      1. 3.4.1. The Code
      2. 3.4.2. Running the Code
    5. 31. Enable Site Visitors to Skype You
    6. 32. Speak Jyve
      1. 3.6.1. Get Signed Up
      2. 3.6.2. Make Jyve a Buddy
      3. 3.6.3. Add Jyve’s HTML to Your Web Page
      4. 3.6.4. Start Jyving
    7. 33. Teach Your Browser to Speak Jyve
      1. 3.7.1. Add Skype Instant Messaging to Your Web Site
      2. 3.7.2. Track Visits to Your Site by Jyve Users
      3. 3.7.3. Simplify Communication for Visitors to Your Site
      4. 3.7.4. Trigger Conference Calls from the Web
    8. 34. Carry Skype in Your Pocket
      1. 3.8.1. Don’t Forget Wireless Security
    9. 35. Degunk International SkypeOut Calls
    10. 36. From Podcasting to Skypecasting
      1. 3.10.1. If You Build It, They Will Come
      2. 3.10.2. Mac Podcasting Tools
      3. 3.10.3. Windows Podcasting Tools
      4. 3.10.4. Three’s a Crowd
      5. 3.10.5. Experiment Your Way to a Perfect Skypecast
      6. 3.10.6. See Also
    11. 37. Answer Your Skype Calls, Even When You’re Not Around
      1. 3.11.1. Let Windows Automatically Rotate Your Greetings
      2. 3.11.2. Skype’s Voicemail Service
    12. 38. Use Custom Rings and Sounds with Skype
    13. 39. Emote by Sight and Sound with Skype
      1. 3.13.1. Adding Sound and Video Emoticons
      2. 3.13.2. Sometimes There’s No Substitute for Video
    14. 40. Skype with Your Home Phone
      1. 3.14.1. Make the Connection
  6. 4. Asterisk
    1. 4.1. Hacks 41–58: Introduction
      1. 4.1.1. Getting Telephony Devices Connected to Asterisk
        1. 4.1.1.1. To FXO or to FXS, That Is the Question
        2. 4.1.1.2. And Then There Was T1
    2. 41. Turn Your Linux Box into a PBX
      1. 4.2.1. Start and Stop the Asterisk Server
      2. 4.2.2. Linux-Specific Start and Stop Scripts
    3. 42. Attach a SIP Phone to Asterisk
      1. 4.3.1. Configure a Grandstream BudgeTone 101 IP Phone
      2. 4.3.2. Set the IP Phone to Use a SIP Server
      3. 4.3.3. Allow the IP Phone to Place Calls Via Asterisk
      4. 4.3.4. Listening to Asterisk
    4. 43. Connect a Phone Line Using an FXO Gateway
      1. 4.4.1. Configure the Gateway
      2. 4.4.2. Configure an Asterisk SIP Peer for the Gateway
      3. 4.4.3. Make Asterisk Answer Automatically
    5. 44. Connect a Legacy Phone Line Using Zaptel
      1. 4.5.1. Install an Interface Card
    6. 45. Forward Your Home Calls to Your Cell Phone
    7. 46. Selectively Forward Calls
      1. 4.7.1. Hacking the Hack
    8. 47. Report Telephone Activity with Excel
      1. 4.8.1. Creating a Call Report
    9. 48. Kindly Introduce Telemarketers to Mr. Privacy
      1. 4.9.1. Hacking the Hack
    10. 49. Build a Four-Line Phone Server
      1. 4.10.1. Set Up Incoming Calls
      2. 4.10.2. Set Up Station-to-Station Calls
      3. 4.10.3. Set Up Outgoing Calls
    11. 50. Master Music-on-Hold
      1. 4.11.1. Hacking the Hack
      2. 4.11.2. Hacking the Hack Some More
    12. 51. Record Calls
      1. 4.12.1. Hacking the Hack
    13. 52. Get Your Daily Weather Forecast from Your Telephone
    14. 53. Put a Happy Face on Asterisk Using AMP
      1. 4.14.1. How AMP Works
      2. 4.14.2. The Setup Process
        1. 4.14.2.1. Get the prerequisites.
        2. 4.14.2.2. Install Perl modules and telecom tools.
        3. 4.14.2.3. Configure the MySQL database.
        4. 4.14.2.4. Run AMP’s install script and finish up.
    15. 54. Run Asterisk Without Root, for Security’s Sake
    16. 55. Link Two Asterisk Servers with PSTN
      1. 4.16.1. The Configuration
      2. 4.16.2. Control Caller ID When Using PSTN Trunks
    17. 56. Link Several PBXs over the Internet
      1. 4.17.1. Configuring the Dial Plan
      2. 4.17.2. Adding the Remote Locations
    18. 57. Route Calls Using Distinctive Ring
    19. 58. Tune Up Your Asterisk Logs
  7. 5. Telephony Hardware Hacks
    1. 5.1. Hacks 59–71: Introduction
    2. 59. Record Calls the Old-Fashioned Way
      1. 5.2.1. See Also
    3. 60. Make IP-to-IP Phone Calls with a Grandstream BudgeTone
      1. 5.3.1. Make an IP-to-IP Phone Call
      2. 5.3.2. Mounting the Grandstream on the Wall
    4. 61. Build a Custom Ringtone for Your Grandstream Phone
      1. 5.4.1. The Code
      2. 5.4.2. Running the Code
    5. 62. Tweak Your Sipura ATA
      1. 5.5.1. Configure the Sipura by Dialing
      2. 5.5.2. Various Tweaks
      3. 5.5.3. Dial-Plan Magic
      4. 5.5.4. Advanced Dial-Plan Examples
    6. 63. Build a Bat Phone
      1. 5.6.1. First Things First
      2. 5.6.2. Configure the Sipuras
      3. 5.6.3. Hacking the Hack
    7. 64. Brew Your Own Zaptel Interface Card
    8. 65. Build a Speed-Dial Service on Cisco IP Phones
    9. 66. Power Cisco Phones with Standard Inline Power
    10. 67. Customize Your Cisco IP Phone’s Boot Logo
    11. 68. Configure Multiple IP Phones at One Time
      1. 5.11.1. Get the Uniden on the Network
      2. 5.11.2. Connect the Uniden to TFTP
      3. 5.11.3. Build a Uniden Configuration File
    12. 69. Customize Uniden IP Phones from TFTP
    13. 70. Control the Lights Using Your IP Phone
      1. 5.13.1. Hacking the Hack
    14. 71. Use a Rotary-Dial Phone with VoIP
      1. 5.14.1. Do Pulse with an IAXy
      2. 5.14.2. Do Pulse with a Wildcard
      3. 5.14.3. “Pass Through” Pulse Dialing Signals
      4. 5.14.4. Do Pulse Without Any Special Hardware
  8. 6. Navigate the VoIP Network
    1. 6.1. Hacks 72–87: Introduction
    2. 72. Monitor VoIP Devices
      1. 6.2.1. The Code
      2. 6.2.2. Running the Code
    3. 73. Inspect the SIP Message Structure
      1. 6.3.1. See Also
    4. 74. Audit a Network’s QoS Capabilities
      1. 6.4.1. Using pathping
      2. 6.4.2. Measure the Latency Time and Jitter on a Call Path
      3. 6.4.3. See Also
    5. 75. Graph Latency and Jitter
      1. 6.5.1. The Hack
    6. 76. Explore NAT Traversal
      1. 6.6.1. Get STUNned
      2. 6.6.2. But What About RTP?
    7. 77. Shape Network Traffic to Improve Quality of Service
      1. 6.7.1. The Actual Script
    8. 78. Create a Premium Class of Service
      1. 6.8.1. Get Started with AstShape Provider
      2. 6.8.2. Explaining the AstShape Provider Script
    9. 79. Build a $100 PSTN Gateway in 10 Minutes or Less
      1. 6.9.1. Configuring the Sipura
    10. 80. Make IP Phone Configuration a Trivial Matter
      1. 6.10.1. Set Up a TFTP Server
      2. 6.10.2. Understand IP Phone Configuration
    11. 81. Peek Inside of SIP Packets
      1. 6.11.1. Configure the SIP Softphone
      2. 6.11.2. Configure Ethereal
      3. 6.11.3. Observe SIP Registration
      4. 6.11.4. Observe Registration Failure
      5. 6.11.5. Capture SIP Statistics
    12. 82. Dig into SDP
      1. 6.12.1. Inspect Successful Capabilities Negotiation
      2. 6.12.2. Inspect Failed Capabilities Negotiation
    13. 83. Sniff Out Jittery Calls with Ethereal
      1. 6.13.1. Identify Jitter
      2. 6.13.2. The Jitter Solution
    14. 84. Log VoIP Traffic
      1. 6.14.1. Logging with NetFilter
      2. 6.14.2. Read and Analyze VoIP Traffic Logs
      3. 6.14.3. See Also
    15. 85. Secretly Record VoIP Calls
      1. 6.15.1. The Hack
        1. 6.15.1.1. Compile and install libdnet and libevent.
        2. 6.15.1.2. Compile and install vomit.
        3. 6.15.1.3. tcpdump some packets.
        4. 6.15.1.4. “Wave” goodbye to privacy.
    16. 86. Log and Record VoIP Streams
      1. 6.16.1. The Easy Way to Intercept Calls
      2. 6.16.2. The Tricky Way to Intercept Calls
    17. 87. Intercept and Record a VoIP Call
      1. 6.17.1. Get to Know Cain & Abel
  9. 7. Hard-Core Voice
    1. 7.1. Hacks 88–100: Introduction
    2. 88. Build a Killer Telephony Server
      1. 7.2.1. The Three Things That Matter Most in Telephony
        1. 7.2.1.1. Creating stability.
        2. 7.2.1.2. Creating high availability.
        3. 7.2.1.3. Building in compatibility.
      2. 7.2.2. Size and Select a Voice Server
      3. 7.2.3. Select an OS and Harden It
        1. 7.2.3.1. Remove unnecessary software.
        2. 7.2.3.2. Clean up xinetd.
        3. 7.2.3.3. Optimize the local firewall on the softPBX.
    3. 89. Build an H.323 Gatekeeper Using OpenH323
      1. 7.3.1. Installing OpenH323
      2. 7.3.2. Set Up the GNU Gatekeeper
      3. 7.3.3. Register an H.323 Softphone Using OhPhoneX
      4. 7.3.4. Register an H.323 Endpoint Using NetMeeting
      5. 7.3.5. Make the Call
    4. 90. Turn Your Linux Box into a Fax Machine
      1. 7.4.1. Receiving Faxes
      2. 7.4.2. Sending Faxes
    5. 91. Build an Inbound Fax-to-Email Gateway
      1. 7.5.1. Automatic Fax Routing
      2. 7.5.2. Hacking the Hack
    6. 92. Teach Your Asterisk Box to Speak
      1. 7.6.1. The Hack
      2. 7.6.2. Mac the Hack
    7. 93. Build a Mac PBX
    8. 94. Monitor Asterisk from Your Perl Scripts
    9. 95. Build a SoftPBX with No Hard Drive
      1. 7.9.1. Current Features of AstLinux
      2. 7.9.2. AstLinux’s Keydisk
      3. 7.9.3. Hardware Requirements
      4. 7.9.4. Install from Windows
      5. 7.9.5. Install from Linux
      6. 7.9.6. Install from CD-ROM
        1. 7.9.6.1. Don’t install at all!
        2. 7.9.6.2. More about the AstLinux CD-ROM.
      7. 7.9.7. Boot Time
      8. 7.9.8. PBX-Only Mode (or Help! I Have Only One Ethernet Interface!)
      9. 7.9.9. Wrap-Up
    10. 96. Build a Standalone Voicemail Server in Less Than a Half-Hour
      1. 7.10.1. Create the Voice Mailboxes
      2. 7.10.2. Final Setup
    11. 97. Automate Your Voicemail Greeting
      1. 7.11.1. Create the Sound Files
      2. 7.11.2. Motion Detection Code
      3. 7.11.3. Dialing Greeting Code
    12. 98. Connect Asterisk to the Skype Network
    13. 99. Forward Your Home Phone Calls to Skype
    14. 100. Get Started with sipX
      1. 7.14.1. sipX’s Requirements
      2. 7.14.2. Install sipXpbx
      3. 7.14.3. Launch sipXpbx
      4. 7.14.4. Finish sipXpbx Setup by Web Interface
      5. 7.14.5. Register for the Administration Guide
  10. About the Author
  11. Colophon
  12. Copyright