ost::BayonneDriver Class Reference

The principle driver node for a given collection of spans and sessions of a given Bayonne driver family type.Bayonne driver node class. More...

#include <bayonne.h>

Inheritance diagram for ost::BayonneDriver:

ost::Bayonne List of all members.

Public Member Functions

 BayonneDriver (Keydata::Define *pairs, const char *cfg, const char *id, bool pri)
 Create a driver instance.
 ~BayonneDriver ()
 Destroy driver instance.
BayonneSessiongetIdle (void)
 Get longest idle session to active for call processing.
virtual const char * registerScript (ScriptImage *img, Line *line)
 Process driver protocol specific proxy registration requests.
virtual const char * assignScript (ScriptImage *img, Line *line)
 Process driver specific assign requests.
timeslot_t getFirst (void)
 Get first server timeslot this driver uses.
timeslot_t getCount (void)
 Get the total number of timeslots this driver uses.
unsigned getSpanFirst (void)
 Get the first span id used.
unsigned getSpansUsed (void)
 Get the number of span objects used by driver.
const char * getName (void)
 Get the name of the driver.
timeout_t getResetTimer (void)
 Get the reset timer for this driver when resetting a thread in the step state.
timeout_t getReleaseTimer (void)
 Get the release timer when releasing a trunk.
timeout_t getHangupTimer (void)
 Get the hangup timer for hang time before going idle.
timeout_t getPickupTimer (void)
 Get the pickup timer to wait for channel pickup.
timeout_t getSeizeTimer (void)
 Get the sieze time to wait for dialtone on outbound call.
timeout_t getFlashTimer (void)
 Get the programmed flash timer to signal trunk flash.
timeout_t getInterdigit (void)
 Get default dtmf interdigit timer to use.
timeout_t getRingTimer (void)
 Get the timer to wait for next ring before deciding a call has dissapeared.
unsigned getAnswerCount (void)
 Get the number of rings to wait before answering.
BayonneSpangetSpan (unsigned id)
 Get the nth span object associated with this driver.
BayonneSessiongetTimeslot (timeslot_t id)
 Get the session associated with the nth timeslot for this driver.
BayonneMsgportgetMsgport (void)
 Return the message port bound with this driver.
size_t getAudioStack (void)
 Get the size of the stack for audio threads.
int getAudioPriority (void)
 Get the thread priority to use for audio threads for this driver.
Audio::Level getAudioLevel (void)
 Get the audio level for silence detection.
void setLogging (std::ostream *output)
 Set driver logging.
bool isSpanable (unsigned span)
 Determine if a span is available.
virtual bool getDestination (const char *target, const char *dial, char *buffer, size_t size)
 Deterime if a network destination is reachable through this driver, and convert dialing string into network reference.
unsigned getAvail (void)
 Get available timeslots.

Static Public Member Functions

static bool useProtocols (void)
 Return flag for protocols active.
static BayonneDrivergetTrunking (void)
 Return primary trunk driver, if driver trunking.
static BayonneDrivergetPrimary (void)
 Return the first loaded driver.
static BayonneDrivergetProtocol (void)
 Return primary protocol driver.
static BayonneDriverget (const char *id)
 Find and return driver object from id name.
static BayonneDriverloadDriver (const char *id)
 Load a bayonne driver into memory.
static BayonneDriverloadTrunking (const char *id)
 Load a bayonne trunking driver into memory, set protocols.
static BayonneDriverloadProtocol (const char *id, unsigned timeslots=0)
 Load a protocol driver into memory, set timeslots.
static unsigned list (char **items, unsigned max)
 Get list of driver names into string array.
static void start (void)
 Start all loaded drivers.
static void stop (void)
 Stop all loaded drivers.
static void add (BayonneSession *session)
 Add session to driver idle list for getIdle, usually during stateIdle.
static void del (BayonneSession *session)
 Remove session from driver idle list if still present.

Protected Member Functions

virtual void startDriver (void)
 Virtual to override method for activating the driver and creating all session and span objects associated with it.
virtual void stopDriver (void)
 Virtual to override method for clean shutdown of the driver.

Protected Attributes

BayonneSessionfirstIdle
BayonneSessionlastIdle
BayonneMsgportmsgport
BayonneDrivernextDriver
const char * name
timeslot_t timeslot
timeslot_t count
unsigned avail
unsigned span
unsigned spans
bool running
std::ostream * logevents
int audio_priority
size_t audio_stack
Audio::Level audio_level
timeout_t pickup_timer
timeout_t hangup_timer
timeout_t seize_timer
timeout_t ring_timer
timeout_t reset_timer
timeout_t release_timer
timeout_t flash_timer
timeout_t interdigit_timer
unsigned answer_count

Static Protected Attributes

static BayonneDriverfirstDriver
static BayonneDriverlastDriver
static BayonneDrivertrunkDriver
static BayonneDriverprotoDriver
static Semaphore oink
static bool protocols

Friends

class __EXPORT BayonneSession
class __EXPORT BayonneMsgport

Detailed Description

The principle driver node for a given collection of spans and sessions of a given Bayonne driver family type.Bayonne driver node class.

Author:
David Sugar <dyfet@gnutelephony.org>


Constructor & Destructor Documentation

ost::BayonneDriver::BayonneDriver Keydata::Define *  pairs,
const char *  cfg,
const char *  id,
bool  pri
 

Create a driver instance.

Parameters:
default keyword entries for config.
name of config key.
driver id string.
whether front load or use all timeslots.

ost::BayonneDriver::~BayonneDriver  ) 
 

Destroy driver instance.


Member Function Documentation

static void ost::BayonneDriver::add BayonneSession session  )  [static]
 

Add session to driver idle list for getIdle, usually during stateIdle.

Parameters:
session being added.

virtual const char* ost::BayonneDriver::assignScript ScriptImage *  img,
Line *  line
[virtual]
 

Process driver specific assign requests.

Returns:
error message if invalid request, NULL if ok.
Parameters:
script image being compiled.
line record of "assign" command.

static void ost::BayonneDriver::del BayonneSession session  )  [static]
 

Remove session from driver idle list if still present.

Usually when changing from idle to an active state.

Parameters:
session being removed.

static BayonneDriver* ost::BayonneDriver::get const char *  id  )  [static]
 

Find and return driver object from id name.

Parameters:
driver name.
Returns:
associated driver node.

unsigned ost::BayonneDriver::getAnswerCount void   )  [inline]
 

Get the number of rings to wait before answering.

Returns:
number of rings before answer.

Audio::Level ost::BayonneDriver::getAudioLevel void   )  [inline]
 

Get the audio level for silence detection.

Returns:
audio threashold for silence.

int ost::BayonneDriver::getAudioPriority void   )  [inline]
 

Get the thread priority to use for audio threads for this driver.

Returns:
thread priority.

size_t ost::BayonneDriver::getAudioStack void   )  [inline]
 

Get the size of the stack for audio threads.

Returns:
stack size in bytes.

unsigned ost::BayonneDriver::getAvail void   )  [inline]
 

Get available timeslots.

Returns:
available slots.

timeslot_t ost::BayonneDriver::getCount void   )  [inline]
 

Get the total number of timeslots this driver uses.

Returns:
total timeslots for driver.

virtual bool ost::BayonneDriver::getDestination const char *  target,
const char *  dial,
char *  buffer,
size_t  size
[virtual]
 

Deterime if a network destination is reachable through this driver, and convert dialing string into network reference.

Parameters:
network destination
dialing string
output buffer
size of output buffer
Returns:
true if reachable

timeslot_t ost::BayonneDriver::getFirst void   )  [inline]
 

Get first server timeslot this driver uses.

Returns:
first server timeslot for driver.

timeout_t ost::BayonneDriver::getFlashTimer void   )  [inline]
 

Get the programmed flash timer to signal trunk flash.

Returns:
flash timer in milliseconds.

timeout_t ost::BayonneDriver::getHangupTimer void   )  [inline]
 

Get the hangup timer for hang time before going idle.

Returns:
hangup timer in milliseconds.

BayonneSession* ost::BayonneDriver::getIdle void   ) 
 

Get longest idle session to active for call processing.

Returns:
handle to longest idle session, if none idle, NULL.

timeout_t ost::BayonneDriver::getInterdigit void   )  [inline]
 

Get default dtmf interdigit timer to use.

Returns:
interdigit timer in milliseconds.

BayonneMsgport* ost::BayonneDriver::getMsgport void   )  [inline]
 

Return the message port bound with this driver.

Returns:
bound msgport for driver.

const char* ost::BayonneDriver::getName void   )  [inline]
 

Get the name of the driver.

Returns:
name of driver.

timeout_t ost::BayonneDriver::getPickupTimer void   )  [inline]
 

Get the pickup timer to wait for channel pickup.

Returns:
pickup timer in milliseconds.

static BayonneDriver* ost::BayonneDriver::getPrimary void   )  [inline, static]
 

Return the first loaded driver.

static BayonneDriver* ost::BayonneDriver::getProtocol void   )  [inline, static]
 

Return primary protocol driver.

..

timeout_t ost::BayonneDriver::getReleaseTimer void   )  [inline]
 

Get the release timer when releasing a trunk.

Returns:
release timer in milliseconds.

timeout_t ost::BayonneDriver::getResetTimer void   )  [inline]
 

Get the reset timer for this driver when resetting a thread in the step state.

Returns:
reset timer in milliseconds.

timeout_t ost::BayonneDriver::getRingTimer void   )  [inline]
 

Get the timer to wait for next ring before deciding a call has dissapeared.

Used when set to answer on nth ring.

Returns:
ring timer in milliseconds. see getAnswerCount.

timeout_t ost::BayonneDriver::getSeizeTimer void   )  [inline]
 

Get the sieze time to wait for dialtone on outbound call.

Returns:
seize timer in milliseconds.

BayonneSpan* ost::BayonneDriver::getSpan unsigned  id  ) 
 

Get the nth span object associated with this driver.

Parameters:
nth span to return.
Returns:
span object or NULL if past limit/no spans.

unsigned ost::BayonneDriver::getSpanFirst void   )  [inline]
 

Get the first span id used.

Returns:
span id.

unsigned ost::BayonneDriver::getSpansUsed void   )  [inline]
 

Get the number of span objects used by driver.

Returns:
span count.

BayonneSession* ost::BayonneDriver::getTimeslot timeslot_t  id  ) 
 

Get the session associated with the nth timeslot for this driver.

Parameters:
nth timeslot of driver.
Returns:
session object.

static BayonneDriver* ost::BayonneDriver::getTrunking void   )  [inline, static]
 

Return primary trunk driver, if driver trunking.

..

bool ost::BayonneDriver::isSpanable unsigned  span  )  [inline]
 

Determine if a span is available.

Parameters:
span associated with driver to check.
Returns:
true if available ports.

static unsigned ost::BayonneDriver::list char **  items,
unsigned  max
[static]
 

Get list of driver names into string array.

Parameters:
array to save in.
count of elements available.
Returns:
number of drivers.

static BayonneDriver* ost::BayonneDriver::loadDriver const char *  id  )  [static]
 

Load a bayonne driver into memory.

Parameters:
prefix path to load.
driver name to load.
Returns:
NULL or pointer to loaded driver.

static BayonneDriver* ost::BayonneDriver::loadProtocol const char *  id,
unsigned  timeslots = 0
[static]
 

Load a protocol driver into memory, set timeslots.

Returns:
NULL or pointer to loaded protocol.
Parameters:
id of protocol driver to load.
timeslots of protocol.

static BayonneDriver* ost::BayonneDriver::loadTrunking const char *  id  )  [static]
 

Load a bayonne trunking driver into memory, set protocols.

Returns:
NULL or pointer to loaded driver.
Parameters:
id of trunking driver to load.

virtual const char* ost::BayonneDriver::registerScript ScriptImage *  img,
Line *  line
[virtual]
 

Process driver protocol specific proxy registration requests.

Returns:
error message if invalid request, NULL if ok.
Parameters:
script image being compiled.
line record of "register" command.

void ost::BayonneDriver::setLogging std::ostream *  output  )  [inline]
 

Set driver logging.

Parameters:
stream to log driver.

static void ost::BayonneDriver::start void   )  [static]
 

Start all loaded drivers.

virtual void ost::BayonneDriver::startDriver void   )  [protected, virtual]
 

Virtual to override method for activating the driver and creating all session and span objects associated with it.

static void ost::BayonneDriver::stop void   )  [static]
 

Stop all loaded drivers.

virtual void ost::BayonneDriver::stopDriver void   )  [protected, virtual]
 

Virtual to override method for clean shutdown of the driver.

static bool ost::BayonneDriver::useProtocols void   )  [inline, static]
 

Return flag for protocols active.


Friends And Related Function Documentation

friend class __EXPORT BayonneMsgport [friend]
 

friend class __EXPORT BayonneSession [friend]
 


Member Data Documentation

unsigned ost::BayonneDriver::answer_count [protected]
 

Audio::Level ost::BayonneDriver::audio_level [protected]
 

int ost::BayonneDriver::audio_priority [protected]
 

size_t ost::BayonneDriver::audio_stack [protected]
 

unsigned ost::BayonneDriver::avail [protected]
 

timeslot_t ost::BayonneDriver::count [protected]
 

BayonneDriver* ost::BayonneDriver::firstDriver [static, protected]
 

BayonneSession* ost::BayonneDriver::firstIdle [protected]
 

timeout_t ost::BayonneDriver::flash_timer [protected]
 

timeout_t ost::BayonneDriver::hangup_timer [protected]
 

timeout_t ost::BayonneDriver::interdigit_timer [protected]
 

BayonneDriver* ost::BayonneDriver::lastDriver [static, protected]
 

BayonneSession * ost::BayonneDriver::lastIdle [protected]
 

std::ostream* ost::BayonneDriver::logevents [protected]
 

BayonneMsgport* ost::BayonneDriver::msgport [protected]
 

const char* ost::BayonneDriver::name [protected]
 

BayonneDriver* ost::BayonneDriver::nextDriver [protected]
 

Semaphore ost::BayonneDriver::oink [static, protected]
 

timeout_t ost::BayonneDriver::pickup_timer [protected]
 

bool ost::BayonneDriver::protocols [static, protected]
 

BayonneDriver* ost::BayonneDriver::protoDriver [static, protected]
 

timeout_t ost::BayonneDriver::release_timer [protected]
 

timeout_t ost::BayonneDriver::reset_timer [protected]
 

Reimplemented from ost::Bayonne.

timeout_t ost::BayonneDriver::ring_timer [protected]
 

bool ost::BayonneDriver::running [protected]
 

timeout_t ost::BayonneDriver::seize_timer [protected]
 

unsigned ost::BayonneDriver::span [protected]
 

unsigned ost::BayonneDriver::spans [protected]
 

timeslot_t ost::BayonneDriver::timeslot [protected]
 

BayonneDriver* ost::BayonneDriver::trunkDriver [static, protected]
 


The documentation for this class was generated from the following file:
Generated on Tue May 2 13:21:09 2006 for Bayonne by  doxygen 1.4.6