Teltone-to-SIP Internet Telephony Gateway

Jingren Zhou
Columbia University
Computer Science Department
New York, NY 10027
USA
jrzhou@cs.columbia.edu

Abstract

Tsip is a simple gateway between a regular telephone line and an IP network such as the Internet. It uses the Teltone Access Unit T-311 to connect a regular telephone line with a SUN workstation. The gateway accepts telephone calls from outside by controlling the Teltone device, retrieves the necessary information from a SIP server (using the Session Initiation Protocol (SIP)) and uses vat to transmit voice between caller and callee, using RTP. In the other direction, the gateway accepts telephone request from an IP network to make a call to the PSTN through the Teltone device.

Background

Teltone T-311

With the Teltone T-311 Telephone Access Unit, computers can make and answer telephone calls, and information about those calls can be returned to the computer. While a modem only transmits data from computer to computer over telephone lines, the T-311 allows communication between called and calling parties. This communication is made possible by the conversion of DTMF to ASCII and ASCII to DTMF. With the T-311, computers and other terminal devices can control telephone system functions such as answering and placing calls, observing call status, sending or receiving DTMF signals, "flashing" the line, and coupling audio sources, like speech synthesizers, onto the line.

For compatibility with communications software, the T-311 uses the industry-standard AT command set. It responds to commands and call processing events by sending messages to the computer.When used in conjunction with contact management software, the T-311 is a powerful automatic dialer. Working with the records from the software database, it speeds call completion by detecting busy/reorder tone and immediately moving to the next number. The result is increased "talk time", thereby improving the efficiency of calling agents.

SIP

SIP, the Session Initiation Protocol, is a simple signaling protocol for Internet conferencing and telephony. SIP provides the necessary protocol mechanisms so that end systems and proxy servers can provide services:

Architecture

The T-311 connects to the Sun audio device line input and line output through a DIN connector.

Program Documentation

The server program is written in C and the SIP user agent and SIP C++ library are written in C++. The server program consists of two parts:

Accepting Calls from outside

After initializing the T-311, the program is waiting for messages from the T-311, a SIP user agent or an operator who can type AT commands directly on the Sun workstation console connected to the T-311.

When detecting an outside call, the program picks up the phone after a specified number of rings. A welcome message will be played to the caller. The caller can use his touch-tone telephone to do the next steps. At any time, caller can stop any message by pressing a button on his telephone. By default, every command from the caller is processed after the caller presses '#'. If caller has not sent any DTMF for a few seconds, the program will parse the commands the caller has already sent or forwards the call to the operator on another specified machine. Calls are also forwarded to the operator by pressing '0'. Caller can also enter the "extension" or IP address of the Internet telephone he wants to call.

After parsing the caller command, the program contacts the SIP server for the location of callee. Then it contacts the callee as whether he would like to accept the call. After confirmation, the program will run var to begin the conversation.

During the conversation, either side can terminate the call. The caller can press '*#' hang up; the callee can use issue a BYE command from the SIP user agent.

Relaying calls from the Internet to the PSTN

After receiving an invitation from a SIP user agent, the program tries to make a call through the T-311 by issuing AT commands. If the call is accepted, the program sends a success message to the SIP user agent and uses vat to communicate via voice to the SIP user agent.

Installation Instructions

Connect the T-311 audio output to the "line in" and "line out" connectors of the Sun workstation and the T-311 serial port to serial port "A" of the workstation. Unpack the source code, compile all files by running ./configure and then make in the exec directory. The gateway program is distributed with the SIP C++ library and a simple console SIP user agent. After compiling, the gateway program is located at ./tel-sip/tsip and the SIP user agent program is located at ./sipua/sipua. Install the welcome and hanp-up audio files in the audio directory which you can specified when running tsip. Audio files can have the suffix .au or .aiff.

Both the gateway and the user agent use vat to communicate each other. Be sure to install vat first. For the gateway, add the following X resources into ~/.Xdefaults:

Vat.inputPort: Linein
Vat.outputPort: Lineout
Vat.speakerMode: FullDuplex
Vat.jackMode: FullDuplex
Vat.lineoutMode: FullDuplex
Vat.lineout2Mode: FullDuplex

Synopsis

tsip [-r rings] [-o url] [-P host] [-s dir] [-p port] [-d delay] [-v]

Options

-r rings
Number of rings to wait before picking up; default is 1.

-o url
SIP url for operator. Default is sip:cisalpino.cs.columbia.edu.

-P host
Address of SIP proxy server. Default is none, i.e., no proxy is used.

-s directory
Directory where sound files are stored; default is current directory

-p port
Port for incoming SIP calls; default is 5060.

-d delay
Delay (in seconds) to wait for digits before automatically transferring the call to operator; default is 3 seconds.

-v
Verbose mode. It writes SIP trace to the file ./sip.txt

Authors

Jingren Zhou wrote the gateway program. Kundan Singh wrote the SIP user agent program and SIP C++ library. The Sun audio file routines are derived from code provided by Henning Schulzrinne.

References

Reference manual: T-311 Teltone Access Unit


Last updated by Henning Schulzrinne