reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::SdpContents::Session::Medium Class Reference

process m= (media announcement) blocks More...

#include <SdpContents.hxx>

Public Types

typedef std::list< Codec > CodecContainer
 

Public Member Functions

 Medium ()
 
 Medium (const Medium &rhs)
 
 Medium (const Data &name, unsigned long port, unsigned long multicast, const Data &protocol)
 Constructor.
 
Medium & operator= (const Medium &rhs)
 
void parse (ParseBuffer &pb)
 
EncodeStream & encode (EncodeStream &) const
 
void addFormat (const Data &format)
 add a format identifier to the m= line
 
void setConnection (const Connection &connection)
 set the media connection line.
 
void addConnection (const Connection &connection)
 add a media connection line.
 
void setBandwidth (const Bandwidth &bandwidth)
 
void addBandwidth (const Bandwidth &bandwidth)
 
void addAttribute (const Data &key, const Data &value=Data::Empty)
 add a media attribute line
 
const Data & name () const
 return the media type
 
Data & name ()
 return the media type
 
int port () const
 return the base port
 
unsigned long & port ()
 return the base port
 
void setPort (int port)
 change the base port
 
int firstRtcpPort () const
 get the value of the first specified RTCP port or if no rtcp: attribute found, the default port() value.
 
int multicast () const
 get the number of transport port pairs
 
unsigned long & multicast ()
 get the number of transport port pairs
 
const Data & protocol () const
 return the transport protocol
 
Data & protocol ()
 return the transport protocol
 
const CodecContainer & codecs () const
 preferred codec/format interface
 
CodecContainer & codecs ()
 
void clearCodecs ()
 remove all codecs from SDP
 
void addCodec (const Codec &codec)
 add a codec to the m= line
 
const std::list< Data > & getFormats () const
 return a list of codec formats
 
const Data & information () const
 get optional i= (information) line contents
 
Data & information ()
 get optional i= (information) line contents
 
const std::list< Bandwidth > & bandwidths () const
 get a list of bandwidth lines
 
std::list< Bandwidth > & bandwidths ()
 
const std::list< Connection > getConnections () const
 get a list of Connection objects, including the Session's c= line.
 
const std::list< Connection > & getMediumConnections () const
 get a list of Connection objects from the m= section.
 
std::list< Connection > & getMediumConnections ()
 
const Encryption & getEncryption () const
 
const Encryption & encryption () const
 
Encryption & encryption ()
 
bool exists (const Data &key) const
 tests if an a= key is present in the media section
 
const std::list< Data > & getValues (const Data &key) const
 get the attribute values corresponding to the key - returns the attributes set on this medium, with fallback to the session
 
std::list< Data > getMergedValues (const Data &key) const
 get the attribute values corresponding to the key - returns both the attributes set on this medium, and those set on the session.
 
void clearAttribute (const Data &key)
 erase all attributes for a given key
 
const Codec & findFirstMatchingCodecs (const CodecContainer &codecs, Codec *pMatchingCodec=0) const
 
const Codec & findFirstMatchingCodecs (const Medium &medium, Codec *pMatchingCodec=0) const
 
const Codec & findTelephoneEventPayloadCodec () const
 finds the telephone-event codec
 
int findTelephoneEventPayloadType () const
 finds the telephone-event payload type
 
const Direction & getDirection () const
 
const Direction & getDirection (const Direction &sessionDefault) const
 

Friends

class Session
 

Detailed Description

process m= (media announcement) blocks

Definition at line 635 of file SdpContents.hxx.

Member Typedef Documentation

◆ CodecContainer

Definition at line 745 of file SdpContents.hxx.

Constructor & Destructor Documentation

◆ Medium() [1/3]

SdpContents::Session::Medium::Medium ( )

Definition at line 1531 of file SdpContents.cxx.

◆ Medium() [2/3]

SdpContents::Session::Medium::Medium ( const Medium &  rhs)

Definition at line 1538 of file SdpContents.cxx.

◆ Medium() [3/3]

SdpContents::Session::Medium::Medium ( const Data &  name,
unsigned long  port,
unsigned long  multicast,
const Data &  protocol 
)

Constructor.

Parameters
namemedia type (audio, video, application, data, etc.)
portUDP port that will receive RTP
multicasta misnomer. If multicast > 1, the next (multicast) even ports will convey RTP and the next (multicast) odd ports will convey corresponding RTCP
protocolthe transport used to convey the media. Usually "RTP/AVP" for SIP.

Definition at line 1519 of file SdpContents.cxx.

Member Function Documentation

◆ addAttribute()

void SdpContents::Session::Medium::addAttribute ( const Data &  key,
const Data &  value = Data::Empty 
)

add a media attribute line

Parameters
keyattribute key
valueattribute value

Definition at line 1833 of file SdpContents.cxx.

◆ addBandwidth()

void SdpContents::Session::Medium::addBandwidth ( const Bandwidth &  bandwidth)

Definition at line 1827 of file SdpContents.cxx.

◆ addCodec()

void SdpContents::Session::Medium::addCodec ( const Codec &  codec)

add a codec to the m= line

Parameters
codeccodec to add

Definition at line 1923 of file SdpContents.cxx.

◆ addConnection()

void SdpContents::Session::Medium::addConnection ( const Connection &  connection)

add a media connection line.

Optional if main SDP has c= line.

Parameters
connectionconnection line to use

Definition at line 1814 of file SdpContents.cxx.

◆ addFormat()

void SdpContents::Session::Medium::addFormat ( const Data &  format)

add a format identifier to the m= line

This will need to be called for each codec used in the SDP.

Parameters
formatformat identifier

Definition at line 1801 of file SdpContents.cxx.

◆ bandwidths() [1/2]

std::list< Bandwidth > & resip::SdpContents::Session::Medium::bandwidths ( )
inline

Definition at line 789 of file SdpContents.hxx.

◆ bandwidths() [2/2]

const std::list< Bandwidth > & resip::SdpContents::Session::Medium::bandwidths ( ) const
inline

get a list of bandwidth lines

Returns
list of Bandwidth objects

Definition at line 788 of file SdpContents.hxx.

◆ clearAttribute()

void SdpContents::Session::Medium::clearAttribute ( const Data &  key)

erase all attributes for a given key

Parameters
keykey to clear

Definition at line 1904 of file SdpContents.cxx.

◆ clearCodecs()

void SdpContents::Session::Medium::clearCodecs ( )

remove all codecs from SDP

Definition at line 1914 of file SdpContents.cxx.

◆ codecs() [1/2]

SdpContents::Session::Medium::CodecContainer & SdpContents::Session::Medium::codecs ( )

Definition at line 1937 of file SdpContents.cxx.

◆ codecs() [2/2]

const SdpContents::Session::Medium::CodecContainer & SdpContents::Session::Medium::codecs ( ) const

preferred codec/format interface

Note
internal storage of formats, rtpmap attributes, and ftmp attributes are cleared out after codecs() is called, since they get converted internally as Codec objects

Definition at line 1931 of file SdpContents.cxx.

◆ encode()

EncodeStream & SdpContents::Session::Medium::encode ( EncodeStream &  s) const

Definition at line 1718 of file SdpContents.cxx.

◆ encryption() [1/2]

Encryption & resip::SdpContents::Session::Medium::encryption ( )
inline

Definition at line 806 of file SdpContents.hxx.

◆ encryption() [2/2]

const Encryption & resip::SdpContents::Session::Medium::encryption ( ) const
inline

Definition at line 805 of file SdpContents.hxx.

◆ exists()

bool SdpContents::Session::Medium::exists ( const Data &  key) const

tests if an a= key is present in the media section

Parameters
keykey to check
Returns
true if key exists, false otherwise

Definition at line 1857 of file SdpContents.cxx.

◆ findFirstMatchingCodecs() [1/2]

const Codec & SdpContents::Session::Medium::findFirstMatchingCodecs ( const CodecContainer &  codecs,
Codec *  pMatchingCodec = 0 
) const

Definition at line 2009 of file SdpContents.cxx.

◆ findFirstMatchingCodecs() [2/2]

const Codec & SdpContents::Session::Medium::findFirstMatchingCodecs ( const Medium &  medium,
Codec *  pMatchingCodec = 0 
) const

Definition at line 2034 of file SdpContents.cxx.

◆ findTelephoneEventPayloadCodec()

const Codec & SdpContents::Session::Medium::findTelephoneEventPayloadCodec ( ) const

finds the telephone-event codec

Returns
telephone-event "codec"

Definition at line 2047 of file SdpContents.cxx.

◆ findTelephoneEventPayloadType()

int SdpContents::Session::Medium::findTelephoneEventPayloadType ( ) const

finds the telephone-event payload type

Returns
payload type of telephone-event "codec"

Definition at line 2061 of file SdpContents.cxx.

◆ firstRtcpPort()

int resip::SdpContents::Session::Medium::firstRtcpPort ( ) const
inline

get the value of the first specified RTCP port or if no rtcp: attribute found, the default port() value.

RFC 3605.

Returns
the RTCP port

Definition at line 719 of file SdpContents.hxx.

◆ getConnections()

const list< SdpContents::Session::Connection > SdpContents::Session::Medium::getConnections ( ) const

get a list of Connection objects, including the Session's c= line.

If the media's c= line is empty, use the Session's c= line.

Returns
list of connections

Definition at line 1843 of file SdpContents.cxx.

◆ getDirection() [1/2]

const SdpContents::Session::Direction & SdpContents::Session::Medium::getDirection ( ) const

Definition at line 1264 of file SdpContents.cxx.

◆ getDirection() [2/2]

const SdpContents::Session::Direction & SdpContents::Session::Medium::getDirection ( const Direction &  sessionDefault) const

Definition at line 1286 of file SdpContents.cxx.

◆ getEncryption()

const Encryption & resip::SdpContents::Session::Medium::getEncryption ( ) const
inline

Definition at line 804 of file SdpContents.hxx.

◆ getFormats()

const std::list< Data > & resip::SdpContents::Session::Medium::getFormats ( ) const
inline

return a list of codec formats

These formats correspond to RTP payload type identifiers

Note
formats are cleared out and converted in codec objects when codecs() is called
Returns
list of codec formats

Definition at line 772 of file SdpContents.hxx.

◆ getMediumConnections() [1/2]

std::list< Connection > & resip::SdpContents::Session::Medium::getMediumConnections ( )
inline

Definition at line 803 of file SdpContents.hxx.

◆ getMediumConnections() [2/2]

const std::list< Connection > & resip::SdpContents::Session::Medium::getMediumConnections ( ) const
inline

get a list of Connection objects from the m= section.

Does not include session c= line.

Returns
list of connections

Definition at line 802 of file SdpContents.hxx.

◆ getMergedValues()

list< Data > SdpContents::Session::Medium::getMergedValues ( const Data &  key) const

get the attribute values corresponding to the key - returns both the attributes set on this medium, and those set on the session.

Attributes from this medium will be returned first in the list, followed by those from the session.

Parameters
keykey to check
Returns
list of values for given key

Definition at line 1883 of file SdpContents.cxx.

◆ getValues()

const list< Data > & SdpContents::Session::Medium::getValues ( const Data &  key) const

get the attribute values corresponding to the key - returns the attributes set on this medium, with fallback to the session

Parameters
keykey to check
Returns
list of values for given key

Definition at line 1867 of file SdpContents.cxx.

◆ information() [1/2]

Data & resip::SdpContents::Session::Medium::information ( )
inline

get optional i= (information) line contents

Returns
contents

Definition at line 783 of file SdpContents.hxx.

◆ information() [2/2]

const Data & resip::SdpContents::Session::Medium::information ( ) const
inline

get optional i= (information) line contents

Returns
contents

Definition at line 778 of file SdpContents.hxx.

◆ multicast() [1/2]

unsigned long & resip::SdpContents::Session::Medium::multicast ( )
inline

get the number of transport port pairs

Returns
number of transport port pairs

Definition at line 732 of file SdpContents.hxx.

◆ multicast() [2/2]

int resip::SdpContents::Session::Medium::multicast ( ) const
inline

get the number of transport port pairs

Returns
number of transport port pairs

Definition at line 727 of file SdpContents.hxx.

◆ name() [1/2]

Data & resip::SdpContents::Session::Medium::name ( )
inline

return the media type

Returns
media type

Definition at line 696 of file SdpContents.hxx.

◆ name() [2/2]

const Data & resip::SdpContents::Session::Medium::name ( ) const
inline

return the media type

Returns
media type

Definition at line 691 of file SdpContents.hxx.

◆ operator=()

SdpContents::Session::Medium & SdpContents::Session::Medium::operator= ( const Medium &  rhs)

Definition at line 1559 of file SdpContents.cxx.

◆ parse()

void SdpContents::Session::Medium::parse ( ParseBuffer &  pb)

Definition at line 1595 of file SdpContents.cxx.

◆ port() [1/2]

unsigned long & resip::SdpContents::Session::Medium::port ( )
inline

return the base port

Returns
base port

Definition at line 706 of file SdpContents.hxx.

◆ port() [2/2]

int resip::SdpContents::Session::Medium::port ( ) const
inline

return the base port

Returns
base port

Definition at line 701 of file SdpContents.hxx.

◆ protocol() [1/2]

Data & resip::SdpContents::Session::Medium::protocol ( )
inline

return the transport protocol

Returns
transport protocol name

Definition at line 742 of file SdpContents.hxx.

◆ protocol() [2/2]

const Data & resip::SdpContents::Session::Medium::protocol ( ) const
inline

return the transport protocol

Returns
transport protocol name

Definition at line 737 of file SdpContents.hxx.

◆ setBandwidth()

void SdpContents::Session::Medium::setBandwidth ( const Bandwidth &  bandwidth)

Definition at line 1820 of file SdpContents.cxx.

◆ setConnection()

void SdpContents::Session::Medium::setConnection ( const Connection &  connection)

set the media connection line.

Optional if main SDP has c= line.

Parameters
connectionconnection line to use

Definition at line 1807 of file SdpContents.cxx.

◆ setPort()

void SdpContents::Session::Medium::setPort ( int  port)

change the base port

Parameters
portnew base port

Definition at line 1583 of file SdpContents.cxx.

Friends And Related Symbol Documentation

◆ Session

friend class Session
friend

Definition at line 883 of file SdpContents.hxx.


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