[reSIProcate] how to get "char *sdp_string" from "SdpContents sdp"?
Kenneth Ho
kenho at bluebottle.com
Thu Sep 22 19:45:45 CDT 2005
something like this:
#include <resiprocate/SdpContents.hxx>
#include <sstream>
#include <string>
void foo (const SdpContents& sdp)
{
std::ostringstream buf;
buf << sdp;
std::string txt(buf.str());
// do whatever you need to with *txt*
}
Ken
常铮 wrote:
> Hi all
> I know I can get "SdpContents sdp" from "char *sdp_string" by
> SdpContents* sdp;
> HeaderFieldValue* hfv;
> Data* txt;
> char *sdp_string = "v=...\r\no=...\r\nc=...\r\n........";
> txt = new Data(sdp_string);
> hfv = new HeaderFieldValue(txt->data(), txt->size());
> Mime type("application", "sdp");
> sdp = new SdpContents(hfv, type);
>
> Now, in
> InviteSessionHandler::onAnswer(InviteSessionHandle, const SipMessage& msg, const SdpContents& sdp)
> {
> ..............
> }
> how to get "char *sdp_string" from "SdpContents sdp" ?
>
> Waiting for your answer online.
> Thank you very much.
>
> ZhengChang
> Beijing, China
>
>
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel at list.sipfoundry.org
> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel
More information about the resiprocate-devel
mailing list