#include <bayonne.h>
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. | |
BayonneDriver * | getNext (void) |
Get next driver. | |
BayonneSession * | getIdle (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. | |
BayonneSpan * | getSpan (unsigned id) |
Get the nth span object associated with this driver. | |
BayonneSession * | getTimeslot (timeslot_t id) |
Get the session associated with the nth timeslot for this driver. | |
BayonneMsgport * | getMsgport (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 BayonneDriver * | getTrunking (void) |
Return primary trunk driver, if driver trunking. | |
static BayonneDriver * | getPrimary (void) |
Return the first loaded driver. | |
static BayonneDriver * | authorize (const char *userid, const char *secret) |
Authorize a user and return associated driver. | |
static BayonneDriver * | getRoot (void) |
static BayonneDriver * | getProtocol (void) |
Return primary protocol driver. | |
static BayonneDriver * | get (const char *id) |
Find and return driver object from id name. | |
static BayonneDriver * | loadDriver (const char *id) |
Load a bayonne driver into memory. | |
static BayonneDriver * | loadTrunking (const char *id) |
Load a bayonne trunking driver into memory, set protocols. | |
static BayonneDriver * | loadProtocol (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 | |
BayonneSession * | firstIdle |
BayonneSession * | lastIdle |
BayonneSession * | highIdle |
BayonneMsgport * | msgport |
BayonneDriver * | nextDriver |
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 BayonneDriver * | firstDriver |
static BayonneDriver * | lastDriver |
static BayonneDriver * | trunkDriver |
static BayonneDriver * | protoDriver |
static Semaphore | oink |
static bool | protocols |
static bool | stopping |
Friends | |
class __EXPORT | BayonneSession |
class __EXPORT | BayonneMsgport |
ost::BayonneDriver::BayonneDriver | ( | Keydata::Define * | pairs, | |
const char * | key, | |||
const char * | id, | |||
bool | virt = false | |||
) |
Create a driver instance.
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.
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).
userid | to check | |
secret | to check |
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.
userid | to authorize. | |
secret | to use. |
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.
virtual bool ost::BayonneDriver::suspend | ( | void | ) | [virtual] |
Suspend a driver.
virtual bool ost::BayonneDriver::resume | ( | void | ) | [virtual] |
Resume a driver.
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.
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.
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.
id | driver name. |
static BayonneDriver* ost::BayonneDriver::loadDriver | ( | const char * | id | ) | [static] |
Load a bayonne driver into memory.
id | driver name to load. |
static BayonneDriver* ost::BayonneDriver::loadTrunking | ( | const char * | id | ) | [static] |
Load a bayonne trunking driver into memory, set protocols.
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.
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.
items | array to save in. | |
max | count of elements available. |
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] |
static void ost::BayonneDriver::add | ( | BayonneSession * | session | ) | [static] |
Add session to driver idle list for getIdle, usually during stateIdle.
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.
session | being removed. |
timeslot_t ost::BayonneDriver::getFirst | ( | void | ) | [inline] |
Get first server timeslot this driver uses.
timeslot_t ost::BayonneDriver::getCount | ( | void | ) | [inline] |
Get the total number of timeslots this driver uses.
unsigned ost::BayonneDriver::getSpanFirst | ( | void | ) | [inline] |
Get the first span id used.
unsigned ost::BayonneDriver::getSpansUsed | ( | void | ) | [inline] |
Get the number of span objects used by driver.
const char* ost::BayonneDriver::getName | ( | void | ) | [inline] |
Get the name of the driver.
timeout_t ost::BayonneDriver::getResetTimer | ( | void | ) | [inline] |
Get the reset timer for this driver when resetting a thread in the step state.
timeout_t ost::BayonneDriver::getReleaseTimer | ( | void | ) | [inline] |
Get the release timer when releasing a trunk.
timeout_t ost::BayonneDriver::getHangupTimer | ( | void | ) | [inline] |
Get the hangup timer for hang time before going idle.
timeout_t ost::BayonneDriver::getPickupTimer | ( | void | ) | [inline] |
Get the pickup timer to wait for channel pickup.
timeout_t ost::BayonneDriver::getSeizeTimer | ( | void | ) | [inline] |
Get the sieze time to wait for dialtone on outbound call.
timeout_t ost::BayonneDriver::getHuntTimer | ( | void | ) | [inline] |
Get the hunting timer.
timeout_t ost::BayonneDriver::getFlashTimer | ( | void | ) | [inline] |
Get the programmed flash timer to signal trunk flash.
timeout_t ost::BayonneDriver::getInterdigit | ( | void | ) | [inline] |
Get default dtmf interdigit timer to use.
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.
unsigned ost::BayonneDriver::getAnswerCount | ( | void | ) | [inline] |
Get the number of rings to wait before answering.
BayonneSpan* ost::BayonneDriver::getSpan | ( | unsigned | id | ) |
Get the nth span object associated with this driver.
id | of nth span to return. |
BayonneSession* ost::BayonneDriver::getTimeslot | ( | timeslot_t | id | ) |
Get the session associated with the nth timeslot for this driver.
id | of nth timeslot of driver. |
BayonneMsgport* ost::BayonneDriver::getMsgport | ( | void | ) | [inline] |
Return the message port bound with this driver.
size_t ost::BayonneDriver::getAudioStack | ( | void | ) | [inline] |
Get the size of the stack for audio threads.
int ost::BayonneDriver::getAudioPriority | ( | void | ) | [inline] |
Get the thread priority to use for audio threads for this driver.
Audio::Level ost::BayonneDriver::getAudioLevel | ( | void | ) | [inline] |
Get the audio level for silence detection.
void ost::BayonneDriver::setLogging | ( | std::ostream * | output | ) | [inline] |
Set driver logging.
output | stream to log driver. |
bool ost::BayonneDriver::isSpanable | ( | unsigned | span | ) | [inline] |
Determine if a span is available.
span | associated with driver to check. |
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.
target | network destination | |
dial | string | |
output | buffer | |
size | of output buffer |
unsigned ost::BayonneDriver::getAvail | ( | void | ) | [inline] |
Get available timeslots.
virtual bool ost::BayonneDriver::isExternal | ( | const char * | dest | ) | [virtual] |
See if a given potential dialed number is an external entry in our registrar.
destination | to test. |
virtual bool ost::BayonneDriver::isRegistered | ( | const char * | dest | ) | [virtual] |
See if a given potential dialed number is registered.
destination | to test. |
virtual bool ost::BayonneDriver::isAvailable | ( | const char * | dest | ) | [virtual] |
See if a given potential dialed number is available.
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.
server | to test. |
virtual unsigned ost::BayonneDriver::getRegistration | ( | regauth_t * | data, | |
unsigned | count, | |||
const char * | id = NULL | |||
) | [virtual] |
Fill registration data.
data | array to fill. | |
number | of entries available. | |
optional | id to match. | |
optional | flag if only extensions. |
friend class __EXPORT BayonneSession [friend] |
friend class __EXPORT BayonneMsgport [friend] |
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] |
volatile unsigned short ost::BayonneDriver::active_calls |