![]() |
A description of the Woomera
protocol Craig Southeren Last updated 14 February 2005 |
This document provides a description of the Woomera protocol for developers and users.
Note that this document is a work-in-progress and is not yet complete.
The Woomera project provides a method for initiating or receiving VoIP calls using the OpenH323 protocol stack via a text-based protocol. This protocol may be carried over a TCP socket or a named pipe, and removes the requirement to use C++ in order to make or receive OPAL calls.
Woomera consists of a process or daemon that encapsulates a running OpenH323 endpoint and provides an externally accessible socket or named pipe interface for commands called the “control channel”. The control channel implements the Woomera protocol used by other client applications.
The Woomera protocol is a synchronous client/server protocol in the same vein as other Internet protocols such as HTTP or SMTP. The client initiates a TCP connection to the server and uses this channel to send requests to which the server responds. A single connection may be used to control multiple calls, or a client may create multiple connections that each exists for the duration of a single call. Woomera does not support overlapped requests, i.e. the client must receive a response from the server for a request before another request can be sent.
Due to the interactive nature of the H.323 protocol, it is sometimes necessary for the server send a message to the client without a preceding request. This type of message is called an “event” and is required for two reasons: it avoids protocol deadlocks between the server and client; and it removes the need for Woomera endpoints to implement full asynchronous “transaction” handling. If the semantics of an event require an acknowledgement from the receiver, this is performed by sending an appropriate request any time after the event has been received. Note that a Woomera server is not allowed to send requests that require a synchronous response. This is intended to simplify the implementation of a Woomera client.
There are four ways a Woomera client and server can be connected:
The Woomera server runs
as a stand-alone server and the clients connect to it using a TCP socket. In this mode,
the server can handle multiple simultaneous connections. This approach is
very flexible (it is possible to telnet directly into the server and enter
commands manually), but it has the disadvantage of allowing access the Woomera
server to any client that has access to the socket. In the real world this
can be security problem.
The Woomera server is
invoked with a parameter that causes it to load a C++ or C "plugin"
module at runtime from a Windows DLL or Unix .so file. The plugin is connected to the Woomera server via
an internal connection (pipe) which avoids the security problems of (1).
However, this requires the abilty to invoke the Woomera process with the correct
command line parameters.
The Woomera server is
invoked with a parameter that causes it run an arbitrary shell command, which is then executed with a
Woomera connection as stdin/stdout. This is allows any program written in a
language such as Perl or Python to be used with Woomera without the security
problems of making a TCP socket available
The Woomera engine is implemented as a C++ library that can be linked directly into a client program.
A single Woomera connection can be used to control multiple simultaneous incoming or outgoing calls. Each call is associated with an integer call-id that is assigned by the Woomera server when a call is created. Every command, response and event contains the call-id for the associated call.
Although each Woomera control channel can be used to control multiple calls, the control channel itself will only process one command at a time. This means that there is no need to introduce complicated "transaction" handing into the application - when the application sends a command to Woomera, it can wait until it gets a response to that command.
If the application needs to handle multiple calls in parallel, it can simply open multiple channels to the Woomera server and handle each call separately. While there is no explicit support for "overlapped" requests (where the application can send multiple requests and receive responses to each request, possibly in a different order), the fact that Woomera uses TCP means that multiple requests can be sent and will be responded to by the server in the order received.
Each call has a context that holds state and status information. Some context information is set automatically by the Woomera server, while other settings can be set by the application. There are Woomera commands for retrieving and setting context information
Woomera can handle audio and video, which is jointly referred to as "media", in three different modes:
- Internal mode: the media is completely handled by Woomera. This allows Woomera complete access to the media stream, allowing it to play and record audio, transfer calls etc
- Raw mode: the media is converted into a raw audio/video data stream that is sent an external UDP port. This allows Woomera to act as a signalling/media gateway in environments that wish to remain protocol agnostic
- External RTP mode: in this mode, the media is not handled by Woomera. The call signalling channel is configured to send the RTP stream to an external RTP device.
Woomera commands, responses
and events all have the same format consisting of a command line, followed by an
optional MIME table and an optional entity body. As an example, the following is
a valid Woomera message:
PLAY
1 file:sample.wav
Use-Format: G.711
empty line
As can be seen, this packet format is similar to a SIP protocol packet or a MIME format email message. Note that optional entity body is only present if there is a Content-Length entry in the MIME table, and that the MIME table is always terminated by an empty line.
The command line of a Woomera message looks slightly different for the three different types of messages:
| Message type | Format |
|---|---|
| Command | command call-id args |
| Response | code description |
| Event | EVENT command callid args |
where:
| command | one of the Woomera verbs such as CALL, HANGUP, DTMF, etc | |
| call-id | a numeric identifier that identifies the call to which the message is associated | |
| args | arguments required by the specific command | |
| code | a numeric code giving the status of the
command. Codes are three digit numbers where the first digit indicates the
type of response:
1xx = intermediate status. More to follow |
|
| description | a text description of the response status |
This chapter describes the commands that a Woomera client can send:
By default, all command responses contain the following MIME fields:
| Call-ID | specifies the call-id of the call associated with the respons | |
| Start-Time | specifies the time at which the call was started, in RFC1123 format | |
| Answer-Time | specifies the time at which the call was answered, if it was answered, in RFC1123 format | |
| End-Time | specifies the time at which the call was ended, in RFC1123 format |
Either of these command will close the current Woomera control connection. This will also hangup all currently active calls
Usage:
BYE
QUIT
MIME fields:
None
Responses:
| 200 Connection closed | Always returned |
Make a call to the specified destination. The current version of Woomera only accepts destinations in the same format accepted by the OpenH323 H323EndPoint::MakeCall function, i.e. IP addresses or H323 URLs. Future versions will also accept SIP URLs.
Usage:
CALL destination
MIME fields:
Raw-Audio Specifies this call should use raw media mode for audio. The argument in this field specifies the IP address and port of the UDP socket to use, in the format ipaddress/port RTP-Audio Specifies this call should use external media mode for audio. The argument in this field specifies the IP address and port of the RTP connection to use, in the format ipaddress/port
Content-body:
None
Responses:
| 201 Call Started | Call has started correctly. This response message will | |
| 402 Could not parse raw audio parms | Unable to parse the raw media parameters | |
| 402 Could not parse audio RTP parms | Unable to parse the RTP media parameters | |
| 402 Unable to start call | Unable to initiate the outgoing call. This is probably because the destination address could not be parsed |
End the specified call
Usage:
HANGUP call-id
MIME fields:
TBA
Content-body:
None
Responses:
TBA
Play the media URL on the specified call. Media URLs can be "file:" or "http:".
Usage:
PLAY call-id mediaurl
MIME fields:
TBA
Content-body:
None
Responses:
TBA
Record audio from the specified call into the media URL. Media URLs can be "file:" or "http:".
Usage:
RECORD call-id mediaurl
MIME fields:
TBA
Content-body:
None
Responses:
TBA
Display the status of the specified call including all of the context information
Usage:
STATUS call-id
MIME fields:
TBA
Content-body:
None
Responses:
TBA
Enable incoming calls on the current connection
Usage:
LISTEN
MIME fields:
TBA
Content-body:
None
Responses:
TBA
Answer an incoming call in response to an INCOMING event
Usage:
ANSWER call-id
MIME fields:
None
Content-body:
None
Responses:
TBA
Play the command argument and content body as speech
Usage:
SPEAK call-id speech-text
MIME fields:
TBA
Content-body:
speech-text
Responses:
TBA
Display the text in the Woomera trace log
Usage:
DEBUG call-id text
MIME fields:
TBA
Content-body:
None
Responses:
TBA
Provides a mechanism for developers to add new commands to the Woomera protocol
Usage:
EXTERNAL call-id
MIME fields:
TBA
Content-body:
None
Responses:
TBA
Set a context variable associated with a call
Usage:
SET call-id
MIME fields:
TBA
Content-body:
None
Responses:
TBA
Get a context variable associated with a call
Usage:
GET call-id
MIME fields:
TBA
Content-body:
None
Responses:
TBA
A Woomera server can send the following events:
|
INCOMING |
An incoming call is available |
|
PROCEED |
An outgoing call has been acknowedged |
|
CONNECT |
An outgoing call
has been accepted |
|
MEDIA |
A call has
established a media connection |
|
DTMF |
A remote endpoint
has send DTMF |
|
RTP |
A call has
established an RTP connection |
The following is an example of an outgoing Woomera call:
|
Client |
Server |
|---|---|
|
HELLO 0 1.0 Post
Increment |
|
|
|
CALL 10.0.0.2 |
|
|
100 Starting call |
|
|
200 Call started |
|
|
EVENT PROCEED 1 |
|
|
EVENT CONNECT 1 |
|
|
EVENT MEDIA 1 AUDIO |
|
PLAY 1
file:sample.wav |
|
|
|
200 Request
Completed |
|
|
EVENT PLAY 1 START |
|
|
EVENT PLAY 1 STOP |
|
HANGUP 1 |
|
|
|
200 Request
Completed |
|
|
EVENT 1 HANGUP |
|
BYE |
|
|
|
200 Request
Completed |
An outgoing call is initiated by sending a CALL command to the server specifying the destination address and any other parameters required. The response to the CALL will contain the call-id for the new call. The server will then send events to the client as the call progresses through various stages of connection. The possible events are:
| PROCEED | the remote endpoint has received the incoming connection and has started further processing | |
| CONNECT | the remote endpoint has accepted the incoming connection | |
| MEDIA | the two endpoints have established a bi-directional media connection. Note that this may occur before or after CONNECT | |
| HANGUP | the remote endpoint has cleared the call |
The local endpoint may send a HANGUP command at any time to clear the call
A client can indicate that it is listening for incoming calls by sending the LISTEN command to the server. The server will then respond to any incoming calls by sending an INCOMING event to the client with a new call-id. If the client wishes to accept the incoming call, it sends an ANSWER command containing the new call-id.
A client can send user indication messages to the remote endpoint by sending the DTMF command to the server. Any incoming user indication messages from the remote endpoint will cause a DTMF event to be sent to the client.
| woomera: (pronounced woom-er-a) | 1. A hooked or notched wooden stick used by Aboriginal peoples of Australia that greatly increases the distance and accuracy of a hand-thrown spear or dart. |
| 2. a town in South Australia which was the site of the Long Range Weapons Establishment used for the launching and testing of rockets |
| 14 February 2005 | Craig Southeren | Filled in extra information on commands |
| 25 January 2005 | Craig Southeren | Fixed problem with header |
| 21 July 2004 | Craig Southeren | Initial version |
Copyright © 2003-2007 by Post Increment
A.B.N 95 856 785 279
All Rights Reserved
All trademarks and copyrights on this page are owned by their respective owners.