|
reSIProcate/stack
9694
|
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 | |
| 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::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 | |
| 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 | |
Private Attributes | |
| int | mVersion |
| Origin | mOrigin |
| Data | mName |
| MediumContainer | mMedia |
| Data | mInformation |
| Uri | mUri |
| std::list< Email > | mEmails |
| std::list< Phone > | mPhones |
| Connection | mConnection |
| std::list< Bandwidth > | mBandwidths |
| std::list< Time > | mTimes |
| Timezones | mTimezones |
| Encryption | mEncryption |
| AttributeHelper | mAttributeHelper |
Friends | |
| class | SdpContents |
Provides an interface to read and modify SDP bodies.
Definition at line 61 of file SdpContents.hxx.
| typedef std::list<Medium> resip::SdpContents::Session::MediumContainer |
Definition at line 917 of file SdpContents.hxx.
| resip::SdpContents::Session::Session | ( | ) | [inline] |
Definition at line 811 of file SdpContents.hxx.
: mVersion(0) {}
| SdpContents::Session::Session | ( | const Session & | rhs | ) |
Definition at line 954 of file SdpContents.cxx.
{
*this = rhs;
}
| void SdpContents::Session::addAttribute | ( | const Data & | key, |
| const Data & | value = Data::Empty |
||
| ) |
add a session attribute line
| key | attribute key |
| value | attribute value |
Definition at line 1173 of file SdpContents.cxx.
References rtpmap.
{
mAttributeHelper.addAttribute(key, value);
if (key == rtpmap)
{
for (MediumContainer::iterator i = mMedia.begin();
i != mMedia.end(); ++i)
{
i->mRtpMapDone = false;
}
}
}
| void SdpContents::Session::addBandwidth | ( | const Bandwidth & | bandwidth | ) |
add a b= (Bandwidth) line to session
| bandwidth | Bandwidth line to add |
Definition at line 1160 of file SdpContents.cxx.
Referenced by resip::SdpContents::Session::Medium::parse(), and resip::SdpContents::Session::Medium::setBandwidth().
{
mBandwidths.push_back(bandwidth);
}
| void SdpContents::Session::addEmail | ( | const Email & | ) |
add an e= (email) line to session
| Email line to add |
Definition at line 1142 of file SdpContents.cxx.
{
mEmails.push_back(email);
}
| void SdpContents::Session::addMedium | ( | const Medium & | medium | ) |
| void SdpContents::Session::addPhone | ( | const Phone & | phone | ) |
add a p= (phone number) line to session
| phone | Phone line to add |
Definition at line 1154 of file SdpContents.cxx.
{
mPhones.push_back(phone);
}
| void SdpContents::Session::addTime | ( | const Time & | t | ) |
| const std::list<Bandwidth>& resip::SdpContents::Session::bandwidths | ( | ) | const [inline] |
return session Bandwidth lines
Definition at line 897 of file SdpContents.hxx.
References mBandwidths.
{return mBandwidths;}
| std::list<Bandwidth>& resip::SdpContents::Session::bandwidths | ( | ) | [inline] |
return session Bandwidth lines
Definition at line 902 of file SdpContents.hxx.
References mBandwidths.
{return mBandwidths;}
| void SdpContents::Session::clearAttribute | ( | const Data & | key | ) |
erase all attributes for a given key
| key | key to clear |
Definition at line 1188 of file SdpContents.cxx.
References rtpmap.
Referenced by resip::SdpContents::Session::Medium::clearCodecs().
{
mAttributeHelper.clearAttribute(key);
if (key == rtpmap)
{
for (MediumContainer::iterator i = mMedia.begin();
i != mMedia.end(); ++i)
{
i->mRtpMapDone = false;
}
}
}
| void resip::SdpContents::Session::clearMedium | ( | ) | [inline] |
remove all Medium sections from session
Definition at line 962 of file SdpContents.hxx.
References mMedia.
{ mMedia.clear(); }
| const Connection& resip::SdpContents::Session::connection | ( | ) | const [inline] |
return session Connection
Definition at line 882 of file SdpContents.hxx.
References mConnection.
Referenced by resip::SdpContents::Session::Medium::getConnections(), and main().
{return mConnection;}
| Connection& resip::SdpContents::Session::connection | ( | ) | [inline] |
return session Connection
Definition at line 887 of file SdpContents.hxx.
References mConnection.
{return mConnection;} // !dlb! optional?
| EncodeStream & SdpContents::Session::encode | ( | EncodeStream & | s | ) | const |
Definition at line 1069 of file SdpContents.cxx.
References CRLF, and resip::Contents::mVersion.
Referenced by resip::SdpContents::encodeParsed().
{
s << "v=" << mVersion << Symbols::CRLF;
mOrigin.encode(s);
s << "s=" << mName << Symbols::CRLF;
if (!mInformation.empty())
{
s << "i=" << mInformation << Symbols::CRLF;
}
if (!mUri.host().empty())
{
s << "u=";
mUri.encode(s);
s << Symbols::CRLF;
}
for (list<Email>::const_iterator i = mEmails.begin();
i != mEmails.end(); ++i)
{
i->encode(s);
}
for (list<Phone>::const_iterator i = mPhones.begin();
i != mPhones.end(); ++i)
{
i->encode(s);
}
if (!mConnection.getAddress().empty())
{
mConnection.encode(s);
}
for (list<Bandwidth>::const_iterator i = mBandwidths.begin();
i != mBandwidths.end(); ++i)
{
i->encode(s);
}
if (mTimes.empty())
{
s << "t=0 0" << Symbols::CRLF;
}
else
{
for (list<Time>::const_iterator i = mTimes.begin();
i != mTimes.end(); ++i)
{
i->encode(s);
}
}
mTimezones.encode(s);
if (mEncryption.getMethod() != Encryption::NoEncryption)
{
mEncryption.encode(s);
}
mAttributeHelper.encode(s);
for (MediumContainer::const_iterator i = mMedia.begin();
i != mMedia.end(); ++i)
{
i->encode(s);
}
return s;
}
| const Encryption& resip::SdpContents::Session::encryption | ( | ) | const [inline] |
| Encryption& resip::SdpContents::Session::encryption | ( | ) | [inline] |
| bool SdpContents::Session::exists | ( | const Data & | key | ) | const |
tests if an a= key is present in the session
| key | key to check |
Definition at line 1203 of file SdpContents.cxx.
Referenced by resip::SdpContents::Session::Medium::codecs(), and resip::SdpContents::Session::Medium::exists().
{
return mAttributeHelper.exists(key);
}
| const std::list<Email>& resip::SdpContents::Session::getEmails | ( | ) | const [inline] |
| const Encryption& resip::SdpContents::Session::getEncryption | ( | ) | const [inline] |
| const std::list<Phone>& resip::SdpContents::Session::getPhones | ( | ) | const [inline] |
| const std::list<Time>& resip::SdpContents::Session::getTimes | ( | ) | const [inline] |
| std::list<Time>& resip::SdpContents::Session::getTimes | ( | ) | [inline] |
| const Timezones& resip::SdpContents::Session::getTimezones | ( | ) | const [inline] |
get the attribute values corresponding to the key
| key | key to check |
Definition at line 1209 of file SdpContents.cxx.
Referenced by resip::SdpContents::Session::Medium::codecs(), and resip::SdpContents::Session::Medium::getValues().
{
return mAttributeHelper.getValues(key);
}
| const Data& resip::SdpContents::Session::information | ( | ) | const [inline] |
return session Information
Definition at line 852 of file SdpContents.hxx.
References mInformation.
{return mInformation;}
| Data& resip::SdpContents::Session::information | ( | ) | [inline] |
return session Information
Definition at line 857 of file SdpContents.hxx.
References mInformation.
{return mInformation;}
| bool resip::SdpContents::Session::isConnection | ( | ) | const [inline] |
check if a c= line is present for the session
Definition at line 892 of file SdpContents.hxx.
References resip::SdpContents::Empty, resip::SdpContents::Session::Connection::mAddress, and mConnection.
{ return mConnection.mAddress != Data::Empty; }
| const MediumContainer& resip::SdpContents::Session::media | ( | ) | const [inline] |
return session Media lines
Definition at line 922 of file SdpContents.hxx.
References mMedia.
{return mMedia;}
| MediumContainer& resip::SdpContents::Session::media | ( | ) | [inline] |
return session Media lines
Definition at line 927 of file SdpContents.hxx.
References mMedia.
{return mMedia;}
| const Data& resip::SdpContents::Session::name | ( | ) | const [inline] |
return session name
Definition at line 842 of file SdpContents.hxx.
References mName.
{return mName;}
| Data& resip::SdpContents::Session::name | ( | ) | [inline] |
return session name
Definition at line 847 of file SdpContents.hxx.
References mName.
{return mName;}
| SdpContents::Session & SdpContents::Session::operator= | ( | const Session & | rhs | ) |
Definition at line 960 of file SdpContents.cxx.
References mAttributeHelper, mBandwidths, mConnection, mEmails, mEncryption, mInformation, mMedia, mName, mOrigin, mPhones, mTimes, mTimezones, mUri, resip::Contents::mVersion, and mVersion.
{
if (this != &rhs)
{
mVersion = rhs.mVersion;
mOrigin = rhs.mOrigin;
mName = rhs.mName;
mMedia = rhs.mMedia;
mInformation = rhs.mInformation;
mUri = rhs.mUri;
mEmails = rhs.mEmails;
mPhones = rhs.mPhones;
mConnection = rhs.mConnection;
mBandwidths = rhs.mBandwidths;
mTimes = rhs.mTimes;
mTimezones = rhs.mTimezones;
mEncryption = rhs.mEncryption;
mAttributeHelper = rhs.mAttributeHelper;
for (MediumContainer::iterator i=mMedia.begin(); i != mMedia.end(); ++i)
{
i->setSession(this);
}
}
return *this;
}
| const Origin& resip::SdpContents::Session::origin | ( | ) | const [inline] |
| Origin& resip::SdpContents::Session::origin | ( | ) | [inline] |
| void SdpContents::Session::parse | ( | ParseBuffer & | pb | ) |
Definition at line 988 of file SdpContents.cxx.
References resip::Symbols::CRLF, resip::ParseBuffer::data(), resip::ParseBuffer::eof(), resip::Symbols::EQUALS, resip::ParseBuffer::integer(), resip::Contents::mVersion, resip::ParseBuffer::position(), resip::ParseBuffer::skipChar(), skipEol(), and resip::ParseBuffer::skipToOneOf().
Referenced by resip::SdpContents::parse().
{
pb.skipChar('v');
pb.skipChar(Symbols::EQUALS[0]);
mVersion = pb.integer();
skipEol(pb);
mOrigin.parse(pb);
pb.skipChar('s');
const char* anchor = pb.skipChar(Symbols::EQUALS[0]);
pb.skipToOneOf(Symbols::CRLF);
pb.data(mName, anchor);
skipEol(pb);
if (!pb.eof() && *pb.position() == 'i')
{
pb.skipChar('i');
const char* anchor = pb.skipChar(Symbols::EQUALS[0]);
pb.skipToOneOf(Symbols::CRLF);
pb.data(mInformation, anchor);
skipEol(pb);
}
if (!pb.eof() && *pb.position() == 'u')
{
pb.skipChar('u');
pb.skipChar(Symbols::EQUALS[0]);
mUri.parse(pb);
skipEol(pb);
}
while (!pb.eof() && *pb.position() == 'e')
{
addEmail(Email());
mEmails.back().parse(pb);
}
while (!pb.eof() && *pb.position() == 'p')
{
addPhone(Phone());
mPhones.back().parse(pb);
}
if (!pb.eof() && *pb.position() == 'c')
{
mConnection.parse(pb);
}
while (!pb.eof() && *pb.position() == 'b')
{
addBandwidth(Bandwidth());
mBandwidths.back().parse(pb);
}
while (!pb.eof() && *pb.position() == 't')
{
addTime(Time());
mTimes.back().parse(pb);
}
if (!pb.eof() && *pb.position() == 'z')
{
mTimezones.parse(pb);
}
if (!pb.eof() && *pb.position() == 'k')
{
mEncryption.parse(pb);
}
mAttributeHelper.parse(pb);
while (!pb.eof() && *pb.position() == 'm')
{
addMedium(Medium());
mMedia.back().parse(pb);
}
}

| const Uri& resip::SdpContents::Session::uri | ( | ) | const [inline] |
| Uri& resip::SdpContents::Session::uri | ( | ) | [inline] |
| int resip::SdpContents::Session::version | ( | ) | const [inline] |
return session version
Definition at line 822 of file SdpContents.hxx.
References mVersion.
{return mVersion;}
| int& resip::SdpContents::Session::version | ( | ) | [inline] |
return session version
Definition at line 827 of file SdpContents.hxx.
References mVersion.
{return mVersion;}
friend class SdpContents [friend] |
Definition at line 1009 of file SdpContents.hxx.
Definition at line 1007 of file SdpContents.hxx.
Referenced by resip::SdpContents::Session::Medium::addAttribute(), resip::SdpContents::Session::Medium::clearAttribute(), resip::SdpContents::Session::Medium::codecs(), resip::SdpContents::Session::Medium::encode(), resip::SdpContents::Session::Medium::exists(), resip::SdpContents::Session::Medium::getValues(), resip::SdpContents::Session::Medium::operator=(), operator=(), and resip::SdpContents::Session::Medium::parse().
std::list<Bandwidth> resip::SdpContents::Session::mBandwidths [private] |
Definition at line 1003 of file SdpContents.hxx.
Referenced by resip::SdpContents::Session::Medium::addBandwidth(), bandwidths(), resip::SdpContents::Session::Medium::encode(), resip::SdpContents::Session::Medium::operator=(), operator=(), resip::SdpContents::Session::Medium::parse(), and resip::SdpContents::Session::Medium::setBandwidth().
Definition at line 1002 of file SdpContents.hxx.
Referenced by connection(), isConnection(), and operator=().
std::list<Email> resip::SdpContents::Session::mEmails [private] |
Definition at line 1000 of file SdpContents.hxx.
Referenced by getEmails(), and operator=().
Definition at line 1006 of file SdpContents.hxx.
Referenced by resip::SdpContents::Session::Medium::encode(), encryption(), getEncryption(), resip::SdpContents::Session::Medium::operator=(), operator=(), and resip::SdpContents::Session::Medium::parse().
Definition at line 998 of file SdpContents.hxx.
Referenced by resip::SdpContents::Session::Medium::encode(), information(), resip::SdpContents::Session::Medium::operator=(), operator=(), and resip::SdpContents::Session::Medium::parse().
Definition at line 995 of file SdpContents.hxx.
Referenced by clearMedium(), media(), and operator=().
Data resip::SdpContents::Session::mName [private] |
Definition at line 994 of file SdpContents.hxx.
Referenced by resip::SdpContents::Session::Medium::encode(), name(), resip::SdpContents::Session::Medium::operator=(), operator=(), and resip::SdpContents::Session::Medium::parse().
Origin resip::SdpContents::Session::mOrigin [private] |
Definition at line 993 of file SdpContents.hxx.
Referenced by operator=(), and origin().
std::list<Phone> resip::SdpContents::Session::mPhones [private] |
Definition at line 1001 of file SdpContents.hxx.
Referenced by getPhones(), and operator=().
std::list<Time> resip::SdpContents::Session::mTimes [private] |
Definition at line 1004 of file SdpContents.hxx.
Referenced by getTimes(), and operator=().
Definition at line 1005 of file SdpContents.hxx.
Referenced by getTimezones(), and operator=().
Uri resip::SdpContents::Session::mUri [private] |
Definition at line 999 of file SdpContents.hxx.
Referenced by operator=(), and uri().
int resip::SdpContents::Session::mVersion [private] |
Definition at line 992 of file SdpContents.hxx.
Referenced by resip::SdpContents::Session::Origin::encode(), resip::SdpContents::Session::Origin::operator=(), operator=(), resip::SdpContents::Session::Origin::parse(), and version().
1.7.5.1