Yate
SignallingCallControl Class Referenceabstract

Abstract phone call signalling. More...

#include <yatesig.h>

Inheritance diagram for SignallingCallControl:
Mutex Lockable ISDNQ931 ISDNQ931Monitor SS7ISUP SS7TUP SS7BICC

Public Types

enum  MediaRequired { MediaNever , MediaAnswered , MediaRinging , MediaAlways }
 

Public Member Functions

 SignallingCallControl (const NamedList &params, const char *msgPrefix=0)
 
virtual ~SignallingCallControl ()
 
const Stringlocation () const
 
void setExiting ()
 
bool exiting () const
 
bool verify ()
 
MediaRequired mediaRequired () const
 
const StringmsgPrefix () const
 
SignallingCircuitGroupcircuits () const
 
const ObjListcalls () const
 
virtual const char * statusName () const =0
 
SignallingCircuitGroupattach (SignallingCircuitGroup *circuits)
 
bool reserveCircuit (SignallingCircuit *&cic, const char *range=0, int checkLock=-1, const String *list=0, bool mandatory=true, bool reverseRestrict=false)
 
bool releaseCircuit (SignallingCircuit *&cic, bool sync=false)
 
bool releaseCircuit (unsigned int code, bool sync=false)
 
virtual void cleanup (const char *reason="net-out-of-order")
 
virtual SignallingEventgetEvent (const Time &when)
 
virtual SignallingCallcall (SignallingMessage *msg, String &reason)
 
virtual void buildVerifyEvent (NamedList &params)
 
- Public Member Functions inherited from Mutex
 Mutex (bool recursive=false, const char *name=0)
 
 Mutex (const Mutex &original)
 
 ~Mutex ()
 
Mutexoperator= (const Mutex &original)
 
virtual bool lock (long maxwait=-1)
 
virtual bool unlock ()
 
virtual bool locked () const
 
const char * owner () const
 
bool recursive () const
 
- Public Member Functions inherited from Lockable
virtual ~Lockable ()
 
virtual bool check (long maxwait=-1)
 
virtual bool unlockAll ()
 

Protected Member Functions

int strategy () const
 
virtual bool processEvent (SignallingEvent *event)
 
virtual SignallingEventprocessCircuitEvent (SignallingCircuitEvent *&event, SignallingCall *call=0)
 
void clearCalls ()
 
void removeCall (SignallingCall *call, bool del=false)
 
void setVerify (bool restartTimer=false, bool fireNow=false, const Time *time=0)
 

Protected Attributes

ObjList m_calls
 
String m_msgPrefix
 
MediaRequired m_mediaRequired
 
bool m_verifyEvent
 
SignallingTimer m_verifyTimer
 
String m_location
 

Static Protected Attributes

static const TokenDict s_mediaRequired []
 

Friends

class SignallingCall
 
class SS7ISUPCall
 
class ISDNQ931Call
 
class ISDNQ931CallMonitor
 

Additional Inherited Members

- Static Public Member Functions inherited from Mutex
static int count ()
 
static int locks ()
 
static bool efficientTimedLock ()
 
- Static Public Member Functions inherited from Lockable
static void wait (unsigned long maxwait)
 
static unsigned long wait ()
 
static void startUsingNow ()
 
static void enableSafety (bool safe=true)
 
static bool safety ()
 

Detailed Description

Abstract phone call signalling.

Interface of protocol independent signalling for phone calls

Member Enumeration Documentation

◆ MediaRequired

When is media absolutely required during the call

Constructor & Destructor Documentation

◆ SignallingCallControl()

SignallingCallControl ( const NamedList & params,
const char * msgPrefix = 0 )

Constructor

Parameters
paramsCall controller's parameters
msgPrefixOptional prefix to be added before a decoded message's parameters or retrieve message parameters from a list

References msgPrefix().

◆ ~SignallingCallControl()

virtual ~SignallingCallControl ( )
virtual

Destructor

Member Function Documentation

◆ attach()

Attach/detach a circuit group to this call controller. Set group's allocation strategy. Set locked flags for all circuits belonging to the attached circuit group. Cleanup controller before detaching the group or attaching a new one This method is thread safe

Parameters
circuitsPointer to the SignallingCircuitGroup to attach. 0 to detach and force a cleanup
Returns
Pointer to the old group that was detached, NULL if none or no change

References circuits().

Referenced by ISDNQ931::destroyed(), and ISDNQ931Monitor::destroyed().

◆ buildVerifyEvent()

virtual void buildVerifyEvent ( NamedList & params)
inlinevirtual

Build the parameters of a Verify event

Parameters
paramsThe list of parameters to fill

◆ call()

virtual SignallingCall * call ( SignallingMessage * msg,
String & reason )
inlinevirtual

Create an outgoing call. Send a NewCall event with the given msg parameter

Parameters
msgCall parameters
reasonFailure reason if any
Returns
Referenced SignallingCall pointer on success or 0 on failure

Reimplemented in ISDNQ931, and SS7ISUP.

Referenced by processCircuitEvent(), and removeCall().

◆ calls()

const ObjList & calls ( ) const
inline

Get the list of calls currently known by this call controller

Returns
Reference to the list of calls

References m_calls.

◆ circuits()

SignallingCircuitGroup * circuits ( ) const
inline

Get the circuit group attached to this call controller

Returns
The circuit group attached to this call controller

Referenced by attach(), and ISDNQ931::restart().

◆ cleanup()

virtual void cleanup ( const char * reason = "net-out-of-order")
inlinevirtual

Cleanup

Parameters
reasonCleanup reason

Reimplemented in ISDNQ931, ISDNQ931Monitor, and SS7ISUP.

◆ clearCalls()

void clearCalls ( )
protected

Clear call list

◆ exiting()

bool exiting ( ) const
inline

Get exiting flag

Returns
The exiting flag

◆ getEvent()

virtual SignallingEvent * getEvent ( const Time & when)
virtual

Iterate through the call list to get an event

Parameters
whenThe current time
Returns
SignallingEvent pointer or 0 if no events

◆ location()

const String & location ( ) const
inline

Retrieve Q.850 cause location

Returns
Controller location

References m_location.

◆ mediaRequired()

MediaRequired mediaRequired ( ) const
inline

Get the Media Required flag

Returns
Configured media requirement

References m_mediaRequired.

◆ msgPrefix()

const String & msgPrefix ( ) const
inline

Get the prefix used by this call controller when decoding message parameters or retrieve message parameters from a list

Returns
Message parameters prefix used by this call controller

References m_msgPrefix.

Referenced by SignallingCallControl().

◆ processCircuitEvent()

virtual SignallingEvent * processCircuitEvent ( SignallingCircuitEvent *& event,
SignallingCall * call = 0 )
inlineprotectedvirtual

Process an event received from a non-reserved circuit

Parameters
eventThe event, will be consumed and zeroed
callOptional signalling call whose circuit generated the event
Returns
Signalling event pointer or 0

Reimplemented in SS7ISUP.

References call().

◆ processEvent()

virtual bool processEvent ( SignallingEvent * event)
inlineprotectedvirtual

Process an event received from a call. This will give to derived classes an opportunity to intercept events generated by their calls

Parameters
eventThe event
Returns
True if the event was processed by the controller. False to deliver the event to the requestor

◆ releaseCircuit() [1/2]

bool releaseCircuit ( SignallingCircuit *& cic,
bool sync = false )

Initiate a release of a circuit. Set cic to 0. This method is thread safe

Parameters
cicThe circuit to release
syncSynchronous release requested
Returns
True if the circuit release was initiated

◆ releaseCircuit() [2/2]

bool releaseCircuit ( unsigned int code,
bool sync = false )

Initiate a release of a circuit from the attached group This method is thread safe

Parameters
codeThe circuit's code
syncSynchronous release requested
Returns
True if the circuit release was initiated

◆ removeCall()

void removeCall ( SignallingCall * call,
bool del = false )
protected

Remove a call from list

Parameters
callThe call to remove
delTrue to delete it. False to remove without destruct

References call().

◆ reserveCircuit()

bool reserveCircuit ( SignallingCircuit *& cic,
const char * range = 0,
int checkLock = -1,
const String * list = 0,
bool mandatory = true,
bool reverseRestrict = false )

Reserve a circuit for later use. If the circuit list is 0, try to reserve a circuit from the group using its strategy. Release the given circuit before trying to reserve it. Set cic to 0 on failure. This method is thread safe

Parameters
cicDestination circuit
checkLockLock flags to check. If the given lock flags are set, reservation will fail
rangeOptional range name to restrict circuit reservation within attached circuit group
listComma separated list of circuits
mandatoryThe list is mandatory. If false and none of the circuits in the list are available, try to reserve a free one. Ignored if list is 0
reverseRestrictUsed when failed to reserve circuit from list. If true and the circuit allocation strategy includes any restriction (odd or even) use the opposite restriction to reserve a circuit. Ignored if mandatory is true
Returns
False if the operation failed

◆ setExiting()

void setExiting ( )
inline

Set exiting flag

◆ setVerify()

void setVerify ( bool restartTimer = false,
bool fireNow = false,
const Time * time = 0 )
protected

Set the verify event flag. Restart/fire verify timer

Parameters
restartTimerTrue to restart/fire the timer
fireNowTrue to fire the verify timer. Ignored if restartTimer is false
timeOptional time to use for timer restart

◆ statusName()

virtual const char * statusName ( ) const
pure virtual

Get the controller's status as text

Returns
Controller status name

Implemented in ISDNQ931, ISDNQ931Monitor, and SS7ISUP.

◆ strategy()

int strategy ( ) const
inlineprotected

Get the strategy used by the attached circuit group to allocate circuits

Returns
The strategy used by the attached circuit group to allocate circuits

◆ verify()

bool verify ( )
inline

Check the verify event flag. Reset it if true is returned

Returns
True if the verify event flag is set

References Mutex::lock(), and m_verifyEvent.

Member Data Documentation

◆ m_calls

ObjList m_calls
protected

List of active calls

Referenced by calls().

◆ m_location

String m_location
protected

Controller location used when encoding Q.850 cause

Referenced by location().

◆ m_mediaRequired

MediaRequired m_mediaRequired
protected

Media required flag, call should drop if requirement not satisfied

Referenced by mediaRequired().

◆ m_msgPrefix

String m_msgPrefix
protected

Prefix to be added to decoded message parameters or retrieve message parameters from a list

Referenced by msgPrefix().

◆ m_verifyEvent

bool m_verifyEvent
protected

Draw attention to call controller's user that something changed by raising a Verify event

Referenced by verify().

◆ m_verifyTimer

SignallingTimer m_verifyTimer
protected

Timer used to raise verify events

◆ s_mediaRequired

const TokenDict s_mediaRequired[]
staticprotected

Media required keywords


The documentation for this class was generated from the following file: