class SignallingCircuit

Abstract data circuit used by signalling. More...

Full nameTelEngine::SignallingCircuit
Definition#include <libs/ysig/yatesig.h>
InheritsTelEngine::RefObject [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Static Methods

Public Members

Protected Methods

Protected Members


Detailed Description

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, Connected, }

Status

Status of the circuit

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, }

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:
newStatDesired new status
syncSynchronous 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:
flagsThe 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:
flagsThe lock flags to set

inline void  resetLock (int flags)

resetLock

Reset the given lock flags of this circuit

Parameters:
flagsThe lock flags to reset

bool  updateFormat (const char* format, int direction)

updateFormat

[virtual]

Set the format of the data transported through this circuit

Parameters:
formatThe new data format
directionThe 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:
paramThe data to update or the action to trigger
valueThe 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:
paramsParameter 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:
paramThe parameter to get
valueThe 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:
paramThe parameter to get
defValueThe 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:
paramThe parameter to get
defValueThe 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:
paramsParameter list to fill from the circuit
categoryOptional 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:
formatOptional 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:
setTrue to set, false to reset the flag
remoteTrue to use remote side of the circuit, false to use the local one
changedSet/reset changed flag. If false the changed flag won't be affected
setChangedThe 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:
setTrue to set, false to reset the flag
remoteTrue to use remote side of the circuit, false to use the local one
changedSet/reset changed flag. If false the changed flag won't be affected
setChangedThe 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:
eventThe event to enqueue

SignallingCircuitEvent*  getEvent (const Time& when)

getEvent

Get an event from queue This method is thread safe

Parameters:
whenThe 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:
typeThe type of the event to send
paramsOptional event parameters

Returns: True on success

const char*  lookupType (int type)

lookupType

[static]

Get the text associated with a circuit type

Parameters:
typeCircuit type used to retrive 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:
statusCircuit status used to retrive the text

Returns: Pointer to the string associated with the given circuit status

static 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:
eventThe terminated event

Mutex m_mutex

m_mutex

[protected]


Generated by: paulc on bussard on Mon Mar 8 12:18:15 2010, using kdoc 2.0a54.