Re: [reSIProcate] Registration event pkg: XML parsing of NOTIFY body
- From: Ryan Kereliuk <ryker@xxxxxxxxx>
- Date: Tue, 10 Jul 2007 07:35:18 -0600
The dynamic_cast to pidf doesn't work because a reginfo body is not a
pidf document. The stack doesn't include a parser for reginfo bodies
so that leaves you with two choices:
1. Write a new subclass of Contents that contains a parser and suitable
accessors for reginfo documents (see Pidf.[ch]xx for an example); or
2. Access the message body as an opaque type and add some decoding
logic in your application.
Thanks,
-Ryan
On 2007-07-10 at 18h18, Purna Chandar M wrote:
>
> After successful subscription to Registration Event package, I am receiving
> a Notify from the server and the onUpdateActive callback function is being
> called. Now, Im trying to parse the NOTIFY body(whose contentType is
> application/reginfo+xml) as the following:
>
> Pidf* body = dynamic_cast<Pidf*>(notify.getContents());
>
> getContents is not returning anything and a debug print from the stack says:
>
> SipMessage::getContents: got content type (application/reginfo+xml) that is
> not known, returning as opaque application/octet-stream.
>
> As getContents is not returning anything, I could not parse through the body
> of NOTIFY message.
>
> Can anybody tell what does it take to make getContents return the actual
> body in NOTIFY message??