SMDI Class Reference

[SMDI Index] [SMDI Heirarchy]


SMDI service thread base class. More...

#include <smdi.h>

Inherits: Thread, Mutex

Public Members

Protected Members


Detailed Description

The SMDI service thread responds to SMDI service events that are received and distributes those events through several abstract calls that can be defined in an application specific class. The SMDI service thread also defines entry points for sending SMDI control messages such as changing message waiting lamp status.


SMDI(int pri)

Create an SMDI service thread for the derived class at the specified priority level. The Start() method should be used to kick it off once the class is created.

Parameters:
pri level for the service thread.

virtual ~SMDI()

Destroy the SMDI service thread and any resources it uses.

int setMsgWaiting(char *target)

Turn the message waiting lamp on at the specified targeted directory number.

Parameters:
target directory station number.
Returns:
0 on success, -1 on error.

int clrMsgWaiting(char *target)

Turn the message waiting lamp off at the specified targeted directory number.

Parameters:
target directory station number.
Returns:
0 on success, -1 on error.

int getActivity(void)

Return number of seconds that have transpired since any SMDI message has been received and processed by the service thread. This can be used to determine if the link is broken.

Returns:
int number of seconds since last input received.

virtual void OnExit(void)

Handler to call in a derived class when contact with the SMDI data source has been broken. By default, it simply exits the SMDI service thread.

virtual void OnRing(int desk, int port, int mtype, char *cid, char *fwd)

Handler to call in derived class when an incoming ring event is received. SMDI ring events include SMDI_DIRECT, SMDI_FWDALL, SMDI_FWDBUSY, and SMDI_FWDNA.

Parameters:
cid calling station id.
fwd forwarding station for integrated greetings.
port number or line of SMDI entity ringing.
mtype message type identifier.
desk number of SMDI entity ringing.

virtual void OnStat(char *msg)

Handler to call in derived class when SMDI status messages are received. These are typically associated with message waiting lamp control requests.

Parameters:
msg status string from SMDI source.

virtual int SendMsgWaiting(char *msg)

Send SMDI message waiting message in either the network or serial protocol derived class.

Parameters:
msg waiting control string.
Returns:
-1 if error.

virtual char *Readline()

Read input from either the network or serial session protocol class.

Returns:
null if no data is available or null terminated string.

void Run(void)

SMDI service thread routine. This calls Readline to receive input from the session protocol (network or serial) and the various dispatch routines based on the type of message received.


  • Author: David Sugar <dyfet@ostel.com>
  • Documentation generated by dyfet@centauri.sys on Wed Jun 30 22:40:59 EDT 1999
Kdoc