Table of Contents

IP-PSTN documentation page

What is IP-PSTN?

    IP-PSTN is a gateway between a telephone and any SIP User Agent Client. It allows a person to call any (allowed) telephone number from any SIP-compliant client application.
sc1.gif (3283 bytes)

Fig1. IP-PSTN Gateway

Used hardware.

    IP-PSTN uses Dialogic D/41ESC telephony card, which provides:
All these features make it possible to create IP-PSTN gateway.

Used software.

IP-PSTN works on Windows NT 4.0 installed on PC, because Dialogic SDK works only with this system. This choice had also influence on the choice of other packages/libraries used. Below is the list of used libraries and packages:
Short description of each item.

Dialogic DNA 3.1

Dialogic SDK, called DNA is a powerful set of functions allowing a programmer to create very complicated CT applications, like call centers, voicemail boxes and also IP telephony gateways. Most functions may be called either synchronously or asynchronously thus allowing the creation of multithreaded applications. Basic functions include:

Gatenet 3.0 Package

This package is a special set of functions developed to allow the creation of IP Telephony Gateways. It's a firmware for the card and a software library with special functions.

The firmware provides:

The most important features are lowering the latency and providing echo cancellation.

sipd from Columbia

This is a sip proxy daemon written in "structured C". Its sources derive from rtsp daemon, HTTP & RFC822 parser. That's why the code is very stable and reliable. It's also very easily understandable and transparent because of lots of accurate and precise comments. It's also been used because Dialogic libraries were written in C and it was the only working SIP code for the Win32 platform.

RTPlib from elemedia (Lucent)

RTPlib from Lucent has been chosen because it's a very easy to use and complete RTP library. Itís available for Win32, Linux & Solaris and is written in C. The API is very easy and is very thoroughly described in the documentation (html file). There are also examples that make use of this library really easy and quick.

GSM codec from TU Berlin

This codec is a library (with source) with functions allowing compression & decompression from linear PCM to 13.2 kbps GSM. It's also written in C and available on most system platforms.

hsstructure.gif (3111 bytes)

    Fig. 2. Hardware and software structure of the gateway.

Implementation details.

IP-PSTN is written as a multithreaded Win32 console application and consists of several threads. These threads include:

Sound processing path.

Since the gateway operation is about translating voice most of the time this process shall be described here in detail. Figure 3 shows subsequent blocks of sound processing path. This path contains two working in parallel stream processing flows: from IP to PSTN and in opposite direction.

flows.gif (4425 bytes)

Fig.3. Sound processing path.

Flow from IP to PSTN

All operations described here are handled by In thread. They include:

After this, sample is taken from the firmware buffer, converted to analog voice and played on the telephone line. These operations take place in the hardware (right big block in the figure).

Flow from PSTN to IP.

These operations are handled by Out thread. They include:

Decoding from/to GSM is optional here and may be negotiated, since mu-law PCM is usually a basic codec for RTP transmission (its payload number is 0).


  • & Jeff Pulver : source of all IP Telephony-related information.
  • : source of all sip-related information, home of sipd & sipc. List of sip-related documents, papers, conferences, implementations and much more.
  • RCF 2543 : SIP.
  • "Understanding Latency in IP Telephony", Alan Percsy, Senior Sales Engineer, Brooktrout

     You can download the package here. Note: You need to have Gatenet package from Dialogic!!!

    For any questions, comments and sugesstions contact:

    Marcin Michalak,