The design of the sample application

The TDM sample application uses three different state tables, and one custom server.

TromboneIn state table

TromboneIn answers the customer’s call and prompts the customer to enter a telephone number. When the customer has entered the number, TromboneIn makes a request to the custom server to dial the number on a second channel, and when the call is answered, to make a TDM connection between the two channels. TromboneIn then waits for completion of this custom server request. When the custom server confirms that it has completed this request, TromboneIn invokes the TromboneMonitor state table (described later) to monitor activities of the calling party.

TromboneOut state table

TromboneOut is invoked by the custom server dial the telephone number specified by the customer. The number is passed to TromboneOut by parameter. TromboneOut uses a MakeCall action to select a free outgoing channel and dial the telephone number. The MakeCall action completes either when the call is answered by the called party, or when the call fails, for example because the number is invalid or busy, or there are no outbound lines available. On completion of the MakeCall action, TromboneOut notifies the custom server of the outcome of the call attempt, and then invokes the TromboneMonitor state table to monitor subsequent activities of the called party.

TromboneMonitor state table

TromboneMonitor monitors one channel for DTMF keys, caller hangup events, or asynchronous channel events from the custom server. If a caller presses a DTMF key, the name of the key is announced to the caller; this feature does not serve any real purpose, but demonstrates how a real application could use DTMF keys to invoke service features. In this application, custom server channel events are used to report that the other party has hung up, so when TromboneMonitor receives such an event, it plays a brief message to the caller on this channel, then exits. If the party on this channel hangs up, the state table exits.

TromboneCS custom server

TromboneCS is a custom server which manages the relationships between different channels, including making and breaking TDM connections between them. TromboneCS provides two user functions which may be used by state tables, and one system function:

t_outdial()
This function represents a request to allocate a new channel and dial a specified phone number on that channel. TromboneCS executes this by allocating a new channel process (CHP) and executing the TromboneOut state table with that new CHP. t_outdial() sends a response to the calling state table when the outbound call attempt is complete, indicating whether the attempt succeeded or failed.
t_outdial_complete()
This function represents an indication from a state table that an outbound call attempt has been completed, and whether the attempt succeeded or failed. There is no response to this user function.
t_chsl()
This is a CloseHostServerLink function, which is invoked automatically when state tables close their connection to TromboneCS, or exit from the main state table.

TromboneCS uses these three functions as events in a state machine which coordinates the making of the trombone connection between the two parties, and breaking that connection when one of the parties hangs up. Figure 1 summarises the steps involved in making and breaking the connection.

Figure 1. Making and breaking a trombone connection
This graphic illustrates the making and breaking of a trombone connection as fully described the preceding text.