Skip to Content
Practical VoIP Using VOCAL
book

Practical VoIP Using VOCAL

by David Kelly, Cullen Jennings, Luan Dang
July 2002
Intermediate to advanced
528 pages
15h 13m
English
O'Reilly Media, Inc.
Content preview from Practical VoIP Using VOCAL

Chapter 9. Base Code

Most VOCAL components execute state machines, which share a common base code: a common framework that we wrote to help ensure some design consistency between several different server types including the Marshal, Redirect, and CPL Feature servers. This chapter looks at how we implemented the base state machine and the different types of classes found within the base code. As this code is widely used within VOCAL, it is important for you to understand how it has been written if you intend to modify any of the other processes.

State Machine

The general model of this state machine provides a class for each state. The constructor for each of these classes lists a series of operators that are instantiated at the same time the state class is instantiated. Each of these operators has been written as a separate class, and the events are defined in a general event class. For example, all the events that drive the state machine for the SIP User Agent are defined within vocal-1.3.0/sip/ua/DeviceEvent.hxx.

When a thread sends an event to a state machine, it passes the event to the current state and then to each operator that is listed within the constructor for that state. Each operator contains code that enables it to work with some events and to ignore all others. If the event is one that it is designed to handle, the operator executes and returns a definition of the next state for the state machine to transform itself into. This makes the state machine move to its next ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Switching to VoIP

Switching to VoIP

Theodore Wallingford
VoIP Hacks

VoIP Hacks

Theodore Wallingford
Voice Over IP

Voice Over IP

Uyless Black
Securing VoIP

Securing VoIP

Regis Jr (Bud) Bates

Publisher Resources

ISBN: 0596000782Catalog PageErrata