[reSIProcate] Silly SipMessage question

david Butcher david at purplecomm.com
Wed Dec 1 15:09:41 CST 2004


Quoting Shaun Dawson <scdawson at gmail.com>:

> OK, I know this is probably a really silly question, but is there a
> way to get at the contents of a SipMessage without using streams?

Most objects have some sort of stream insertion operator, but they're for, well,
 stream insertion.

How about SipMessage::getContents()?

> char *sipMessageContents(SipMessage &message) {
>           Data enc;
>           {
>                 DataStream str(enc);
>                 str << *message;
>           }
> 
>           return enc.c_str();
> }

For pendantic completeness, the above code enstreams the message headers, not
just the contents.

david



More information about the resiprocate-devel mailing list