Yate
SDPParser Class Reference

A SDP parser. More...

#include <yatesdp.h>

Inheritance diagram for SDPParser:
DebugEnabler Mutex Lockable

Public Member Functions

 SDPParser (const char *dbgName, const char *sessName, const char *fmts="alaw,mulaw")
 
void getAudioFormats (String &buf)
 
int rfc2833 () const
 
bool secure () const
 
bool sdpForward () const
 
bool ignorePort () const
 
ObjListparse (const MimeSdpBody &sdp, String &addr, ObjList *oldMedia=0, const String &media=String::empty(), bool force=false)
 
ObjListparse (const MimeSdpBody *sdp, String &addr, ObjList *oldMedia=0, const String &media=String::empty(), bool force=false)
 
void initialize (const NamedList *codecs, const NamedList *hacks, const NamedList *general=0)
 
- Public Member Functions inherited from DebugEnabler
 DebugEnabler (int level=TelEngine::debugLevel(), bool enabled=true)
 
int debugLevel () const
 
int debugLevel (int level)
 
bool debugEnabled () const
 
void debugEnabled (bool enable)
 
const char * debugName () const
 
bool debugAt (int level) const
 
bool debugChained () const
 
void debugChain (const DebugEnabler *chain=0)
 
void debugCopy (const DebugEnabler *original=0)
 
- 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 ()
 

Static Public Attributes

static const TokenDict s_payloads []
 
static const TokenDict s_rtpmap []
 

Friends

class SDPSession
 

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 ()
 
- Protected Member Functions inherited from DebugEnabler
void debugName (const char *name)
 

Detailed Description

A SDP parser.

This class holds a SDP parser and additional data used by SDP objects

Constructor & Destructor Documentation

◆ SDPParser()

SDPParser ( const char * dbgName,
const char * sessName,
const char * fmts = "alaw,mulaw" )
inline

Constructor

Parameters
dbgNameDebug name of this parser
sessNameName of the session in SDP
fmtsDefault media formats

References DebugEnabler::debugName(), and Mutex::Mutex().

Member Function Documentation

◆ getAudioFormats()

void getAudioFormats ( String & buf)
inline

Get the formats list This method is thread safe

Parameters
bufString to be filled with comma separated list of formats

References Mutex::lock().

◆ ignorePort()

bool ignorePort ( ) const
inline

Get the RTP port change ignore flag

Returns
True if a port change should not cause an offer change

◆ initialize()

void initialize ( const NamedList * codecs,
const NamedList * hacks,
const NamedList * general = 0 )

Update configuration. This method should be called after a configuration file is loaded

Parameters
codecsList of supported codecs
hacksList of hacks
generalList of general settings

◆ parse() [1/2]

ObjList * parse ( const MimeSdpBody & sdp,
String & addr,
ObjList * oldMedia = 0,
const String & media = String::empty(),
bool force = false )

Parse a received SDP body This method is thread safe

Parameters
sdpReceived SDP body
addrRemote address
oldMediaOptional list of existing media (an already existing media will be moved to returned list)
mediaOptional expected media type. If not empty this will be the only media type returned (if found)
forceForce updating formats even if incompatible with old ones
Returns
List of SDPMedia objects, may be NULL

References String::empty().

Referenced by parse().

◆ parse() [2/2]

ObjList * parse ( const MimeSdpBody * sdp,
String & addr,
ObjList * oldMedia = 0,
const String & media = String::empty(),
bool force = false )
inline

Parse a received SDP body, returns NULL if SDP is not present This method is thread safe

Parameters
sdpPointer to received SDP body
addrRemote address
oldMediaOptional list of existing media (an already existing media will be moved to returned list)
mediaOptional expected media type. If not empty this will be the only media type returned (if found)
forceForce updating formats even if incompatible with old ones
Returns
List of SDPMedia objects, may be NULL

References String::empty(), and parse().

◆ rfc2833()

int rfc2833 ( ) const
inline

Get the RFC 2833 offer payload

Returns
Payload for RFC 2883 telephony events, negative if not offered

◆ sdpForward()

bool sdpForward ( ) const
inline

Get the SDP forward flag

Returns
True if raw SDP should be added to RTP forward offer

◆ secure()

bool secure ( ) const
inline

Get the secure offer flag

Returns
True if SDES descriptors for SRTP will be offered

Member Data Documentation

◆ s_payloads

const TokenDict s_payloads[]
static

Yate Payloads for the AV profile

◆ s_rtpmap

const TokenDict s_rtpmap[]
static

SDP Payloads for the AV profile


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