Commit b8795c9a authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #7246: Print SDP properly

parent f71da8ae
......@@ -221,6 +221,16 @@ void Sdp::setLocalMediaCapabilities(const CodecOrder &selectedCodecs)
}
}
namespace {
void printSession(const pjmedia_sdp_session *session)
{
char buffer[2048];
size_t size = pjmedia_sdp_print(session, buffer, sizeof(buffer));
std::string sessionStr(buffer, size);
DEBUG("%s", sessionStr.c_str());
}
}
int Sdp::createLocalSession(const CodecOrder &selectedCodecs)
{
setLocalMediaCapabilities(selectedCodecs);
......@@ -259,9 +269,8 @@ int Sdp::createLocalSession(const CodecOrder &selectedCodecs)
if (!srtpCrypto_.empty())
addSdesAttribute(srtpCrypto_);
char buffer[1000];
pjmedia_sdp_print(localSession_, buffer, sizeof(buffer));
DEBUG("SDP: Local SDP Session:\n%s", buffer);
DEBUG("SDP: Local SDP Session:");
printSession(localSession_);
return pjmedia_sdp_validate(localSession_);
}
......@@ -279,8 +288,8 @@ void Sdp::receiveOffer(const pjmedia_sdp_session* remote,
{
assert(remote);
char buffer[1000];
pjmedia_sdp_print(remote, buffer, sizeof(buffer));
DEBUG("SDP: Remote SDP Session:");
printSession(remote);
if (localSession_ == NULL && createLocalSession(selectedCodecs) != PJ_SUCCESS) {
ERROR("SDP: Failed to create initial offer");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment