libosip  5.3.0
Classes | Macros | Typedefs | Enumerations | Functions
oSIP fsm Handling

Classes

struct  osip_ict
 
struct  osip_nict
 
struct  osip_ist
 
struct  osip_nist
 
struct  osip_srv_entry
 
struct  osip_srv_record
 
struct  osip_naptr
 
struct  osip_transaction
 
struct  ixt
 
struct  osip
 
struct  osip_event
 

Macros

#define DEFAULT_T1   500 /* 500 ms */
 
#define DEFAULT_T1_TCP_PROGRESS   500 /* 500ms */
 
#define DEFAULT_T2   4000 /* 4s */
 
#define DEFAULT_T4   5000 /* 5s */
 
#define OSIP_SRV_STATE_UNKNOWN   0
 
#define OSIP_SRV_STATE_RETRYLATER   2
 
#define OSIP_SRV_STATE_COMPLETED   3
 
#define OSIP_SRV_STATE_NOTSUPPORTED   4
 
#define OSIP_NAPTR_STATE_UNKNOWN   0
 
#define OSIP_NAPTR_STATE_INPROGRESS   1
 
#define OSIP_NAPTR_STATE_NAPTRDONE   2
 
#define OSIP_NAPTR_STATE_SRVINPROGRESS   3
 
#define OSIP_NAPTR_STATE_SRVDONE   4
 
#define OSIP_NAPTR_STATE_RETRYLATER   5
 
#define OSIP_NAPTR_STATE_NOTSUPPORTED   6
 
#define EVT_IS_RCV_INVITE(event)   (event->type == RCV_REQINVITE)
 
#define EVT_IS_RCV_ACK(event)   (event->type == RCV_REQACK)
 
#define EVT_IS_RCV_REQUEST(event)   (event->type == RCV_REQUEST)
 
#define EVT_IS_RCV_STATUS_1XX(event)   (event->type == RCV_STATUS_1XX)
 
#define EVT_IS_RCV_STATUS_2XX(event)   (event->type == RCV_STATUS_2XX)
 
#define EVT_IS_RCV_STATUS_3456XX(event)   (event->type == RCV_STATUS_3456XX)
 
#define EVT_IS_SND_INVITE(event)   (event->type == SND_REQINVITE)
 
#define EVT_IS_SND_ACK(event)   (event->type == SND_REQACK)
 
#define EVT_IS_SND_REQUEST(event)   (event->type == SND_REQUEST)
 
#define EVT_IS_SND_STATUS_1XX(event)   (event->type == SND_STATUS_1XX)
 
#define EVT_IS_SND_STATUS_2XX(event)   (event->type == SND_STATUS_2XX)
 
#define EVT_IS_SND_STATUS_3456XX(event)   (event->type == SND_STATUS_3456XX)
 
#define EVT_IS_INCOMINGMSG(event)   (event->type >= RCV_REQINVITE && event->type <= RCV_STATUS_3456XX)
 
#define EVT_IS_INCOMINGREQ(event)   (EVT_IS_RCV_INVITE(event) || EVT_IS_RCV_ACK(event) || EVT_IS_RCV_REQUEST(event))
 
#define EVT_IS_INCOMINGRESP(event)   (EVT_IS_RCV_STATUS_1XX(event) || EVT_IS_RCV_STATUS_2XX(event) || EVT_IS_RCV_STATUS_3456XX(event))
 
#define EVT_IS_OUTGOINGMSG(event)   (event->type >= SND_REQINVITE && event->type <= SND_STATUS_3456XX)
 
#define EVT_IS_OUTGOINGREQ(event)   (EVT_IS_SND_INVITE(event) || EVT_IS_SND_ACK(event) || EVT_IS_SND_REQUEST(event))
 
#define EVT_IS_OUTGOINGRESP(event)   (EVT_IS_SND_STATUS_1XX(event) || EVT_IS_SND_STATUS_2XX(event) || EVT_IS_SND_STATUS_3456XX(event))
 
#define EVT_IS_MSG(event)   (event->type >= RCV_REQINVITE && event->type <= SND_STATUS_3456XX)
 
#define EVT_IS_KILL_TRANSACTION(event)   (event->type == KILL_TRANSACTION)
 

Typedefs

typedef enum _state_t state_t
 
typedef enum type_t type_t
 
typedef enum osip_fsm_type_t osip_fsm_type_t
 
typedef struct osip_ict osip_ict_t
 
typedef struct osip_nict osip_nict_t
 
typedef struct osip_ist osip_ist_t
 
typedef struct osip_nist osip_nist_t
 
typedef struct osip_srv_entry osip_srv_entry_t
 
typedef struct osip_srv_record osip_srv_record_t
 
typedef struct osip_naptr osip_naptr_t
 
typedef struct osip_transaction osip_transaction_t
 
typedef enum osip_message_callback_type osip_message_callback_type_t
 
typedef enum osip_kill_callback_type osip_kill_callback_type_t
 
typedef enum osip_transport_error_callback_type osip_transport_error_callback_type_t
 
typedef void(* osip_message_cb_t) (int type, osip_transaction_t *, osip_message_t *)
 
typedef void(* osip_kill_transaction_cb_t) (int type, osip_transaction_t *)
 
typedef void(* osip_transport_error_cb_t) (int type, osip_transaction_t *, int error)
 
typedef struct ixt ixt_t
 
typedef struct osip osip_t
 
typedef struct osip_event osip_event_t
 

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
}
 
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
}
 
enum  osip_fsm_type_t { ICT , IST , NICT , NIST }
 
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
}
 
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
}
 
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
}
 

Functions

int osip_set_message_callback (osip_t *osip, int type, osip_message_cb_t cb)
 
int osip_set_kill_transaction_callback (osip_t *osip, int type, osip_kill_transaction_cb_t cb)
 
int osip_set_transport_error_callback (osip_t *osip, int type, osip_transport_error_cb_t cb)
 
int osip_transaction_init (osip_transaction_t **transaction, osip_fsm_type_t ctx_type, osip_t *osip, osip_message_t *request)
 
int osip_transaction_free (osip_transaction_t *transaction)
 
int osip_transaction_free2 (osip_transaction_t *transaction)
 
void osip_response_get_destination (osip_message_t *response, char **address, int *portnum)
 
int osip_ict_set_destination (osip_ict_t *ict, char *destination, int port)
 
int osip_nict_set_destination (osip_nict_t *nict, char *destination, int port)
 
int osip_transaction_add_event (osip_transaction_t *transaction, osip_event_t *evt)
 
int osip_transaction_execute (osip_transaction_t *transaction, osip_event_t *evt)
 
int osip_transaction_set_your_instance (osip_transaction_t *transaction, void *ptr)
 
int osip_transaction_set_reserved1 (osip_transaction_t *transaction, void *ptr)
 
int osip_transaction_set_reserved2 (osip_transaction_t *transaction, void *ptr)
 
int osip_transaction_set_reserved3 (osip_transaction_t *transaction, void *ptr)
 
int osip_transaction_set_reserved4 (osip_transaction_t *transaction, void *ptr)
 
int osip_transaction_set_reserved5 (osip_transaction_t *transaction, void *ptr)
 
int osip_transaction_set_reserved6 (osip_transaction_t *transaction, void *ptr)
 
void * osip_transaction_get_your_instance (osip_transaction_t *transaction)
 
void * osip_transaction_get_reserved1 (osip_transaction_t *transaction)
 
void * osip_transaction_get_reserved2 (osip_transaction_t *transaction)
 
void * osip_transaction_get_reserved3 (osip_transaction_t *transaction)
 
void * osip_transaction_get_reserved4 (osip_transaction_t *transaction)
 
void * osip_transaction_get_reserved5 (osip_transaction_t *transaction)
 
void * osip_transaction_get_reserved6 (osip_transaction_t *transaction)
 
int osip_transaction_get_destination (osip_transaction_t *transaction, char **ip, int *port)
 
int osip_transaction_set_srv_record (osip_transaction_t *transaction, osip_srv_record_t *record)
 
int osip_transaction_set_naptr_record (osip_transaction_t *transaction, osip_naptr_t *record)
 
int osip_transaction_set_in_socket (osip_transaction_t *transaction, int sock)
 
int osip_transaction_set_out_socket (osip_transaction_t *transaction, int sock)
 
int osip_init (osip_t **osip)
 
void osip_release (osip_t *osip)
 
void osip_set_application_context (osip_t *osip, void *pointer)
 
void * osip_get_application_context (osip_t *osip)
 
int osip_remove_transaction (osip_t *osip, osip_transaction_t *ict)
 
int osip_ict_execute (osip_t *osip)
 
int osip_ist_execute (osip_t *osip)
 
int osip_nict_execute (osip_t *osip)
 
int osip_nist_execute (osip_t *osip)
 
void osip_timers_gettimeout (osip_t *osip, struct timeval *lower_tv)
 
void osip_timers_ict_execute (osip_t *osip)
 
void osip_timers_ist_execute (osip_t *osip)
 
void osip_timers_nict_execute (osip_t *osip)
 
void osip_timers_nist_execute (osip_t *osip)
 
osip_transaction_tosip_transaction_find (osip_list_t *transactions, osip_event_t *evt)
 
int osip_find_transaction_and_add_event (osip_t *osip, osip_event_t *evt)
 
osip_transaction_tosip_create_transaction (osip_t *osip, osip_event_t *evt)
 
osip_event_tosip_parse (const char *buf, size_t length)
 
void osip_retransmissions_execute (osip_t *osip)
 
void osip_start_200ok_retransmissions (osip_t *osip, struct osip_dialog *dialog, osip_message_t *msg200ok, int sock)
 
void osip_start_ack_retransmissions (osip_t *osip, struct osip_dialog *dialog, osip_message_t *ack, char *dest, int port, int sock)
 
struct osip_dialogosip_stop_200ok_retransmissions (osip_t *osip, osip_message_t *ack)
 
void osip_stop_retransmissions_from_dialog (osip_t *osip, struct osip_dialog *dialog)
 
osip_event_tosip_new_outgoing_sipmessage (osip_message_t *sip)
 
void osip_event_free (osip_event_t *event)
 
void osip_set_cb_send_message (osip_t *cf, int(*cb)(osip_transaction_t *, osip_message_t *, char *, int, int))
 

Detailed Description

Macro Definition Documentation

◆ DEFAULT_T1

#define DEFAULT_T1   500 /* 500 ms */

You can re-define the default value for T1. (T1 is defined in rfcxxxx) The default value is 500ms.

◆ DEFAULT_T1_TCP_PROGRESS

#define DEFAULT_T1_TCP_PROGRESS   500 /* 500ms */

[OBSOLETE] 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 500ms.

◆ DEFAULT_T2

#define DEFAULT_T2   4000 /* 4s */

You can re-define the default value for T2. (T2 is defined in rfcxxxx) The default value is 4000ms.

◆ DEFAULT_T4

#define DEFAULT_T4   5000 /* 5s */

You can re-define the default value for T4. (T1 is defined in rfcxxxx) The default value is 5000ms.

◆ EVT_IS_INCOMINGMSG

#define EVT_IS_INCOMINGMSG (   event)    (event->type >= RCV_REQINVITE && event->type <= RCV_STATUS_3456XX)

Check if the sipevent is of an incoming SIP MESSAGE.

Parameters
eventthe event to check.

◆ EVT_IS_INCOMINGREQ

#define EVT_IS_INCOMINGREQ (   event)    (EVT_IS_RCV_INVITE(event) || EVT_IS_RCV_ACK(event) || EVT_IS_RCV_REQUEST(event))

Check if the sipevent is of an incoming SIP REQUEST.

Parameters
eventthe event to check.

◆ EVT_IS_INCOMINGRESP

#define EVT_IS_INCOMINGRESP (   event)    (EVT_IS_RCV_STATUS_1XX(event) || EVT_IS_RCV_STATUS_2XX(event) || EVT_IS_RCV_STATUS_3456XX(event))

Check if the sipevent is of an incoming SIP RESPONSE.

Parameters
eventthe event to check.

◆ EVT_IS_KILL_TRANSACTION

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

Check if the sipevent is of type KILL_TRANSACTION. NOTE: THIS IS AN INTERNAL METHOD ONLY

Parameters
eventthe event to check.

◆ EVT_IS_MSG

#define EVT_IS_MSG (   event)    (event->type >= RCV_REQINVITE && event->type <= SND_STATUS_3456XX)

Check if the sipevent is a SIP MESSAGE.

Parameters
eventthe event to check.

◆ EVT_IS_OUTGOINGMSG

#define EVT_IS_OUTGOINGMSG (   event)    (event->type >= SND_REQINVITE && event->type <= SND_STATUS_3456XX)

Check if the sipevent is of an outgoing SIP MESSAGE.

Parameters
eventthe event to check.

◆ EVT_IS_OUTGOINGREQ

#define EVT_IS_OUTGOINGREQ (   event)    (EVT_IS_SND_INVITE(event) || EVT_IS_SND_ACK(event) || EVT_IS_SND_REQUEST(event))

Check if the sipevent is of an outgoing SIP REQUEST.

Parameters
eventthe event to check.

◆ EVT_IS_OUTGOINGRESP

#define EVT_IS_OUTGOINGRESP (   event)    (EVT_IS_SND_STATUS_1XX(event) || EVT_IS_SND_STATUS_2XX(event) || EVT_IS_SND_STATUS_3456XX(event))

Check if the sipevent is of an outgoing SIP RESPONSE.

Parameters
eventthe event to check.

◆ EVT_IS_RCV_ACK

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

Check if the sipevent is of type RCV_REQACK.

Parameters
eventthe event to check.

◆ EVT_IS_RCV_INVITE

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

Check if the sipevent is of type RCV_REQINVITE.

Parameters
eventthe event to check.

◆ EVT_IS_RCV_REQUEST

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

Check if the sipevent is of type RCV_REQUEST.

Parameters
eventthe event to check.

◆ EVT_IS_RCV_STATUS_1XX

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

Check if the sipevent is of type RCV_STATUS_1XX.

Parameters
eventthe event to check.

◆ EVT_IS_RCV_STATUS_2XX

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

Check if the sipevent is of type RCV_STATUS_2XX.

Parameters
eventthe event to check.

◆ EVT_IS_RCV_STATUS_3456XX

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

Check if the sipevent is of type RCV_STATUS_3456XX.

Parameters
eventthe event to check.

◆ EVT_IS_SND_ACK

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

Check if the sipevent is of type SND_REQACK.

Parameters
eventthe event to check.

◆ EVT_IS_SND_INVITE

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

Check if the sipevent is of type SND_REQINVITE.

Parameters
eventthe event to check.

◆ EVT_IS_SND_REQUEST

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

Check if the sipevent is of type SND_REQUEST.

Parameters
eventthe event to check.

◆ EVT_IS_SND_STATUS_1XX

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

Check if the sipevent is of type SND_STATUS_1XX.

Parameters
eventthe event to check.

◆ EVT_IS_SND_STATUS_2XX

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

Check if the sipevent is of type SND_STATUS_2XX.

Parameters
eventthe event to check.

◆ EVT_IS_SND_STATUS_3456XX

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

Check if the sipevent is of type SND_STATUS_3456XX.

Parameters
eventthe event to check.

◆ OSIP_NAPTR_STATE_INPROGRESS

#define OSIP_NAPTR_STATE_INPROGRESS   1

in progress

◆ OSIP_NAPTR_STATE_NAPTRDONE

#define OSIP_NAPTR_STATE_NAPTRDONE   2

naptr done

◆ OSIP_NAPTR_STATE_NOTSUPPORTED

#define OSIP_NAPTR_STATE_NOTSUPPORTED   6

not supported

◆ OSIP_NAPTR_STATE_RETRYLATER

#define OSIP_NAPTR_STATE_RETRYLATER   5

retry later

◆ OSIP_NAPTR_STATE_SRVDONE

#define OSIP_NAPTR_STATE_SRVDONE   4

srv done

◆ OSIP_NAPTR_STATE_SRVINPROGRESS

#define OSIP_NAPTR_STATE_SRVINPROGRESS   3

srv in progress

◆ OSIP_NAPTR_STATE_UNKNOWN

#define OSIP_NAPTR_STATE_UNKNOWN   0

unknown

◆ OSIP_SRV_STATE_COMPLETED

#define OSIP_SRV_STATE_COMPLETED   3

completed

◆ OSIP_SRV_STATE_NOTSUPPORTED

#define OSIP_SRV_STATE_NOTSUPPORTED   4

not supported

◆ OSIP_SRV_STATE_RETRYLATER

#define OSIP_SRV_STATE_RETRYLATER   2

retry later

◆ OSIP_SRV_STATE_UNKNOWN

#define OSIP_SRV_STATE_UNKNOWN   0

unknown

Typedef Documentation

◆ ixt_t

Structure for 2XX retransmission management.

◆ osip_event_t

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.

◆ osip_fsm_type_t

Enumeration for transaction type. A transaction can be either of: ICT, IST, NICT, NIST,

◆ osip_ict_t

Structure for INVITE CLIENT TRANSACTION (outgoing INVITE transaction).

◆ osip_ist_t

Structure for INVITE SERVER TRANSACTION (incoming INVITE transaction).

◆ osip_kill_callback_type_t

Enumeration for callback type used when transaction is over.

◆ osip_kill_transaction_cb_t

osip_kill_transaction_cb_t

Callback definition for end of transaction announcements.

◆ osip_message_callback_type_t

Enumeration for callback type.

◆ osip_message_cb_t

osip_message_cb_t

Callback definition for message announcements.

◆ osip_naptr_t

Structure for NAPTR record.

◆ osip_nict_t

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

◆ osip_nist_t

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

◆ osip_srv_entry_t

Structure for SRV record entry.

◆ osip_srv_record_t

Structure for SRV record.

◆ osip_t

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.

◆ osip_transaction_t

Structure for transaction handling.

◆ osip_transport_error_callback_type_t

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

◆ osip_transport_error_cb_t

osip_transport_error_cb_t

Callback definition for transport error announcements.

◆ state_t

typedef enum _state_t state_t

Enumeration for transaction state. Those states are extracted from the diagram found in rfc3261.txt

◆ type_t

typedef enum type_t type_t

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

◆ _state_t

enum _state_t

Enumeration for transaction state. Those states are extracted from the diagram found in rfc3261.txt

◆ osip_fsm_type_t

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

◆ osip_kill_callback_type

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

◆ osip_message_callback_type

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

◆ osip_transport_error_callback_type

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

◆ type_t

enum type_t

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

Function Documentation

◆ osip_create_transaction()

osip_transaction_t* osip_create_transaction ( osip_t osip,
osip_event_t evt 
)

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.

References osip_message::cseq, EVT_IS_INCOMINGREQ, EVT_IS_OUTGOINGREQ, ICT, IST, osip_cseq::method, MSG_IS_ACK, MSG_IS_REQUEST, NICT, NIST, osip_transaction_init(), osip_event::sip, osip_message::sip_method, osip_transaction::transactionid, and osip_event::transactionid.

◆ osip_event_free()

void osip_event_free ( osip_event_t event)

Free all resource in a sipevent.

Parameters
eventThe event to free.

References osip_message_free(), and osip_event::sip.

◆ osip_find_transaction_and_add_event()

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..

Parameters
osipThe element to work on.
evtThe element representing the SIP MESSAGE.

◆ osip_get_application_context()

void* osip_get_application_context ( osip_t osip)

Get a pointer in a osip_t element. This help to find your application layer in callbacks.

Parameters
osipThe element to work on.

References osip::application_context.

◆ osip_ict_execute()

int osip_ict_execute ( osip_t osip)

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

Parameters
osipThe element to work on.

References osip::ict_fastmutex, osip_fifo_tryget(), osip::osip_ict_transactions, osip_list_get_first(), osip_list_get_next(), osip_list_iterator_has_elem, osip_list_size(), osip_mutex_lock(), osip_mutex_unlock(), osip_transaction_execute(), and osip_transaction::transactionff.

◆ osip_ict_set_destination()

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. 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.

References osip_ict::destination, and osip_ict::port.

◆ osip_init()

int osip_init ( osip_t **  osip)

Allocate an osip_t element.

Parameters
osipthe element to allocate.

References osip_list_init(), osip_mutex_init(), and parser_init().

◆ osip_ist_execute()

int osip_ist_execute ( osip_t osip)

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

Parameters
osipThe element to work on.

References osip::ist_fastmutex, osip_fifo_tryget(), osip::osip_ist_transactions, osip_list_get_first(), osip_list_get_next(), osip_list_iterator_has_elem, osip_list_size(), osip_mutex_lock(), osip_mutex_unlock(), osip_transaction_execute(), and osip_transaction::transactionff.

◆ osip_new_outgoing_sipmessage()

osip_event_t* osip_new_outgoing_sipmessage ( osip_message_t sip)

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

Parameters
sipThe SIP message we want to send.

References MSG_IS_REQUEST, osip_message::req_uri, osip_event::sip, osip_message::sip_method, osip_event::transactionid, and osip_event::type.

◆ osip_nict_execute()

int osip_nict_execute ( osip_t osip)

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

Parameters
osipThe element to work on.

References osip::nict_fastmutex, osip_fifo_tryget(), osip_list_get_first(), osip_list_get_next(), osip_list_iterator_has_elem, osip_list_size(), osip_mutex_lock(), osip_mutex_unlock(), osip::osip_nict_transactions, osip_transaction_execute(), and osip_transaction::transactionff.

◆ osip_nict_set_destination()

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. 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.

References osip_nict::destination, and osip_nict::port.

◆ osip_nist_execute()

int osip_nist_execute ( osip_t osip)

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

Parameters
osipThe element to work on.

References osip::nist_fastmutex, osip_fifo_tryget(), osip_list_get_first(), osip_list_get_next(), osip_list_iterator_has_elem, osip_list_size(), osip_mutex_lock(), osip_mutex_unlock(), osip::osip_nist_transactions, osip_transaction_execute(), and osip_transaction::transactionff.

◆ osip_parse()

osip_event_t* osip_parse ( const char *  buf,
size_t  length 
)

Create a sipevent from a SIP message string.

Parameters
bufThe SIP message as a string.
lengthThe length of the buffer to parse.

References osip_message::call_id, MSG_IS_REQUEST, osip_call_id::number, osip_message_free(), osip_message_init(), osip_message_parse(), osip_message::req_uri, osip_event::sip, osip_message::sip_method, osip_event::type, and UNKNOWN_EVT.

◆ osip_release()

void osip_release ( osip_t osip)

Free all resource in a osip_t element.

Parameters
osipThe element to release.

References osip::ict_fastmutex, osip::id_mutex, osip::ist_fastmutex, osip::ixt_fastmutex, osip::nict_fastmutex, osip::nist_fastmutex, and osip_mutex_destroy().

◆ osip_remove_transaction()

int osip_remove_transaction ( osip_t osip,
osip_transaction_t ict 
)

Remove a transaction from the osip stack.

Parameters
osipThe element to work on.
ictThe transaction to add.

References osip_transaction::ctx_type, ICT, IST, NICT, and NIST.

Referenced by osip_transaction_free().

◆ osip_response_get_destination()

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.

Parameters
responsethe message to work on.
addressa pointer to receive the allocated host address.
portnuma pointer to receive the host port.

References osip_uri_param::gvalue, osip_via::host, osip_list_get(), osip_via_param_get_byname, osip_via::port, and osip_message::vias.

Referenced by osip_start_200ok_retransmissions().

◆ osip_retransmissions_execute()

void osip_retransmissions_execute ( osip_t osip)

Send required retransmissions

Parameters
osipThe element to work on.

References ixt::counter, osip::ixt_retransmissions, osip_list_eol(), osip_list_get(), and osip_list_remove().

◆ osip_set_application_context()

void osip_set_application_context ( osip_t osip,
void *  pointer 
)

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.

References osip::application_context.

◆ osip_set_cb_send_message()

void osip_set_cb_send_message ( osip_t cf,
int(*)(osip_transaction_t *, osip_message_t *, char *, int, int)  cb 
)

Register the callback used to send SIP message.

Parameters
cfThe osip element attached to the transaction.
cbThe method we want to register.

References osip::cb_send_message.

◆ osip_set_kill_transaction_callback()

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.

Parameters
osipThe element to work on.
typeThe event type to hook on.
cbThe method to be called upon the event.

References osip::kill_callbacks, and OSIP_KILL_CALLBACK_COUNT.

◆ osip_set_message_callback()

int osip_set_message_callback ( osip_t osip,
int  type,
osip_message_cb_t  cb 
)

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.

References osip::msg_callbacks, and OSIP_MESSAGE_CALLBACK_COUNT.

◆ osip_set_transport_error_callback()

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.

Parameters
osipThe element to work on.
typeThe event type to hook on.
cbThe method to be called upon the event.

References OSIP_TRANSPORT_ERROR_CALLBACK_COUNT, and osip::tp_error_callbacks.

◆ osip_start_200ok_retransmissions()

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. 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).

References ixt::dest, ixt::dialog, ixt::msg2xx, osip_message_clone(), osip_response_get_destination(), ixt::port, and ixt::sock.

◆ osip_start_ack_retransmissions()

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. 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).

References ixt::ack, ixt::dest, ixt::dialog, osip_message_clone(), ixt::port, and ixt::sock.

◆ osip_stop_200ok_retransmissions()

struct osip_dialog* osip_stop_200ok_retransmissions ( osip_t osip,
osip_message_t ack 
)

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

Parameters
osipThe osip_t structure.
ackThe ack that has just been received.

References osip_message::cseq, ixt::dialog, osip::ixt_retransmissions, ixt::msg2xx, osip_cseq::number, osip_dialog_match_as_uas(), osip_list_eol(), osip_list_get(), and osip_list_remove().

◆ osip_stop_retransmissions_from_dialog()

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. This function must be called before freeing a dialog if out of fsm retransmissions have been scheduled.

Parameters
osipThe osip_t structure
dialogThe dialog.

References ixt::dialog, osip::ixt_retransmissions, osip_list_eol(), osip_list_get(), and osip_list_remove().

◆ osip_timers_gettimeout()

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.

Parameters
osipThe element to work on.
lower_tvThe minimum timer when the application should wake up.

References osip::ict_fastmutex, osip_fifo_size(), osip::osip_ict_transactions, osip_list_get_first(), osip_list_iterator_has_elem, osip_mutex_lock(), and osip_mutex_unlock().

◆ osip_timers_ict_execute()

void osip_timers_ict_execute ( osip_t osip)

◆ osip_timers_ist_execute()

void osip_timers_ist_execute ( osip_t osip)

◆ osip_timers_nict_execute()

void osip_timers_nict_execute ( osip_t osip)

◆ osip_timers_nist_execute()

void osip_timers_nist_execute ( osip_t osip)

◆ osip_transaction_add_event()

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.

Parameters
transactionThe element to work on.
evtThe event to add.

References osip_fifo_add(), osip_transaction::transactionff, osip_transaction::transactionid, and osip_event::transactionid.

◆ osip_transaction_execute()

int osip_transaction_execute ( osip_transaction_t transaction,
osip_event_t evt 
)

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.

References osip_transaction::ctx_type, EVT_IS_KILL_TRANSACTION, EVT_IS_MSG, ICT, IST, NICT, osip_message_free(), osip_event::sip, osip_transaction::state, osip_transaction::transactionid, and osip_event::type.

Referenced by osip_ict_execute(), osip_ist_execute(), osip_nict_execute(), and osip_nist_execute().

◆ osip_transaction_find()

osip_transaction_t* osip_transaction_find ( osip_list_t transactions,
osip_event_t evt 
)

◆ osip_transaction_free()

int osip_transaction_free ( osip_transaction_t transaction)

Free all resource in a osip_transaction_t element.

Parameters
transactionThe element to free.

References osip_transaction::config, osip_remove_transaction(), osip_transaction_free2(), and osip_transaction::transactionid.

Referenced by osip_transaction_init().

◆ osip_transaction_free2()

int osip_transaction_free2 ( osip_transaction_t transaction)

◆ osip_transaction_get_destination()

int osip_transaction_get_destination ( osip_transaction_t transaction,
char **  ip,
int *  port 
)

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.

References osip_ict::destination, osip_nict::destination, osip_transaction::ict_context, osip_transaction::nict_context, osip_ict::port, and osip_nict::port.

◆ osip_transaction_get_reserved1()

void* osip_transaction_get_reserved1 ( osip_transaction_t transaction)

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

Parameters
transactionThe element to work on.

References osip_transaction::reserved1.

◆ osip_transaction_get_reserved2()

void* osip_transaction_get_reserved2 ( osip_transaction_t transaction)

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

Parameters
transactionThe element to work on.

References osip_transaction::reserved2.

◆ osip_transaction_get_reserved3()

void* osip_transaction_get_reserved3 ( osip_transaction_t transaction)

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

Parameters
transactionThe element to work on.

References osip_transaction::reserved3.

◆ osip_transaction_get_reserved4()

void* osip_transaction_get_reserved4 ( osip_transaction_t transaction)

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

Parameters
transactionThe element to work on.

References osip_transaction::reserved4.

◆ osip_transaction_get_reserved5()

void* osip_transaction_get_reserved5 ( osip_transaction_t transaction)

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

Parameters
transactionThe element to work on.

References osip_transaction::reserved5.

◆ osip_transaction_get_reserved6()

void* osip_transaction_get_reserved6 ( osip_transaction_t transaction)

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

Parameters
transactionThe element to work on.

References osip_transaction::reserved6.

◆ osip_transaction_get_your_instance()

void* osip_transaction_get_your_instance ( osip_transaction_t transaction)

Get a pointer to your personal context associated with this transaction. OBSOLETE: see osip_transaction_get_reserved1...

Parameters
transactionThe element to work on.

References osip_transaction::reserved1.

◆ osip_transaction_init()

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.

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.

References osip_message::call_id, osip_message::cseq, osip_message::from, ICT, osip_call_id::number, osip_transaction::orig_request, osip_fifo_init(), osip_list_get(), osip_transaction_free(), osip_message::to, osip::transactionid, and osip_message::vias.

Referenced by osip_create_transaction().

◆ osip_transaction_set_in_socket()

int osip_transaction_set_in_socket ( osip_transaction_t transaction,
int  sock 
)

Set the socket for incoming message.

Parameters
transactionThe element to work on.
sockThe socket for incoming message.

References osip_transaction::in_socket.

◆ osip_transaction_set_naptr_record()

int osip_transaction_set_naptr_record ( osip_transaction_t transaction,
osip_naptr_t record 
)

Set NAPTR lookup information to be used by state machine.

Parameters
transactionThe element to work on.
recordThe NAPTR lookup results for this transaction.

References osip_transaction::naptr_record.

◆ osip_transaction_set_out_socket()

int osip_transaction_set_out_socket ( osip_transaction_t transaction,
int  sock 
)

Set the socket for outgoing message.

Parameters
transactionThe element to work on.
sockThe socket for outgoing message.

References osip_transaction::out_socket.

◆ osip_transaction_set_reserved1()

int osip_transaction_set_reserved1 ( osip_transaction_t transaction,
void *  ptr 
)

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.

References osip_transaction::reserved1.

◆ osip_transaction_set_reserved2()

int osip_transaction_set_reserved2 ( osip_transaction_t transaction,
void *  ptr 
)

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.

References osip_transaction::reserved2.

◆ osip_transaction_set_reserved3()

int osip_transaction_set_reserved3 ( osip_transaction_t transaction,
void *  ptr 
)

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.

References osip_transaction::reserved3.

◆ osip_transaction_set_reserved4()

int osip_transaction_set_reserved4 ( osip_transaction_t transaction,
void *  ptr 
)

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.

References osip_transaction::reserved4.

◆ osip_transaction_set_reserved5()

int osip_transaction_set_reserved5 ( osip_transaction_t transaction,
void *  ptr 
)

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.

References osip_transaction::reserved5.

◆ osip_transaction_set_reserved6()

int osip_transaction_set_reserved6 ( osip_transaction_t transaction,
void *  ptr 
)

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.

References osip_transaction::reserved6.

◆ osip_transaction_set_srv_record()

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.

Parameters
transactionThe element to work on.
recordThe SRV lookup results for this transaction.

References osip_transaction::record.

◆ osip_transaction_set_your_instance()

int osip_transaction_set_your_instance ( osip_transaction_t transaction,
void *  ptr 
)

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.

References osip_transaction::reserved1.