Chapter 10. VOCAL User Agent
The Vovida SIP User Agent (UA) is a key component used for testing our SIP-based telephony applications. Besides SIP messaging, the User Agent also has a media component, making it a fully functional softphone. You can make calls between two UAs or between a UA and another SIP endpoint, with or without going through a Proxy or a Redirect server.
One of the key abstractions of the UA is the state machine, as discussed in Chapter 9, which contains a few paths that describe answered calls and many paths that describe unanswered calls and error conditions. If we were to describe the states for every error condition and nonanswered call in detail, this chapter might exceed the page length of all of the other chapters in this book combined! As in Chapter 7, we have narrowed our discussion about the User Agent to its essential components and behaviors for the sake of clarity.
The state machine is driven from one state to the next by events. An example of an event is a SIP event, which occurs when the UA receives a SIP message. As SIP messages are parsed by the SIP stack and passed to the UA, they are transformed into events and entered into a First In First Out (FIFO) queue from which the state machine retrieves them.
There are other types of events such as timer events that provide time-outs for replies or the entry of phone numbers. You can set up a timer to stop a phone from ringing after a set length of time. There are also hardware ...