Yate
SignallingUtils Class Reference

Library wide services and data provider. More...

#include <yatesig.h>

Static Public Member Functions

static const TokenDictcodings ()
 
static const TokenDictlocations ()
 
static const TokenDictdict (unsigned int index, unsigned char coding=0)
 
static bool hasFlag (const String &flags, const char *flag)
 
static bool appendFlag (String &flags, const char *flag)
 
static bool removeFlag (String &flags, const char *flag)
 
static bool hasFlag (const NamedList &list, const char *param, const char *flag)
 
static bool appendFlag (NamedList &list, const char *param, const char *flag)
 
static void addKeyword (NamedList &list, const char *param, const TokenDict *tokens, unsigned int val)
 
static void dumpData (const SignallingComponent *comp, NamedList &list, const char *param, const unsigned char *buf, unsigned int len, char sep=' ')
 
static unsigned int dumpDataExt (const SignallingComponent *comp, NamedList &list, const char *param, const unsigned char *buf, unsigned int len, char sep=' ')
 
static bool decodeFlags (const SignallingComponent *comp, NamedList &list, const char *param, const SignallingFlags *flags, const unsigned char *buf, unsigned int len)
 
static bool decodeCause (const SignallingComponent *comp, NamedList &list, const unsigned char *buf, unsigned int len, const char *prefix, bool isup)
 
static bool decodeCaps (const SignallingComponent *comp, NamedList &list, const unsigned char *buf, unsigned int len, const char *prefix, bool isup)
 
static void encodeFlags (const SignallingComponent *comp, int &dest, const String &flags, const TokenDict *dict)
 
static unsigned int encodeFlags (const SignallingComponent *comp, const String &flags, const SignallingFlags *dict, const char *paramName=0)
 
static bool encodeCause (const SignallingComponent *comp, DataBlock &buf, const NamedList &params, const char *prefix, bool isup, bool fail=false)
 
static bool encodeCaps (const SignallingComponent *comp, DataBlock &buf, const NamedList &params, const char *prefix, bool isup)
 
static unsigned int * parseUIntArray (const String &source, unsigned int minVal, unsigned int maxVal, unsigned int &count, bool discardDup)
 

Detailed Description

Library wide services and data provider.

Provides data and services for SS7 and ISDN

Member Function Documentation

◆ addKeyword()

static void addKeyword ( NamedList & list,
const char * param,
const TokenDict * tokens,
unsigned int val )
static

Add string (keyword) if found in a dictionary or integer parameter to a named list

Parameters
listDestination list
paramParameter to add to the list
tokensThe dictionary used to find the given value
valThe value to find/add to the list

◆ appendFlag() [1/2]

static bool appendFlag ( NamedList & list,
const char * param,
const char * flag )
static

Append a flag to a list parameter (comma separated list), craete parameter if missing

Parameters
listThe parameter list
paramThe parameter to append to
flagThe flag to add
Returns
True if the given flag was not found but added

◆ appendFlag() [2/2]

static bool appendFlag ( String & flags,
const char * flag )
static

Append a flag to a comma separated list of flags if it doesn't exist

Parameters
flagsThe list of flags
flagThe flag to add
Returns
True if the given flag was not found but added

◆ codings()

static const TokenDict * codings ( )
static

Retreive the dictionary keeping the coding standard flags of ISUP and ISDN parameters as defined in Q.850

Returns
Pointer to the coding standards dictionary

◆ decodeCaps()

static bool decodeCaps ( const SignallingComponent * comp,
NamedList & list,
const unsigned char * buf,
unsigned int len,
const char * prefix,
bool isup )
static

Decode bearer capabilities as defined in Q.931 (Bearer Capabilities) and Q.763 (User Service Information)

Parameters
compSignalling component requesting the service. Used to print debug messages
listThe destination list
bufThe buffer containing the data to parse
lenBuffer's length
prefixThe prefix to add to the fields before adding to the destination list
isupTrue if the requestor is ISUP, false for ISDN requestor
Returns
True if successfully parsed

◆ decodeCause()

static bool decodeCause ( const SignallingComponent * comp,
NamedList & list,
const unsigned char * buf,
unsigned int len,
const char * prefix,
bool isup )
static

Decode cause parameters as defined in Q.850

Parameters
compSignalling component requesting the service. Used to print debug messages
listThe destination list
bufThe buffer containing the data to parse
lenBuffer's length
prefixThe prefix to add to the fields before adding to the destination list
isupTrue if the requestor is ISUP, false for ISDN requestor
Returns
True if successfully parsed

◆ decodeFlags()

static bool decodeFlags ( const SignallingComponent * comp,
NamedList & list,
const char * param,
const SignallingFlags * flags,
const unsigned char * buf,
unsigned int len )
static

Decode a received buffer to a comma separated list of flags and add it to a list of parameters

Parameters
compSignalling component requesting the service. Used to print debug messages
listThe destination list
paramThe parameter to add to the list
flagsThe flags description to use
bufThe buffer containing the data to parse
lenBuffer's length
Returns
False if the flags description or the buffer is missing or the buffer's length exceeds the length of the 'unsigned int' data type

◆ dict()

static const TokenDict * dict ( unsigned int index,
unsigned char coding = 0 )
inlinestatic

Retreive a dictionary given by index and coding standard for ISUP and ISDN parameters

Parameters
indexThe desired disctionary: 0: The release causes of ISUP and ISDN calls as defined in Q.850. 1: The formats negotiated in ISDN and ISUP parameters as defined in Q.931/Q.763. 2: The transfer capability negotiated in ISDN and ISUP parameters as defined in Q.931/Q.763. 3: The transfer mode negotiated in ISDN and ISUP parameters as defined in Q.931/Q.763. 4: The transfer rate negotiated in ISDN and ISUP parameters as defined in Q.931/Q.763.
codingOptional coding standard. Defaults to CCITT if 0
Returns
Pointer to the requested dictionary or 0

Referenced by encodeFlags(), and encodeFlags().

◆ dumpData()

static void dumpData ( const SignallingComponent * comp,
NamedList & list,
const char * param,
const unsigned char * buf,
unsigned int len,
char sep = ' ' )
static

Dump a buffer to a list of parameters

Parameters
compSignalling component requesting the service. Used to print debug messages
listThe destination list
paramParameter to add to the list
bufThe buffer containing the data to dump
lenBuffer's length
sepThe separator between elements

◆ dumpDataExt()

static unsigned int dumpDataExt ( const SignallingComponent * comp,
NamedList & list,
const char * param,
const unsigned char * buf,
unsigned int len,
char sep = ' ' )
static

Dump data from a buffer to a list of parameters. The buffer is parsed until (and including) the first byte with the extension bit (the most significant one) set

Parameters
compSignalling component requesting the service. Used to print debug messages
listThe destination list
paramParameter to add to the list
bufThe buffer containing the data to dump
lenBuffer's length
sepThe separator between elements
Returns
The number of bytes processed. 0 if the end of the buffer was reached without finding a byte with the extension bit set

◆ encodeCaps()

static bool encodeCaps ( const SignallingComponent * comp,
DataBlock & buf,
const NamedList & params,
const char * prefix,
bool isup )
static

Encode bearer capabilities as defined in Q.931 (Bearer Capabilities) and Q.763 (User Service Information)

Parameters
compSignalling component requesting the service. Used to print debug messages
bufThe destination buffer
paramsThe list with the parameters
prefixThe prefix of the fields obtained from parameter list
isupTrue if the requestor is ISUP, false for ISDN requestor
Returns
True

◆ encodeCause()

static bool encodeCause ( const SignallingComponent * comp,
DataBlock & buf,
const NamedList & params,
const char * prefix,
bool isup,
bool fail = false )
static

Encode cause parameters as defined in Q.850. Create with normal clearing value if parameter is missing. Don't encode diagnostic if total length exceeds 32 bytes for Q.931 requestor

Parameters
compSignalling component requesting the service. Used to print debug messages
bufThe destination buffer
paramsThe list with the parameters
prefixThe prefix of the fields obtained from parameter list
isupTrue if the requestor is ISUP, false for ISDN requestor
failFail if the buffer is too long. Ignored if isup is true
Returns
False if the requestor is Q.931, fail is true and the length exceeds 32 bytes

◆ encodeFlags() [1/2]

static unsigned int encodeFlags ( const SignallingComponent * comp,
const String & flags,
const SignallingFlags * dict,
const char * paramName = 0 )
static

Encode a comma separated list of signalling flags

Parameters
compSignalling component requesting the service. Used to print debug messages
flagsThe flag list
dictSignalling flags used to retrieve the flag names and values
paramNameOptional flags parameter name used for debug purposes
Returns
The OR'd value of found flags

References dict().

◆ encodeFlags() [2/2]

static void encodeFlags ( const SignallingComponent * comp,
int & dest,
const String & flags,
const TokenDict * dict )
static

Encode a comma separated list of flags. Flags can be prefixed with the '-' character to be reset if previously set

Parameters
compSignalling component requesting the service. Used to print debug messages
destDestination flak mask
flagsThe flag list
dictDictionary used to retrieve the flag names and values
Returns
The OR'd value of found flags

References dict().

◆ hasFlag() [1/2]

static bool hasFlag ( const NamedList & list,
const char * param,
const char * flag )
static

Check if a list's parameter (comma separated list of flags) has a given flag

Parameters
listThe parameter list
paramThe parameter to check
flagThe flag to check
Returns
True if the given flag is found

◆ hasFlag() [2/2]

static bool hasFlag ( const String & flags,
const char * flag )
static

Check if a comma separated list of flags has a given flag

Parameters
flagsThe list of flags
flagThe flag to check
Returns
True if the given flag is found

◆ locations()

static const TokenDict * locations ( )
static

Retreive the dictionary keeping the location flags of ISUP and ISDN parameters as defined in Q.850

Returns
Pointer to the locations dictionary

◆ parseUIntArray()

static unsigned int * parseUIntArray ( const String & source,
unsigned int minVal,
unsigned int maxVal,
unsigned int & count,
bool discardDup )
static

Parse a list of unsigned integers or unsigned integer intervals. Source elements must be separated by a '.' or ',' character. Interval margins must be separated by a '-' character. Empty elements are ignored

Parameters
sourceThe string to parse
minValThe minimum value for each element in the array
maxValThe maximum value for each element in the array
countOn exit will contain the length of the returned array (0 on failure)
discardDupTrue to discard duplicate values
Returns
Pointer to an array of unsigned integers on success (the caller must delete it after use). 0 on failure (source is empty or has invalid format or an invalid value was found)

◆ removeFlag()

static bool removeFlag ( String & flags,
const char * flag )
static

Remove a flag from a comma separated list of flags

Parameters
flagsThe list of flags
flagThe flag to remove
Returns
True if the given flag was found and removed

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