libosip
5.3.0
|
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 |
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 |
#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.
#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.
#define DEFAULT_T2 4000 /* 4s */ |
You can re-define the default value for T2. (T2 is defined in rfcxxxx) The default value is 4000ms.
#define DEFAULT_T4 5000 /* 5s */ |
You can re-define the default value for T4. (T1 is defined in rfcxxxx) The default value is 5000ms.
#define EVT_IS_INCOMINGMSG | ( | event | ) | (event->type >= RCV_REQINVITE && event->type <= RCV_STATUS_3456XX) |
Check if the sipevent is of an incoming SIP MESSAGE.
event | the event to check. |
#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.
event | the event to check. |
#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.
event | the event to check. |
#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
event | the event to check. |
#define EVT_IS_MSG | ( | event | ) | (event->type >= RCV_REQINVITE && event->type <= SND_STATUS_3456XX) |
Check if the sipevent is a SIP MESSAGE.
event | the event to check. |
#define EVT_IS_OUTGOINGMSG | ( | event | ) | (event->type >= SND_REQINVITE && event->type <= SND_STATUS_3456XX) |
Check if the sipevent is of an outgoing SIP MESSAGE.
event | the event to check. |
#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.
event | the event to check. |
#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.
event | the event to check. |
#define EVT_IS_RCV_ACK | ( | event | ) | (event->type == RCV_REQACK) |
Check if the sipevent is of type RCV_REQACK.
event | the event to check. |
#define EVT_IS_RCV_INVITE | ( | event | ) | (event->type == RCV_REQINVITE) |
Check if the sipevent is of type RCV_REQINVITE.
event | the event to check. |
#define EVT_IS_RCV_REQUEST | ( | event | ) | (event->type == RCV_REQUEST) |
Check if the sipevent is of type RCV_REQUEST.
event | the event to check. |
#define EVT_IS_RCV_STATUS_1XX | ( | event | ) | (event->type == RCV_STATUS_1XX) |
Check if the sipevent is of type RCV_STATUS_1XX.
event | the event to check. |
#define EVT_IS_RCV_STATUS_2XX | ( | event | ) | (event->type == RCV_STATUS_2XX) |
Check if the sipevent is of type RCV_STATUS_2XX.
event | the event to check. |
#define EVT_IS_RCV_STATUS_3456XX | ( | event | ) | (event->type == RCV_STATUS_3456XX) |
Check if the sipevent is of type RCV_STATUS_3456XX.
event | the event to check. |
#define EVT_IS_SND_ACK | ( | event | ) | (event->type == SND_REQACK) |
Check if the sipevent is of type SND_REQACK.
event | the event to check. |
#define EVT_IS_SND_INVITE | ( | event | ) | (event->type == SND_REQINVITE) |
Check if the sipevent is of type SND_REQINVITE.
event | the event to check. |
#define EVT_IS_SND_REQUEST | ( | event | ) | (event->type == SND_REQUEST) |
Check if the sipevent is of type SND_REQUEST.
event | the event to check. |
#define EVT_IS_SND_STATUS_1XX | ( | event | ) | (event->type == SND_STATUS_1XX) |
Check if the sipevent is of type SND_STATUS_1XX.
event | the event to check. |
#define EVT_IS_SND_STATUS_2XX | ( | event | ) | (event->type == SND_STATUS_2XX) |
Check if the sipevent is of type SND_STATUS_2XX.
event | the event to check. |
#define EVT_IS_SND_STATUS_3456XX | ( | event | ) | (event->type == SND_STATUS_3456XX) |
Check if the sipevent is of type SND_STATUS_3456XX.
event | the event to check. |
#define OSIP_NAPTR_STATE_INPROGRESS 1 |
in progress
#define OSIP_NAPTR_STATE_NAPTRDONE 2 |
naptr done
#define OSIP_NAPTR_STATE_NOTSUPPORTED 6 |
not supported
#define OSIP_NAPTR_STATE_RETRYLATER 5 |
retry later
#define OSIP_NAPTR_STATE_SRVDONE 4 |
srv done
#define OSIP_NAPTR_STATE_SRVINPROGRESS 3 |
srv in progress
#define OSIP_NAPTR_STATE_UNKNOWN 0 |
unknown
#define OSIP_SRV_STATE_COMPLETED 3 |
completed
#define OSIP_SRV_STATE_NOTSUPPORTED 4 |
not supported
#define OSIP_SRV_STATE_RETRYLATER 2 |
retry later
#define OSIP_SRV_STATE_UNKNOWN 0 |
unknown
Structure for 2XX retransmission management.
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.
typedef enum osip_fsm_type_t osip_fsm_type_t |
Enumeration for transaction type. A transaction can be either of: ICT, IST, NICT, NIST,
Structure for INVITE CLIENT TRANSACTION (outgoing INVITE transaction).
Structure for INVITE SERVER TRANSACTION (incoming INVITE transaction).
typedef enum osip_kill_callback_type osip_kill_callback_type_t |
Enumeration for callback type used when transaction is over.
osip_kill_transaction_cb_t |
Callback definition for end of transaction announcements.
typedef enum osip_message_callback_type osip_message_callback_type_t |
Enumeration for callback type.
osip_message_cb_t |
Callback definition for message announcements.
Structure for NAPTR record.
Structure for NON-INVITE CLIENT TRANSACTION (outgoing NON-INVITE transaction).
Structure for NON-INVITE SERVER TRANSACTION (incoming SERVER transaction).
Structure for SRV record entry.
Structure for SRV record.
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.
Structure for transaction handling.
Enumeration for callback type used when a transport error is detected.
osip_transport_error_cb_t |
Callback definition for transport error announcements.
Enumeration for transaction state. Those states are extracted from the diagram found in rfc3261.txt
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 |
Enumeration for transaction state. Those states are extracted from the diagram found in rfc3261.txt
enum osip_fsm_type_t |
Enumeration for callback type used when transaction is over.
Enumeration for callback type.
Enumeration for callback type used when a transport error is detected.
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,
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).
osip | The element to work on. |
evt | The 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.
void osip_event_free | ( | osip_event_t * | event | ) |
Free all resource in a sipevent.
event | The event to free. |
References osip_message_free(), and osip_event::sip.
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..
osip | The element to work on. |
evt | The element representing the SIP MESSAGE. |
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.
osip | The element to work on. |
References osip::application_context.
int osip_ict_execute | ( | osip_t * | osip | ) |
Consume ALL pending osip_event_t previously added in the fifos of ict transactions.
osip | The 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.
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.
ict | The element to work on. |
destination | The destination host. |
port | The destination port. |
References osip_ict::destination, and osip_ict::port.
int osip_init | ( | osip_t ** | osip | ) |
Allocate an osip_t element.
osip | the element to allocate. |
References osip_list_init(), osip_mutex_init(), and parser_init().
int osip_ist_execute | ( | osip_t * | osip | ) |
Consume ALL pending osip_event_t previously added in the fifos of ist transactions.
osip | The 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_event_t* osip_new_outgoing_sipmessage | ( | osip_message_t * | sip | ) |
Allocate a sipevent (we know this message is an OUTGOING SIP message).
sip | The 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.
int osip_nict_execute | ( | osip_t * | osip | ) |
Consume ALL pending osip_event_t previously added in the fifos of nict transactions.
osip | The 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.
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.
nict | The element to work on. |
destination | The destination host. |
port | The destination port. |
References osip_nict::destination, and osip_nict::port.
int osip_nist_execute | ( | osip_t * | osip | ) |
Consume ALL pending osip_event_t previously added in the fifos of nist transactions.
osip | The 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_event_t* osip_parse | ( | const char * | buf, |
size_t | length | ||
) |
Create a sipevent from a SIP message string.
buf | The SIP message as a string. |
length | The 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.
void osip_release | ( | osip_t * | osip | ) |
Free all resource in a osip_t element.
osip | The 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().
int osip_remove_transaction | ( | osip_t * | osip, |
osip_transaction_t * | ict | ||
) |
Remove a transaction from the osip stack.
osip | The element to work on. |
ict | The transaction to add. |
References osip_transaction::ctx_type, ICT, IST, NICT, and NIST.
Referenced by osip_transaction_free().
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.
response | the message to work on. |
address | a pointer to receive the allocated host address. |
portnum | a 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().
void osip_retransmissions_execute | ( | osip_t * | osip | ) |
Send required retransmissions
osip | The element to work on. |
References ixt::counter, osip::ixt_retransmissions, osip_list_eol(), osip_list_get(), and osip_list_remove().
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.
osip | The element to work on. |
pointer | The element to set. |
References osip::application_context.
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.
cf | The osip element attached to the transaction. |
cb | The method we want to register. |
References osip::cb_send_message.
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.
osip | The element to work on. |
type | The event type to hook on. |
cb | The method to be called upon the event. |
References osip::kill_callbacks, and OSIP_KILL_CALLBACK_COUNT.
int osip_set_message_callback | ( | osip_t * | osip, |
int | type, | ||
osip_message_cb_t | cb | ||
) |
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. |
References osip::msg_callbacks, and OSIP_MESSAGE_CALLBACK_COUNT.
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.
osip | The element to work on. |
type | The event type to hook on. |
cb | The method to be called upon the event. |
References OSIP_TRANSPORT_ERROR_CALLBACK_COUNT, and osip::tp_error_callbacks.
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.
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). |
References ixt::dest, ixt::dialog, ixt::msg2xx, osip_message_clone(), osip_response_get_destination(), ixt::port, and ixt::sock.
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.
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). |
References ixt::ack, ixt::dest, ixt::dialog, osip_message_clone(), ixt::port, and ixt::sock.
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.
osip | The osip_t structure. |
ack | The 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().
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.
osip | The osip_t structure |
dialog | The dialog. |
References ixt::dialog, osip::ixt_retransmissions, osip_list_eol(), osip_list_get(), and osip_list_remove().
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.
osip | The element to work on. |
lower_tv | The 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().
void osip_timers_ict_execute | ( | osip_t * | osip | ) |
Check if an ict transactions needs a timer event.
osip | The element to work on. |
References osip_transaction::ict_context, osip::ict_fastmutex, osip_fifo_add(), osip_fifo_size(), osip::osip_ict_transactions, osip_list_get_first(), osip_list_get_next(), osip_list_iterator_has_elem, osip_mutex_lock(), osip_mutex_unlock(), osip_transaction::state, osip_transaction::transactionff, and osip_transaction::transactionid.
void osip_timers_ist_execute | ( | osip_t * | osip | ) |
Check if an ist transactions needs a timer event.
osip | The element to work on. |
References osip_transaction::ist_context, osip::ist_fastmutex, osip_fifo_add(), osip::osip_ist_transactions, osip_list_get_first(), osip_list_get_next(), osip_list_iterator_has_elem, osip_mutex_lock(), osip_mutex_unlock(), osip_transaction::state, osip_transaction::transactionff, and osip_transaction::transactionid.
void osip_timers_nict_execute | ( | osip_t * | osip | ) |
Check if a nict transactions needs a timer event.
osip | The element to work on. |
References osip_transaction::nict_context, osip::nict_fastmutex, osip_fifo_add(), osip_list_get_first(), osip_list_get_next(), osip_list_iterator_has_elem, osip_mutex_lock(), osip_mutex_unlock(), osip::osip_nict_transactions, osip_transaction::state, osip_transaction::transactionff, and osip_transaction::transactionid.
void osip_timers_nist_execute | ( | osip_t * | osip | ) |
Check if a nist transactions needs a timer event.
osip | The element to work on. |
References osip_transaction::nist_context, osip::nist_fastmutex, osip_fifo_add(), osip_list_get_first(), osip_list_get_next(), osip_list_iterator_has_elem, osip_mutex_lock(), osip_mutex_unlock(), osip::osip_nist_transactions, osip_transaction::state, osip_transaction::transactionff, and osip_transaction::transactionid.
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.
transaction | The element to work on. |
evt | The event to add. |
References osip_fifo_add(), osip_transaction::transactionff, osip_transaction::transactionid, and osip_event::transactionid.
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.)
transaction | The element to free. |
evt | The 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_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).
transactions | The list of transactions to work on. |
evt | The element representing the SIP MESSAGE. |
References osip_transaction::config, EVT_IS_INCOMINGREQ, EVT_IS_INCOMINGRESP, osip_uri_param::gvalue, MSG_IS_ACK, MSG_IS_INVITE, MSG_IS_RESPONSE_FOR, osip::osip_ict_hastable, osip::osip_ist_hastable, osip_list_get(), osip_list_get_first(), osip_list_get_next(), osip_list_iterator_has_elem, osip::osip_nict_hastable, osip::osip_nist_hastable, osip_via_param_get_byname, osip_event::sip, osip_transaction::transactionid, osip_event::transactionid, and osip_message::vias.
int osip_transaction_free | ( | osip_transaction_t * | transaction | ) |
Free all resource in a osip_transaction_t element.
transaction | The element to free. |
References osip_transaction::config, osip_remove_transaction(), osip_transaction_free2(), and osip_transaction::transactionid.
Referenced by osip_transaction_init().
int osip_transaction_free2 | ( | osip_transaction_t * | transaction | ) |
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. |
References osip_transaction::ack, osip_message::call_id, osip_transaction::callid, osip_transaction::cseq, osip_transaction::ctx_type, osip_transaction::from, ICT, osip_transaction::ict_context, IST, osip_transaction::ist_context, osip_transaction::last_response, NICT, osip_transaction::nict_context, osip_transaction::nist_context, osip_call_id::number, osip_transaction::orig_request, osip_call_id_free(), osip_cseq_free(), osip_fifo_free(), osip_fifo_tryget(), osip_from_free(), osip_message_free(), osip_to_free(), osip_via_free(), osip_event::sip, osip_transaction::to, osip_transaction::topvia, osip_transaction::transactionff, and osip_transaction::transactionid.
Referenced by osip_transaction_free().
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)
transaction | The element to work on. |
ip | The ip of host where to send initial request. |
port | The 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.
void* osip_transaction_get_reserved1 | ( | osip_transaction_t * | transaction | ) |
Get a pointer to your personal context associated with this transaction.
transaction | The element to work on. |
References osip_transaction::reserved1.
void* osip_transaction_get_reserved2 | ( | osip_transaction_t * | transaction | ) |
Get a pointer to your personal context associated with this transaction.
transaction | The element to work on. |
References osip_transaction::reserved2.
void* osip_transaction_get_reserved3 | ( | osip_transaction_t * | transaction | ) |
Get a pointer to your personal context associated with this transaction.
transaction | The element to work on. |
References osip_transaction::reserved3.
void* osip_transaction_get_reserved4 | ( | osip_transaction_t * | transaction | ) |
Get a pointer to your personal context associated with this transaction.
transaction | The element to work on. |
References osip_transaction::reserved4.
void* osip_transaction_get_reserved5 | ( | osip_transaction_t * | transaction | ) |
Get a pointer to your personal context associated with this transaction.
transaction | The element to work on. |
References osip_transaction::reserved5.
void* osip_transaction_get_reserved6 | ( | osip_transaction_t * | transaction | ) |
Get a pointer to your personal context associated with this transaction.
transaction | The element to work on. |
References osip_transaction::reserved6.
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...
transaction | The element to work on. |
References osip_transaction::reserved1.
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.
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. |
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().
int osip_transaction_set_in_socket | ( | osip_transaction_t * | transaction, |
int | sock | ||
) |
Set the socket for incoming message.
transaction | The element to work on. |
sock | The socket for incoming message. |
References osip_transaction::in_socket.
int osip_transaction_set_naptr_record | ( | osip_transaction_t * | transaction, |
osip_naptr_t * | record | ||
) |
Set NAPTR lookup information to be used by state machine.
transaction | The element to work on. |
record | The NAPTR lookup results for this transaction. |
References osip_transaction::naptr_record.
int osip_transaction_set_out_socket | ( | osip_transaction_t * | transaction, |
int | sock | ||
) |
Set the socket for outgoing message.
transaction | The element to work on. |
sock | The socket for outgoing message. |
References osip_transaction::out_socket.
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().
transaction | The element to work on. |
ptr | The address of your context. |
References osip_transaction::reserved1.
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
transaction | The element to work on. |
ptr | The address of your context. |
References osip_transaction::reserved2.
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
transaction | The element to work on. |
ptr | The address of your context. |
References osip_transaction::reserved3.
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
transaction | The element to work on. |
ptr | The address of your context. |
References osip_transaction::reserved4.
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
transaction | The element to work on. |
ptr | The address of your context. |
References osip_transaction::reserved5.
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
transaction | The element to work on. |
ptr | The address of your context. |
References osip_transaction::reserved6.
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.
transaction | The element to work on. |
record | The SRV lookup results for this transaction. |
References osip_transaction::record.
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().
transaction | The element to work on. |
ptr | The address of your context. |
References osip_transaction::reserved1.