ASN.1 / XML Software Tools from Objective Systems
Home > Support > Documentation

PBXSession Class Reference

List of all members.

Public Member Functions

delegate void AsyncCallback (PBXSession sessionObject, byte[] asyncData)
void Close (CSTAContext threadContext)
delegate void ConnectionCallback (PBXSession sessionObject)
void Open (CSTAContext threadContext)
 PBXSession (string pbxSystem, int port)
SocketState SendACSEMessage (byte[] message, int messageLength, Constants.ACSEMessageTypes messageType, CSTAContext threadContext)
void SendMessage (string messageType, byte[] message, int messageLength, CSTAContext threadContext)
void SendMessage (byte[] message, int messageLength, CSTAContext threadContext)
void WaitForROSEResponse (CSTAContext threadContext)

Properties

AsyncCallback ClientCallback [get, set]
ConnectionCallback ConnectionLostCallback [get, set]
bool DebugClientCallback [get, set]
bool DebugMode [get, set]
int MaxReceiveTimeout [get, set]
string PBXSystem [get]
int Port [get]

Detailed Description

This class manages communication with a PBX. One instance of this class should be created for each PBX with which a CSTADLL client application needs to exchange CSTA messages.

The CSTA worker classes (e.g., Alcatel4400, PanasonicNCP) hold a reference to a PBXSession object. If the constructor for the worker class that takes a PBX identification and a PBX port is used, a PBXSession object is created. Alternatively, the client application can create a PBXSession instance and pass a reference to the instance to the other worker class constructor signature.

Only one PBXSession instance for a PBX/port combination should be created. The behavior is undefined if multiple PBXSession instances are created for the same PBX and port.


Constructor & Destructor Documentation

PBXSession ( string  pbxSystem,
int  port 
)

Constructs a PBXSession object.

Parameters:
pbxSystem The name or IP address of the PBX system.
port The port on the PBX system to which the client is connecting.

Member Function Documentation

delegate void AsyncCallback ( PBXSession  sessionObject,
byte[]  asyncData 
)

Declaration of a callback function to be invoked when an asynchronous message is received, such as from a monitor session.

Parameters:
sessionObject The session object for the PBX that generated the asynchronous message.
asyncData The data received asynchronously from the PBX.
void Close ( CSTAContext  threadContext  ) 

Terminates the session to the PBX. This method can be used to terminate sessions with PBX devices that don't accept ACSE release association requests.

Parameters:
threadContext The context object for the caling thread.
delegate void ConnectionCallback ( PBXSession  sessionObject  ) 

Declaration of a callback function to be invoked if the connection to the PBX is lost.

Parameters:
sessionObject The session object for the PBX whose connection was lost.
void Open ( CSTAContext  threadContext  ) 

This method can be used to establish communication with a PBX device before any messages are actually sent to the device.

Parameters:
threadContext The thread context object.
SocketState SendACSEMessage ( byte[]  message,
int  messageLength,
Constants.ACSEMessageTypes  messageType,
CSTAContext  threadContext 
)

This method sends an ACSE message (either Make Association or Release Association) to the PBX and receives the response. This operation is done synchronously. If the Make Association needs to be done (usually it does), it must be done before any threads for sending and receiving CSTA messages are started.

This method is only intended to be used by client code that encodes its own ACSEMakeAssociation or ACSEReleaseAssociation message. Most clients can probably use the MakeACSEAssociation() and ReleaseACSEAssociation() methods that are in each phase's helper classes.

Parameters:
message An encoded ACSE Make Association or Release Association message.
messageLength The length of the encoded message.
messageType A constant telling whether the message is an ACSE Make Association or an ACSE Release Association.
threadContext The thread context object.
Returns:
A populated SocketState instance.
void SendMessage ( string  messageType,
byte[]  message,
int  messageLength,
CSTAContext  threadContext 
)

This method sends a message to the PBX using TCP/IP.

Parameters:
messageType A string token to help identify the message in the CSTADLL log file.
message Byte array containing the encoded message to send.
messageLength The length of the encoded message.
threadContext The thread context object.
void SendMessage ( byte[]  message,
int  messageLength,
CSTAContext  threadContext 
)

This method sends a message to the PBX using TCP/IP.

Parameters:
message Byte array containing the encoded message to send.
messageLength The length of the encoded message.
threadContext The thread context object.
void WaitForROSEResponse ( CSTAContext  threadContext  ) 

This method waits for a response to a CSTA message sent with a ROSE header.

Parameters:
threadContext The CSTAContext object associated with the calling thread.

Property Documentation

AsyncCallback ClientCallback [get, set]

Holds a reference to an asynchronous callback function. This function will be invoked if data is received asynchronously from the PBX, such as from a monitor operation.

ConnectionCallback ConnectionLostCallback [get, set]

Holds a reference to an asynchronous callback function. This function will be invoked if the connection to the PBX is lost.

bool DebugClientCallback [get, set]

Enables easier debugging of asynchronous callback methods. If set to true, the read for the next message from the PBX won't occur until after the client callback method returns. Normally the read for the next message occurs before the client callback method is invoked. The default value for this property is false.

bool DebugMode [get, set]

Enables behavior that facilitates debugging of the CSTADLL software. This property is most likely useful only to Objective Systems staff.

int MaxReceiveTimeout [get, set]

Specifies the amount of time, in milliseconds, to wait for a respone to arrive from the PBX. The default value is 5,000 milliseconds (5 seconds).

string PBXSystem [get]

The TCIP/IP address or well-known name of the PBX.

int Port [get]

The port where the PBX listens for CSTA messages.