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

Module Class Reference

Modules are used for protocol modules and detached threads used to service key Bayonne protocols and interfaces. Module interface class. More...

#include <bayonne.h>

List of all members.

Public Methods

Module * getNext (void)
virtual char * getName (void)=0
 Get the "name" identifer of this module. More...

virtual char * Dispatch (Trunk *trunk)
 Execute the script request. More...

virtual unsigned Sleep (Trunk *trunk)
 This is used to determine if a timeout/sleep should occur or if script advance is immediate. More...

virtual void Detach (Trunk *trunk)
 Notify for detach. More...

virtual void Attach (Trunk *trunk)
 Notify for attach. More...

virtual TrunkImagegetXML (void)
 Create an XML parser resource. More...

virtual AudioSample * getPhrase (Trunk *trunk, const char *phrase)
 Provide audio output sample from phrase using pure TTS. More...

virtual const char * getSpeech (Trunk *trunk, char **domain, unsigned long mask, AudioSample *sample)
 Provide ASR processing of an audio sample using a domain vocabulary. More...

virtual void Reload (void)
 reload provisioning interface for fifos. More...

virtual bool Command (char **argv, ostream *out)
 fifo command extension. More...


Protected Methods

 Module ()
Module * getFirst (void)
virtual const char * getExtension (void)
 Get alternate script extensions. More...

virtual modtype_t getType (void)=0
 Get the "type" identifer of this module. More...

void addSession (void)
 Add as a session handling module. More...

void addCommand (void)
 Add fifo command handling module. More...

void addPrompts (void)
 Add module as url processing. More...

void addNetwork (void)
 Add module for net processing. More...

void addRequest (void)
 Add request handler back-end. More...

void enableTTS (void)
 Enable a TTS module. More...

void enableASR (void)
 Enable a ASR module. More...

virtual char * getPrompt (const char *original)
 Parse a url/prompt file into a fixed file path. More...

virtual void Expires (Request *request)
 Notify an expired request. More...

virtual void Running (Request *request)
 Notify a running request. More...

virtual void Cancelled (Request *request)
 Notify a cancelled request. More...

virtual int Accept (char *buffer, socklen_t len, statnode_t *node)
 Notify when a module network packet has been received and offer reply possibility. More...

virtual void Failover (statnode_t *node)
 Notify when a heartbeat dies... More...

virtual void Broadcast (void)
 Network synchronization to broadcast messages from a module thread. More...


Friends

class Fifo
class AudioService
class TrunkGroup
class Network
class aaImage
void broadcast (char *msgbuf, unsigned msglen)
void cancel (TrunkGroup *grp, const char *tag)
Module * getModule (modtype_t mod, const char *name=NULL)
void detachModules (Trunk *trunk)
void attachModules (Trunk *trunk)


Detailed Description

Modules are used for protocol modules and detached threads used to service key Bayonne protocols and interfaces. Module interface class.

These are done as loadable modules and may be replaced with application specific interfaces.

Author:
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

Module::Module   [protected]
 


Member Function Documentation

virtual int Module::Accept char *   buffer,
socklen_t   len,
statnode_t *   node
[inline, protected, virtual]
 

Notify when a module network packet has been received and offer reply possibility.

Returns:
!= 0 to claim packet, >0 if reply.
Parameters:
packet   buffer.
packet   length.
node   entity.

virtual void Module::Attach Trunk *   trunk [inline, virtual]
 

Notify for attach.

This can be used to set constants in the trunks symbol space for this module's use at call setup.

Parameters:
trunk   to attach to.

virtual void Module::Broadcast void   [inline, protected, virtual]
 

Network synchronization to broadcast messages from a module thread.

virtual void Module::Cancelled Request *   request [inline, protected, virtual]
 

Notify a cancelled request.

virtual bool Module::Command char **   argv,
ostream *   out
[inline, virtual]
 

fifo command extension.

virtual void Module::Detach Trunk *   trunk [inline, virtual]
 

Notify for detach.

As each call is detached, this will get called.

Parameters:
trunk   to detach from.

virtual char* Module::Dispatch Trunk *   trunk [inline, virtual]
 

Execute the script request.

Usually this involves creating a detached service thread.

Returns:
error message or NULL.
Parameters:
trunk   object to reference.

virtual void Module::Expires Request *   request [inline, protected, virtual]
 

Notify an expired request.

virtual void Module::Failover statnode_t *   node [inline, protected, virtual]
 

Notify when a heartbeat dies...

Parameters:
node   that heartbeat died on.

virtual void Module::Reload void   [inline, virtual]
 

reload provisioning interface for fifos.

virtual void Module::Running Request *   request [inline, protected, virtual]
 

Notify a running request.

virtual unsigned Module::Sleep Trunk *   trunk [inline, virtual]
 

This is used to determine if a timeout/sleep should occur or if script advance is immediate.

Returns:
number of seconds in sleep state.
Parameters:
trunk   object to reference.

void Module::addCommand void   [protected]
 

Add fifo command handling module.

void Module::addNetwork void   [protected]
 

Add module for net processing.

void Module::addPrompts void   [protected]
 

Add module as url processing.

void Module::addRequest void   [protected]
 

Add request handler back-end.

void Module::addSession void   [protected]
 

Add as a session handling module.

void Module::enableASR void   [inline, protected]
 

Enable a ASR module.

void Module::enableTTS void   [inline, protected]
 

Enable a TTS module.

virtual const char* Module::getExtension void   [inline, protected, virtual]
 

Get alternate script extensions.

Returns:
extension if used.

Module* Module::getFirst void   [inline, protected]
 

virtual char* Module::getName void   [pure virtual]
 

Get the "name" identifer of this module.

Returns:
name string.

Module* Module::getNext void   [inline]
 

virtual AudioSample* Module::getPhrase Trunk *   trunk,
const char *   phrase
[inline, virtual]
 

Provide audio output sample from phrase using pure TTS.

Returns:
audio sample object to play.
Parameters:
Trunk   reference.
text   phrase.

virtual char* Module::getPrompt const char *   original [inline, protected, virtual]
 

Parse a url/prompt file into a fixed file path.

virtual const char* Module::getSpeech Trunk *   trunk,
char **   domain,
unsigned long   mask,
AudioSample *   sample
[inline, virtual]
 

Provide ASR processing of an audio sample using a domain vocabulary.

Returns:
text output.
Parameters:
Trunk   reference.
Domain.  
Digit   mask.
Audio   sample.

virtual modtype_t Module::getType void   [protected, pure virtual]
 

Get the "type" identifer of this module.

Returns:
type id.

virtual TrunkImage* Module::getXML void   [inline, virtual]
 

Create an XML parser resource.

This produces a trunkimage instance.

Returns:
resource made by new.


Friends And Related Function Documentation

friend class AudioService [friend]
 

friend class Fifo [friend]
 

friend class Network [friend]
 

friend class TrunkGroup [friend]
 

friend class aaImage [friend]
 

void attachModules Trunk *   trunk [friend]
 

void broadcast char *   msgbuf,
unsigned   msglen
[friend]
 

void cancel TrunkGroup *   grp,
const char *   tag
[friend]
 

void detachModules Trunk *   trunk [friend]
 

Module* getModule modtype_t   mod,
const char *   name = NULL
[friend]
 


The documentation for this class was generated from the following file:
Generated at Wed Nov 21 12:17:04 2001 for Bayonne by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001