Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Trunk Class Reference

We derive a Bayonne server version of ScriptInterp, "Trunk", which holds most common elements of the script engine for Bayonne use. Bayonne channel port script engine. More...

#include <bayonne.h>

Inheritance diagram for Trunk:

ScriptInterp List of all members.

Public Methods

virtual unsigned long getCapabilities (void)
 Get driver capabilities. More...

virtual void getName (char *buffer) = 0
 Get the device logical name number. More...

virtual bool postEvent (TrunkEvent *event) = 0
 Invoke a runtime state handler for a trunk driver. More...

int getDigit (char digit)
 Compute the DTMF digit id of a character. More...

bool isReady (void)
 See if trunk is idle and available. More...


Protected Methods

virtual ConferencegetConference (void)
 Return the current conference resource. More...

virtual void exitConference (void)
 Disconnect from a conference resource.

unsigned long getTrapDefault (void)
 Our default mask includes timeout. More...

void setConstant (const char *id, const char *data)
 This is used to initialize constant variables in the symbol space. More...

scriptsymbol_t* getEntry (const char *symname, int size)
 This provides an interface to internal symbol definitions. More...

void Commit (scriptsymbol_t *sym)
 A derived Commit handler, allows "clear digits", etc. More...

int getTimeout (void)
 Get a "timeout" option. More...

int getInterdigit (void)
 Get a "interdigit" timeout option. More...

unsigned short getDigitMask (void)
 Get a dtmf bit "mask". More...

bool TrunkSignal (trunksignal_t)
 Notify the script subsystem of a completion event. More...

virtual void setDTMFDetect (void)
 This function sets dtmf detection based on the script interpreter's current trap mask. More...

virtual void setDTMFDetect (bool enable)
 Set actual dtmf detection in the derived trunk class driver. More...

virtual void stopServices (void)
 This is used to reset service threads and generally cleanup the session handler. More...

virtual void TrunkStep (trunkstep_t step) = 0
 Used to perform state transitions when trunk is in "step" state, from the Bayonne script engine. More...

bool idleHangup ()
 This is used to see if the total timer has expired. More...

virtual unsigned long getIdleTime (void) = 0
 This is used to determine if the trunk is currently "idle" and for how long. More...

bool ScriptStep (void)
 This is used to post a step update back to the script engine.

bool Attach (const char *scrname)
 We override ScriptInterp::Attach with our own that adds additional support. More...

void Detach (void)
 We override ScriptInterp::Detach with our own that adds additional support to purge the variable pool.

unsigned long getMask (void)
 Get the interpter mask or manager mask.

char** getInitial (char **args)
 We get the scheduled or dnis or callerid map table values. More...

void setList (char **list)
 Set a list of keyword values into the variable space of the script interpreter. More...

 Trunk (int port)

Protected Attributes

ScriptInterface* script
TrunkGroupgroup
PortManagermanager
int id
time_t start
time_t idle
int idle_timer
int rings
int digits
Servicethread
trunkdata_t data
execdata_t tgi
digitsymbol_t dtmf
struct {
   bool   offhook
   bool   dtmf
   bool   script
   bool   reset
   bool   timer
   bool   audio
   bool   once
   bool   ready
   bool   echo
   unsigned   temp
   trunkmode_t   trunk
   dspmode_t   dsp
flags

Static Protected Attributes

ScriptSymbol globals
char digit [16]

Friends

class  TestDebug
class  aaScript
class  Translator
class  ScriptInterface
class  Service
class  AudioService
class  Fifo
class  PortManager

Detailed Description

We derive a Bayonne server version of ScriptInterp, "Trunk", which holds most common elements of the script engine for Bayonne use. Bayonne channel port script engine.

This is also the base of the channel port structure for Bayonne. Drivers will further derive this as "DriverTrunk".

Author(s):
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

Trunk::Trunk ( int port ) [protected]
 


Member Function Documentation

bool Trunk::Attach ( const char * scrname ) [protected]
 

We override ScriptInterp::Attach with our own that adds additional support.

This attach initializes a series of required and default "variables" for the script interpreter.

Returns:
true on success
Parameters:
name   of script to start.

void Trunk::Commit ( scriptsymbol_t * sym ) [protected]
 

A derived Commit handler, allows "clear digits", etc.

Parameters:
symbol   entry.

void Trunk::Detach ( void ) [protected]
 

We override ScriptInterp::Detach with our own that adds additional support to purge the variable pool.

bool Trunk::ScriptStep ( void ) [protected]
 

This is used to post a step update back to the script engine.

bool Trunk::TrunkSignal ( trunksignal_t ) [protected]
 

Notify the script subsystem of a completion event.

Parameters:
completion   event signal id.

void Trunk::TrunkStep ( trunkstep_t step ) [protected, pure virtual]
 

Used to perform state transitions when trunk is in "step" state, from the Bayonne script engine.

This call is used rather than "postEvent" with TRUNK_MAKE_STEP since the Bayonne engine is already in the context of the callback thread and invoked from a postEvent initiated call. Hence, this saves the overhead rather of a recursive postEvent call.

Parameters:
new   state to use.

void Trunk::exitConference ( void ) [inline, protected, virtual]
 

Disconnect from a conference resource.

unsigned long Trunk::getCapabilities ( void ) [inline, virtual]
 

Get driver capabilities.

Returns:
capability mask.

Conference * Trunk::getConference ( void ) [inline, protected, virtual]
 

Return the current conference resource.

Returns:
conference resource member of.

int Trunk::getDigit ( char digit )
 

Compute the DTMF digit id of a character.

Returns:
dtmf digit or -1.

unsigned short Trunk::getDigitMask ( void ) [protected]
 

Get a dtmf bit "mask".

Returns:
dtmf bit mask of digits.

scriptsymbol_t * Trunk::getEntry ( const char * symname,
int size ) [protected]
 

This provides an interface to internal symbol definitions.

Returns:
symbol entry.
Parameters:
symbol   name.
allocation   size if not found.

unsigned long Trunk::getIdleTime ( void ) [protected, pure virtual]
 

This is used to determine if the trunk is currently "idle" and for how long.

Returns:
number of seconds idle.

char ** Trunk::getInitial ( char ** args ) [protected]
 

We get the scheduled or dnis or callerid map table values.

Returns:
argument list for startup.
Parameters:
buffer   for defaults.

int Trunk::getInterdigit ( void ) [protected]
 

Get a "interdigit" timeout option.

This is like getValue, however the interdigit value supplied is from the const table.

Returns:
interdigit timeout in seconds.

unsigned long Trunk::getMask ( void ) [protected]
 

Get the interpter mask or manager mask.

void Trunk::getName ( char * buffer ) [pure virtual]
 

Get the device logical name number.

Parameters:
Buffer   to store name.

int Trunk::getTimeout ( void ) [protected]
 

Get a "timeout" option.

This is like getValue, however the default timeout supplied is from the constant table.

Returns:
default timeout in seconds.

unsigned long Trunk::getTrapDefault ( void ) [inline, protected]
 

Our default mask includes timeout.

Returns:
default mask.

bool Trunk::idleHangup ( ) [protected]
 

This is used to see if the total timer has expired.

Returns:
true if should hangup.

bool Trunk::isReady ( void )
 

See if trunk is idle and available.

Returns:
true if ready.

bool Trunk::postEvent ( TrunkEvent * event ) [pure virtual]
 

Invoke a runtime state handler for a trunk driver.

This must be in an event in the derived TrunkDriver class.

Returns:
true if event claimed.
Parameters:
derived   method to call.

void Trunk::setConstant ( const char * id,
const char * data ) [protected]
 

This is used to initialize constant variables in the symbol space.

These are assumed to be constant for the current session as variables are purged between sessions.

Parameters:
symbol   name.
symbol   value.

void Trunk::setDTMFDetect ( bool enable ) [inline, protected, virtual]
 

Set actual dtmf detection in the derived trunk class driver.

This typically is called by the "initial" state handler when entering a trunk driver call processing state when an implicit setting is required (such as "collect", which forces enable).

Parameters:
true   to enable DTMF detection.

void Trunk::setDTMFDetect ( void ) [protected, virtual]
 

This function sets dtmf detection based on the script interpreter's current trap mask.

This is often used as the initial handler for setting dtmf detection when entering each trunk driver's state.

void Trunk::setList ( char ** list ) [protected]
 

Set a list of keyword values into the variable space of the script interpreter.

Parameters:
list   of keyword pairs.

void Trunk::stopServices ( void ) [protected, virtual]
 

This is used to reset service threads and generally cleanup the session handler.

It is a virtual since driver specific implimentations may vary.


Friends And Related Function Documentation

class AudioService [friend]
 

class Fifo [friend]
 

class PortManager [friend]
 

class ScriptInterface [friend]
 

class Service [friend]
 

class TestDebug [friend]
 

class Translator [friend]
 

class aaScript [friend]
 


Member Data Documentation

bool Trunk::audio [protected]
 

trunkdata_t Trunk::data [protected]
 

char Trunk::digit[16] [static, protected]
 

int Trunk::digits [protected]
 

dspmode_t Trunk::dsp [protected]
 

digitsymbol_t Trunk::dtmf [protected]
 

digitsymbol_t Trunk::dtmf [protected]
 

bool Trunk::echo [protected]
 

struct { ... } Trunk::flags [protected]
 

ScriptSymbol Trunk::globals [static, protected]
 

TrunkGroup * Trunk::group [protected]
 

int Trunk::id [protected]
 

time_t Trunk::idle [protected]
 

int Trunk::idle_timer [protected]
 

PortManager * Trunk::manager [protected]
 

bool Trunk::offhook [protected]
 

bool Trunk::once [protected]
 

bool Trunk::ready [protected]
 

bool Trunk::reset [protected]
 

int Trunk::rings [protected]
 

ScriptInterface * Trunk::script [protected]
 

ScriptInterface * Trunk::script [protected]
 

time_t Trunk::start [protected]
 

unsigned Trunk::temp [protected]
 

execdata_t Trunk::tgi [protected]
 

Service * Trunk::thread [protected]
 

bool Trunk::timer [protected]
 

trunkmode_t Trunk::trunk [protected]
 


The documentation for this class was generated from the following file:
Generated at Sun Jan 7 08:42:08 2001 for Bayonne by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000