Simple H323Plus/OpenH323 Tutorial
by Vladimir Toncar
Text version: 1.1-1
Tutorial application version: 1.1-1 (builds with both H323 Plus and OpenH323)
Spanish version by Javier Roca.
1 Introduction
Welcome to the Simple H323Plus/OpenH323 Tutorial. The aim of this work is to describe and explain several PWLib- and H323Plus- related programming techniques, starting with the basic ones and later discussing one of the more advanced topics.
The tutorial has been updated to compile with H323 Plus, but you can still use it with OpenH323. The names H323 Plus and OpenH323 are used interchangeably throughout the text.
The application that accompanies this tutorial has been designed as a compromise between simplicity and functionality. The application has to be easy to study. Because of that, it should focus on presenting the core techniques and leave out additional features. On the other hand, the application should have at least some practical functionality. The result is a simple application called oh323tut. It works as an OpenH323-based WAV file player: you call it from an H.323 telephone and it will play a WAV file to you over the H.323 connection.
The tutorial shows how to use PWLib and H323Plus/OpenH323 to:
- derive an application class;
- parse command-line options;
- derive an H.323 endpoint class;
- initialize the endpoint;
- customize the behavior of the endpoint using virtual methods;
- read audio data from a WAV file and handle correct timing.
The reader is expected to have a basic knowledge of H.323 (endpoints, aliases, basic call signaling). Also, the reader should be familiar with C++, and to be specific, a good understanding of polymorphism is needed.
The tutorial application has been developed on Linux. It should work out of the box on most Unix-based operating systems and a very few changes are needed to port it to the Win32 environment.
The tutorial starts with a brief description of how to compile PWLib, H323Plus/OpenH323, and the tutorial application (oh323tut) on a Linux/Unix system in Section 2.
Section 3 contains a brief user manual for oh323tut. If you only wish to try out OpenH323 and need oh323tut as an receiving endpoint for calls made from e.g. ohphone, then Sections 2 and 3 are all you need to look at.
Section 4 deals with oh323tut's application class. It explains how to derive the application class from PWLib's class PProcess, how to parse command-line options, etc.
Section 5 describes the H.323 endpoint class and it covers topics like deriving the class, initializing the endpoint (listening at a given port number, setting aliases, choosing codecs, etc.), and using virtual methods to alter the behaviour of the endpoint class.
Section 6 explains how to read audio data from a WAV file using a channel class. This is the most complex section of the tutorial, as it covers the adaptive timing problem.
1.1 Typographic Conventions
The following typographic conventions are used in this text:
- file names, code snippets, and command-line input are set in typewriter font, e.g. pconf.h, make bothdepend;
- variable names, function names, method names, and application names are set in italics. e.g. fileName, main(), ohphone;
- class names are set in normal font, e.g. PProcess, MyEndPoint.
1.2 Copyright Information
The Simple OpenH323 Tutorial is Copyright (c) 2002-2003 Vladimir Toncar, Ph.D. All rights reserved. No part of this tutorial may be reproduced without the prior permission from the author.
The application that accompanies this tutorial (oh323tut) is published under the terms of the Mozilla Public License Version 1.1. You may obtain a copy of the License at http://www.mozilla.org/MPL/.
All trademarks and registered trademarks are the property of their respective owners.
1.3 Contact Information
Please send comments regarding this tutorial to oh323tut [at] toncar.cz.