SIP Witch 1.9.15
|
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... | |
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_t * | osip_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_t * | osip_create_transaction (osip_t *osip, osip_event_t *evt) |
Create a transaction for this event (MUST be a SIP REQUEST event). More... | |
osip_event_t * | osip_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_dialog * | osip_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_t * | osip_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... | |
#define DEFAULT_T1 500 /* 500 ms */ |
#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.
#define DEFAULT_T2 4000 /* 4s */ |
#define DEFAULT_T4 5000 /* 5s */ |
#define EVT_IS_INCOMINGMSG | ( | event | ) |
#include <osip.h>
Check if the sipevent is of an incoming SIP MESSAGE.
event | the event to check. |
#define EVT_IS_INCOMINGREQ | ( | event | ) |
#include <osip.h>
Check if the sipevent is of an incoming SIP REQUEST.
event | the event to check. |
#define EVT_IS_INCOMINGRESP | ( | event | ) |
#include <osip.h>
Check if the sipevent is of an incoming SIP RESPONSE.
event | the event to check. |
#define EVT_IS_KILL_TRANSACTION | ( | event | ) | (event->type==KILL_TRANSACTION) |
#define EVT_IS_MSG | ( | event | ) |
#include <osip.h>
Check if the sipevent is a SIP MESSAGE.
event | the event to check. |
#define EVT_IS_OUTGOINGMSG | ( | event | ) |
#include <osip.h>
Check if the sipevent is of an outgoing SIP MESSAGE.
event | the event to check. |
#define EVT_IS_OUTGOINGREQ | ( | event | ) |
#include <osip.h>
Check if the sipevent is of an outgoing SIP REQUEST.
event | the event to check. |
#define EVT_IS_OUTGOINGRESP | ( | event | ) |
#include <osip.h>
Check if the sipevent is of an outgoing SIP RESPONSE.
event | the event to check. |
#define EVT_IS_RCV_ACK | ( | event | ) | (event->type==RCV_REQACK) |
#define EVT_IS_RCV_INVITE | ( | event | ) | (event->type==RCV_REQINVITE) |
#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_ACK | ( | event | ) | (event->type==SND_REQACK) |
#define EVT_IS_SND_INVITE | ( | event | ) | (event->type==SND_REQINVITE) |
#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 OSIP_NAPTR_STATE_INPROGRESS 1 |
#define OSIP_NAPTR_STATE_NAPTRDONE 2 |
#define OSIP_NAPTR_STATE_NOTSUPPORTED 6 |
#define OSIP_NAPTR_STATE_RETRYLATER 5 |
#define OSIP_NAPTR_STATE_SRVDONE 4 |
#define OSIP_NAPTR_STATE_SRVINPROGRESS 3 |
#define OSIP_SRV_STATE_COMPLETED 3 |
#define OSIP_SRV_STATE_NOTSUPPORTED 4 |
#define OSIP_SRV_STATE_RETRYLATER 2 |
typedef enum osip_fsm_type_t osip_fsm_type_t |
#include <osip.h>
Enumeration for transaction type.
A transaction can be either of: ICT, IST, NICT, NIST,
typedef enum osip_kill_callback_type osip_kill_callback_type_t |
#include <osip.h>
Enumeration for callback type used when transaction is over.
osip_kill_transaction_cb_t |
typedef enum osip_message_callback_type osip_message_callback_type_t |
#include <osip.h>
Enumeration for callback type.
osip_message_cb_t |
#include <osip.h>
Enumeration for callback type used when a transport error is detected.
osip_transport_error_cb_t |
#include <osip.h>
Enumeration for transaction state.
Those states are extracted from the diagram found in rfc3261.txt
#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,
enum _state_t |
#include <osip.h>
Enumeration for transaction state.
Those states are extracted from the diagram found in rfc3261.txt
enum osip_fsm_type_t |
#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. |
#include <osip.h>
Enumeration for callback type used when transaction is over.
#include <osip.h>
Enumeration for callback type.
#include <osip.h>
Enumeration for callback type used when a transport error is detected.
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,
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).
osip | The element to work on. |
evt | The 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).
osip | The element to work on. |
evt | The element representing the new SIP REQUEST. |
void osip_event_free | ( | osip_event_t * | event | ) |
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.
osip | The element to work on. |
evt | The 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.
osip | The 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.
osip | The 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.
ict | The element to work on. |
destination | The destination host. |
port | The destination port. |
int osip_init | ( | osip_t ** | osip | ) |
int osip_ist_execute | ( | osip_t * | osip | ) |
#include <osip.h>
Consume ALL pending osip_event_t previously added in the fifos of ist transactions.
osip | The 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).
sip | The 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.
osip | The 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.
nict | The element to work on. |
destination | The destination host. |
port | The 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.
osip | The 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.
buf | The SIP message as a string. |
length | The length of the buffer to parse. |
void osip_release | ( | osip_t * | osip | ) |
int osip_remove_transaction | ( | osip_t * | osip, |
osip_transaction_t * | ict | ||
) |
#include <osip.h>
Remove a transaction from the osip stack.
osip | The element to work on. |
ict | The 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.
response | the message to work on. |
address | a pointer to receive the allocated host address. |
portnum | a pointer to receive the host port. |
void osip_retransmissions_execute | ( | osip_t * | osip | ) |
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.
osip | The element to work on. |
pointer | The 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.
cf | The osip element attached to the transaction. |
cb | The 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.
osip | The element to work on. |
type | The event type to hook on. |
cb | The 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.
osip | The element to work on. |
type | The event type to hook on. |
cb | The 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.
osip | The element to work on. |
type | The event type to hook on. |
cb | The 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.
osip | The osip_t structure. |
dialog | The dialog the 200 Ok is part of. |
msg200ok | The 200 ok response. |
sock | The 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.
osip | The osip_t structure. |
dialog | The dialog the ACK is part of. |
ack | The ACK that has just been sent in response to a 200 Ok. |
dest | The destination host. |
port | The destination port. |
sock | The 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.
osip | The osip_t structure. |
ack | The 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.
osip | The osip_t structure |
dialog | The 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.
osip | The element to work on. |
lower_tv | The 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.
osip | The element to work on. |
void osip_timers_ist_execute | ( | osip_t * | osip | ) |
#include <osip.h>
Check if an ist transactions needs a timer event.
osip | The element to work on. |
void osip_timers_nict_execute | ( | osip_t * | osip | ) |
#include <osip.h>
Check if a nict transactions needs a timer event.
osip | The element to work on. |
void osip_timers_nist_execute | ( | osip_t * | osip | ) |
#include <osip.h>
Check if a nist transactions needs a timer event.
osip | The 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.
transaction | The element to work on. |
evt | The 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.)
transaction | The element to free. |
evt | The 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).
transactions | The list of transactions to work on. |
evt | The 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.
transaction | The 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);
transaction | The 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)
transaction | The element to work on. |
ip | The ip of host where to send initial request. |
port | The 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.
transaction | The 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.
transaction | The 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.
transaction | The 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.
transaction | The 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.
transaction | The 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.
transaction | The 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...
transaction | The 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.
transaction | The element to allocate. |
ctx_type | The type of transaction. (ICT, IST, NICT, NIST) |
osip | The global instance of oSIP. |
request | The 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.
transaction | The element to work on. |
sock | The 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.
transaction | The element to work on. |
record | The 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.
transaction | The element to work on. |
sock | The 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().
transaction | The element to work on. |
ptr | The 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
transaction | The element to work on. |
ptr | The 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
transaction | The element to work on. |
ptr | The 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
transaction | The element to work on. |
ptr | The 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
transaction | The element to work on. |
ptr | The 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
transaction | The element to work on. |
ptr | The 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.
transaction | The element to work on. |
record | The 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().
transaction | The element to work on. |
ptr | The address of your context. |