Home
 
 Technical Notes
 
 DPSG-STR
 
Technical Abbreviations Database
 
 
 
TN0014: Setting up Internet telephony over a DSL connection using a D-Link DI-804 Internet router utilizing the H.323 protocol
 
This technical note describes how to set up a standards-based Voice over IP (VoIP) system using a home computer that is connected to the Internet via an ADSL connection and a D-Link DI-804 Firewall / Router.
 
Motivation
 
A digital ISDN telephone is connected to the telephone system by a 64 kb/s connection. A DSL connection to the Internet delivers 128 kb/s upstream and 768 kb/s downstream. A current LAN establishes 100 Mb/s connections between conputers. This means that ordinary home computers can communicate with other computers through the Internet with at least twice the speed than ISDN telephones can communicate with each other. Headphone / Microphone combinations are commonplace today and webcams can be bought at a price of less than $50 US. Seems like it's time to replace the telephone system by an Internet-based solution.
 
VoIP, H.323
 
H.323 is an ITU standard for a teleconferencing protocol that is widely implemented. Equivalence Pty has implemented this standard in a freely available set of libraries and tools and made it available under the name OpenH323. This software is available for Windows and Linux operating systems at http://www.openh323.org/. Using this software, connections can be established between two or more computers and text, audio and video can be transmitted between these computers.
 
Setting up an answering machine with OpenH323/OpenAM
 
  1. You need to record a short message. I used sndrec32.exe which comes as part of Windows XP. You need to store the recording as a WAV file. It needs to be sampled at 8000 Hz, 16 bit resolution, mono. You can select these parameters in the Save As Dialog box.
  2. Start the answering machine program OpenAM that comes with Openh323 using the "-m" parameter. If your WAV file is named "hello.wav", you should start the program with "openam -m hello.wav". Now your computer will listen for incoming phone calls.
  3. If somebody calls your computer, s/he will hear your pre-recorded message, and then will be able to leave a message. The OpenAM program will store all messages as WAV files.
  4. You can listen to all recorded messages simply by double-clicking on them in the Explorer.

 
Ringing up a computer with OpenH323/OHPhone
 
OHPhone is a command line program that exists for Linux as well as for Windows. It allows you to specify a lot of options in the command line. In order to establish a connection to another computer, you just run ohphone with the name or IP address of the computer you want to reach. If there is no firewall or router between your computer and the remote computer, this is all that's needed. For example, this is the case for all computers on a LAN.
Example: You want to call the computer "magrathea" in your LAN. For this, you just type "ohphone magrathea".
If you have openam running as an answering machine on your computer and you want to see if it works correctly, you simply specify "localhost" as the target computer name: "ohphone localhost".
In both cases, a message will be displayed which tells you that a connection has been established. You will hear the messages transmitted from the other computer on your loudspeaker and if you have a microphone connected to your computer, whatever you say will be transmitted to the other computer.
If you don't want to initiate a telephone call but listen for one instead, you have to start ohphone with the "-l" option.
 
Ringing up a computer with OpenH323/OpenPhone
 
OpenPhone offers the same functionality as ohphone, but it is implemented as a GUI program. And it always wants to start as a listener, which is in conflict with a running answering machine, which also tries to establish a listener port.
 
Configuring the Firewall
 
The H323 protocol apparently was not designed with firewalls in mind. It needs a lot of open ports and it uses TCP and UDP traffic. Here are the details:
  1. TCP Port 1720 needs to be opened in order to be able to listen for incoming calls
  2. TCP Ports 30.000-30.010 need to be opened for H245 traffic
  3. UDP Ports 5000-5003 need to be opened
The router has to forward all traffic for these ports to the computer that is used for communicating with the Internet.
 
Configuring the Software for user over a Firewall
 
When a telephone application establishes a connection with a remote computer, it tells the remote computer its own IP address. Unfortunately, most router / firewall boxes do something called NAT: Whenever it forwards a packet from the inside of the network to the Internet, it replaces the sender IP address (which contains an IP address known only in the internal network) by its own address. When a remote computer wants to send a packet back to the computer on the internal network, the remote computer needs to send the packet to the IP address of the router, which in turn forwards the packet to the real target. Unfortunately, the router doesn't know anything about the information contained inside the data packets. H323 sends the IP address of the sender inside these data packets. Since this IP address is only valid inside the local network, but not on the Internet, the remote computer sends a lot of packets that get lost. In order to avoid this, the software needs to be told that such a situation exists and that it needs to use a different IP address inside the data packets. In order to do this, you, the user, have to do the following:
  1. First you have to determine your router's current IP address in the Internet. If you use a D-Link DI-804, you can do this by logging into your router (http://192.168.0.1/), and then select "Unit Status". The page you'll see after this contains the IP address under the heading "Current IP". Write this down on a piece of paper. Let's assume it is 217.0.101.18.
  2. If you want to use ohphone to make a phone call, you need to use the "--translate" command line option. So, if you want to call a friend's computer and this computer has an IP address of 111.222.33.44, you have to use ohphone 111.222.33.44 --translate 217.0.101.18.
  3. If you want to use OpenPhone to make a phone call, you need to select Options --> Networking in the menu, and then enter your own IP in the line with the label "NAT router".

 
Problems finding the right headset
 
While performing my experiments, I soon found out that I had a problem with my microphone. A year ago I bought a very cheap (less than 10 USD) headset and have used this for listening to CDs without disturbing my family at night. When I tried to use the microphone it turned out that the recordings were very, very quiet, regardless how much I shouted into the microphone. My initial theory was that the amplifying circuits on my computer's mainboard were too week. So I installed a Soundblaster compatible sound card and connected the headset to this card instead. The volume increased only marginally. So the amplifier was ruled out as the source of the problem, and it was clear, that the problem was the headset. I did a web search for headphone / microphone combinations. Most web sites only had pictures and price information, but no technical information. One of the exceptions was the Sennheiser web site at http://www.sennheiser.com/. The two "headsets for the office" that I liked from looking at the pictures were the MAB 30 model and the MAB 40 model. I took a look at the technical data section. Both headsets have a headphone impedance of 32 Ohms and a microphone impedance of 1400 Ohms. But they differ significantly in AF (Audio Frequency?!) sensitivity. The MAB 30 has an AF sensitivity of 12 mV/Pa whereas the MAB 40 has an AF sensitivity of 25 mV/Pa. My prior experience with Sennheiser headphones for my stereo was very good, so I decided to go ahead and buy the MAB 40. I went to the Ludwigsburg outlet of the German chain Saturn, and asked for one there. They didn't have it in stock, but were happy to backorder it for me. A few days later I got it. I plugged it into my computer and it worked perfectly. So if you have problems with your headset I suggest that you look at the technical data about the microphone part of your headset, and ensure that you have one with a sensitivity of at least 25 mV/Pa.
 
Document History
 
First Version: February 02, 2003
Second Version: February 26, 2003 (added section about my headset problems)

 
Questions?
 
If you have any questions, please send e-mail to Carsten Kuckuk at .