libosip  4.0.0
How-To initialize libosip2.
The GNU oSIP stack

Initialize osip.

When using osip, your first task is to initialize the parser and the state machine. This must be done prior to any use of libosip2.

#include <osip2/osip.h>
int i;
i=osip_init(&osip);
if (i!=0)
return -1;

In case you want to use the state machines (transaction management), the second step will be to set a few callbacks which will inform you of any change in the state of a SIP transaction.

Most of the following callbacks are optional. The following ones are usefull.

callback called when a SIP message must be sent.
osip_set_cb_send_message(osip, &cb_udp_snd_message);
callback called when a SIP transaction is TERMINATED.
&cb_ict_kill_transaction);
&cb_ist_kill_transaction);
&cb_nict_kill_transaction);
&cb_nist_kill_transaction);
callback called when the callback to send message have failed.
&cb_transport_error);
&cb_transport_error);
&cb_transport_error);
&cb_transport_error);
callback called when a received answer has been accepted by the transaction.
callback called when a received answer has been accepted by the transaction.
callback called when a received request has been accepted by the transaction.
other callbacks exists... They are optionnal.