Yate
ISDNQ931Message Class Reference

A Q.931 ISDN Layer 3 message. More...

#include <yatesig.h>

Inheritance diagram for ISDNQ931Message:
SignallingMessage RefObject GenObject

Public Types

enum  Type {
  Alerting = 0x01 , Proceeding = 0x02 , Connect = 0x07 , ConnectAck = 0x0f ,
  Progress = 0x03 , Setup = 0x05 , SetupAck = 0x0d , Resume = 0x26 ,
  ResumeAck = 0x2e , ResumeRej = 0x22 , Suspend = 0x25 , SuspendAck = 0x2d ,
  SuspendRej = 0x21 , UserInfo = 0x20 , Disconnect = 0x45 , Release = 0x4d ,
  ReleaseComplete = 0x5a , Restart = 0x46 , RestartAck = 0x4e , Segment = 0x60 ,
  CongestionCtrl = 0x79 , Info = 0x7b , Notify = 0x6e , Status = 0x7d ,
  StatusEnquiry = 0x75
}
 

Public Member Functions

 ISDNQ931Message (Type type, bool initiator, u_int32_t callRef, u_int8_t callRefLen)
 
 ISDNQ931Message (Type type)
 
 ISDNQ931Message (Type type, ISDNQ931Call *call)
 
virtual ~ISDNQ931Message ()
 
Type type () const
 
bool initiator () const
 
u_int32_t callRef () const
 
u_int8_t callRefLen () const
 
bool dummyCallRef () const
 
bool unknownMandatory () const
 
void setUnknownMandatory ()
 
ObjListieList ()
 
ISDNQ931IEgetIE (ISDNQ931IE::Type type, ISDNQ931IE *base=0)
 
ISDNQ931IEremoveIE (ISDNQ931IE::Type type, ISDNQ931IE *base=0)
 
const char * getIEValue (ISDNQ931IE::Type type, const char *param, const char *defVal=0)
 
ISDNQ931IEappendIEValue (ISDNQ931IE::Type type, const char *param, const char *value)
 
bool append (ISDNQ931IE *ie)
 
bool appendSafe (ISDNQ931IE *ie)
 
void toString (String &dest, bool extendedDebug, const char *indent=0) const
 
virtual void * getObject (const String &name) const
 
u_int8_t encode (ISDNQ931ParserData &parserData, ObjList &dest)
 
- Public Member Functions inherited from SignallingMessage
 SignallingMessage (const char *name=0)
 
const char * name () const
 
NamedListparams ()
 
const NamedListparams () const
 
- Public Member Functions inherited from RefObject
 RefObject ()
 
virtual ~RefObject ()
 
virtual bool alive () const
 
bool ref ()
 
bool deref ()
 
int refcount () const
 
virtual void destruct ()
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual const StringtoString () const
 
virtual const StringtraceId () const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 

Static Public Member Functions

static ISDNQ931Messageparse (ISDNQ931ParserData &parserData, const DataBlock &buffer, DataBlock *segData)
 
static const char * typeName (int t)
 
- Static Public Member Functions inherited from RefObject
static bool alive (const RefObject *obj)
 
static bool efficientIncDec ()
 
- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 

Public Attributes

DataBlock m_buffer
 

Static Public Attributes

static const TokenDict s_type []
 

Additional Inherited Members

- Protected Member Functions inherited from RefObject
virtual void zeroRefs ()
 
bool resurrect ()
 
virtual void destroyed ()
 
- Protected Attributes inherited from SignallingMessage
NamedList m_params
 

Detailed Description

A Q.931 ISDN Layer 3 message.

Q.931 ISDN Layer 3 message

Member Enumeration Documentation

◆ Type

enum Type

Message type enumeration

Constructor & Destructor Documentation

◆ ISDNQ931Message() [1/3]

ISDNQ931Message ( Type type,
bool initiator,
u_int32_t callRef,
u_int8_t callRefLen )

Constructor Constructs a message from given data. Used for incoming messages

Parameters
typeMessage type
initiatorThe call initiator flag: True: this is the initiator
callRefThe call reference
callRefLenThe call reference length

References callRef(), callRefLen(), initiator(), and type().

Referenced by parse().

◆ ISDNQ931Message() [2/3]

Constructor Constructs a message with dummy call reference

Parameters
typeMessage type

References type().

◆ ISDNQ931Message() [3/3]

ISDNQ931Message ( Type type,
ISDNQ931Call * call )

Constructor Constructs a message for a given call. Used for outgoing messages

Parameters
typeMessage type
callThe call this message belongs to

References type().

◆ ~ISDNQ931Message()

virtual ~ISDNQ931Message ( )
virtual

Destructor

Member Function Documentation

◆ append()

bool append ( ISDNQ931IE * ie)
inline

Append an information element to this message

Parameters
ieInformation element to add
Returns
True if the IE was added or replaced, false if it was invalid

◆ appendIEValue()

ISDNQ931IE * appendIEValue ( ISDNQ931IE::Type type,
const char * param,
const char * value )
inline

Append an IE with a given parameter

Parameters
typeIE's type
paramIE's parameter. Set to 0 to use IE's name
valueIE parameter's value
Returns
Pointer to the requested value or 0

References NamedList::addParam(), appendSafe(), String::c_str(), and type().

◆ appendSafe()

bool appendSafe ( ISDNQ931IE * ie)

Append/insert an information element to this message. Check the IE list consistency The given IE is 'consumed': deleted or appended to the list

Parameters
ieInformation element to add
Returns
True if the IE was added or replaced, false if it was invalid

Referenced by appendIEValue().

◆ callRef()

u_int32_t callRef ( ) const
inline

Get the id of the call this message belongs to

Returns
The call reference

Referenced by ISDNQ931Message().

◆ callRefLen()

u_int8_t callRefLen ( ) const
inline

Get the length of the call reference

Returns
The length of the call reference

Referenced by ISDNQ931Message().

◆ dummyCallRef()

bool dummyCallRef ( ) const
inline

Check if this message has a dummy call reference

Returns
True if this message has a dummy call reference

◆ encode()

u_int8_t encode ( ISDNQ931ParserData & parserData,
ObjList & dest )

Encode this message If message segmentation is allowed and the message is longer then maximum allowed, split it into Segment messages

Parameters
parserDataThe parser settings
destThe destination list. If 1 is returned the list contains a DataBuffer with this message. If more then 1 is returned, the list is filled with data buffers with Segment messages
Returns
The number of segments on success or 0 on failure.

◆ getIE()

ISDNQ931IE * getIE ( ISDNQ931IE::Type type,
ISDNQ931IE * base = 0 )

Get a pointer to the first IE with the given type

Parameters
typeRequested IE's type
baseOptional search starting element. If 0, search is started from the first IE following base
Returns
Pointer to the IE or 0 if not found

References type().

Referenced by getIEValue().

◆ getIEValue()

const char * getIEValue ( ISDNQ931IE::Type type,
const char * param,
const char * defVal = 0 )
inline

Get the value of a given parameter of a given IE

Parameters
typeRequested IE's type
paramRequested IE's parameter. Set to 0 to use IE's name
defValDefault value to return if IE is missing or the parameter is missing
Returns
Pointer to the requested value or 0

References String::c_str(), getIE(), NamedList::getValue(), and type().

◆ getObject()

virtual void * getObject ( const String & name) const
virtual

Get a pointer to a data member or this message

Parameters
nameObject name
Returns
The requested pointer or 0 if not exists

Reimplemented from RefObject.

References SignallingMessage::name().

◆ ieList()

ObjList * ieList ( )
inline

Get the IE list of this message

Returns
A valid pointer to the list of this message's IEs

◆ initiator()

bool initiator ( ) const
inline

Check if the sender of this message is the call initiator

Returns
True if the sender of this message is the call initiator

Referenced by ISDNQ931Message().

◆ parse()

static ISDNQ931Message * parse ( ISDNQ931ParserData & parserData,
const DataBlock & buffer,
DataBlock * segData )
static

Parse received data If the message type is Segment, decode only the header and the first IE If valid, fills the given buffer with the rest of the message. If segData is 0, drop the message.

Parameters
parserDataThe parser settings
bufferThe received data
segDataSegment message data. If 0, received segmented messages will be dropped
Returns
Valid ISDNQ931Message pointer on success or 0

References ISDNQ931Message().

◆ removeIE()

ISDNQ931IE * removeIE ( ISDNQ931IE::Type type,
ISDNQ931IE * base = 0 )

Remove an IE from list without destroying it

Parameters
typeRequested IE's type
baseOptional search starting element. If 0, search is started from the first IE following base
Returns
Pointer to the IE or 0 if not found

References type().

◆ setUnknownMandatory()

void setUnknownMandatory ( )
inline

Set the unknown mandatory IE(s) flag

◆ toString()

void toString ( String & dest,
bool extendedDebug,
const char * indent = 0 ) const

Put this message into a string for debug purposes

Parameters
destThe destination string
extendedDebugTrue to add the content of IEs and dump data. If false, only the IE name is added to the destination string
indentThe line indent

◆ type()

Type type ( ) const
inline

Get the type of this message

Returns
The type of this message as enumeration

Referenced by appendIEValue(), getIE(), getIEValue(), ISDNQ931Message(), ISDNQ931Message(), ISDNQ931Message(), and removeIE().

◆ typeName()

static const char * typeName ( int t)
inlinestatic

Get the string associated with a given message type

Parameters
tThe message type whose string we want to get
Returns
Pointer to the string associated with the given message type or 0

References s_type.

◆ unknownMandatory()

bool unknownMandatory ( ) const
inline

Check if this message contains unknown mandatory IE(s)

Returns
True if this message contains unknown mandatory IE(s)

Member Data Documentation

◆ m_buffer

DataBlock m_buffer

Internally used buffer for debug purposes

◆ s_type

const TokenDict s_type[]
static

Keep the string associated with message types

Referenced by typeName().


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