Yate
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Friends

ISDNQ931 Class Reference

ISDN Q.931 implementation on top of Q.921. More...

#include <yatesig.h>

Inheritance diagram for ISDNQ931:
SignallingCallControl SignallingDumpable ISDNLayer3 Mutex SignallingComponent Lockable RefObject DebugEnabler GenObject

List of all members.

Public Types

enum  BehaviourFlags {
  SendNonIsdnSource = 0x00000001, IgnoreNonIsdnDest = 0x00000002, ForcePresNetProv = 0x00000004, Translate31kAudio = 0x00000008,
  URDITransferCapsOnly = 0x00000010, NoLayer1Caps = 0x00000020, IgnoreNonLockedIE = 0x00000040, NoDisplayIE = 0x00000080,
  NoDisplayCharset = 0x00000100, ForceSendComplete = 0x00000200, NoActiveOnConnect = 0x00000400, CheckNotifyInd = 0x00000800
}
enum  SwitchType {
  Unknown = 0, EuroIsdnE1 = ForceSendComplete|CheckNotifyInd|NoDisplayCharset|URDITransferCapsOnly, EuroIsdnT1 = ForceSendComplete|CheckNotifyInd, NationalIsdn = SendNonIsdnSource,
  Dms100 = ForcePresNetProv|IgnoreNonIsdnDest, Lucent5e = IgnoreNonLockedIE, Att4ess = ForcePresNetProv|IgnoreNonLockedIE|Translate31kAudio|NoLayer1Caps, QSIG = NoActiveOnConnect|NoDisplayIE|NoDisplayCharset
}

Public Member Functions

 ISDNQ931 (const NamedList &params, const char *name=0)
virtual ~ISDNQ931 ()
virtual bool initialize (const NamedList *config)
const ISDNLayer2layer2 () const
bool primaryRate () const
bool network () const
bool transferModeCircuit () const
ISDNQ931ParserDataparserData ()
const StringnumPlan () const
const StringnumType () const
const StringnumPresentation () const
const StringnumScreening () const
const Stringformat () const
bool sendMessage (ISDNQ931Message *msg, u_int8_t tei, String *reason=0)
virtual void multipleFrameEstablished (u_int8_t tei, bool confirm, bool timeout, ISDNLayer2 *layer2)
virtual void multipleFrameReleased (u_int8_t tei, bool confirm, bool timeout, ISDNLayer2 *layer2)
virtual void receiveData (const DataBlock &data, u_int8_t tei, ISDNLayer2 *layer2)
virtual ISDNLayer2attach (ISDNLayer2 *q921)
SignallingCallcall (SignallingMessage *msg, String &reason)
bool restart (const char *circuits)
bool sendStatus (ISDNQ931Call *call, const char *cause, u_int8_t tei=0, const char *display=0, const char *diagnostic=0)
bool sendRelease (ISDNQ931Call *call, bool release, const char *cause, u_int8_t tei=0, const char *diag=0, const char *display=0, const char *signal=0)
virtual void cleanup (const char *reason="offline")
void setInterval (SignallingTimer &timer, int id)
void manageTimeout ()
void setDebug (bool printMsg, bool extendedDebug)

Static Public Attributes

static TokenDict s_flags []
static TokenDict s_swType []

Protected Member Functions

virtual void destroyed ()
virtual void timerTick (const Time &when)
ISDNQ931CallfindCall (u_int32_t callRef, bool outgoing, u_int8_t tei=0)
ISDNQ931CallfindCall (unsigned int circuit)
void terminateCalls (ObjList *list, const char *reason)
bool acceptNewCall (bool outgoing, String &reason)
ISDNQ931MessagegetMsg (const DataBlock &data)
ISDNQ931MessageendReceiveSegment (const char *reason=0)
void processGlobalMsg (ISDNQ931Message *msg, u_int8_t tei=0)
void processMsgRestart (ISDNQ931Message *msg, u_int8_t tei=0)
void processInvalidMsg (ISDNQ931Message *msg, u_int8_t tei=0)
void sendRestart (u_int64_t time=Time::msecNow(), bool retrans=false)
void endRestart (bool restart, u_int64_t time, bool timeout=false)
bool sendStatus (const char *cause, u_int8_t callRefLen, u_int32_t callRef=0, u_int8_t tei=0, bool initiator=false, ISDNQ931Call::State state=ISDNQ931Call::Null, const char *display=0, const char *diagnostic=0)
bool sendRelease (bool release, u_int8_t callRefLen, u_int32_t callRef, u_int8_t tei, bool initiator, const char *cause=0, const char *diag=0, const char *display=0, const char *signal=0)

Friends

class ISDNQ931Call

Detailed Description

ISDN Q.931 implementation on top of Q.921.

Q.931 ISDN Layer 3 implementation on top of a Layer 2


Member Enumeration Documentation

Enumeration flags defining the behaviour of the ISDN call controller and any active calls managed by it

enum SwitchType

Call controller switch type. Each value is a mask of behaviour flags


Constructor & Destructor Documentation

ISDNQ931 ( const NamedList params,
const char *  name = 0 
)

Constructor Initialize this object and the component

Parameters:
paramsLayer's parameters and parser settings
nameName of this component
virtual ~ISDNQ931 ( ) [virtual]

Destructor Destroy all calls


Member Function Documentation

bool acceptNewCall ( bool  outgoing,
String reason 
) [protected]

Check if this call control can accept new calls

Parameters:
outgoingCall direction (true for outgoing)
reasonString to be filled with the reason if not accepted
Returns:
True if the call request is accepted
virtual ISDNLayer2* attach ( ISDNLayer2 q921) [virtual]

Attach an ISDN Q.921 transport This method is thread safe

Parameters:
q921Pointer to the Q.921 transport to attach
Returns:
Pointer to the detached Layer 2 or NULL

Reimplemented from ISDNLayer3.

SignallingCall* call ( SignallingMessage msg,
String reason 
) [virtual]

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 from SignallingCallControl.

virtual void cleanup ( const char *  reason = "offline") [virtual]

Set terminate to all calls This method is thread safe

Parameters:
reasonCleanup reason

Reimplemented from SignallingCallControl.

virtual void destroyed ( ) [inline, protected, virtual]

Detach links. Disposes memory

Reimplemented from SignallingComponent.

References SignallingCallControl::attach(), SignallingComponent::destroyed(), and TelEngine::destruct().

ISDNQ931Message* endReceiveSegment ( const char *  reason = 0) [protected]

End waiting for message segments If reason is 0 parse already received data for the segmented message This method is thread safe

Parameters:
reasonDebug info reason. If non 0 drop the received segment(s)
Returns:
ISDNQ931Message pointer or 0
void endRestart ( bool  restart,
u_int64_t  time,
bool  timeout = false 
) [protected]

End restart procedure on timeout or restart acknoledge This method is thread safe

Parameters:
restartTrue to try to send restart for the next circuit
timeThe time of the transmission
timeoutTrue if a restart request timed out
ISDNQ931Call* findCall ( u_int32_t  callRef,
bool  outgoing,
u_int8_t  tei = 0 
) [protected]

Find a call given its call reference and direction

Parameters:
callRefThe call reference to find
outgoingTrue to find an outgoing call, false to find an incoming one
teiTEI of the layer associated to the call to find
Returns:
A referenced pointer to a call or 0
ISDNQ931Call* findCall ( unsigned int  circuit) [protected]

Find a call given a circuit number

Parameters:
circuitThe circuit number to find
Returns:
A referenced pointer to a call or 0
const String& format ( ) const [inline]

Get the default data format for outgoing calls

Returns:
The default data format for outgoing calls
ISDNQ931Message* getMsg ( const DataBlock data) [protected]

Process received data. Process received message segments if any

Parameters:
dataThe received data
Returns:
ISDNQ931Message pointer or 0
virtual bool initialize ( const NamedList config) [virtual]

Configure and initialize Q.931 and its layer 2

Parameters:
configOptional configuration parameters override
Returns:
True if Q.931 and the layer 2 were initialized properly

Reimplemented from SignallingComponent.

const ISDNLayer2* layer2 ( ) const [inline]

Get the layer 2 attached to this object

Returns:
Pointer to the layer 2 attached to this object or 0 if none
void manageTimeout ( )

Manage timeout for the call setup message

virtual void multipleFrameEstablished ( u_int8_t  tei,
bool  confirm,
bool  timeout,
ISDNLayer2 layer2 
) [virtual]

Notification of Layer 2 up state

Parameters:
teiTEI received by the Layer 2
confirmTrue if this is a confirmation of a previous request. False if it is an indication of state change on remote request
timeoutTrue if the reason is a timeout.
layer2Pointer to the notifier

Reimplemented from ISDNLayer3.

virtual void multipleFrameReleased ( u_int8_t  tei,
bool  confirm,
bool  timeout,
ISDNLayer2 layer2 
) [virtual]

Notification of Layer 2 down state

Parameters:
teiTEI received by the Layer 2
confirmTrue if this is a confirmation of a previous request. False if it is an indication of state change on remote request
timeoutTrue if the reason is a timeout.
layer2Pointer to the notifier

Reimplemented from ISDNLayer3.

bool network ( ) const [inline]

Chech if this call controller is at the NET or CPE side of the link

Returns:
True if we are NET, false if we are CPE

References ISDNLayer2::network().

const String& numPlan ( ) const [inline]

Get the default numbering plan for outgoing calls

Returns:
The default numbering plan for outgoing calls
const String& numPresentation ( ) const [inline]

Get the default number presentation for outgoing calls

Returns:
The default number presentation for outgoing calls
const String& numScreening ( ) const [inline]

Get the default number screening for outgoing calls

Returns:
The default number screening for outgoing calls
const String& numType ( ) const [inline]

Get the default number type for outgoing calls

Returns:
The default number type for outgoing calls
ISDNQ931ParserData& parserData ( ) [inline]

Get the parser settings of this call control

Returns:
The parser settings
bool primaryRate ( ) const [inline]

Check if this call controller supports primary or basic rate transfer

Returns:
True for primary rate. False for basic rate
void processGlobalMsg ( ISDNQ931Message msg,
u_int8_t  tei = 0 
) [protected]

Process messages with global call reference or should have one

Parameters:
msgThe received message
teiThe TEI received with the message
void processInvalidMsg ( ISDNQ931Message msg,
u_int8_t  tei = 0 
) [protected]

Process messages with invalid call reference

Parameters:
msgThe received message
teiThe TEI received with the message
void processMsgRestart ( ISDNQ931Message msg,
u_int8_t  tei = 0 
) [protected]

Process a restart request

Parameters:
msgThe received message
teiThe TEI received with the message
virtual void receiveData ( const DataBlock data,
u_int8_t  tei,
ISDNLayer2 layer2 
) [virtual]

Receive data from Layer 2

Parameters:
dataReceived data
teiTEI received by the Layer 2
layer2Pointer to the sender Layer 2

Implements ISDNLayer3.

bool restart ( const char *  circuits)

Restart one or more the circuits

Parameters:
circuitsComma separated list of circuits to be restarted
Returns:
True if the procedure was succesfully started or enqueued
bool sendMessage ( ISDNQ931Message msg,
u_int8_t  tei,
String reason = 0 
)

Send a message

Parameters:
msgThe message to be sent
teiTEI value to use at Layer 2
reasonOptional string to write the failure reason
Returns:
False if the message is invalid, Layer 2 is missing or refused the data
bool sendRelease ( ISDNQ931Call call,
bool  release,
const char *  cause,
u_int8_t  tei = 0,
const char *  diag = 0,
const char *  display = 0,
const char *  signal = 0 
) [inline]

Send a RELEASE or RELEASE COMPLETE message for a given call

Parameters:
callThe call requesting the operation
releaseTrue to send RELEASE, false to send RELEASE COMPLETE
causeValue for Cause IE
teiTEI to which the release is sent to
diagOptional hexified string for cause dignostic
displayOptional value for Display IE
signalOptional value for Signal IE
Returns:
The result of the operation (true if succesfully sent)

References ISDNQ931Call::callRef(), ISDNQ931Call::callRefLen(), and SignallingCall::outgoing().

bool sendRelease ( bool  release,
u_int8_t  callRefLen,
u_int32_t  callRef,
u_int8_t  tei,
bool  initiator,
const char *  cause = 0,
const char *  diag = 0,
const char *  display = 0,
const char *  signal = 0 
) [protected]

Send a RELEASE or RELEASE COMPLETE message

Parameters:
releaseTrue to send RELEASE, false to send RELEASE COMPLETE
callRefLenThe call reference length parameter
callRefThe call reference
teiThe TEI of the Layer 2 associated with the call
initiatorThe call initiator flag
causeValue for Cause IE
diagOptional hexified string for cause dignostic
displayOptional value for Display IE
signalOptional value for Signal IE
Returns:
The result of the operation (true if succesfully sent)
void sendRestart ( u_int64_t  time = Time::msecNow(),
bool  retrans = false 
) [protected]

Try to reserve a circuit for restarting if none. Send a restart request on it's behalf Start counting the restart interval if no circuit reserved This method is thread safe

Parameters:
timeThe time of the transmission
retransRetransmission flag (true if a previous request timed out)
bool sendStatus ( const char *  cause,
u_int8_t  callRefLen,
u_int32_t  callRef = 0,
u_int8_t  tei = 0,
bool  initiator = false,
ISDNQ931Call::State  state = ISDNQ931Call::Null,
const char *  display = 0,
const char *  diagnostic = 0 
) [protected]

Send a STATUS message

Parameters:
causeValue for Cause IE
callRefLenThe call reference length parameter.
callRefThe call reference
teiThe TEI to send with the STATUS message
initiatorTrue if this is from the call initiator
stateThe state for CallState IE
displayOptional value for Display IE
diagnosticOptional value for cause diagnostic value
Returns:
The result of the operation (true if succesfully sent)
bool sendStatus ( ISDNQ931Call call,
const char *  cause,
u_int8_t  tei = 0,
const char *  display = 0,
const char *  diagnostic = 0 
) [inline]

Send a STATUS message for a given call

Parameters:
callThe call requesting the operation
teiThe TEI to send with the STATUS message
causeValue for Cause IE
displayOptional value for Display IE
diagnosticOptional value for cause diagnostic value
Returns:
The result of the operation (true if succesfully sent)

References ISDNQ931Call::callRef(), ISDNQ931Call::callRefLen(), SignallingCall::outgoing(), and ISDNQ931State::state().

void setDebug ( bool  printMsg,
bool  extendedDebug 
) [inline]

Set debug data of this call controller

Parameters:
printMsgEnable/disable message printing on output
extendedDebugEnable/disable hex data dump if print messages is enabled
void setInterval ( SignallingTimer timer,
int  id 
)

Set the timeout interval for a given timer if implemented If the timer is not implemented the interval is set to 0

Parameters:
timerThe destination timer
idThe timer number as defined in Q.931
void terminateCalls ( ObjList list,
const char *  reason 
) [protected]

Terminate calls. If list is 0 terminate all calls

Parameters:
listOptional list of circuits (strings) to be released
reasonThe reason to be passed to each terminated call
virtual void timerTick ( const Time when) [protected, virtual]

Method called periodically to check timeouts This method is thread safe

Parameters:
whenTime to use as computing base for events and timeouts

Reimplemented from SignallingComponent.

bool transferModeCircuit ( ) const [inline]

Check if this call controller supports circuit switch or packet mode transfer

Returns:
True for circuit switch. False for packet mode

Member Data Documentation

TokenDict s_flags[] [static]

The list of behaviour flag names

TokenDict s_swType[] [static]

The list of switch type names


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