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

PBXSessionHelper Class Reference

List of all members.

Public Member Functions

delegate void AsyncCallback (byte[] asyncData)
delegate void ConnectionCallback ()

Static Public Member Functions

static void Close (CSTAContext threadContext)
static void Init (string pbxSystem, int port)
static void Open (CSTAContext threadContext)
static SocketState SendACSEMessage (byte[] message, int messageLength, Constants.ACSEMessageTypes messageType, CSTAContext threadContext)
static void SendMessage (string messageType, byte[] message, int messageLength, CSTAContext threadContext)
static void SendMessage (byte[] message, int messageLength, CSTAContext threadContext)
static void WaitForROSEResponse (CSTAContext threadContext)

Properties

static AsyncCallback ClientCallback [get, set]
static ConnectionCallback ConnectionLostCallback [get, set]
static bool DebugMode [get, set]
static bool LoggingEnabled [get, set]
static string LoggingFolder [get, set]

Detailed Description

Manages the communication with the PBX. This class is a static helper class that allows a client of the DLL to communicate with a single PBX.


Member Function Documentation

delegate void AsyncCallback ( byte[]  asyncData  ) 

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

Parameters:
asyncData The data received asynchronously from the PBX.
static void Close ( CSTAContext  threadContext  )  [static]

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 (  ) 

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

static void Init ( string  pbxSystem,
int  port 
) [static]

Initializes the PBX Session.

Parameters:
pbxSystem The name or IP address of the PBX system.
port The port on the PBX system to which the client is connecting.
static void Open ( CSTAContext  threadContext  )  [static]

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.
static SocketState SendACSEMessage ( byte[]  message,
int  messageLength,
Constants.ACSEMessageTypes  messageType,
CSTAContext  threadContext 
) [static]

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.
static void SendMessage ( string  messageType,
byte[]  message,
int  messageLength,
CSTAContext  threadContext 
) [static]

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.
static void SendMessage ( byte[]  message,
int  messageLength,
CSTAContext  threadContext 
) [static]

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.
static void WaitForROSEResponse ( CSTAContext  threadContext  )  [static]

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 [static, 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 [static, get, set]

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

bool DebugMode [static, get, set]

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

bool LoggingEnabled [static, get, set]

Determines whether logging of traffic between the client and the PBX will be done.

string LoggingFolder [static, get, set]

Specifies a folder to receive the log file. If not specified, the log file will go into whatever folder the calling .exe resides in.