ost::BayonneDriver Class Reference

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

#include <bayonne.h>

Inheritance diagram for ost::BayonneDriver:

ost::Bayonne ost::ReconfigKeydata ost::StaticKeydata ost::DynamicKeydata

List of all members.

Public Member Functions

virtual bool isAuthorized (const char *userid, const char *secret)
 Determine if user id and secret is authorized for this driver subsystem (registry).
virtual bool deregister (const char *id)
virtual bool reregister (const char *id, const char *uri, const char *secret, timeout_t expires)
 BayonneDriver (Keydata::Define *pairs, const char *key, const char *id, bool virt=false)
 Create a driver instance.
 ~BayonneDriver ()
 Destroy driver instance.
BayonneDrivergetNext (void)
 Get next driver.
BayonneSessiongetIdle (void)
 Get longest idle session to active for call processing.
virtual bool suspend (void)
 Suspend a driver.
virtual bool resume (void)
 Resume a driver.
virtual void reregister (void)
 Re-register.
virtual const char * registerScript (ScriptImage *image, Line *line)
 Process driver protocol specific proxy registration requests.
virtual const char * assignScript (ScriptImage *image, 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 getHuntTimer (void)
 Get the hunting timer.
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 *output, 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.
virtual bool isExternal (const char *dest)
 See if a given potential dialed number is an external entry in our registrar.
virtual bool isRegistered (const char *dest)
 See if a given potential dialed number is registered.
virtual bool isAvailable (const char *dest)
 See if a given potential dialed number is available.
virtual bool isReachable (const char *proxy)
 See if a given selected server is currently considered reachable.
virtual unsigned getRegistration (regauth_t *data, unsigned count, const char *id=NULL)
 Fill registration data.

Static Public Member Functions

static bool useProtocols (void)
 Return flag for protocols active.
static bool isStopping (void)
 Return is stopping flag.
static BayonneDrivergetTrunking (void)
 Return primary trunk driver, if driver trunking.
static BayonneDrivergetPrimary (void)
 Return the first loaded driver.
static BayonneDriverauthorize (const char *userid, const char *secret)
 Authorize a user and return associated driver.
static BayonneDrivergetRoot (void)
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 reload (void)
 Notify all drivers about reload.
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.

Public Attributes

Traffic call_attempts
Traffic call_complete
volatile unsigned short active_calls

Protected Member Functions

virtual void reloadDriver (void)
 Virtual to notify driver that a server image reload is in progress.
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.
void relistIdle (void)
 Relist idle drivers on high idle list, for drivers which do highwater marking allocation.

Protected Attributes

BayonneSessionfirstIdle
BayonneSessionlastIdle
BayonneSessionhighIdle
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 hunt_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
static bool stopping

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.

Author:
David Sugar <dyfet@gnutelephony.org> Bayonne driver node class.

Constructor & Destructor Documentation

ost::BayonneDriver::BayonneDriver ( Keydata::Define *  pairs,
const char *  key,
const char *  id,
bool  virt = false 
)

Create a driver instance.

Parameters:
pairs of default keyword entries for config.
key name of config key.
id string of driver.
whether virtual driver of some sort or real.

ost::BayonneDriver::~BayonneDriver (  ) 

Destroy driver instance.


Member Function Documentation

virtual void ost::BayonneDriver::reloadDriver ( void   )  [protected, virtual]

Virtual to notify driver that a server image reload is in progress.

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.

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

Virtual to override method for clean shutdown of the driver.

void ost::BayonneDriver::relistIdle ( void   )  [protected]

Relist idle drivers on high idle list, for drivers which do highwater marking allocation.

virtual bool ost::BayonneDriver::isAuthorized ( const char *  userid,
const char *  secret 
) [virtual]

Determine if user id and secret is authorized for this driver subsystem (registry).

Parameters:
userid to check
secret to check
Returns:
true if authorized

virtual bool ost::BayonneDriver::deregister ( const char *  id  )  [virtual]

virtual bool ost::BayonneDriver::reregister ( const char *  id,
const char *  uri,
const char *  secret,
timeout_t  expires 
) [virtual]

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

Return flag for protocols active.

static bool ost::BayonneDriver::isStopping ( void   )  [inline, static]

Return is stopping flag.

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

Return primary trunk driver, if driver trunking.

..

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

Return the first loaded driver.

static BayonneDriver* ost::BayonneDriver::authorize ( const char *  userid,
const char *  secret 
) [static]

Authorize a user and return associated driver.

Parameters:
userid to authorize.
secret to use.
Returns:
driver authorized under or NULL.

BayonneDriver* ost::BayonneDriver::getNext ( void   )  [inline]

Get next driver.

..

static BayonneDriver* ost::BayonneDriver::getRoot ( void   )  [inline, static]

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

Return primary protocol driver.

..

BayonneSession* ost::BayonneDriver::getIdle ( void   ) 

Get longest idle session to active for call processing.

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

virtual bool ost::BayonneDriver::suspend ( void   )  [virtual]

Suspend a driver.

Returns:
true if successful.

virtual bool ost::BayonneDriver::resume ( void   )  [virtual]

Resume a driver.

Returns:
true if successful.

virtual void ost::BayonneDriver::reregister ( void   )  [virtual]

Re-register.

virtual const char* ost::BayonneDriver::registerScript ( ScriptImage *  image,
Line *  line 
) [virtual]

Process driver protocol specific proxy registration requests.

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

virtual const char* ost::BayonneDriver::assignScript ( ScriptImage *  image,
Line *  line 
) [virtual]

Process driver specific assign requests.

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

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

Find and return driver object from id name.

Parameters:
id driver name.
Returns:
associated driver node.

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

Load a bayonne driver into memory.

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

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.

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 unsigned ost::BayonneDriver::list ( char **  items,
unsigned  max 
) [static]

Get list of driver names into string array.

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

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

Start all loaded drivers.

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

Stop all loaded drivers.

static void ost::BayonneDriver::reload ( void   )  [static]

Notify all drivers about reload.

Reimplemented from ost::Bayonne.

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

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

Parameters:
session being added.

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.

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

Get first server timeslot this driver uses.

Returns:
first server timeslot for driver.

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

Get the total number of timeslots this driver uses.

Returns:
total timeslots for driver.

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.

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

Get the name of the driver.

Returns:
name of driver.

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::getReleaseTimer ( void   )  [inline]

Get the release timer when releasing a trunk.

Returns:
release 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.

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

Get the pickup timer to wait for channel pickup.

Returns:
pickup timer in milliseconds.

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

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

Returns:
seize timer in milliseconds.

timeout_t ost::BayonneDriver::getHuntTimer ( void   )  [inline]

Get the hunting timer.

Returns:
hunt timer in milliseconds.

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::getInterdigit ( void   )  [inline]

Get default dtmf interdigit timer to use.

Returns:
interdigit 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.

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

Get the number of rings to wait before answering.

Returns:
number of rings before answer.

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

Get the nth span object associated with this driver.

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

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

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

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

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

Return the message port bound with this driver.

Returns:
bound msgport for driver.

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

Get the size of the stack for audio threads.

Returns:
stack size in bytes.

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

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

Returns:
thread priority.

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

Get the audio level for silence detection.

Returns:
audio threashold for silence.

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

Set driver logging.

Parameters:
output stream to log driver.

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.

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

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

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

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

Get available timeslots.

Returns:
available slots.

virtual bool ost::BayonneDriver::isExternal ( const char *  dest  )  [virtual]

See if a given potential dialed number is an external entry in our registrar.

Returns:
true if external.
Parameters:
destination to test.

virtual bool ost::BayonneDriver::isRegistered ( const char *  dest  )  [virtual]

See if a given potential dialed number is registered.

Returns:
true if extern and registered.
Parameters:
destination to test.

virtual bool ost::BayonneDriver::isAvailable ( const char *  dest  )  [virtual]

See if a given potential dialed number is available.

Returns:
true if extern and available.
Parameters:
destination to test.

virtual bool ost::BayonneDriver::isReachable ( const char *  proxy  )  [virtual]

See if a given selected server is currently considered reachable.

This could be used for failover.

Returns:
true if reachable.
Parameters:
server to test.

virtual unsigned ost::BayonneDriver::getRegistration ( regauth_t data,
unsigned  count,
const char *  id = NULL 
) [virtual]

Fill registration data.

Returns:
number of records filled.
Parameters:
data array to fill.
number of entries available.
optional id to match.
optional flag if only extensions.


Friends And Related Function Documentation

friend class __EXPORT BayonneSession [friend]

friend class __EXPORT BayonneMsgport [friend]


Member Data Documentation

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

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

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

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

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

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

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

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

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

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

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

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

timeslot_t ost::BayonneDriver::timeslot [protected]

timeslot_t ost::BayonneDriver::count [protected]

unsigned ost::BayonneDriver::avail [protected]

unsigned ost::BayonneDriver::span [protected]

unsigned ost::BayonneDriver::spans [protected]

bool ost::BayonneDriver::running [protected]

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

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

int ost::BayonneDriver::audio_priority [protected]

size_t ost::BayonneDriver::audio_stack [protected]

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

timeout_t ost::BayonneDriver::pickup_timer [protected]

timeout_t ost::BayonneDriver::hangup_timer [protected]

timeout_t ost::BayonneDriver::seize_timer [protected]

timeout_t ost::BayonneDriver::ring_timer [protected]

timeout_t ost::BayonneDriver::hunt_timer [protected]

timeout_t ost::BayonneDriver::reset_timer [protected]

Reimplemented from ost::Bayonne.

timeout_t ost::BayonneDriver::release_timer [protected]

timeout_t ost::BayonneDriver::flash_timer [protected]

timeout_t ost::BayonneDriver::interdigit_timer [protected]

unsigned ost::BayonneDriver::answer_count [protected]

Traffic ost::BayonneDriver::call_attempts

Traffic ost::BayonneDriver::call_complete

volatile unsigned short ost::BayonneDriver::active_calls


The documentation for this class was generated from the following file:
Generated on Wed Jan 16 04:45:26 2008 for Bayonne by  doxygen 1.5.4