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

How CPL Script Converts to a C++ State Machine

The Feature server executes CPL scripts by parsing them into eXtensible Markup Language (XML) document object model (DOM) trees, turning these trees into state machines and then executing them. The following diagrams show how CPL scripts become features and DOM trees.

Figure 13-3 shows how a script becomes a feature.

The FS turns a script, brought in from Provisioning, into a state machine by calling CPLParser to build the tree. The parser takes a long string provided by the Provisioning server and turns it into a state machine.

How a script becomes a feature

Figure 13-3. How a script becomes a feature

Figure 13-4 shows how a script becomes a DOM tree.

CPLParser: script becomes a DOM tree

Figure 13-4. CPLParser: script becomes a DOM tree

The FS doesn’t really care about this, but when it receives a string of characters, it calls the libxml library, which creates this data structure. The FS uses this structure, but it has to understand a few things, such as how to traverse it and how to get the data it needs. For more information about libxml, see http://xmlsoft.org.

Types of States and Operators

In the FS state machine are a state object and three different types of operators. One major difference between the FS state machine and the UA’s state machine is that while the UA’s machine never needs more ...

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