#include <yatesig.h>
Public Types | |
enum | Type { Unknown = 0, Local, TDM, RTP, IAX } |
enum | Status { Missing = 0, Disabled, Idle, Reserved, Starting, Stopping, Connected } |
enum | LockFlags { LockLocalHWFail = 0x0001, LockLocalMaint = 0x0002, LockLocalHWFailChg = 0x0010, LockLocalMaintChg = 0x0020, LockRemoteHWFail = 0x0100, LockRemoteMaint = 0x0200, LockRemoteHWFailChg = 0x1000, LockRemoteMaintChg = 0x2000, LockLocal = LockLocalHWFail | LockLocalMaint, LockRemote = LockRemoteHWFail | LockRemoteMaint, LockLocked = LockLocal | LockRemote, LockLocalChg = LockLocalHWFailChg | LockLocalMaintChg, LockRemoteChg = LockRemoteHWFailChg | LockRemoteMaintChg, LockChanged = LockLocalChg | LockRemoteChg } |
Public Member Functions | |
virtual | ~SignallingCircuit () |
virtual bool | status (Status newStat, bool sync=false) |
Type | type () const |
Status | status () const |
int | locked (int flags=-1) const |
void | setLock (int flags) |
void | resetLock (int flags) |
virtual bool | updateFormat (const char *format, int direction) |
virtual bool | setParam (const String ¶m, const String &value) |
virtual bool | getParam (const String ¶m, String &value) const |
SignallingCircuitGroup * | group () |
SignallingCircuitSpan * | span () |
const SignallingCircuitGroup * | group () const |
unsigned int | code () const |
bool | available () const |
bool | connected () const |
bool | reserve () |
bool | connect (const char *format=0) |
bool | disconnect () |
bool | disable () |
bool | hwLock (bool set, bool remote, bool changed=false, bool setChanged=false) |
bool | maintLock (bool set, bool remote, bool changed=false, bool setChanged=false) |
void | addEvent (SignallingCircuitEvent *event) |
SignallingCircuitEvent * | getEvent (const Time &when) |
virtual bool | sendEvent (SignallingCircuitEvent::Type type, NamedList *params=0) |
Static Public Member Functions | |
static const char * | lookupType (int type) |
static const char * | lookupStatus (int status) |
Static Public Attributes | |
static TokenDict | s_lockNames [] |
Protected Member Functions | |
SignallingCircuit (Type type, unsigned int code, SignallingCircuitGroup *group=0, SignallingCircuitSpan *span=0) | |
SignallingCircuit (Type type, unsigned int code, Status status, SignallingCircuitGroup *group=0, SignallingCircuitSpan *span=0) | |
virtual void | clearEvents () |
void | eventTerminated (SignallingCircuitEvent *event) |
Protected Attributes | |
Mutex | m_mutex |
Friends | |
class | SignallingCircuitGroup |
class | SignallingCircuitEvent |
Interface to an abstract voice/data circuit referenced by signalling
enum Type |
Type of the circuit hardware or transport
enum Status |
Status of the circuit
virtual ~SignallingCircuit | ( | ) | [virtual] |
Destructor. Clear event list
SignallingCircuit | ( | Type | type, | |
unsigned int | code, | |||
SignallingCircuitGroup * | group = 0 , |
|||
SignallingCircuitSpan * | span = 0 | |||
) | [protected] |
Constructor
SignallingCircuit | ( | Type | type, | |
unsigned int | code, | |||
Status | status, | |||
SignallingCircuitGroup * | group = 0 , |
|||
SignallingCircuitSpan * | span = 0 | |||
) | [protected] |
Constructor
virtual bool status | ( | Status | newStat, | |
bool | sync = false | |||
) | [inline, virtual] |
Initiate a status transition
newStat | Desired new status | |
sync | Synchronous status change requested |
Referenced by SignallingCircuitGroup::release().
Type type | ( | ) | const [inline] |
Get the type of this circuit
Status status | ( | ) | const [inline] |
Get the status of this circuit
int locked | ( | int | flags = -1 |
) | const [inline] |
Check if the given lock flags are set
flags | The lock flags to check. -1 to check all flags |
void setLock | ( | int | flags | ) | [inline] |
Set the given lock flags of this circuit
flags | The lock flags to set |
void resetLock | ( | int | flags | ) | [inline] |
Reset the given lock flags of this circuit
flags | The lock flags to reset |
virtual bool updateFormat | ( | const char * | format, | |
int | direction | |||
) | [inline, virtual] |
Set the format of the data transported through this circuit
format | The new data format | |
direction | The direction to be updated. -1 means to the lower layer, 1 from the lower layer, 0 both directions |
Set circuit data or trigger some action
param | The data to update or the action to trigger | |
value | The data value or action parameter |
Get circuit parameter
param | The parameter to get | |
value | The value of the parameter |
SignallingCircuitGroup* group | ( | ) | [inline] |
Get the group of circuits this one belongs to
SignallingCircuitSpan* span | ( | ) | [inline] |
Get the circuit span this one belongs to
const SignallingCircuitGroup* group | ( | ) | const [inline] |
Get the group of circuits this one belongs to - const version
unsigned int code | ( | ) | const [inline] |
Get the group-local code of this circuit
bool available | ( | ) | const [inline] |
Get the available status of the circuit
bool connected | ( | ) | const [inline] |
Get the connected status of the circuit
bool reserve | ( | ) | [inline] |
Reserve this circuit for later use
bool connect | ( | const char * | format = 0 |
) | [inline] |
Connect this circuit
format | Optional data format to update for both directions |
bool disconnect | ( | ) | [inline] |
Disconnect (set state to Reserved) this circuit if connected
bool disable | ( | ) | [inline] |
Disable this circuit for maintenance
bool hwLock | ( | bool | set, | |
bool | remote, | |||
bool | changed = false , |
|||
bool | setChanged = false | |||
) |
Set/reset HW failure lock flag
set | True to set, false to reset the flag | |
remote | True to use remote side of the circuit, false to use the local one | |
changed | Set/reset changed flag. If false the changed flag won't be affected | |
setChanged | The value of the changed flag. gnored if changed is false |
bool maintLock | ( | bool | set, | |
bool | remote, | |||
bool | changed = false , |
|||
bool | setChanged = false | |||
) |
Set/reset maintenance lock flag
set | True to set, false to reset the flag | |
remote | True to use remote side of the circuit, false to use the local one | |
changed | Set/reset changed flag. If false the changed flag won't be affected | |
setChanged | The value of the changed flag. gnored if changed is false |
void addEvent | ( | SignallingCircuitEvent * | event | ) |
Add an event to the queue This method is thread safe
event | The event to enqueue |
SignallingCircuitEvent* getEvent | ( | const Time & | when | ) |
Get an event from queue This method is thread safe
when | The current time |
virtual bool sendEvent | ( | SignallingCircuitEvent::Type | type, | |
NamedList * | params = 0 | |||
) | [virtual] |
Send an event through this circuit
type | The type of the event to send | |
params | Optional event parameters |
static const char* lookupType | ( | int | type | ) | [static] |
Get the text associated with a circuit type
type | Circuit type used to retrive the text |
static const char* lookupStatus | ( | int | status | ) | [static] |
Get the text associated with a circuit status
status | Circuit status used to retrive the text |
virtual void clearEvents | ( | ) | [protected, virtual] |
Clear event queue This method is thread safe
void eventTerminated | ( | SignallingCircuitEvent * | event | ) | [protected] |
Event termination notification
event | The terminated event |
TokenDict s_lockNames[] [static] |
Keep the lock flags names