O'Reilly logo

Practical VoIP Using VOCAL by Luan Dang, Cullen Jennings, David Kelly

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

Looking Through the Code

From a coding point of view, the UA is constructed from classes and threads.

Classes

Here is a look at some of the classes behind the VOCAL UA . These classes can be easily divided into base classes and event classes, as shown in the following diagrams. Figure 10-3 shows the UA classes.

The classes in the gray shading are base classes. Here are descriptions of the event classes:

DeviceThread

Works with the hardware devices such as the sound card.

DigitCollector

Receives digit input while the user is dialing and processes the digits according to the dialing plan.

FeatureThread

The main thread that executes the state machine.

LoadGenThread

Tracks statistics when the UA is being run in Load Generation mode. This is used for bulk testing to make large numbers of calls.

NullHwDevice

Used for testing when neither a sound card nor a Quicknet card is available.

QuickNetDevice

A device thread that works with Quicknet cards (http://www.quicknet.com).

UA class diagram

Figure 10-3. UA class diagram

RegistrationManager

Keeps track of the UA’s registration with the network and its expiry.

ResGwDevice

Residential Gateway Device, a base class. Anything that was a UA that did audio would need to deal with certain operations. We derive certain devices from that, such as the Quicknet card and sound card, or if there is nothing, we derive the NullHardware class. If you have ...

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

Start Free Trial

No credit card required