On 7/30/08, Stefano Sabatini <[EMAIL PROTECTED]> wrote:
> On Wed, Jul 30, 2008 at 10:31 AM, Stefano Sabatini
> <[EMAIL PROTECTED]> wrote:
>> Hi all,
>> can you say if there is a simple way to convert a sip_t object to a char*
>> and viceversa?
>>
>> For example I would like to print all the incoming SIP messages from
>> the the event callback function.
[...]

>From a textual representation to a msg_t and to a sip_t:
msg_data = "...";
msg_t* msg = msg_make (sip_default_mclass(), 0, msg_data, sizeof (msg_data));
if (!msg) {
    fprintf(stderr, "Impossible to parse message\n");
    exit(1);
}
sip_t* sip = sip_object(msg);

Still I don't know if there exists a function which returns a textual
representation of a message,
there is a sip_header_as_string(home, sip) function but not one which
prints the whole message.

Also how can I get the headers from a sip_t struct, and how can I
iterate thrugh them?

Thanks in advance, 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

Reply via email to