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

Provides an interface to read and modify SDP bodies. More...

#include <SdpContents.hxx>

Classes

class  Bandwidth
 Process optional b= (bandwidth) lines in SDP. More...
 
class  Codec
 parameters for a specific codec are stored in this class. More...
 
class  Connection
 Process c= (connection) lines in SDP. More...
 
class  Direction
 
class  Email
 process e= (email) lines in the SDP More...
 
class  Encryption
 process k= (encryption key) line More...
 
class  Medium
 process m= (media announcement) blocks More...
 
class  Origin
 processes o= lines in SDP More...
 
class  Phone
 process p= (phone number) lines in the SDP More...
 
class  Time
 Process t= (start/stop time) lines in SDP. More...
 
class  Timezones
 process z= (timezone) lines More...
 

Public Types

typedef std::vector< std::reference_wrapper< const SdpContents::Session::Direction > > DirectionList
 
typedef std::list< Medium > MediumContainer
 

Public Member Functions

 Session (int version, const Origin &origin, const Data &name)
 session constructor
 
 Session ()
 
 Session (const Session &rhs)
 
Session & operator= (const Session &rhs)
 
void parse (ParseBuffer &pb)
 
EncodeStream & encode (EncodeStream &) const
 
int version () const
 return session version
 
int & version ()
 return session version
 
const Origin & origin () const
 return session Origin line
 
Origin & origin ()
 return session Origin line
 
const Data & name () const
 return session name
 
Data & name ()
 return session name
 
const Data & information () const
 return session Information
 
Data & information ()
 return session Information
 
const Uri & uri () const
 return session Uri
 
Uri & uri ()
 return session Uri
 
const std::list< Email > & getEmails () const
 return session Email list
 
const std::list< Phone > & getPhones () const
 return session Phone number list
 
const Connection & connection () const
 return session Connection
 
Connection & connection ()
 return session Connection
 
bool isConnection () const
 check if a c= line is present for the session
 
const std::list< Bandwidth > & bandwidths () const
 return session Bandwidth lines
 
std::list< Bandwidth > & bandwidths ()
 return session Bandwidth lines
 
const std::list< Time > & getTimes () const
 return session Time lines
 
std::list< Time > & getTimes ()
 return session Time lines
 
const Timezones & getTimezones () const
 
const Encryption & getEncryption () const
 
const Encryption & encryption () const
 
Encryption & encryption ()
 
const MediumContainer & media () const
 return session Media lines
 
MediumContainer & media ()
 return session Media lines
 
std::list< std::reference_wrapper< Medium > > getMediaByType (const Data &type)
 return session Media lines filtered by type
 
void addEmail (const Email &email)
 add an e= (email) line to session
 
void addPhone (const Phone &phone)
 add a p= (phone number) line to session
 
void addBandwidth (const Bandwidth &bandwidth)
 add a b= (Bandwidth) line to session
 
void addTime (const Time &t)
 add a t= (Time) line to session
 
void addMedium (const Medium &medium)
 add an m= (Medium) section to session
 
void clearMedium ()
 remove all Medium sections from session
 
void clearAttribute (const Data &key)
 erase all attributes for a given key
 
void addAttribute (const Data &key, const Data &value=Data::Empty)
 add a session attribute line
 
bool exists (const Data &key) const
 tests if an a= key is present in the session
 
const std::list< Data > & getValues (const Data &key) const
 get the attribute values corresponding to the key
 
const Direction & getDirection () const
 
const Direction & getDirection (const std::set< Data > types, const std::set< Data > protocolTypes) const
 examine direction for streams of given types
 
DirectionList getDirections () const
 
DirectionList getNetDirections (const SdpContents &remote) const
 
std::set< Data > getMediaStreamLabels () const
 retrieve label (RFC 4574) attributes in a set
 
bool isWebRTC () const
 determine if the SDP appears to conform to WebRTC
 
bool isTrickleIceSupported () const
 determine if ice-options:trickle is present
 
void transformCOMedia (const Data &setupDirection="active", const Data &cOMediaAttribute="setup")
 apply RFC 4145 COMEDIA transform
 
void transformLocalHold (bool holding)
 change the direction attributes as if the peer who created the SDP is on hold or not
 
const Medium * getMediumByMid (const Data &mid) const
 find the Medium with given mid value
 
std::shared_ptr< TrickleIceContents > makeIceFragment (const Data &fragment, unsigned int lineIndex, const Data &mid)
 based on the original SDP in this instances of SdpContents, find the relevant ICE and m= line(s), copy them into a new SDP fragment and add the candidate line provided
 

Friends

class SdpContents
 

Detailed Description

Provides an interface to read and modify SDP bodies.

Definition at line 71 of file SdpContents.hxx.

Member Typedef Documentation

◆ DirectionList

typedef std::vector<std::reference_wrapper<const SdpContents::Session::Direction> > resip::SdpContents::Session::DirectionList

Definition at line 587 of file SdpContents.hxx.

◆ MediumContainer

Definition at line 1005 of file SdpContents.hxx.

Constructor & Destructor Documentation

◆ Session() [1/3]

SdpContents::Session::Session ( int  version,
const Origin &  origin,
const Data &  name 
)

session constructor

Create a new session from origin line, version, and session anme

Parameters
versionsession version
originOrigin line
namesession name

Definition at line 968 of file SdpContents.cxx.

◆ Session() [2/3]

resip::SdpContents::Session::Session ( )
inline

Definition at line 899 of file SdpContents.hxx.

◆ Session() [3/3]

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

Definition at line 976 of file SdpContents.cxx.

Member Function Documentation

◆ addAttribute()

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

add a session attribute line

Parameters
keyattribute key
valueattribute value

Definition at line 1208 of file SdpContents.cxx.

◆ addBandwidth()

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

add a b= (Bandwidth) line to session

Parameters
bandwidthBandwidth line to add

Definition at line 1195 of file SdpContents.cxx.

◆ addEmail()

void SdpContents::Session::addEmail ( const Email &  email)

add an e= (email) line to session

Parameters
emailEmail line to add

Definition at line 1177 of file SdpContents.cxx.

◆ addMedium()

void SdpContents::Session::addMedium ( const Medium &  medium)

add an m= (Medium) section to session

Parameters
mediumMedium section to add

Definition at line 1201 of file SdpContents.cxx.

◆ addPhone()

void SdpContents::Session::addPhone ( const Phone &  phone)

add a p= (phone number) line to session

Parameters
phonePhone line to add

Definition at line 1189 of file SdpContents.cxx.

◆ addTime()

void SdpContents::Session::addTime ( const Time &  t)

add a t= (Time) line to session

Parameters
tTime line to add

Definition at line 1183 of file SdpContents.cxx.

◆ bandwidths() [1/2]

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

return session Bandwidth lines

Returns
Bandwidth lines

Definition at line 990 of file SdpContents.hxx.

◆ bandwidths() [2/2]

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

return session Bandwidth lines

Returns
Bandwidth lines

Definition at line 985 of file SdpContents.hxx.

◆ clearAttribute()

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

erase all attributes for a given key

Parameters
keykey to clear

Definition at line 1223 of file SdpContents.cxx.

◆ clearMedium()

void resip::SdpContents::Session::clearMedium ( )
inline

remove all Medium sections from session

Definition at line 1055 of file SdpContents.hxx.

◆ connection() [1/2]

Connection & resip::SdpContents::Session::connection ( )
inline

return session Connection

Returns
Connection line

Definition at line 975 of file SdpContents.hxx.

◆ connection() [2/2]

const Connection & resip::SdpContents::Session::connection ( ) const
inline

return session Connection

Returns
Connection line

Definition at line 970 of file SdpContents.hxx.

◆ encode()

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

Definition at line 1091 of file SdpContents.cxx.

◆ encryption() [1/2]

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

Definition at line 1004 of file SdpContents.hxx.

◆ encryption() [2/2]

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

Definition at line 1003 of file SdpContents.hxx.

◆ exists()

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

tests if an a= key is present in the session

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

Definition at line 1238 of file SdpContents.cxx.

◆ getDirection() [1/2]

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

Definition at line 1250 of file SdpContents.cxx.

◆ getDirection() [2/2]

const SdpContents::Session::Direction & SdpContents::Session::getDirection ( const std::set< Data >  types,
const std::set< Data >  protocolTypes 
) const

examine direction for streams of given types

Parameters
types@params protocolTypes

Definition at line 1361 of file SdpContents.cxx.

◆ getDirections()

SdpContents::Session::DirectionList SdpContents::Session::getDirections ( ) const

Definition at line 1300 of file SdpContents.cxx.

◆ getEmails()

const std::list< Email > & resip::SdpContents::Session::getEmails ( ) const
inline

return session Email list

Returns
Email list

Definition at line 960 of file SdpContents.hxx.

◆ getEncryption()

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

Definition at line 1002 of file SdpContents.hxx.

◆ getMediaByType()

std::list< std::reference_wrapper< SdpContents::Session::Medium > > SdpContents::Session::getMediaByType ( const Data &  type)

return session Media lines filtered by type

Parameters
typethe type
Returns
Media lines

Definition at line 1164 of file SdpContents.cxx.

◆ getMediaStreamLabels()

std::set< Data > SdpContents::Session::getMediaStreamLabels ( ) const

retrieve label (RFC 4574) attributes in a set

Returns
set of label attribute values, if any

Definition at line 1390 of file SdpContents.cxx.

◆ getMediumByMid()

const SdpContents::Session::Medium * SdpContents::Session::getMediumByMid ( const Data &  mid) const

find the Medium with given mid value

Parameters
midthe mid value to search for
Returns
nullptr if no match found

Definition at line 1489 of file SdpContents.cxx.

◆ getNetDirections()

SdpContents::Session::DirectionList SdpContents::Session::getNetDirections ( const SdpContents &  remote) const

Definition at line 1314 of file SdpContents.cxx.

◆ getPhones()

const std::list< Phone > & resip::SdpContents::Session::getPhones ( ) const
inline

return session Phone number list

Returns
Phone number list

Definition at line 965 of file SdpContents.hxx.

◆ getTimes() [1/2]

std::list< Time > & resip::SdpContents::Session::getTimes ( )
inline

return session Time lines

Returns
Time lines

Definition at line 1000 of file SdpContents.hxx.

◆ getTimes() [2/2]

const std::list< Time > & resip::SdpContents::Session::getTimes ( ) const
inline

return session Time lines

Returns
Time lines

Definition at line 995 of file SdpContents.hxx.

◆ getTimezones()

const Timezones & resip::SdpContents::Session::getTimezones ( ) const
inline

Definition at line 1001 of file SdpContents.hxx.

◆ getValues()

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

get the attribute values corresponding to the key

Parameters
keykey to check
Returns
list of values for given key

Definition at line 1244 of file SdpContents.cxx.

◆ information() [1/2]

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

return session Information

Returns
Information line

Definition at line 945 of file SdpContents.hxx.

◆ information() [2/2]

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

return session Information

Returns
Information line

Definition at line 940 of file SdpContents.hxx.

◆ isConnection()

bool resip::SdpContents::Session::isConnection ( ) const
inline

check if a c= line is present for the session

Returns
true if c= line is present

Definition at line 980 of file SdpContents.hxx.

◆ isTrickleIceSupported()

bool SdpContents::Session::isTrickleIceSupported ( ) const

determine if ice-options:trickle is present

Returns
true if ice-options:trickle is present

Definition at line 1422 of file SdpContents.cxx.

◆ isWebRTC()

bool SdpContents::Session::isWebRTC ( ) const

determine if the SDP appears to conform to WebRTC

Returns
true if the SDP appears to be WebRTC

Definition at line 1406 of file SdpContents.cxx.

◆ makeIceFragment()

std::shared_ptr< TrickleIceContents > SdpContents::Session::makeIceFragment ( const Data &  fragment,
unsigned int  lineIndex,
const Data &  mid 
)

based on the original SDP in this instances of SdpContents, find the relevant ICE and m= line(s), copy them into a new SDP fragment and add the candidate line provided

Parameters
fragmentthe candidate line to include
Returns
a new TrickleIceContents

Definition at line 1502 of file SdpContents.cxx.

◆ media() [1/2]

MediumContainer & resip::SdpContents::Session::media ( )
inline

return session Media lines

Returns
Media lines

Definition at line 1015 of file SdpContents.hxx.

◆ media() [2/2]

const MediumContainer & resip::SdpContents::Session::media ( ) const
inline

return session Media lines

Returns
Media lines

Definition at line 1010 of file SdpContents.hxx.

◆ name() [1/2]

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

return session name

Returns
name

Definition at line 935 of file SdpContents.hxx.

◆ name() [2/2]

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

return session name

Returns
name

Definition at line 930 of file SdpContents.hxx.

◆ operator=()

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

Definition at line 982 of file SdpContents.cxx.

◆ origin() [1/2]

Origin & resip::SdpContents::Session::origin ( )
inline

return session Origin line

Returns
Origin line

Definition at line 925 of file SdpContents.hxx.

◆ origin() [2/2]

const Origin & resip::SdpContents::Session::origin ( ) const
inline

return session Origin line

Returns
Origin line

Definition at line 920 of file SdpContents.hxx.

◆ parse()

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

Definition at line 1010 of file SdpContents.cxx.

◆ transformCOMedia()

void SdpContents::Session::transformCOMedia ( const Data &  setupDirection = "active",
const Data &  cOMediaAttribute = "setup" 
)

apply RFC 4145 COMEDIA transform

sets the IP port number of each media to 9 and adds the setup attribute. Early versions of the draft up to draft-ietf-mmusic-sdp-comedia-05.txt used the attribute name "direction", later versions and the RFC 4145 use the attribute name "setup"

Definition at line 1440 of file SdpContents.cxx.

◆ transformLocalHold()

void SdpContents::Session::transformLocalHold ( bool  holding)

change the direction attributes as if the peer who created the SDP is on hold or not

Parameters
holdingwhether to represent hold or normal

Definition at line 1453 of file SdpContents.cxx.

◆ uri() [1/2]

Uri & resip::SdpContents::Session::uri ( )
inline

return session Uri

Returns
Uri line

Definition at line 955 of file SdpContents.hxx.

◆ uri() [2/2]

const Uri & resip::SdpContents::Session::uri ( ) const
inline

return session Uri

Returns
Uri line

Definition at line 950 of file SdpContents.hxx.

◆ version() [1/2]

int & resip::SdpContents::Session::version ( )
inline

return session version

Returns
session version

Definition at line 915 of file SdpContents.hxx.

◆ version() [2/2]

int resip::SdpContents::Session::version ( ) const
inline

return session version

Returns
session version

Definition at line 910 of file SdpContents.hxx.

Friends And Related Symbol Documentation

◆ SdpContents

friend class SdpContents
friend

Definition at line 1157 of file SdpContents.hxx.


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