On date Thursday 2008-11-20 10:49:21 +0100, Stefano Sabatini phoned this: > On date Tuesday 2008-08-05 11:40:44 +0200, Stefano Sabatini phoned this: > > On Mon, Aug 4, 2008 at 8:07 PM, Pekka Pessi <[EMAIL PROTECTED]> wrote: [...] > How can I get a msg_t from a sip_t? > > I can convert a msg_t -> sip_t using sip_object, but how can I perform > the inverse conversion? > > All I want to do is to simply print out the sip_t message received by > the event callback, so the solution looks either convert sip_t -> > msg_t and use msg_as_string() either to print sip_t using some to text > conversion function, which I can't find. > > > >> Also how can I get the headers from a sip_t struct, and how can I > > >> iterate thrugh them? > > > > > > sip_t has pointers to each header fields, e.g., sip_via is pointer to > > > a list of Via header fields. You can iterate through Via header fields > > > with a loop like this: > > > > > > sip_t *sip = sip_object(sip); > > > sip_via_t *via; > > > > > > for (via = sip->sip_via; via; via = via->v_next) { > > > ... > > > } > > There is a supposed way to convert such header field structure to a > string?
Auto replying to myself: the sip_header_as_string() is the supposed way to perform such conversion. > Suppose that I want for example to convert sip->sip_from to a > corresponding string, which is the supposed way to do it (apart to > manually concat the various pieces found in that struct, which doesn't > look like the way to go)? char* sip_from_str = sip_header_as_string(home, (const sip_header_t*)sip->sip_from); [...] Still missing the answer to the first question. Regards. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel