SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
oSIP fsm Handling

Data Structures

struct  osip_ict
 Structure for INVITE CLIENT TRANSACTION. More...
 
struct  osip_nict
 Structure for NON-INVITE CLIENT TRANSACTION. More...
 
struct  osip_ist
 Structure for INVITE SERVER TRANSACTION. More...
 
struct  osip_nist
 Structure for NON-INVITE SERVER TRANSACTION. More...
 
struct  osip_srv_entry
 Structure for SRV record entry. More...
 
struct  osip_srv_record
 Structure for SRV record entry. More...
 
struct  osip_naptr
 Structure for NAPTR record entry. More...
 
struct  osip_transaction
 Structure for transaction handling. More...
 
struct  ixt
 Structure for 2XX retransmission management. More...
 
struct  osip
 Structure for osip handling. More...
 
struct  osip_event
 Structure for osip event handling. More...
 

Macros

#define DEFAULT_T1   500 /* 500 ms */
 You can re-define the default value for T1. More...
 
#define DEFAULT_T1_TCP_PROGRESS   50 /* 50ms */
 You can re-define the default value for T1_TCP_PROGRESS. More...
 
#define DEFAULT_T2   4000 /* 4s */
 You can re-define the default value for T2. More...
 
#define DEFAULT_T4   5000 /* 5s */
 You can re-define the default value for T4. More...
 
#define OSIP_SRV_STATE_UNKNOWN   0
 unknown More...
 
#define OSIP_SRV_STATE_RETRYLATER   2
 retry later More...
 
#define OSIP_SRV_STATE_COMPLETED   3
 completed More...
 
#define OSIP_SRV_STATE_NOTSUPPORTED   4
 not supported More...
 
#define OSIP_NAPTR_STATE_UNKNOWN   0
 unknown More...
 
#define OSIP_NAPTR_STATE_INPROGRESS   1
 in progress More...
 
#define OSIP_NAPTR_STATE_NAPTRDONE   2
 naptr done More...
 
#define OSIP_NAPTR_STATE_SRVINPROGRESS   3
 srv in progress More...
 
#define OSIP_NAPTR_STATE_SRVDONE   4
 srv done More...
 
#define OSIP_NAPTR_STATE_RETRYLATER   5
 retry later More...
 
#define OSIP_NAPTR_STATE_NOTSUPPORTED   6
 not supported More...
 
#define EVT_IS_RCV_INVITE(event)   (event->type==RCV_REQINVITE)
 Check if the sipevent is of type RCV_REQINVITE. More...
 
#define EVT_IS_RCV_ACK(event)   (event->type==RCV_REQACK)
 Check if the sipevent is of type RCV_REQACK. More...
 
#define EVT_IS_RCV_REQUEST(event)   (event->type==RCV_REQUEST)
 Check if the sipevent is of type RCV_REQUEST. More...
 
#define EVT_IS_RCV_STATUS_1XX(event)   (event->type==RCV_STATUS_1XX)
 Check if the sipevent is of type RCV_STATUS_1XX. More...
 
#define EVT_IS_RCV_STATUS_2XX(event)   (event->type==RCV_STATUS_2XX)
 Check if the sipevent is of type RCV_STATUS_2XX. More...
 
#define EVT_IS_RCV_STATUS_3456XX(event)   (event->type==RCV_STATUS_3456XX)
 Check if the sipevent is of type RCV_STATUS_3456XX. More...
 
#define EVT_IS_SND_INVITE(event)   (event->type==SND_REQINVITE)
 Check if the sipevent is of type SND_REQINVITE. More...
 
#define EVT_IS_SND_ACK(event)   (event->type==SND_REQACK)
 Check if the sipevent is of type SND_REQACK. More...
 
#define EVT_IS_SND_REQUEST(event)   (event->type==SND_REQUEST)
 Check if the sipevent is of type SND_REQUEST. More...
 
#define EVT_IS_SND_STATUS_1XX(event)   (event->type==SND_STATUS_1XX)
 Check if the sipevent is of type SND_STATUS_1XX. More...
 
#define EVT_IS_SND_STATUS_2XX(event)   (event->type==SND_STATUS_2XX)
 Check if the sipevent is of type SND_STATUS_2XX. More...
 
#define EVT_IS_SND_STATUS_3456XX(event)   (event->type==SND_STATUS_3456XX)
 Check if the sipevent is of type SND_STATUS_3456XX. More...
 
#define EVT_IS_INCOMINGMSG(event)
 Check if the sipevent is of an incoming SIP MESSAGE. More...
 
#define EVT_IS_INCOMINGREQ(event)
 Check if the sipevent is of an incoming SIP REQUEST. More...
 
#define EVT_IS_INCOMINGRESP(event)
 Check if the sipevent is of an incoming SIP RESPONSE. More...
 
#define EVT_IS_OUTGOINGMSG(event)
 Check if the sipevent is of an outgoing SIP MESSAGE. More...
 
#define EVT_IS_OUTGOINGREQ(event)
 Check if the sipevent is of an outgoing SIP REQUEST. More...
 
#define EVT_IS_OUTGOINGRESP(event)
 Check if the sipevent is of an outgoing SIP RESPONSE. More...
 
#define EVT_IS_MSG(event)
 Check if the sipevent is a SIP MESSAGE. More...
 
#define EVT_IS_KILL_TRANSACTION(event)   (event->type==KILL_TRANSACTION)
 Check if the sipevent is of type KILL_TRANSACTION. More...
 

Typedefs

typedef enum _state_t state_t
 Enumeration for transaction state. More...
 
typedef enum type_t type_t
 Enumeration for event type. More...
 
typedef enum osip_fsm_type_t osip_fsm_type_t
 Enumeration for transaction type. More...
 
typedef struct osip_ict osip_ict_t
 Structure for INVITE CLIENT TRANSACTION (outgoing INVITE transaction). More...
 
typedef struct osip_nict osip_nict_t
 Structure for NON-INVITE CLIENT TRANSACTION (outgoing NON-INVITE transaction). More...
 
typedef struct osip_ist osip_ist_t
 Structure for INVITE SERVER TRANSACTION (incoming INVITE transaction). More...
 
typedef struct osip_nist osip_nist_t
 Structure for NON-INVITE SERVER TRANSACTION (incoming SERVER transaction). More...
 
typedef struct osip_srv_entry osip_srv_entry_t
 Structure for SRV record entry. More...
 
typedef struct osip_srv_record osip_srv_record_t
 Structure for SRV record. More...
 
typedef struct osip_naptr osip_naptr_t
 Structure for NAPTR record. More...
 
typedef struct osip_transaction osip_transaction_t
 Structure for transaction handling. More...
 
typedef enum
osip_message_callback_type 
osip_message_callback_type_t
 Enumeration for callback type. More...
 
typedef enum
osip_kill_callback_type 
osip_kill_callback_type_t
 Enumeration for callback type used when transaction is over. More...
 
typedef enum
osip_transport_error_callback_type 
osip_transport_error_callback_type_t
 Enumeration for callback type used when a transport error is detected. More...
 
typedef void(* osip_message_cb_t )(int type, osip_transaction_t *, osip_message_t *)
 Callback definition for message announcements. More...
 
typedef void(* osip_kill_transaction_cb_t )(int type, osip_transaction_t *)
 Callback definition for end of transaction announcements. More...
 
typedef void(* osip_transport_error_cb_t )(int type, osip_transaction_t *, int error)
 Callback definition for transport error announcements. More...
 
typedef struct ixt ixt_t
 Structure for 2XX retransmission management. More...
 
typedef struct osip osip_t
 Structure for osip handling. More...
 
typedef struct osip_event osip_event_t
 Structure for osip event handling. More...
 

Enumerations

enum  _state_t {
  ICT_PRE_CALLING, ICT_CALLING, ICT_PROCEEDING, ICT_COMPLETED,
  ICT_TERMINATED, IST_PRE_PROCEEDING, IST_PROCEEDING, IST_COMPLETED,
  IST_CONFIRMED, IST_TERMINATED, NICT_PRE_TRYING, NICT_TRYING,
  NICT_PROCEEDING, NICT_COMPLETED, NICT_TERMINATED, NIST_PRE_TRYING,
  NIST_TRYING, NIST_PROCEEDING, NIST_COMPLETED, NIST_TERMINATED,
  DIALOG_EARLY, DIALOG_CONFIRMED, DIALOG_CLOSE
}
 Enumeration for transaction state. More...
 
enum  type_t {
  TIMEOUT_A, TIMEOUT_B, TIMEOUT_D, TIMEOUT_E,
  TIMEOUT_F, TIMEOUT_K, TIMEOUT_G, TIMEOUT_H,
  TIMEOUT_I, TIMEOUT_J, RCV_REQINVITE, RCV_REQACK,
  RCV_REQUEST, RCV_STATUS_1XX, RCV_STATUS_2XX, RCV_STATUS_3456XX,
  SND_REQINVITE, SND_REQACK, SND_REQUEST, SND_STATUS_1XX,
  SND_STATUS_2XX, SND_STATUS_3456XX, KILL_TRANSACTION, UNKNOWN_EVT
}
 Enumeration for event type. More...
 
enum  osip_fsm_type_t { ICT, IST, NICT, NIST }
 Enumeration for transaction type. More...
 
enum  osip_message_callback_type {
  OSIP_ICT_INVITE_SENT = 0, OSIP_ICT_INVITE_SENT_AGAIN, OSIP_ICT_ACK_SENT, OSIP_ICT_ACK_SENT_AGAIN,
  OSIP_ICT_STATUS_1XX_RECEIVED, OSIP_ICT_STATUS_2XX_RECEIVED, OSIP_ICT_STATUS_2XX_RECEIVED_AGAIN, OSIP_ICT_STATUS_3XX_RECEIVED,
  OSIP_ICT_STATUS_4XX_RECEIVED, OSIP_ICT_STATUS_5XX_RECEIVED, OSIP_ICT_STATUS_6XX_RECEIVED, OSIP_ICT_STATUS_3456XX_RECEIVED_AGAIN,
  OSIP_IST_INVITE_RECEIVED, OSIP_IST_INVITE_RECEIVED_AGAIN, OSIP_IST_ACK_RECEIVED, OSIP_IST_ACK_RECEIVED_AGAIN,
  OSIP_IST_STATUS_1XX_SENT, OSIP_IST_STATUS_2XX_SENT, OSIP_IST_STATUS_2XX_SENT_AGAIN, OSIP_IST_STATUS_3XX_SENT,
  OSIP_IST_STATUS_4XX_SENT, OSIP_IST_STATUS_5XX_SENT, OSIP_IST_STATUS_6XX_SENT, OSIP_IST_STATUS_3456XX_SENT_AGAIN,
  OSIP_NICT_REGISTER_SENT, OSIP_NICT_BYE_SENT, OSIP_NICT_OPTIONS_SENT, OSIP_NICT_INFO_SENT,
  OSIP_NICT_CANCEL_SENT, OSIP_NICT_NOTIFY_SENT, OSIP_NICT_SUBSCRIBE_SENT, OSIP_NICT_UNKNOWN_REQUEST_SENT,
  OSIP_NICT_REQUEST_SENT_AGAIN, OSIP_NICT_STATUS_1XX_RECEIVED, OSIP_NICT_STATUS_2XX_RECEIVED, OSIP_NICT_STATUS_2XX_RECEIVED_AGAIN,
  OSIP_NICT_STATUS_3XX_RECEIVED, OSIP_NICT_STATUS_4XX_RECEIVED, OSIP_NICT_STATUS_5XX_RECEIVED, OSIP_NICT_STATUS_6XX_RECEIVED,
  OSIP_NICT_STATUS_3456XX_RECEIVED_AGAIN, OSIP_NIST_REGISTER_RECEIVED, OSIP_NIST_BYE_RECEIVED, OSIP_NIST_OPTIONS_RECEIVED,
  OSIP_NIST_INFO_RECEIVED, OSIP_NIST_CANCEL_RECEIVED, OSIP_NIST_NOTIFY_RECEIVED, OSIP_NIST_SUBSCRIBE_RECEIVED,
  OSIP_NIST_UNKNOWN_REQUEST_RECEIVED, OSIP_NIST_REQUEST_RECEIVED_AGAIN, OSIP_NIST_STATUS_1XX_SENT, OSIP_NIST_STATUS_2XX_SENT,
  OSIP_NIST_STATUS_2XX_SENT_AGAIN, OSIP_NIST_STATUS_3XX_SENT, OSIP_NIST_STATUS_4XX_SENT, OSIP_NIST_STATUS_5XX_SENT,
  OSIP_NIST_STATUS_6XX_SENT, OSIP_NIST_STATUS_3456XX_SENT_AGAIN, OSIP_ICT_STATUS_TIMEOUT, OSIP_NICT_STATUS_TIMEOUT,
  OSIP_MESSAGE_CALLBACK_COUNT
}
 Enumeration for callback type. More...
 
enum  osip_kill_callback_type {
  OSIP_ICT_KILL_TRANSACTION, OSIP_IST_KILL_TRANSACTION, OSIP_NICT_KILL_TRANSACTION, OSIP_NIST_KILL_TRANSACTION,
  OSIP_KILL_CALLBACK_COUNT
}
 Enumeration for callback type used when transaction is over. More...
 
enum  osip_transport_error_callback_type {
  OSIP_ICT_TRANSPORT_ERROR, OSIP_IST_TRANSPORT_ERROR, OSIP_NICT_TRANSPORT_ERROR, OSIP_NIST_TRANSPORT_ERROR,
  OSIP_TRANSPORT_ERROR_CALLBACK_COUNT
}
 Enumeration for callback type used when a transport error is detected. More...
 

Functions

int osip_set_message_callback (osip_t *osip, int type, osip_message_cb_t cb)
 Set a callback for each transaction operation. More...
 
int osip_set_kill_transaction_callback (osip_t *osip, int type, osip_kill_transaction_cb_t cb)
 Set a callback for transaction operation related to the end of transactions. More...
 
int osip_set_transport_error_callback (osip_t *osip, int type, osip_transport_error_cb_t cb)
 Set a callback for each transaction operation related to network error. More...
 
int osip_transaction_init (osip_transaction_t **transaction, osip_fsm_type_t ctx_type, osip_t *osip, osip_message_t *request)
 Allocate an osip_transaction_t element. More...
 
int osip_transaction_free (osip_transaction_t *transaction)
 Free all resource in a osip_transaction_t element. More...
 
int osip_transaction_free2 (osip_transaction_t *transaction)
 Free all resource in a osip_transaction_t element. More...
 
void osip_response_get_destination (osip_message_t *response, char **address, int *portnum)
 Search in a SIP response the destination where the message should be sent. More...
 
int osip_ict_set_destination (osip_ict_t *ict, char *destination, int port)
 Set the host and port destination used for sending the SIP message. More...
 
int osip_nict_set_destination (osip_nict_t *nict, char *destination, int port)
 Set the host and port destination used for sending the SIP message. More...
 
int osip_transaction_add_event (osip_transaction_t *transaction, osip_event_t *evt)
 Add a SIP event in the fifo of a osip_transaction_t element. More...
 
int osip_transaction_execute (osip_transaction_t *transaction, osip_event_t *evt)
 Consume one osip_event_t element previously added in the fifo. More...
 
int osip_transaction_set_your_instance (osip_transaction_t *transaction, void *ptr)
 Set a pointer to your personal context associated with this transaction. More...
 
int osip_transaction_set_reserved1 (osip_transaction_t *transaction, void *ptr)
 Set a pointer to your personal context associated with this transaction. More...
 
int osip_transaction_set_reserved2 (osip_transaction_t *transaction, void *ptr)
 Set a pointer to your personal context associated with this transaction. More...
 
int osip_transaction_set_reserved3 (osip_transaction_t *transaction, void *ptr)
 Set a pointer to your personal context associated with this transaction. More...
 
int osip_transaction_set_reserved4 (osip_transaction_t *transaction, void *ptr)
 Set a pointer to your personal context associated with this transaction. More...
 
int osip_transaction_set_reserved5 (osip_transaction_t *transaction, void *ptr)
 Set a pointer to your personal context associated with this transaction. More...
 
int osip_transaction_set_reserved6 (osip_transaction_t *transaction, void *ptr)
 Set a pointer to your personal context associated with this transaction. More...
 
void * osip_transaction_get_your_instance (osip_transaction_t *transaction)
 Get a pointer to your personal context associated with this transaction. More...
 
void * osip_transaction_get_reserved1 (osip_transaction_t *transaction)
 Get a pointer to your personal context associated with this transaction. More...
 
void * osip_transaction_get_reserved2 (osip_transaction_t *transaction)
 Get a pointer to your personal context associated with this transaction. More...
 
void * osip_transaction_get_reserved3 (osip_transaction_t *transaction)
 Get a pointer to your personal context associated with this transaction. More...
 
void * osip_transaction_get_reserved4 (osip_transaction_t *transaction)
 Get a pointer to your personal context associated with this transaction. More...
 
void * osip_transaction_get_reserved5 (osip_transaction_t *transaction)
 Get a pointer to your personal context associated with this transaction. More...
 
void * osip_transaction_get_reserved6 (osip_transaction_t *transaction)
 Get a pointer to your personal context associated with this transaction. More...
 
int osip_transaction_get_destination (osip_transaction_t *transaction, char **ip, int *port)
 Get target ip and port for this request. More...
 
int osip_transaction_set_srv_record (osip_transaction_t *transaction, osip_srv_record_t *record)
 Set SRV lookup information to be used by state machine. More...
 
int osip_transaction_set_naptr_record (osip_transaction_t *transaction, osip_naptr_t *record)
 Set NAPTR lookup information to be used by state machine. More...
 
int osip_transaction_set_in_socket (osip_transaction_t *transaction, int sock)
 Set the socket for incoming message. More...
 
int osip_transaction_set_out_socket (osip_transaction_t *transaction, int sock)
 Set the socket for outgoing message. More...
 
int osip_init (osip_t **osip)
 Allocate an osip_t element. More...
 
void osip_release (osip_t *osip)
 Free all resource in a osip_t element. More...
 
void osip_set_application_context (osip_t *osip, void *pointer)
 Set a pointer in a osip_t element. More...
 
void * osip_get_application_context (osip_t *osip)
 Get a pointer in a osip_t element. More...
 
int osip_remove_transaction (osip_t *osip, osip_transaction_t *ict)
 Remove a transaction from the osip stack. More...
 
int osip_ict_execute (osip_t *osip)
 Consume ALL pending osip_event_t previously added in the fifos of ict transactions. More...
 
int osip_ist_execute (osip_t *osip)
 Consume ALL pending osip_event_t previously added in the fifos of ist transactions. More...
 
int osip_nict_execute (osip_t *osip)
 Consume ALL pending osip_event_t previously added in the fifos of nict transactions. More...
 
int osip_nist_execute (osip_t *osip)
 Consume ALL pending osip_event_t previously added in the fifos of nist transactions. More...
 
void osip_timers_gettimeout (osip_t *osip, struct timeval *lower_tv)
 Retreive the minimum timer value to be used by an application so that the osip_timer_*_execute method don't have to be called often. More...
 
void osip_timers_ict_execute (osip_t *osip)
 Check if an ict transactions needs a timer event. More...
 
void osip_timers_ist_execute (osip_t *osip)
 Check if an ist transactions needs a timer event. More...
 
void osip_timers_nict_execute (osip_t *osip)
 Check if a nict transactions needs a timer event. More...
 
void osip_timers_nist_execute (osip_t *osip)
 Check if a nist transactions needs a timer event. More...
 
osip_transaction_tosip_transaction_find (osip_list_t *transactions, osip_event_t *evt)
 Search for a transaction that match this event (MUST be a MESSAGE event). More...
 
osip_transaction_t__osip_find_transaction (osip_t *osip, osip_event_t *evt, int consume)
 Some race conditions can happen in multi threaded applications. More...
 
int osip_find_transaction_and_add_event (osip_t *osip, osip_event_t *evt)
 Search for a transaction that match this event (MUST be a MESSAGE event) and add this event if a transaction is found. More...
 
osip_transaction_tosip_create_transaction (osip_t *osip, osip_event_t *evt)
 Create a transaction for this event (MUST be a SIP REQUEST event). More...
 
osip_event_tosip_parse (const char *buf, size_t length)
 Create a sipevent from a SIP message string. More...
 
void osip_retransmissions_execute (osip_t *osip)
 Send required retransmissions. More...
 
void osip_start_200ok_retransmissions (osip_t *osip, struct osip_dialog *dialog, osip_message_t *msg200ok, int sock)
 Start out of fsm 200 Ok retransmissions. More...
 
void osip_start_ack_retransmissions (osip_t *osip, struct osip_dialog *dialog, osip_message_t *ack, char *dest, int port, int sock)
 Start out of fsm ACK retransmissions. More...
 
struct osip_dialogosip_stop_200ok_retransmissions (osip_t *osip, osip_message_t *ack)
 Stop the out of fsm 200 Ok retransmissions matching an incoming ACK. More...
 
void osip_stop_retransmissions_from_dialog (osip_t *osip, struct osip_dialog *dialog)
 Stop out of fsm retransmissions (ACK or 200 Ok) associated to a given dialog. More...
 
osip_event_tosip_new_outgoing_sipmessage (osip_message_t *sip)
 Allocate a sipevent (we know this message is an OUTGOING SIP message). More...
 
void osip_event_free (osip_event_t *event)
 Free all resource in a sipevent. More...
 
void osip_set_cb_send_message (osip_t *cf, int(*cb)(osip_transaction_t *, osip_message_t *, char *, int, int))
 Register the callback used to send SIP message. More...
 

Detailed Description

Macro Definition Documentation

#define DEFAULT_T1   500 /* 500 ms */

#include <osip.h>

You can re-define the default value for T1.

(T1 is defined in rfcxxxx) The default value is 500ms.

Definition at line 170 of file osip.h.

#define DEFAULT_T1_TCP_PROGRESS   50 /* 50ms */

#include <osip.h>

You can re-define the default value for T1_TCP_PROGRESS.

This is a trick to use non blocking socke for reliable protocol On first attempt, the connection is not ready and the next osip retransmission are used to check the progress of the connection in order to send the message. The default value is 50ms.

Definition at line 181 of file osip.h.

#define DEFAULT_T2   4000 /* 4s */

#include <osip.h>

You can re-define the default value for T2.

(T2 is defined in rfcxxxx) The default value is 4000ms.

Definition at line 188 of file osip.h.

#define DEFAULT_T4   5000 /* 5s */

#include <osip.h>

You can re-define the default value for T4.

(T1 is defined in rfcxxxx) The default value is 5000ms.

Definition at line 195 of file osip.h.

#define EVT_IS_INCOMINGMSG (   event)

#include <osip.h>

Value:
(event->type>=RCV_REQINVITE \
&&event->type<=RCV_STATUS_3456XX)
Event is an incoming final response (not 2XX)
Definition: osip.h:136
Event is an incoming INVITE request.
Definition: osip.h:131

Check if the sipevent is of an incoming SIP MESSAGE.

Parameters
eventthe event to check.

Definition at line 1120 of file osip.h.

#define EVT_IS_INCOMINGREQ (   event)

#include <osip.h>

Value:
||EVT_IS_RCV_ACK(event) \
#define EVT_IS_RCV_REQUEST(event)
Check if the sipevent is of type RCV_REQUEST.
Definition: osip.h:1067
#define EVT_IS_RCV_ACK(event)
Check if the sipevent is of type RCV_REQACK.
Definition: osip.h:1062
#define EVT_IS_RCV_INVITE(event)
Check if the sipevent is of type RCV_REQINVITE.
Definition: osip.h:1057

Check if the sipevent is of an incoming SIP REQUEST.

Parameters
eventthe event to check.

Definition at line 1126 of file osip.h.

#define EVT_IS_INCOMINGRESP (   event)

#include <osip.h>

Value:
#define EVT_IS_RCV_STATUS_2XX(event)
Check if the sipevent is of type RCV_STATUS_2XX.
Definition: osip.h:1077
#define EVT_IS_RCV_STATUS_3456XX(event)
Check if the sipevent is of type RCV_STATUS_3456XX.
Definition: osip.h:1082
#define EVT_IS_RCV_STATUS_1XX(event)
Check if the sipevent is of type RCV_STATUS_1XX.
Definition: osip.h:1072

Check if the sipevent is of an incoming SIP RESPONSE.

Parameters
eventthe event to check.

Definition at line 1133 of file osip.h.

#define EVT_IS_KILL_TRANSACTION (   event)    (event->type==KILL_TRANSACTION)

#include <osip.h>

Check if the sipevent is of type KILL_TRANSACTION.

NOTE: THIS IS AN INTERNAL METHOD ONLY

Parameters
eventthe event to check.

Definition at line 1168 of file osip.h.

#define EVT_IS_MSG (   event)

#include <osip.h>

Value:
(event->type>=RCV_REQINVITE \
&&event->type<=SND_STATUS_3456XX)
Event is an outgoing final response (not 2XX)
Definition: osip.h:144
Event is an incoming INVITE request.
Definition: osip.h:131

Check if the sipevent is a SIP MESSAGE.

Parameters
eventthe event to check.

Definition at line 1161 of file osip.h.

#define EVT_IS_OUTGOINGMSG (   event)

#include <osip.h>

Value:
(event->type>=SND_REQINVITE \
&&event->type<=SND_STATUS_3456XX)
Event is an outgoing final response (not 2XX)
Definition: osip.h:144
Event is an outgoing INVITE request.
Definition: osip.h:139

Check if the sipevent is of an outgoing SIP MESSAGE.

Parameters
eventthe event to check.

Definition at line 1140 of file osip.h.

#define EVT_IS_OUTGOINGREQ (   event)

#include <osip.h>

Value:
||EVT_IS_SND_ACK(event) \
#define EVT_IS_SND_INVITE(event)
Check if the sipevent is of type SND_REQINVITE.
Definition: osip.h:1090
#define EVT_IS_SND_ACK(event)
Check if the sipevent is of type SND_REQACK.
Definition: osip.h:1095
#define EVT_IS_SND_REQUEST(event)
Check if the sipevent is of type SND_REQUEST.
Definition: osip.h:1100

Check if the sipevent is of an outgoing SIP REQUEST.

Parameters
eventthe event to check.

Definition at line 1146 of file osip.h.

#define EVT_IS_OUTGOINGRESP (   event)

#include <osip.h>

Value:
#define EVT_IS_SND_STATUS_1XX(event)
Check if the sipevent is of type SND_STATUS_1XX.
Definition: osip.h:1105
#define EVT_IS_SND_STATUS_3456XX(event)
Check if the sipevent is of type SND_STATUS_3456XX.
Definition: osip.h:1115
#define EVT_IS_SND_STATUS_2XX(event)
Check if the sipevent is of type SND_STATUS_2XX.
Definition: osip.h:1110

Check if the sipevent is of an outgoing SIP RESPONSE.

Parameters
eventthe event to check.

Definition at line 1153 of file osip.h.

#define EVT_IS_RCV_ACK (   event)    (event->type==RCV_REQACK)

#include <osip.h>

Check if the sipevent is of type RCV_REQACK.

Parameters
eventthe event to check.

Definition at line 1062 of file osip.h.

#define EVT_IS_RCV_INVITE (   event)    (event->type==RCV_REQINVITE)

#include <osip.h>

Check if the sipevent is of type RCV_REQINVITE.

Parameters
eventthe event to check.

Definition at line 1057 of file osip.h.

#define EVT_IS_RCV_REQUEST (   event)    (event->type==RCV_REQUEST)

#include <osip.h>

Check if the sipevent is of type RCV_REQUEST.

Parameters
eventthe event to check.

Definition at line 1067 of file osip.h.

#define EVT_IS_RCV_STATUS_1XX (   event)    (event->type==RCV_STATUS_1XX)

#include <osip.h>

Check if the sipevent is of type RCV_STATUS_1XX.

Parameters
eventthe event to check.

Definition at line 1072 of file osip.h.

#define EVT_IS_RCV_STATUS_2XX (   event)    (event->type==RCV_STATUS_2XX)

#include <osip.h>

Check if the sipevent is of type RCV_STATUS_2XX.

Parameters
eventthe event to check.

Definition at line 1077 of file osip.h.

#define EVT_IS_RCV_STATUS_3456XX (   event)    (event->type==RCV_STATUS_3456XX)

#include <osip.h>

Check if the sipevent is of type RCV_STATUS_3456XX.

Parameters
eventthe event to check.

Definition at line 1082 of file osip.h.

#define EVT_IS_SND_ACK (   event)    (event->type==SND_REQACK)

#include <osip.h>

Check if the sipevent is of type SND_REQACK.

Parameters
eventthe event to check.

Definition at line 1095 of file osip.h.

#define EVT_IS_SND_INVITE (   event)    (event->type==SND_REQINVITE)

#include <osip.h>

Check if the sipevent is of type SND_REQINVITE.

Parameters
eventthe event to check.

Definition at line 1090 of file osip.h.

#define EVT_IS_SND_REQUEST (   event)    (event->type==SND_REQUEST)

#include <osip.h>

Check if the sipevent is of type SND_REQUEST.

Parameters
eventthe event to check.

Definition at line 1100 of file osip.h.

#define EVT_IS_SND_STATUS_1XX (   event)    (event->type==SND_STATUS_1XX)

#include <osip.h>

Check if the sipevent is of type SND_STATUS_1XX.

Parameters
eventthe event to check.

Definition at line 1105 of file osip.h.

#define EVT_IS_SND_STATUS_2XX (   event)    (event->type==SND_STATUS_2XX)

#include <osip.h>

Check if the sipevent is of type SND_STATUS_2XX.

Parameters
eventthe event to check.

Definition at line 1110 of file osip.h.

#define EVT_IS_SND_STATUS_3456XX (   event)    (event->type==SND_STATUS_3456XX)

#include <osip.h>

Check if the sipevent is of type SND_STATUS_3456XX.

Parameters
eventthe event to check.

Definition at line 1115 of file osip.h.

#define OSIP_NAPTR_STATE_INPROGRESS   1

#include <osip.h>

in progress

Definition at line 323 of file osip.h.

#define OSIP_NAPTR_STATE_NAPTRDONE   2

#include <osip.h>

naptr done

Definition at line 324 of file osip.h.

#define OSIP_NAPTR_STATE_NOTSUPPORTED   6

#include <osip.h>

not supported

Definition at line 328 of file osip.h.

#define OSIP_NAPTR_STATE_RETRYLATER   5

#include <osip.h>

retry later

Definition at line 327 of file osip.h.

#define OSIP_NAPTR_STATE_SRVDONE   4

#include <osip.h>

srv done

Definition at line 326 of file osip.h.

#define OSIP_NAPTR_STATE_SRVINPROGRESS   3

#include <osip.h>

srv in progress

Definition at line 325 of file osip.h.

#define OSIP_NAPTR_STATE_UNKNOWN   0

#include <osip.h>

unknown

Definition at line 322 of file osip.h.

#define OSIP_SRV_STATE_COMPLETED   3

#include <osip.h>

completed

Definition at line 299 of file osip.h.

#define OSIP_SRV_STATE_NOTSUPPORTED   4

#include <osip.h>

not supported

Definition at line 300 of file osip.h.

#define OSIP_SRV_STATE_RETRYLATER   2

#include <osip.h>

retry later

Definition at line 298 of file osip.h.

#define OSIP_SRV_STATE_UNKNOWN   0

#include <osip.h>

unknown

Definition at line 297 of file osip.h.

Typedef Documentation

#include <osip.h>

Structure for 2XX retransmission management.

Definition at line 525 of file osip.h.

#include <osip.h>

Structure for osip event handling.

A osip_event_t element will have a type and will be related to a transaction. In the general case, it is used by the application layer to give SIP messages to the oSIP finite state machine.

Definition at line 623 of file osip.h.

#include <osip.h>

Enumeration for transaction type.

A transaction can be either of: ICT, IST, NICT, NIST,

#include <osip.h>

Structure for INVITE CLIENT TRANSACTION (outgoing INVITE transaction).

Definition at line 203 of file osip.h.

#include <osip.h>

Structure for INVITE SERVER TRANSACTION (incoming INVITE transaction).

Definition at line 246 of file osip.h.

#include <osip.h>

Enumeration for callback type used when transaction is over.

osip_kill_transaction_cb_t

#include <osip.h>

Callback definition for end of transaction announcements.

Definition at line 511 of file osip.h.

#include <osip.h>

Enumeration for callback type.

osip_message_cb_t

#include <osip.h>

Callback definition for message announcements.

Definition at line 506 of file osip.h.

#include <osip.h>

Structure for NAPTR record.

Definition at line 334 of file osip.h.

#include <osip.h>

Structure for NON-INVITE CLIENT TRANSACTION (outgoing NON-INVITE transaction).

Definition at line 224 of file osip.h.

#include <osip.h>

Structure for NON-INVITE SERVER TRANSACTION (incoming SERVER transaction).

Definition at line 265 of file osip.h.

#include <osip.h>

Structure for SRV record entry.

Definition at line 280 of file osip.h.

#include <osip.h>

Structure for SRV record.

Definition at line 306 of file osip.h.

#include <osip.h>

Structure for osip handling.

In order to use osip, you have to manage at least one global instance of an osip_t element. Then, you'll register a set of required callbacks and a set of optional ones.

Definition at line 552 of file osip.h.

#include <osip.h>

Structure for transaction handling.

Definition at line 356 of file osip.h.

#include <osip.h>

Enumeration for callback type used when a transport error is detected.

osip_transport_error_cb_t

#include <osip.h>

Callback definition for transport error announcements.

Definition at line 516 of file osip.h.

typedef enum _state_t state_t

#include <osip.h>

Enumeration for transaction state.

Those states are extracted from the diagram found in rfc3261.txt

typedef enum type_t type_t

#include <osip.h>

Enumeration for event type.


The list of values that you need to know is reduced to this:
RCV_REQINVITE,
RCV_REQACK,
RCV_REQUEST,
RCV_STATUS_1XX,
RCV_STATUS_2XX,
RCV_STATUS_3456XX,

SND_REQINVITE,
SND_REQACK,
SND_REQUEST,
SND_STATUS_1XX,
SND_STATUS_2XX,
SND_STATUS_3456XX,

Enumeration Type Documentation

enum _state_t

#include <osip.h>

Enumeration for transaction state.

Those states are extracted from the diagram found in rfc3261.txt

Enumerator
ICT_PRE_CALLING 
ICT_CALLING 
ICT_PROCEEDING 
ICT_COMPLETED 
ICT_TERMINATED 
IST_PRE_PROCEEDING 
IST_PROCEEDING 
IST_COMPLETED 
IST_CONFIRMED 
IST_TERMINATED 
NICT_PRE_TRYING 
NICT_TRYING 
NICT_PROCEEDING 
NICT_COMPLETED 
NICT_TERMINATED 
NIST_PRE_TRYING 
NIST_TRYING 
NIST_PROCEEDING 
NIST_COMPLETED 
NIST_TERMINATED 
DIALOG_EARLY 
DIALOG_CONFIRMED 
DIALOG_CLOSE 

Definition at line 58 of file osip.h.

#include <osip.h>

Enumeration for transaction type.

A transaction can be either of: ICT, IST, NICT, NIST,

Enumerator
ICT 

Invite Client (outgoing) Transaction.

IST 

Invite Server (incoming) Transaction.

NICT 

Non-Invite Client (outgoing) Transaction.

NIST 

Non-Invite Server (incoming) Transaction.

Definition at line 158 of file osip.h.

#include <osip.h>

Enumeration for callback type used when transaction is over.

Enumerator
OSIP_ICT_KILL_TRANSACTION 

end of Client INVITE transaction

OSIP_IST_KILL_TRANSACTION 

end of Server INVITE transaction

OSIP_NICT_KILL_TRANSACTION 

end of Client Non-INVITE transaction

OSIP_NIST_KILL_TRANSACTION 

end of Server Non-INVITE transaction

OSIP_KILL_CALLBACK_COUNT 

END OF ENUM.

Definition at line 481 of file osip.h.

#include <osip.h>

Enumeration for callback type.

Enumerator
OSIP_ICT_INVITE_SENT 

INVITE MESSAGE SENT.

OSIP_ICT_INVITE_SENT_AGAIN 

INVITE MESSAGE RETRANSMITTED.

OSIP_ICT_ACK_SENT 

ACK MESSAGE SENT.

OSIP_ICT_ACK_SENT_AGAIN 

ACK MESSAGE RETRANSMITTED.

OSIP_ICT_STATUS_1XX_RECEIVED 

1XX FOR INVITE RECEIVED

OSIP_ICT_STATUS_2XX_RECEIVED 

2XX FOR INVITE RECEIVED

OSIP_ICT_STATUS_2XX_RECEIVED_AGAIN 

2XX FOR INVITE RECEIVED AGAIN

OSIP_ICT_STATUS_3XX_RECEIVED 

3XX FOR INVITE RECEIVED

OSIP_ICT_STATUS_4XX_RECEIVED 

4XX FOR INVITE RECEIVED

OSIP_ICT_STATUS_5XX_RECEIVED 

5XX FOR INVITE RECEIVED

OSIP_ICT_STATUS_6XX_RECEIVED 

6XX FOR INVITE RECEIVED

OSIP_ICT_STATUS_3456XX_RECEIVED_AGAIN 

RESPONSE RECEIVED AGAIN.

OSIP_IST_INVITE_RECEIVED 

INVITE MESSAGE RECEIVED.

OSIP_IST_INVITE_RECEIVED_AGAIN 

INVITE MESSAGE RECEIVED AGAN.

OSIP_IST_ACK_RECEIVED 

ACK MESSAGE RECEIVED.

OSIP_IST_ACK_RECEIVED_AGAIN 

ACK MESSAGE RECEIVED AGAIN.

OSIP_IST_STATUS_1XX_SENT 

1XX FOR INVITE SENT

OSIP_IST_STATUS_2XX_SENT 

2XX FOR INVITE SENT

OSIP_IST_STATUS_2XX_SENT_AGAIN 

2XX FOR INVITE RETRANSMITTED

OSIP_IST_STATUS_3XX_SENT 

3XX FOR INVITE SENT

OSIP_IST_STATUS_4XX_SENT 

4XX FOR INVITE SENT

OSIP_IST_STATUS_5XX_SENT 

5XX FOR INVITE SENT

OSIP_IST_STATUS_6XX_SENT 

6XX FOR INVITE SENT

OSIP_IST_STATUS_3456XX_SENT_AGAIN 

RESPONSE RETRANSMITTED.

OSIP_NICT_REGISTER_SENT 

REGISTER MESSAGE SENT.

OSIP_NICT_BYE_SENT 

BYE MESSAGE SENT.

OSIP_NICT_OPTIONS_SENT 

OPTIONS MESSAGE SENT.

OSIP_NICT_INFO_SENT 

INFO MESSAGE SENT.

OSIP_NICT_CANCEL_SENT 

CANCEL MESSAGE SENT.

OSIP_NICT_NOTIFY_SENT 

NOTIFY MESSAGE SENT.

OSIP_NICT_SUBSCRIBE_SENT 

SUBSCRIBE MESSAGE SENT.

OSIP_NICT_UNKNOWN_REQUEST_SENT 

UNKNOWN REQUEST MESSAGE SENT.

OSIP_NICT_REQUEST_SENT_AGAIN 

REQUEST MESSAGE RETRANMITTED.

OSIP_NICT_STATUS_1XX_RECEIVED 

1XX FOR MESSAGE RECEIVED

OSIP_NICT_STATUS_2XX_RECEIVED 

2XX FOR MESSAGE RECEIVED

OSIP_NICT_STATUS_2XX_RECEIVED_AGAIN 

2XX FOR MESSAGE RECEIVED AGAIN

OSIP_NICT_STATUS_3XX_RECEIVED 

3XX FOR MESSAGE RECEIVED

OSIP_NICT_STATUS_4XX_RECEIVED 

4XX FOR MESSAGE RECEIVED

OSIP_NICT_STATUS_5XX_RECEIVED 

5XX FOR MESSAGE RECEIVED

OSIP_NICT_STATUS_6XX_RECEIVED 

6XX FOR MESSAGE RECEIVED

OSIP_NICT_STATUS_3456XX_RECEIVED_AGAIN 

RESPONSE RECEIVED AGAIN.

OSIP_NIST_REGISTER_RECEIVED 

REGISTER RECEIVED.

OSIP_NIST_BYE_RECEIVED 

BYE RECEIVED.

OSIP_NIST_OPTIONS_RECEIVED 

OPTIONS RECEIVED.

OSIP_NIST_INFO_RECEIVED 

INFO RECEIVED.

OSIP_NIST_CANCEL_RECEIVED 

CANCEL RECEIVED.

OSIP_NIST_NOTIFY_RECEIVED 

NOTIFY RECEIVED.

OSIP_NIST_SUBSCRIBE_RECEIVED 

SUBSCRIBE RECEIVED.

OSIP_NIST_UNKNOWN_REQUEST_RECEIVED 

UNKNWON REQUEST RECEIVED.

OSIP_NIST_REQUEST_RECEIVED_AGAIN 

UNKNWON REQUEST RECEIVED AGAIN.

OSIP_NIST_STATUS_1XX_SENT 

1XX FOR MESSAGE SENT

OSIP_NIST_STATUS_2XX_SENT 

2XX FOR MESSAGE SENT

OSIP_NIST_STATUS_2XX_SENT_AGAIN 

2XX FOR MESSAGE RETRANSMITTED

OSIP_NIST_STATUS_3XX_SENT 

3XX FOR MESSAGE SENT

OSIP_NIST_STATUS_4XX_SENT 

4XX FOR MESSAGE SENT

OSIP_NIST_STATUS_5XX_SENT 

5XX FOR MESSAGE SENT

OSIP_NIST_STATUS_6XX_SENT 

6XX FOR MESSAGE SENT

OSIP_NIST_STATUS_3456XX_SENT_AGAIN 

RESPONSE RETRANSMITTED.

OSIP_ICT_STATUS_TIMEOUT 

TIMER B EXPIRATION: NO REMOTE ANSWER.

OSIP_NICT_STATUS_TIMEOUT 

TIMER F EXPIRATION: NO REMOTE ANSWER.

OSIP_MESSAGE_CALLBACK_COUNT 

END OF ENUM.

Definition at line 408 of file osip.h.

#include <osip.h>

Enumeration for callback type used when a transport error is detected.

Enumerator
OSIP_ICT_TRANSPORT_ERROR 

transport error for ICT

OSIP_IST_TRANSPORT_ERROR 

transport error for IST

OSIP_NICT_TRANSPORT_ERROR 

transport error for NICT

OSIP_NIST_TRANSPORT_ERROR 

transport error for NIST

OSIP_TRANSPORT_ERROR_CALLBACK_COUNT 

END OF ENUM.

Definition at line 493 of file osip.h.

enum type_t

#include <osip.h>

Enumeration for event type.


The list of values that you need to know is reduced to this:
RCV_REQINVITE,
RCV_REQACK,
RCV_REQUEST,
RCV_STATUS_1XX,
RCV_STATUS_2XX,
RCV_STATUS_3456XX,

SND_REQINVITE,
SND_REQACK,
SND_REQUEST,
SND_STATUS_1XX,
SND_STATUS_2XX,
SND_STATUS_3456XX,

Enumerator
TIMEOUT_A 

Timer A.

TIMEOUT_B 

Timer B.

TIMEOUT_D 

Timer D.

TIMEOUT_E 

Timer E.

TIMEOUT_F 

Timer F.

TIMEOUT_K 

Timer K.

TIMEOUT_G 

Timer G.

TIMEOUT_H 

Timer H.

TIMEOUT_I 

Timer I.

TIMEOUT_J 

Timer J.

RCV_REQINVITE 

Event is an incoming INVITE request.

RCV_REQACK 

Event is an incoming ACK request.

RCV_REQUEST 

Event is an incoming NON-INVITE and NON-ACK request.

RCV_STATUS_1XX 

Event is an incoming informational response.

RCV_STATUS_2XX 

Event is an incoming 2XX response.

RCV_STATUS_3456XX 

Event is an incoming final response (not 2XX)

SND_REQINVITE 

Event is an outgoing INVITE request.

SND_REQACK 

Event is an outgoing ACK request.

SND_REQUEST 

Event is an outgoing NON-INVITE and NON-ACK request.

SND_STATUS_1XX 

Event is an outgoing informational response.

SND_STATUS_2XX 

Event is an outgoing 2XX response.

SND_STATUS_3456XX 

Event is an outgoing final response (not 2XX)

KILL_TRANSACTION 

Event to 'kill' the transaction before termination.

UNKNOWN_EVT 

Max event.

Definition at line 111 of file osip.h.

Function Documentation

osip_transaction_t* __osip_find_transaction ( osip_t osip,
osip_event_t evt,
int  consume 
)

#include <osip.h>

Some race conditions can happen in multi threaded applications.

Use this method carefully.
Search for a transaction that match this event (MUST be a MESSAGE event).

Parameters
osipThe element to work on.
evtThe element representing the SIP MESSAGE.
osip_transaction_t* osip_create_transaction ( osip_t osip,
osip_event_t evt 
)

#include <osip.h>

Create a transaction for this event (MUST be a SIP REQUEST event).

Parameters
osipThe element to work on.
evtThe element representing the new SIP REQUEST.
void osip_event_free ( osip_event_t event)

#include <osip.h>

Free all resource in a sipevent.

Parameters
eventThe event to free.
int osip_find_transaction_and_add_event ( osip_t osip,
osip_event_t evt 
)

#include <osip.h>

Search for a transaction that match this event (MUST be a MESSAGE event) and add this event if a transaction is found.

Parameters
osipThe element to work on.
evtThe element representing the SIP MESSAGE.
void* osip_get_application_context ( osip_t osip)

#include <osip.h>

Get a pointer in a osip_t element.

This help to find your application layer in callbacks.

Parameters
osipThe element to work on.
int osip_ict_execute ( osip_t osip)

#include <osip.h>

Consume ALL pending osip_event_t previously added in the fifos of ict transactions.

Parameters
osipThe element to work on.
int osip_ict_set_destination ( osip_ict_t ict,
char *  destination,
int  port 
)

#include <osip.h>

Set the host and port destination used for sending the SIP message.

This can be useful for an application with 'DIRECT ROOTING MODE' NOTE: Instead, you should use the 'Route' header facility which leads to the same behaviour.

Parameters
ictThe element to work on.
destinationThe destination host.
portThe destination port.
int osip_init ( osip_t **  osip)

#include <osip.h>

Allocate an osip_t element.

Parameters
osipthe element to allocate.
int osip_ist_execute ( osip_t osip)

#include <osip.h>

Consume ALL pending osip_event_t previously added in the fifos of ist transactions.

Parameters
osipThe element to work on.
osip_event_t* osip_new_outgoing_sipmessage ( osip_message_t sip)

#include <osip.h>

Allocate a sipevent (we know this message is an OUTGOING SIP message).

Parameters
sipThe SIP message we want to send.
int osip_nict_execute ( osip_t osip)

#include <osip.h>

Consume ALL pending osip_event_t previously added in the fifos of nict transactions.

Parameters
osipThe element to work on.
int osip_nict_set_destination ( osip_nict_t nict,
char *  destination,
int  port 
)

#include <osip.h>

Set the host and port destination used for sending the SIP message.

This can be useful for an application with 'DIRECT ROOTING MODE' NOTE: Instead, you should use the 'Route' header facility which leads to the same behaviour.

Parameters
nictThe element to work on.
destinationThe destination host.
portThe destination port.
int osip_nist_execute ( osip_t osip)

#include <osip.h>

Consume ALL pending osip_event_t previously added in the fifos of nist transactions.

Parameters
osipThe element to work on.
osip_event_t* osip_parse ( const char *  buf,
size_t  length 
)

#include <osip.h>

Create a sipevent from a SIP message string.

Parameters
bufThe SIP message as a string.
lengthThe length of the buffer to parse.
void osip_release ( osip_t osip)

#include <osip.h>

Free all resource in a osip_t element.

Parameters
osipThe element to release.
int osip_remove_transaction ( osip_t osip,
osip_transaction_t ict 
)

#include <osip.h>

Remove a transaction from the osip stack.

Parameters
osipThe element to work on.
ictThe transaction to add.
void osip_response_get_destination ( osip_message_t response,
char **  address,
int *  portnum 
)

#include <osip.h>

Search in a SIP response the destination where the message should be sent.

Parameters
responsethe message to work on.
addressa pointer to receive the allocated host address.
portnuma pointer to receive the host port.
void osip_retransmissions_execute ( osip_t osip)

#include <osip.h>

Send required retransmissions.

Parameters
osipThe element to work on.
void osip_set_application_context ( osip_t osip,
void *  pointer 
)

#include <osip.h>

Set a pointer in a osip_t element.

This help to find your application layer in callbacks.

Parameters
osipThe element to work on.
pointerThe element to set.
void osip_set_cb_send_message ( osip_t cf,
int(*)(osip_transaction_t *, osip_message_t *, char *, int, int)  cb 
)

#include <osip.h>

Register the callback used to send SIP message.

Parameters
cfThe osip element attached to the transaction.
cbThe method we want to register.
int osip_set_kill_transaction_callback ( osip_t osip,
int  type,
osip_kill_transaction_cb_t  cb 
)

#include <osip.h>

Set a callback for transaction operation related to the end of transactions.

Parameters
osipThe element to work on.
typeThe event type to hook on.
cbThe method to be called upon the event.
int osip_set_message_callback ( osip_t osip,
int  type,
osip_message_cb_t  cb 
)

#include <osip.h>

Set a callback for each transaction operation.

Parameters
osipThe element to work on.
typeThe event type to hook on.
cbThe method to be called upon the event.
int osip_set_transport_error_callback ( osip_t osip,
int  type,
osip_transport_error_cb_t  cb 
)

#include <osip.h>

Set a callback for each transaction operation related to network error.

Parameters
osipThe element to work on.
typeThe event type to hook on.
cbThe method to be called upon the event.
void osip_start_200ok_retransmissions ( osip_t osip,
struct osip_dialog dialog,
osip_message_t msg200ok,
int  sock 
)

#include <osip.h>

Start out of fsm 200 Ok retransmissions.

This is usefull for user-agents.

Parameters
osipThe osip_t structure.
dialogThe dialog the 200 Ok is part of.
msg200okThe 200 ok response.
sockThe socket to be used to send the message. (optional).
void osip_start_ack_retransmissions ( osip_t osip,
struct osip_dialog dialog,
osip_message_t ack,
char *  dest,
int  port,
int  sock 
)

#include <osip.h>

Start out of fsm ACK retransmissions.

This is usefull for user-agents.

Parameters
osipThe osip_t structure.
dialogThe dialog the ACK is part of.
ackThe ACK that has just been sent in response to a 200 Ok.
destThe destination host.
portThe destination port.
sockThe socket to be used to send the message. (optional).
struct osip_dialog* osip_stop_200ok_retransmissions ( osip_t osip,
osip_message_t ack 
)

#include <osip.h>

Stop the out of fsm 200 Ok retransmissions matching an incoming ACK.

Parameters
osipThe osip_t structure.
ackThe ack that has just been received.
void osip_stop_retransmissions_from_dialog ( osip_t osip,
struct osip_dialog dialog 
)

#include <osip.h>

Stop out of fsm retransmissions (ACK or 200 Ok) associated to a given dialog.

This function must be called before freeing a dialog if out of fsm retransmissions have been scheduled.

Parameters
osipThe osip_t structure
dialogThe dialog.
void osip_timers_gettimeout ( osip_t osip,
struct timeval *  lower_tv 
)

#include <osip.h>

Retreive the minimum timer value to be used by an application so that the osip_timer_*_execute method don't have to be called often.

Parameters
osipThe element to work on.
lower_tvThe minimum timer when the application should wake up.
void osip_timers_ict_execute ( osip_t osip)

#include <osip.h>

Check if an ict transactions needs a timer event.

Parameters
osipThe element to work on.
void osip_timers_ist_execute ( osip_t osip)

#include <osip.h>

Check if an ist transactions needs a timer event.

Parameters
osipThe element to work on.
void osip_timers_nict_execute ( osip_t osip)

#include <osip.h>

Check if a nict transactions needs a timer event.

Parameters
osipThe element to work on.
void osip_timers_nist_execute ( osip_t osip)

#include <osip.h>

Check if a nist transactions needs a timer event.

Parameters
osipThe element to work on.
int osip_transaction_add_event ( osip_transaction_t transaction,
osip_event_t evt 
)

#include <osip.h>

Add a SIP event in the fifo of a osip_transaction_t element.

Parameters
transactionThe element to work on.
evtThe event to add.
int osip_transaction_execute ( osip_transaction_t transaction,
osip_event_t evt 
)

#include <osip.h>

Consume one osip_event_t element previously added in the fifo.

NOTE: This method MUST NEVER be called within another call of this method. (For example, you can't call osip_transaction_execute() in a callback registered in the osip_t element.)

Parameters
transactionThe element to free.
evtThe element to consume.
osip_transaction_t* osip_transaction_find ( osip_list_t transactions,
osip_event_t evt 
)

#include <osip.h>

Search for a transaction that match this event (MUST be a MESSAGE event).

Parameters
transactionsThe list of transactions to work on.
evtThe element representing the SIP MESSAGE.
int osip_transaction_free ( osip_transaction_t transaction)

#include <osip.h>

Free all resource in a osip_transaction_t element.

Parameters
transactionThe element to free.
int osip_transaction_free2 ( osip_transaction_t transaction)

#include <osip.h>

Free all resource in a osip_transaction_t element.

This method does the same than osip_transaction_free() but it assumes that the transaction is already removed from the list of transaction in the osip stack. (to remove it use osip_xixt_remove(osip, transaction);

Parameters
transactionThe element to free.
int osip_transaction_get_destination ( osip_transaction_t transaction,
char **  ip,
int *  port 
)

#include <osip.h>

Get target ip and port for this request.

(automaticly set by osip_transaction_init() for ict and nict)

Parameters
transactionThe element to work on.
ipThe ip of host where to send initial request.
portThe port where to send initial request.
void* osip_transaction_get_reserved1 ( osip_transaction_t transaction)

#include <osip.h>

Get a pointer to your personal context associated with this transaction.

Parameters
transactionThe element to work on.
void* osip_transaction_get_reserved2 ( osip_transaction_t transaction)

#include <osip.h>

Get a pointer to your personal context associated with this transaction.

Parameters
transactionThe element to work on.
void* osip_transaction_get_reserved3 ( osip_transaction_t transaction)

#include <osip.h>

Get a pointer to your personal context associated with this transaction.

Parameters
transactionThe element to work on.
void* osip_transaction_get_reserved4 ( osip_transaction_t transaction)

#include <osip.h>

Get a pointer to your personal context associated with this transaction.

Parameters
transactionThe element to work on.
void* osip_transaction_get_reserved5 ( osip_transaction_t transaction)

#include <osip.h>

Get a pointer to your personal context associated with this transaction.

Parameters
transactionThe element to work on.
void* osip_transaction_get_reserved6 ( osip_transaction_t transaction)

#include <osip.h>

Get a pointer to your personal context associated with this transaction.

Parameters
transactionThe element to work on.
void* osip_transaction_get_your_instance ( osip_transaction_t transaction)

#include <osip.h>

Get a pointer to your personal context associated with this transaction.

OBSOLETE: see osip_transaction_get_reserved1...

Parameters
transactionThe element to work on.
int osip_transaction_init ( osip_transaction_t **  transaction,
osip_fsm_type_t  ctx_type,
osip_t osip,
osip_message_t request 
)

#include <osip.h>

Allocate an osip_transaction_t element.

Parameters
transactionThe element to allocate.
ctx_typeThe type of transaction. (ICT, IST, NICT, NIST)
osipThe global instance of oSIP.
requestThe SIP request that initiate the transaction.
int osip_transaction_set_in_socket ( osip_transaction_t transaction,
int  sock 
)

#include <osip.h>

Set the socket for incoming message.

Parameters
transactionThe element to work on.
sockThe socket for incoming message.
int osip_transaction_set_naptr_record ( osip_transaction_t transaction,
osip_naptr_t record 
)

#include <osip.h>

Set NAPTR lookup information to be used by state machine.

Parameters
transactionThe element to work on.
recordThe NAPTR lookup results for this transaction.
int osip_transaction_set_out_socket ( osip_transaction_t transaction,
int  sock 
)

#include <osip.h>

Set the socket for outgoing message.

Parameters
transactionThe element to work on.
sockThe socket for outgoing message.
int osip_transaction_set_reserved1 ( osip_transaction_t transaction,
void *  ptr 
)

#include <osip.h>

Set a pointer to your personal context associated with this transaction.

NOTE: this is a very useful method that allow you to avoid searching for your personal context inside the registered callbacks. You can initialise this pointer to your context right after the creation of the osip_transaction_t element. Then, you'll be able to get the address of your context by calling osip_transaction_get_reserved1().

Parameters
transactionThe element to work on.
ptrThe address of your context.
int osip_transaction_set_reserved2 ( osip_transaction_t transaction,
void *  ptr 
)

#include <osip.h>

Set a pointer to your personal context associated with this transaction.

NOTE: see osip_transaction_set_reserved1

Parameters
transactionThe element to work on.
ptrThe address of your context.
int osip_transaction_set_reserved3 ( osip_transaction_t transaction,
void *  ptr 
)

#include <osip.h>

Set a pointer to your personal context associated with this transaction.

NOTE: see osip_transaction_set_reserved1

Parameters
transactionThe element to work on.
ptrThe address of your context.
int osip_transaction_set_reserved4 ( osip_transaction_t transaction,
void *  ptr 
)

#include <osip.h>

Set a pointer to your personal context associated with this transaction.

NOTE: see osip_transaction_set_reserved1

Parameters
transactionThe element to work on.
ptrThe address of your context.
int osip_transaction_set_reserved5 ( osip_transaction_t transaction,
void *  ptr 
)

#include <osip.h>

Set a pointer to your personal context associated with this transaction.

NOTE: see osip_transaction_set_reserved1

Parameters
transactionThe element to work on.
ptrThe address of your context.
int osip_transaction_set_reserved6 ( osip_transaction_t transaction,
void *  ptr 
)

#include <osip.h>

Set a pointer to your personal context associated with this transaction.

NOTE: see osip_transaction_set_reserved1

Parameters
transactionThe element to work on.
ptrThe address of your context.
int osip_transaction_set_srv_record ( osip_transaction_t transaction,
osip_srv_record_t record 
)

#include <osip.h>

Set SRV lookup information to be used by state machine.

Parameters
transactionThe element to work on.
recordThe SRV lookup results for this transaction.
int osip_transaction_set_your_instance ( osip_transaction_t transaction,
void *  ptr 
)

#include <osip.h>

Set a pointer to your personal context associated with this transaction.

OBSOLETE: see osip_transaction_set_reserved1... NOTE: this is a very useful method that allow you to avoid searching for your personal context inside the registered callbacks. You can initialise this pointer to your context right after the creation of the osip_transaction_t element. Then, you'll be able to get the address of your context by calling osip_transaction_get_your_instance().

Parameters
transactionThe element to work on.
ptrThe address of your context.