< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate] Silly SipMessage question


Sorry.  What I'm after is the message as a block of text.  The reason
I'm trying to do this is that I'm debugging a problem where I get a
"pure virtual function" error when I try to do something, and I wanted
to see if I tried another way if I could get it to work.

Since the Data::from method still tries to do the equivalent of <<
message, I get the same pure virtual function error.

Shaun

On Wed,  1 Dec 2004 17:44:13 -0500, david Butcher <david@xxxxxxxxxxxxxx> wrote:
> Quoting Shaun Dawson <scdawson@xxxxxxxxx>:
> 
> > Oh, right.  Actually, what I need is the entire message, not just the
> > contents, as my original message indicated.
> >
> > So, is there any way to get at the message data of a SipMessage
> > without using streams?
> 
> Sorry, now I am confused. 'message data' is pretty vague. Did you want a
> particular header? Do you want the message as a block of text?
> 
> The moral equivalent of the code you wrote can also be done as
> 
> Data::from(message).c_str();    // uses DataStream under the hood..
> 
> But I wonder what you are going to do with that char* that would not be better
> done as operations on the SipMessage as object?
> 
> david
> 
> 
> 
> 
> > Shaun
> >
> > On Wed,  1 Dec 2004 16:09:41 -0500, david Butcher <david@xxxxxxxxxxxxxx>
> > wrote:
> > > Quoting Shaun Dawson <scdawson@xxxxxxxxx>:
> > >
> > > > 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
> > >
> >
> 
>