|
|
Interface to an abstract voice/data circuit referenced by signalling
enum Type { Unknown = 0, Local, TDM, RTP, IAX, } | Type |
Type of the circuit hardware or transport
enum Status { Missing = 0, Disabled, Idle, Reserved, Starting, Stopping, Special, Connected, } | Status |
Status of the circuit
enum LockFlags { LockLocalHWFail = 0x0001, LockLocalMaint = 0x0002, LockingHWFail = 0x0004, LockingMaint = 0x0008, LockLocalHWFailChg = 0x0010, LockLocalMaintChg = 0x0020, Resetting = 0x0040, LockRemoteHWFail = 0x0100, LockRemoteMaint = 0x0200, LockRemoteHWFailChg = 0x1000, LockRemoteMaintChg = 0x2000, LockLocal = LockLocalHWFail | LockLocalMaint, LockRemote = LockRemoteHWFail | LockRemoteMaint, LockLocked = LockLocal | LockRemote, LockBusy = LockingHWFail | LockingMaint | Resetting, LockLockedBusy = LockLocked | LockBusy, LockLocalChg = LockLocalHWFailChg | LockLocalMaintChg, LockRemoteChg = LockRemoteHWFailChg | LockRemoteMaintChg, LockChanged = LockLocalChg | LockRemoteChg, } | LockFlags |
Lock circuit flags
~SignallingCircuit ()
| ~SignallingCircuit |
[virtual]
Destructor. Clear event list
bool status (Status newStat, bool sync = false)
| status |
[virtual]
Initiate a status transition
Parameters:
newStat | Desired new status |
sync | Synchronous status change requested |
Returns: True if status change has been initiated
inline Type type ()
| type |
[const]
Get the type of this circuit
Returns: Enumerated type of circuit
inline Status status ()
| status |
[const]
Get the status of this circuit
Returns: Enumerated status of circuit
inline int locked (int flags = -1)
| locked |
[const]
Check if the given lock flags are set
Parameters:
flags | The lock flags to check. -1 to check all flags |
Returns: The lock flags of this circuit masked by the given flags
inline void setLock (int flags)
| setLock |
Set the given lock flags of this circuit
Parameters:
flags | The lock flags to set |
inline void resetLock (int flags)
| resetLock |
Reset the given lock flags of this circuit
Parameters:
flags | The lock flags to reset |
bool updateFormat (const char* format, int direction)
| updateFormat |
[virtual]
Set the format of the data transported through this circuit
Parameters:
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 |
Returns: True if the operation succeedded (format changed)
bool setParam (const String& param, const String& value)
| setParam |
[virtual]
Set circuit data or trigger some action
Parameters:
param | The data to update or the action to trigger |
value | The data value or action parameter |
Returns: True on success
bool setParams (const NamedList& params)
| setParams |
[virtual]
Set circuit data from a list of parameters
Parameters:
params | Parameter list to set in the circuit |
Returns: True if all parameters were succesfully set
bool getParam (const String& param, String& value)
| getParam |
[const virtual]
Get circuit parameter
Parameters:
param | The parameter to get |
value | The value of the parameter |
Returns: True on success. False if the parameter doesn't exist
bool getBoolParam (const String& param, bool defValue = false)
| getBoolParam |
[const virtual]
Get boolean circuit parameter
Parameters:
param | The parameter to get |
defValue | The default returned value |
Returns: Value from circuit, devValue if the parameter doesn't exist
int getIntParam (const String& param, int defValue = 0)
| getIntParam |
[const virtual]
Get integer circuit parameter
Parameters:
param | The parameter to get |
defValue | The default returned value |
Returns: Value from circuit, devValue if the parameter doesn't exist
bool getParams (NamedList& params, const String& category = String::empty())
| getParams |
[virtual]
Get circuit parameters
Parameters:
params | Parameter list to fill from the circuit |
category | Optional category used to select desired parameters |
Returns: True if handled
inline SignallingCircuitGroup* group ()
| group |
Get the group of circuits this one belongs to
Returns: Pointer to circuit group
inline SignallingCircuitSpan* span ()
| span |
Get the circuit span this one belongs to
Returns: Pointer to circuit span
inline const SignallingCircuitGroup* group ()
| group |
[const]
Get the group of circuits this one belongs to - const version
Returns: Pointer to const circuit group
inline const SignallingCircuitSpan* span ()
| span |
[const]
Get the circuit span this one belongs to - const version
Returns: Pointer to const circuit span
inline unsigned int code ()
| code |
[const]
Get the group-local code of this circuit
Returns: Identification code within group
inline bool available ()
| available |
[const]
Get the available status of the circuit
Returns: True if the circuit is available for use
inline bool connected ()
| connected |
[const]
Get the connected status of the circuit
Returns: True if the circuit is connected (in use)
inline bool reserve ()
| reserve |
Reserve this circuit for later use
Returns: True if the circuit was changed from Idle to Reserved
inline bool connect (const char* format = 0)
| connect |
Connect this circuit
Parameters:
format | Optional data format to update for both directions |
Returns: True if the circuit state was changed to Connected
inline bool disconnect ()
| disconnect |
Disconnect (set state to Reserved) this circuit if connected
Returns: True if the circuit was changed from Connected to Reserved
inline bool disable ()
| disable |
Disable this circuit for maintenance
Returns: True if the circuit was changed from Idle to Reserved
bool hwLock (bool set, bool remote, bool changed = false, bool setChanged = false)
| hwLock |
Set/reset HW failure lock flag
Parameters:
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 |
Returns: True if the flag's state changed
bool maintLock (bool set, bool remote, bool changed = false, bool setChanged = false)
| maintLock |
Set/reset maintenance lock flag
Parameters:
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 |
Returns: True if the flag's state changed
void addEvent (SignallingCircuitEvent* event)
| addEvent |
Add an event to the queue This method is thread safe
Parameters:
event | The event to enqueue |
SignallingCircuitEvent* getEvent (const Time& when)
| getEvent |
Get an event from queue This method is thread safe
Parameters:
when | The current time |
Returns: SignallingCircuitEvent pointer or 0 if no events
bool sendEvent (SignallingCircuitEvent::Type type, NamedList* params = 0)
| sendEvent |
[virtual]
Send an event through this circuit
Parameters:
type | The type of the event to send |
params | Optional event parameters |
Returns: True on success
const char* lookupType (int type)
| lookupType |
[static]
Get the text associated with a circuit type
Parameters:
type | Circuit type used to retrieve the text |
Returns: Pointer to the string associated with the given circuit type
const char* lookupStatus (int status)
| lookupStatus |
[static]
Get the text associated with a circuit status
Parameters:
status | Circuit status used to retrieve the text |
Returns: Pointer to the string associated with the given circuit status
static const TokenDict s_lockNames[] | s_lockNames[] |
SignallingCircuit (Type type, unsigned int code, SignallingCircuitGroup* group = 0,
SignallingCircuitSpan* span = 0)
| SignallingCircuit |
[protected]
Constructor
SignallingCircuit (Type type, unsigned int code, Status status,
SignallingCircuitGroup* group = 0, SignallingCircuitSpan* span = 0)
| SignallingCircuit |
[protected]
Constructor
void clearEvents ()
| clearEvents |
[protected virtual]
Clear event queue This method is thread safe
void eventTerminated (SignallingCircuitEvent* event)
| eventTerminated |
[protected]
Event termination notification
Parameters:
event | The terminated event |
Mutex m_mutex | m_mutex |
[protected]
Generated by: paulc on bussard on Fri Apr 1 18:17:10 2011, using kdoc 2.0a54. |