| osip.h | | osip.h | |
| | | | |
| skipping to change at line 52 | | skipping to change at line 52 | |
| * | | * | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @defgroup oSIP_FSM oSIP fsm Handling | | * @defgroup oSIP_FSM oSIP fsm Handling | |
| * @ingroup osip2_fsm | | * @ingroup osip2_fsm | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
|
| extern "C" | | extern "C" { | |
| { | | | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * Enumeration for transaction state. | | * Enumeration for transaction state. | |
| * Those states are extracted from the diagram found in rfc3261.txt | | * Those states are extracted from the diagram found in rfc3261.txt | |
| * | | * | |
| */ | | */ | |
|
| typedef enum _state_t | | typedef enum _state_t { | |
| { | | /* STATES for invite client transaction */ | |
| /* STATES for invite client transaction */ | | ICT_PRE_CALLING, | |
| ICT_PRE_CALLING, | | ICT_CALLING, | |
| ICT_CALLING, | | ICT_PROCEEDING, | |
| ICT_PROCEEDING, | | ICT_COMPLETED, | |
| ICT_COMPLETED, | | ICT_TERMINATED, | |
| ICT_TERMINATED, | | | |
| | | | |
|
| /* STATES for invite server transaction */ | | /* STATES for invite server transaction */ | |
| IST_PRE_PROCEEDING, | | IST_PRE_PROCEEDING, | |
| IST_PROCEEDING, | | IST_PROCEEDING, | |
| IST_COMPLETED, | | IST_COMPLETED, | |
| IST_CONFIRMED, | | IST_CONFIRMED, | |
| IST_TERMINATED, | | IST_TERMINATED, | |
| | | | |
|
| /* STATES for NON-invite client transaction */ | | /* STATES for NON-invite client transaction */ | |
| NICT_PRE_TRYING, | | NICT_PRE_TRYING, | |
| NICT_TRYING, | | NICT_TRYING, | |
| NICT_PROCEEDING, | | NICT_PROCEEDING, | |
| NICT_COMPLETED, | | NICT_COMPLETED, | |
| NICT_TERMINATED, | | NICT_TERMINATED, | |
| | | | |
|
| /* STATES for NON-invite server transaction */ | | /* STATES for NON-invite server transaction */ | |
| NIST_PRE_TRYING, | | NIST_PRE_TRYING, | |
| NIST_TRYING, | | NIST_TRYING, | |
| NIST_PROCEEDING, | | NIST_PROCEEDING, | |
| NIST_COMPLETED, | | NIST_COMPLETED, | |
| NIST_TERMINATED, | | NIST_TERMINATED, | |
| | | | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
|
| DIALOG_EARLY, | | DIALOG_EARLY, | |
| DIALOG_CONFIRMED, | | DIALOG_CONFIRMED, | |
| DIALOG_CLOSE /* ?? */ | | DIALOG_CLOSE /* ?? */ | |
| #endif | | #endif | |
|
| } | | } state_t; | |
| state_t; | | | |
| | | | |
| /** | | /** | |
| * Enumeration for event type. | | * Enumeration for event type. | |
| * <BR>The list of values that you need to know is reduced to this: | | * <BR>The list of values that you need to know is reduced to this: | |
| * <BR> RCV_REQINVITE, | | * <BR> RCV_REQINVITE, | |
| * <BR> RCV_REQACK, | | * <BR> RCV_REQACK, | |
| * <BR> RCV_REQUEST, | | * <BR> RCV_REQUEST, | |
| * <BR> RCV_STATUS_1XX, | | * <BR> RCV_STATUS_1XX, | |
| * <BR> RCV_STATUS_2XX, | | * <BR> RCV_STATUS_2XX, | |
| * <BR> RCV_STATUS_3456XX, | | * <BR> RCV_STATUS_3456XX, | |
| *<BR> | | *<BR> | |
| * <BR> SND_REQINVITE, | | * <BR> SND_REQINVITE, | |
| * <BR> SND_REQACK, | | * <BR> SND_REQACK, | |
| * <BR> SND_REQUEST, | | * <BR> SND_REQUEST, | |
| * <BR> SND_STATUS_1XX, | | * <BR> SND_STATUS_1XX, | |
| * <BR> SND_STATUS_2XX, | | * <BR> SND_STATUS_2XX, | |
| * <BR> SND_STATUS_3456XX, | | * <BR> SND_STATUS_3456XX, | |
| */ | | */ | |
|
| typedef enum type_t | | typedef enum type_t { | |
| { | | /* TIMEOUT EVENTS for ICT */ | |
| /* TIMEOUT EVENTS for ICT */ | | TIMEOUT_A, | |
| TIMEOUT_A, /**< Timer A */ | | /**< Timer A */ | |
| TIMEOUT_B, /**< Timer B */ | | TIMEOUT_B, | |
| TIMEOUT_D, /**< Timer D */ | | /**< Timer B */ | |
| | | TIMEOUT_D, | |
| | | /**< Timer D */ | |
| | | | |
|
| /* TIMEOUT EVENTS for NICT */ | | /* TIMEOUT EVENTS for NICT */ | |
| TIMEOUT_E, /**< Timer E */ | | TIMEOUT_E, | |
| TIMEOUT_F, /**< Timer F */ | | /**< Timer E */ | |
| TIMEOUT_K, /**< Timer K */ | | TIMEOUT_F, | |
| | | /**< Timer F */ | |
| | | TIMEOUT_K, | |
| | | /**< Timer K */ | |
| | | | |
|
| /* TIMEOUT EVENTS for IST */ | | /* TIMEOUT EVENTS for IST */ | |
| TIMEOUT_G, /**< Timer G */ | | TIMEOUT_G, | |
| TIMEOUT_H, /**< Timer H */ | | /**< Timer G */ | |
| TIMEOUT_I, /**< Timer I */ | | TIMEOUT_H, | |
| | | /**< Timer H */ | |
| | | TIMEOUT_I, | |
| | | /**< Timer I */ | |
| | | | |
|
| /* TIMEOUT EVENTS for NIST */ | | /* TIMEOUT EVENTS for NIST */ | |
| TIMEOUT_J, /**< Timer J */ | | TIMEOUT_J, | |
| | | /**< Timer J */ | |
| | | | |
|
| /* FOR INCOMING MESSAGE */ | | /* FOR INCOMING MESSAGE */ | |
| RCV_REQINVITE, /**< Event is an incoming INVITE request */ | | RCV_REQINVITE,/**< Event is an incoming INVITE request */ | |
| RCV_REQACK, /**< Event is an incoming ACK request */ | | RCV_REQACK, /**< Event is an incoming ACK request */ | |
| RCV_REQUEST, /**< Event is an incoming NON-INVITE and NON-ACK requ | | RCV_REQUEST, /**< Event is an incoming NON-INVITE and NON-A | |
| est */ | | CK request */ | |
| RCV_STATUS_1XX, /**< Event is an incoming informational response */ | | RCV_STATUS_1XX, | |
| RCV_STATUS_2XX, /**< Event is an incoming 2XX response */ | | /**< Event is an incoming informat | |
| RCV_STATUS_3456XX,/**< Event is an incoming final response (not 2XX) */ | | ional response */ | |
| | | RCV_STATUS_2XX, | |
| | | /**< Event is an incoming 2XX resp | |
| | | onse */ | |
| | | RCV_STATUS_3456XX, | |
| | | /**< Event is an incoming final re | |
| | | sponse (not 2XX) */ | |
| | | | |
|
| /* FOR OUTGOING MESSAGE */ | | /* FOR OUTGOING MESSAGE */ | |
| SND_REQINVITE, /**< Event is an outgoing INVITE request */ | | SND_REQINVITE,/**< Event is an outgoing INVITE request */ | |
| SND_REQACK, /**< Event is an outgoing ACK request */ | | SND_REQACK, /**< Event is an outgoing ACK request */ | |
| SND_REQUEST, /**< Event is an outgoing NON-INVITE and NON-ACK requ | | SND_REQUEST, /**< Event is an outgoing NON-INVITE and NON-A | |
| est */ | | CK request */ | |
| SND_STATUS_1XX, /**< Event is an outgoing informational response */ | | SND_STATUS_1XX, | |
| SND_STATUS_2XX, /**< Event is an outgoing 2XX response */ | | /**< Event is an outgoing informat | |
| SND_STATUS_3456XX,/**< Event is an outgoing final response (not 2XX) */ | | ional response */ | |
| | | SND_STATUS_2XX, | |
| | | /**< Event is an outgoing 2XX resp | |
| | | onse */ | |
| | | SND_STATUS_3456XX, | |
| | | /**< Event is an outgoing final re | |
| | | sponse (not 2XX) */ | |
| | | | |
|
| KILL_TRANSACTION, /**< Event to 'kill' the transaction before terminati | | KILL_TRANSACTION, | |
| on */ | | /**< Event to 'kill' the transacti | |
| UNKNOWN_EVT | | on before termination */ | |
| } | | UNKNOWN_EVT | |
| type_t; | | } type_t; | |
| | | | |
| /** | | /** | |
| * Enumeration for transaction type. | | * Enumeration for transaction type. | |
| * A transaction can be either of: | | * A transaction can be either of: | |
| * ICT, | | * ICT, | |
| * IST, | | * IST, | |
| * NICT, | | * NICT, | |
| * NIST, | | * NIST, | |
| */ | | */ | |
|
| typedef enum osip_fsm_type_t | | typedef enum osip_fsm_type_t { | |
| { | | ICT, | |
| ICT, /**< Invite Client (outgoing) Transaction */ | | /**< Invite Client (outgoing) Transaction */ | |
| IST, /**< Invite Server (incoming) Transaction */ | | IST, | |
| NICT,/**< Non-Invite Client (outgoing) Transaction */ | | /**< Invite Server (incoming) Transaction */ | |
| NIST /**< Non-Invite Server (incoming) Transaction */ | | NICT, | |
| } | | /**< Non-Invite Client (outgoing) Transaction */ | |
| osip_fsm_type_t; | | NIST | |
| | | /**< Non-Invite Server (incoming) Transaction */ | |
| | | } osip_fsm_type_t; | |
| | | | |
| #ifndef DEFAULT_T1 | | #ifndef DEFAULT_T1 | |
| /** | | /** | |
| * You can re-define the default value for T1. (T1 is defined in rfcxxxx) | | * You can re-define the default value for T1. (T1 is defined in rfcxxxx) | |
| * The default value is 500ms. | | * The default value is 500ms. | |
| */ | | */ | |
|
| #define DEFAULT_T1 500 /* 500 ms */ | | #define DEFAULT_T1 500 /* 500 ms */ | |
| #endif | | #endif | |
| #ifndef DEFAULT_T2 | | #ifndef DEFAULT_T2 | |
| /** | | /** | |
| * You can re-define the default value for T2. (T2 is defined in rfcxxxx) | | * You can re-define the default value for T2. (T2 is defined in rfcxxxx) | |
| * The default value is 4000ms. | | * The default value is 4000ms. | |
| */ | | */ | |
|
| #define DEFAULT_T2 4000 /* 4s */ | | #define DEFAULT_T2 4000 /* 4s */ | |
| #endif | | #endif | |
| #ifndef DEFAULT_T4 | | #ifndef DEFAULT_T4 | |
| /** | | /** | |
| * You can re-define the default value for T4. (T1 is defined in rfcxxxx) | | * You can re-define the default value for T4. (T1 is defined in rfcxxxx) | |
| * The default value is 5000ms. | | * The default value is 5000ms. | |
| */ | | */ | |
|
| #define DEFAULT_T4 5000 /* 5s */ | | #define DEFAULT_T4 5000 /* 5s */ | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * Structure for INVITE CLIENT TRANSACTION (outgoing INVITE transaction). | | * Structure for INVITE CLIENT TRANSACTION (outgoing INVITE transaction). | |
| * @var osip_ict_t | | * @var osip_ict_t | |
| */ | | */ | |
|
| typedef struct osip_ict osip_ict_t; | | typedef struct osip_ict osip_ict_t; | |
| | | | |
| /** | | /** | |
| * Structure for INVITE CLIENT TRANSACTION. | | * Structure for INVITE CLIENT TRANSACTION. | |
| * @struct osip_ict | | * @struct osip_ict | |
| */ | | */ | |
|
| struct osip_ict | | struct osip_ict { | |
| { | | int timer_a_length; /**@internal A=T1, A=2xT1. | |
| int timer_a_length; /**@internal A=T1, A=2xT1... (unreliable | | .. (unreliable only) */ | |
| only) */ | | struct timeval timer_a_start; | |
| struct timeval timer_a_start; /**@internal */ | | /**@intern | |
| int timer_b_length; /**@internal B = 64* T1 */ | | al */ | |
| struct timeval timer_b_start; /**@internal fire when transaction timeou | | int timer_b_length; /**@internal B = 64* T1 */ | |
| ts */ | | struct timeval timer_b_start; | |
| int timer_d_length; /**@internal D >= 32s for unreliable tr ( | | /**@intern | |
| or 0) */ | | al fire when transaction timeouts */ | |
| struct timeval timer_d_start; /**@internal should be equal to timer H * | | int timer_d_length; /**@internal D >= 32s for | |
| / | | unreliable tr (or 0) */ | |
| char *destination; /**@internal url used to send requests */ | | struct timeval timer_d_start; | |
| int port; /**@internal port of next hop */ | | /**@intern | |
| }; | | al should be equal to timer H */ | |
| | | char *destination; /**@internal url used to s | |
| | | end requests */ | |
| | | int port; /**@internal port | |
| | | of next hop */ | |
| | | }; | |
| | | | |
| /** | | /** | |
| * Structure for NON-INVITE CLIENT TRANSACTION (outgoing NON-INVITE transac
tion). | | * Structure for NON-INVITE CLIENT TRANSACTION (outgoing NON-INVITE transac
tion). | |
| * @var osip_nict_t | | * @var osip_nict_t | |
| */ | | */ | |
|
| typedef struct osip_nict osip_nict_t; | | typedef struct osip_nict osip_nict_t; | |
| | | | |
| /** | | /** | |
| * Structure for NON-INVITE CLIENT TRANSACTION. | | * Structure for NON-INVITE CLIENT TRANSACTION. | |
| * @struct osip_nict | | * @struct osip_nict | |
| */ | | */ | |
|
| struct osip_nict | | struct osip_nict { | |
| { | | int timer_e_length; /**@internal A=T1, A=2xT1. | |
| int timer_e_length; /**@internal A=T1, A=2xT1... (unreliable | | .. (unreliable only) */ | |
| only) */ | | struct timeval timer_e_start; | |
| struct timeval timer_e_start; /**@internal */ | | /**@intern | |
| int timer_f_length; /**@internal B = 64* T1 */ | | al */ | |
| struct timeval timer_f_start; /**@internal fire when transaction timeou | | int timer_f_length; /**@internal B = 64* T1 */ | |
| ts */ | | struct timeval timer_f_start; | |
| int timer_k_length; /**@internal K = T4 (else = 0) */ | | /**@intern | |
| struct timeval timer_k_start; /**@internal */ | | al fire when transaction timeouts */ | |
| char *destination; /**@internal url used to send requests */ | | int timer_k_length; /**@internal K = T4 (else | |
| int port; /**@internal port of next hop */ | | = 0) */ | |
| | | struct timeval timer_k_start; | |
| | | /**@intern | |
| | | al */ | |
| | | char *destination; /**@internal url used to s | |
| | | end requests */ | |
| | | int port; /**@internal port | |
| | | of next hop */ | |
| | | | |
|
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Structure for INVITE SERVER TRANSACTION (incoming INVITE transaction). | | * Structure for INVITE SERVER TRANSACTION (incoming INVITE transaction). | |
| * @var osip_ist_t | | * @var osip_ist_t | |
| */ | | */ | |
|
| typedef struct osip_ist osip_ist_t; | | typedef struct osip_ist osip_ist_t; | |
| | | | |
| /** | | /** | |
| * Structure for INVITE SERVER TRANSACTION. | | * Structure for INVITE SERVER TRANSACTION. | |
| * @struct osip_ist | | * @struct osip_ist | |
| */ | | */ | |
|
| struct osip_ist | | struct osip_ist { | |
| { | | int timer_g_length; /**@internal G=MIN(T1*2,T2) for unr | |
| int timer_g_length; /**@internal G=MIN(T1*2,T2) for unreliable tra | | eliable trans. */ | |
| ns. */ | | struct timeval timer_g_start; | |
| struct timeval timer_g_start; /**@internal 0 when reliable transport is | | /**@intern | |
| used */ | | al 0 when reliable transport is used */ | |
| int timer_h_length; /**@internal H = 64* T1 */ | | int timer_h_length; /**@internal H = 64* T1 */ | |
| struct timeval timer_h_start; /**@internal fire when if no ACK is recei | | struct timeval timer_h_start; | |
| ved */ | | /**@intern | |
| int timer_i_length; /**@internal I = T4 for unreliable (or 0) | | al fire when if no ACK is received */ | |
| */ | | int timer_i_length; /**@internal I = T4 for un | |
| struct timeval timer_i_start; /**@internal absorb all ACK */ | | reliable (or 0) */ | |
| }; | | struct timeval timer_i_start; | |
| | | /**@intern | |
| | | al absorb all ACK */ | |
| | | }; | |
| | | | |
| /** | | /** | |
| * Structure for NON-INVITE SERVER TRANSACTION (incoming SERVER transaction
). | | * Structure for NON-INVITE SERVER TRANSACTION (incoming SERVER transaction
). | |
| * @var osip_nist_t | | * @var osip_nist_t | |
| */ | | */ | |
|
| typedef struct osip_nist osip_nist_t; | | typedef struct osip_nist osip_nist_t; | |
| | | | |
| /** | | /** | |
| * Structure for NON-INVITE SERVER TRANSACTION. | | * Structure for NON-INVITE SERVER TRANSACTION. | |
| * @struct osip_nist | | * @struct osip_nist | |
| */ | | */ | |
|
| struct osip_nist | | struct osip_nist { | |
| { | | int timer_j_length; /**@internal J = 64*T1 (e | |
| int timer_j_length; /**@internal J = 64*T1 (else 0) */ | | lse 0) */ | |
| struct timeval timer_j_start; /**@internal */ | | struct timeval timer_j_start; | |
| }; | | /**@inter | |
| | | nal */ | |
| | | }; | |
| | | | |
| /** | | /** | |
| * Structure for SRV record entry. | | * Structure for SRV record entry. | |
| * @var osip_srv_entry_t | | * @var osip_srv_entry_t | |
| */ | | */ | |
|
| typedef struct osip_srv_entry osip_srv_entry_t; | | typedef struct osip_srv_entry osip_srv_entry_t; | |
| | | | |
| /** | | /** | |
| * Structure for SRV record entry. | | * Structure for SRV record entry. | |
| * @struct osip_srv_entry | | * @struct osip_srv_entry | |
| */ | | */ | |
| | | | |
|
| struct osip_srv_entry { | | struct osip_srv_entry { | |
| char srv[512]; | | char srv[512]; | |
| int priority; | | int priority; | |
| int weight; | | int weight; | |
| int rweight; | | int rweight; | |
| int port; | | int port; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Structure for SRV record. | | * Structure for SRV record. | |
| * @var osip_srv_record_t | | * @var osip_srv_record_t | |
| */ | | */ | |
|
| typedef struct osip_srv_record osip_srv_record_t; | | typedef struct osip_srv_record osip_srv_record_t; | |
| | | | |
| /** | | /** | |
| * Structure for SRV record entry. | | * Structure for SRV record entry. | |
| * @struct osip_srv_record | | * @struct osip_srv_record | |
| */ | | */ | |
|
| struct osip_srv_record { | | struct osip_srv_record { | |
| char name[512]; | | char name[512]; | |
| char protocol[64]; | | char protocol[64]; | |
| struct osip_srv_entry srventry[10]; | | struct osip_srv_entry srventry[10]; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Structure for transaction handling. | | * Structure for transaction handling. | |
| * @var osip_transaction_t | | * @var osip_transaction_t | |
| */ | | */ | |
|
| typedef struct osip_transaction osip_transaction_t; | | typedef struct osip_transaction osip_transaction_t; | |
| | | | |
| /** | | /** | |
| * Structure for transaction handling | | * Structure for transaction handling | |
| * @struct osip_transaction | | * @struct osip_transaction | |
| */ | | */ | |
|
| struct osip_transaction | | struct osip_transaction { | |
| { | | | |
| | | | |
|
| void *your_instance; /**< User Defined Pointer. */ | | void *your_instance; /**< User Defined Pointer. */ | |
| int transactionid; /**< Internal Transaction Identifier. */ | | int transactionid; /**< Internal Transaction Id | |
| osip_fifo_t *transactionff; /**< events must be added in this fifo */ | | entifier. */ | |
| | | osip_fifo_t *transactionff; | |
| | | /**< events | |
| | | must be added in this fifo */ | |
| | | | |
|
| osip_via_t *topvia; /**< CALL-LEG definition (Top Via) */ | | osip_via_t *topvia; /**< CALL-LEG definition (To | |
| osip_from_t *from; /**< CALL-LEG definition (From) */ | | p Via) */ | |
| osip_to_t *to; /**< CALL-LEG definition (To) */ | | osip_from_t *from; /**< CALL-LEG definition (Fr | |
| osip_call_id_t *callid; /**< CALL-LEG definition (Call-ID) */ | | om) */ | |
| osip_cseq_t *cseq; /**< CALL-LEG definition (CSeq) */ | | osip_to_t *to; /**< CALL-LEG definition (To | |
| | | ) */ | |
| | | osip_call_id_t *callid; /**< CALL-LEG definition (Call-ID) * | |
| | | / | |
| | | osip_cseq_t *cseq; /**< CALL-LEG definition (CS | |
| | | eq) */ | |
| | | | |
|
| osip_message_t *orig_request; /**< Initial request */ | | osip_message_t *orig_request; | |
| osip_message_t *last_response; /**< Last response */ | | /**< Init | |
| osip_message_t *ack; /**< ack request sent */ | | ial request */ | |
| | | osip_message_t *last_response; | |
| | | /**< Last | |
| | | response */ | |
| | | osip_message_t *ack; /**< ack request sent * | |
| | | / | |
| | | | |
|
| state_t state; /**< Current state of the transaction */ | | state_t state; /**< Current state of the tr
ansaction */ | |
| | | | |
|
| time_t birth_time; /**< birth date of transaction */ | | time_t birth_time; /**< birth date of transacti | |
| time_t completed_time; /**< end date of transaction */ | | on */ | |
| | | time_t completed_time; /**< end date of transaction | |
| | | */ | |
| | | | |
|
| int in_socket; /**< Optional socket for incoming message * | | int in_socket; /**< Optional socket for inc | |
| / | | oming message */ | |
| int out_socket; /**< Optional place for outgoing message */ | | int out_socket; /**< Optional place for outg | |
| | | oing message */ | |
| | | | |
|
| void *config; /**@internal transaction is managed by osip
_t */ | | void *config; /**@internal transaction is
managed by osip_t */ | |
| | | | |
|
| osip_fsm_type_t ctx_type; /**< Type of the transaction */ | | osip_fsm_type_t ctx_type; | |
| osip_ict_t *ict_context; /**@internal */ | | /**< Type of | |
| osip_ist_t *ist_context; /**@internal */ | | the transaction */ | |
| osip_nict_t *nict_context; /**@internal */ | | osip_ict_t *ict_context;/**@internal */ | |
| osip_nist_t *nist_context; /**@internal */ | | osip_ist_t *ist_context;/**@internal */ | |
| | | osip_nict_t *nict_context; | |
| | | /**@internal | |
| | | */ | |
| | | osip_nist_t *nist_context; | |
| | | /**@internal | |
| | | */ | |
| | | | |
|
| osip_srv_record_t record; /**@internal */ | | osip_srv_record_t record; | |
| }; | | /**@internal | |
| | | */ | |
| | | }; | |
| | | | |
| /** | | /** | |
| * Enumeration for callback type. | | * Enumeration for callback type. | |
| */ | | */ | |
|
| typedef enum osip_message_callback_type | | typedef enum osip_message_callback_type { | |
| { | | OSIP_ICT_INVITE_SENT = 0, /**< INVITE | |
| OSIP_ICT_INVITE_SENT = 0, /**< INVITE MESSAGE SENT */ | | MESSAGE SENT */ | |
| OSIP_ICT_INVITE_SENT_AGAIN, /**< INVITE MESSAGE RETRANSMITT | | OSIP_ICT_INVITE_SENT_AGAIN, /**< INVITE | |
| ED */ | | MESSAGE RETRANSMITTED */ | |
| OSIP_ICT_ACK_SENT, /**< ACK MESSAGE SENT */ | | OSIP_ICT_ACK_SENT, /**< | |
| OSIP_ICT_ACK_SENT_AGAIN, /**< ACK MESSAGE RETRANSMITTED | | ACK MESSAGE SENT */ | |
| */ | | OSIP_ICT_ACK_SENT_AGAIN, /**< ACK MES | |
| OSIP_ICT_STATUS_1XX_RECEIVED, /**< 1XX FOR INVITE RECEIVED */ | | SAGE RETRANSMITTED */ | |
| OSIP_ICT_STATUS_2XX_RECEIVED, /**< 2XX FOR INVITE RECEIVED */ | | OSIP_ICT_STATUS_1XX_RECEIVED, /**< 1XX FOR INVITE | |
| OSIP_ICT_STATUS_2XX_RECEIVED_AGAIN, /**< 2XX FOR INVITE RECEIVED AG | | RECEIVED */ | |
| AIN */ | | OSIP_ICT_STATUS_2XX_RECEIVED, /**< 2XX FOR INVITE | |
| OSIP_ICT_STATUS_3XX_RECEIVED, /**< 3XX FOR INVITE RECEIVED */ | | RECEIVED */ | |
| OSIP_ICT_STATUS_4XX_RECEIVED, /**< 4XX FOR INVITE RECEIVED */ | | OSIP_ICT_STATUS_2XX_RECEIVED_AGAIN, /**< 2XX FOR INVITE | |
| OSIP_ICT_STATUS_5XX_RECEIVED, /**< 5XX FOR INVITE RECEIVED */ | | RECEIVED AGAIN */ | |
| OSIP_ICT_STATUS_6XX_RECEIVED, /**< 6XX FOR INVITE RECEIVED */ | | OSIP_ICT_STATUS_3XX_RECEIVED, /**< 3XX FOR INVITE | |
| OSIP_ICT_STATUS_3456XX_RECEIVED_AGAIN, /**< RESPONSE RECEIVED AGAIN */ | | 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, /**< INVITE | |
| OSIP_IST_INVITE_RECEIVED_AGAIN, /**< INVITE MESSAGE RECEIVED AG | | MESSAGE RECEIVED */ | |
| AN */ | | OSIP_IST_INVITE_RECEIVED_AGAIN, /**< INVITE MESSAGE | |
| OSIP_IST_ACK_RECEIVED, /**< ACK MESSAGE RECEIVED */ | | RECEIVED AGAN */ | |
| OSIP_IST_ACK_RECEIVED_AGAIN, /**< ACK MESSAGE RECEIVED AGAIN | | OSIP_IST_ACK_RECEIVED, /**< ACK MES | |
| */ | | SAGE RECEIVED */ | |
| OSIP_IST_STATUS_1XX_SENT, /**< 1XX FOR INVITE SENT */ | | OSIP_IST_ACK_RECEIVED_AGAIN, /**< ACK MESSAGE REC | |
| OSIP_IST_STATUS_2XX_SENT, /**< 2XX FOR INVITE SENT */ | | EIVED AGAIN */ | |
| OSIP_IST_STATUS_2XX_SENT_AGAIN, /**< 2XX FOR INVITE RETRANSMITT | | OSIP_IST_STATUS_1XX_SENT, /**< 1XX FOR | |
| ED */ | | INVITE SENT */ | |
| OSIP_IST_STATUS_3XX_SENT, /**< 3XX FOR INVITE SENT */ | | OSIP_IST_STATUS_2XX_SENT, /**< 2XX FOR | |
| OSIP_IST_STATUS_4XX_SENT, /**< 4XX FOR INVITE SENT */ | | INVITE SENT */ | |
| OSIP_IST_STATUS_5XX_SENT, /**< 5XX FOR INVITE SENT */ | | OSIP_IST_STATUS_2XX_SENT_AGAIN, /**< 2XX FOR INVITE | |
| OSIP_IST_STATUS_6XX_SENT, /**< 6XX FOR INVITE SENT */ | | RETRANSMITTED */ | |
| OSIP_IST_STATUS_3456XX_SENT_AGAIN, /**< RESPONSE 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 RETRAN | |
| | | SMITTED */ | |
| | | | |
|
| OSIP_NICT_REGISTER_SENT, /**< REGISTER MESSAGE SENT */ | | OSIP_NICT_REGISTER_SENT, /**< REGISTE | |
| OSIP_NICT_BYE_SENT, /**< BYE MESSAGE SENT */ | | R MESSAGE SENT */ | |
| OSIP_NICT_OPTIONS_SENT, /**< OPTIONS MESSAGE SENT */ | | OSIP_NICT_BYE_SENT, /**< | |
| OSIP_NICT_INFO_SENT, /**< INFO MESSAGE SENT */ | | BYE MESSAGE SENT */ | |
| OSIP_NICT_CANCEL_SENT, /**< CANCEL MESSAGE SENT */ | | OSIP_NICT_OPTIONS_SENT, /**< OPTIONS | |
| OSIP_NICT_NOTIFY_SENT, /**< NOTIFY MESSAGE SENT */ | | MESSAGE SENT */ | |
| OSIP_NICT_SUBSCRIBE_SENT, /**< SUBSCRIBE MESSAGE SENT */ | | OSIP_NICT_INFO_SENT, /**< INFO ME | |
| OSIP_NICT_UNKNOWN_REQUEST_SENT, /**< UNKNOWN REQUEST MESSAGE SE | | SSAGE SENT */ | |
| NT */ | | OSIP_NICT_CANCEL_SENT, /**< CANCEL | |
| OSIP_NICT_REQUEST_SENT_AGAIN, /**< REQUEST MESSAGE RETRANMITT | | MESSAGE SENT */ | |
| ED */ | | OSIP_NICT_NOTIFY_SENT, /**< NOTIFY | |
| OSIP_NICT_STATUS_1XX_RECEIVED, /**< 1XX FOR MESSAGE RECEIVED * | | MESSAGE SENT */ | |
| / | | OSIP_NICT_SUBSCRIBE_SENT, /**< SUBSCRI | |
| OSIP_NICT_STATUS_2XX_RECEIVED, /**< 2XX FOR MESSAGE RECEIVED * | | BE MESSAGE SENT */ | |
| / | | OSIP_NICT_UNKNOWN_REQUEST_SENT, /**< UNKNOWN REQUEST | |
| OSIP_NICT_STATUS_2XX_RECEIVED_AGAIN, /**< 2XX FOR MESSAGE RECEIVED A | | MESSAGE SENT */ | |
| GAIN */ | | OSIP_NICT_REQUEST_SENT_AGAIN, /**< REQUEST MESSAGE | |
| OSIP_NICT_STATUS_3XX_RECEIVED, /**< 3XX FOR MESSAGE RECEIVED * | | RETRANMITTED */ | |
| / | | OSIP_NICT_STATUS_1XX_RECEIVED, /**< 1XX FOR MESSAGE | |
| OSIP_NICT_STATUS_4XX_RECEIVED, /**< 4XX FOR MESSAGE RECEIVED * | | RECEIVED */ | |
| / | | OSIP_NICT_STATUS_2XX_RECEIVED, /**< 2XX FOR MESSAGE | |
| OSIP_NICT_STATUS_5XX_RECEIVED, /**< 5XX FOR MESSAGE RECEIVED * | | RECEIVED */ | |
| / | | OSIP_NICT_STATUS_2XX_RECEIVED_AGAIN,/**< 2XX FOR MESSAGE REC | |
| OSIP_NICT_STATUS_6XX_RECEIVED, /**< 6XX FOR MESSAGE RECEIVED * | | EIVED AGAIN */ | |
| / | | OSIP_NICT_STATUS_3XX_RECEIVED, /**< 3XX FOR MESSAGE | |
| OSIP_NICT_STATUS_3456XX_RECEIVED_AGAIN, /**< RESPONSE RECEIVED AGAIN */ | | 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_REGISTER_RECEIVED, /**< REGISTER RECEIV | |
| OSIP_NIST_BYE_RECEIVED, /**< BYE RECEIVED */ | | ED */ | |
| OSIP_NIST_OPTIONS_RECEIVED, /**< OPTIONS RECEIVED */ | | OSIP_NIST_BYE_RECEIVED, /**< BYE REC | |
| OSIP_NIST_INFO_RECEIVED, /**< INFO RECEIVED */ | | EIVED */ | |
| OSIP_NIST_CANCEL_RECEIVED, /**< CANCEL RECEIVED */ | | OSIP_NIST_OPTIONS_RECEIVED, /**< OPTIONS | |
| OSIP_NIST_NOTIFY_RECEIVED, /**< NOTIFY RECEIVED */ | | RECEIVED */ | |
| OSIP_NIST_SUBSCRIBE_RECEIVED, /**< SUBSCRIBE RECEIVED */ | | OSIP_NIST_INFO_RECEIVED, /**< INFO RE | |
| | | CEIVED */ | |
| | | OSIP_NIST_CANCEL_RECEIVED, /**< CANCEL | |
| | | RECEIVED */ | |
| | | OSIP_NIST_NOTIFY_RECEIVED, /**< NOTIFY | |
| | | RECEIVED */ | |
| | | OSIP_NIST_SUBSCRIBE_RECEIVED, /**< SUBSCRIBE RECEI | |
| | | VED */ | |
| | | | |
|
| OSIP_NIST_UNKNOWN_REQUEST_RECEIVED, /**< UNKNWON REQUEST RECEIVED * | | OSIP_NIST_UNKNOWN_REQUEST_RECEIVED, /**< UNKNWON REQUEST | |
| / | | RECEIVED */ | |
| OSIP_NIST_REQUEST_RECEIVED_AGAIN, /**< UNKNWON REQUEST RECEIVED A | | OSIP_NIST_REQUEST_RECEIVED_AGAIN, /**< UNKNWON REQUEST | |
| GAIN */ | | RECEIVED AGAIN */ | |
| OSIP_NIST_STATUS_1XX_SENT, /**< 1XX FOR MESSAGE SENT */ | | OSIP_NIST_STATUS_1XX_SENT, /**< 1XX FOR | |
| OSIP_NIST_STATUS_2XX_SENT, /**< 2XX FOR MESSAGE SENT */ | | MESSAGE SENT */ | |
| OSIP_NIST_STATUS_2XX_SENT_AGAIN, /**< 2XX FOR MESSAGE RETRANSMIT | | OSIP_NIST_STATUS_2XX_SENT, /**< 2XX FOR | |
| TED */ | | MESSAGE SENT */ | |
| OSIP_NIST_STATUS_3XX_SENT, /**< 3XX FOR MESSAGE SENT */ | | OSIP_NIST_STATUS_2XX_SENT_AGAIN, /**< 2XX FOR MESSAGE | |
| OSIP_NIST_STATUS_4XX_SENT, /**< 4XX FOR MESSAGE SENT */ | | RETRANSMITTED */ | |
| OSIP_NIST_STATUS_5XX_SENT, /**< 5XX FOR MESSAGE SENT */ | | OSIP_NIST_STATUS_3XX_SENT, /**< 3XX FOR | |
| OSIP_NIST_STATUS_6XX_SENT, /**< 6XX FOR MESSAGE SENT */ | | MESSAGE SENT */ | |
| OSIP_NIST_STATUS_3456XX_SENT_AGAIN, /**< RESPONSE RETRANSMITTED */ | | 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 RETRAN | |
| | | SMITTED */ | |
| | | | |
|
| OSIP_ICT_STATUS_TIMEOUT, /**< TIMER B EXPIRATION: NO REM | | OSIP_ICT_STATUS_TIMEOUT, /**< TIMER B | |
| OTE ANSWER */ | | EXPIRATION: NO REMOTE ANSWER */ | |
| OSIP_NICT_STATUS_TIMEOUT, /**< TIMER F EXPIRATION: NO REM | | OSIP_NICT_STATUS_TIMEOUT, /**< TIMER F | |
| OTE ANSWER */ | | EXPIRATION: NO REMOTE ANSWER */ | |
| | | | |
|
| OSIP_MESSAGE_CALLBACK_COUNT /**< END OF ENUM */ | | OSIP_MESSAGE_CALLBACK_COUNT /**< END OF | |
| } osip_message_callback_type_t; | | ENUM */ | |
| | | } osip_message_callback_type_t; | |
| | | | |
| /** | | /** | |
| * Enumeration for callback type used when transaction is over. | | * Enumeration for callback type used when transaction is over. | |
| */ | | */ | |
|
| typedef enum osip_kill_callback_type | | typedef enum osip_kill_callback_type { | |
| { | | OSIP_ICT_KILL_TRANSACTION, /**< end of Client INVITE tr | |
| OSIP_ICT_KILL_TRANSACTION, /**< end of Client INVITE transaction * | | ansaction */ | |
| / | | OSIP_IST_KILL_TRANSACTION, /**< end of Server INVITE tr | |
| OSIP_IST_KILL_TRANSACTION, /**< end of Server INVITE transaction * | | ansaction */ | |
| / | | OSIP_NICT_KILL_TRANSACTION, /**< end of Client Non-INVIT | |
| OSIP_NICT_KILL_TRANSACTION, /**< end of Client Non-INVITE transacti | | E transaction */ | |
| on */ | | OSIP_NIST_KILL_TRANSACTION, /**< end of Server Non-INVIT | |
| OSIP_NIST_KILL_TRANSACTION, /**< end of Server Non-INVITE transacti | | E transaction */ | |
| on */ | | | |
| | | | |
|
| OSIP_KILL_CALLBACK_COUNT /**< END OF ENUM */ | | OSIP_KILL_CALLBACK_COUNT /**< END OF ENUM */ | |
| } osip_kill_callback_type_t; | | } osip_kill_callback_type_t; | |
| | | | |
| /** | | /** | |
| * Enumeration for callback type used when a transport error is detected. | | * Enumeration for callback type used when a transport error is detected. | |
| * @var osip_transport_error_callback_type_t | | * @var osip_transport_error_callback_type_t | |
| */ | | */ | |
|
| typedef enum osip_transport_error_callback_type | | typedef enum osip_transport_error_callback_type { | |
| { | | OSIP_ICT_TRANSPORT_ERROR, /**< transport err | |
| OSIP_ICT_TRANSPORT_ERROR, /**< transport error for ICT */ | | or for ICT */ | |
| OSIP_IST_TRANSPORT_ERROR, /**< transport error for IST */ | | OSIP_IST_TRANSPORT_ERROR, /**< transport err | |
| OSIP_NICT_TRANSPORT_ERROR, /**< transport error for NICT */ | | or for IST */ | |
| OSIP_NIST_TRANSPORT_ERROR, /**< transport error for NIST */ | | OSIP_NICT_TRANSPORT_ERROR, /**< transport err | |
| | | or for NICT */ | |
| | | OSIP_NIST_TRANSPORT_ERROR, /**< transport err | |
| | | or for NIST */ | |
| | | | |
|
| OSIP_TRANSPORT_ERROR_CALLBACK_COUNT /**< END OF ENUM */ | | OSIP_TRANSPORT_ERROR_CALLBACK_COUNT | |
| } osip_transport_error_callback_type_t; | | | |
| | | /**< END OF ENUM */ | |
| | | } osip_transport_error_callback_type_t; | |
| | | | |
| /** | | /** | |
| * Callback definition for message announcements. | | * Callback definition for message announcements. | |
| * @var osip_message_cb_t | | * @var osip_message_cb_t | |
| */ | | */ | |
|
| typedef void (*osip_message_cb_t) (int type, osip_transaction_t *, | | typedef void (*osip_message_cb_t) (int type, osip_transaction_t *, | |
| osip_message_t *); | | o | |
| | | sip_message_t *); | |
| /** | | /** | |
| * Callback definition for end of transaction announcements. | | * Callback definition for end of transaction announcements. | |
| * @var osip_kill_transaction_cb_t | | * @var osip_kill_transaction_cb_t | |
| */ | | */ | |
|
| typedef void (*osip_kill_transaction_cb_t) (int type, osip_transaction_t
*); | | typedef void (*osip_kill_transaction_cb_t) (int type, osip_transacti
on_t *); | |
| /** | | /** | |
| * Callback definition for transport error announcements. | | * Callback definition for transport error announcements. | |
| * @var osip_transport_error_cb_t | | * @var osip_transport_error_cb_t | |
| */ | | */ | |
|
| typedef void (*osip_transport_error_cb_t) (int type, osip_transaction_t * | | typedef void (*osip_transport_error_cb_t) (int type, osip_transactio | |
| , | | n_t *, | |
| int error); | | | |
| | | int error); | |
| | | | |
|
| struct osip_dialog; | | struct osip_dialog; | |
| | | | |
| /** | | /** | |
| * Structure for 2XX retransmission management. | | * Structure for 2XX retransmission management. | |
| * @var ixt_t | | * @var ixt_t | |
| */ | | */ | |
|
| typedef struct ixt_t ixt_t; | | typedef struct ixt_t ixt_t; | |
| | | | |
| /** | | /** | |
| * Structure for 2XX retransmission management. | | * Structure for 2XX retransmission management. | |
| * @struct ixt | | * @struct ixt | |
| */ | | */ | |
|
| struct ixt_t | | struct ixt_t { | |
| { | | /* any ACK received that match this context will set counter | |
| /* any ACK received that match this context will set counter to -1 */ | | to -1 */ | |
| struct osip_dialog *dialog; /**< related dialog */ | | struct osip_dialog *dialog; | |
| osip_message_t *msg2xx; /**< buffer to retransmit */ | | /**< related | |
| osip_message_t *ack; /**< ack message if needed */ | | dialog */ | |
| struct timeval start; /**< Time of first retransmission */ | | osip_message_t *msg2xx; /**< buffer to retransmit */ | |
| int interval; /**< delay between retransmission, in ms */ | | osip_message_t *ack; /**< ack message if needed */ | |
| char *dest; /**< destination host */ | | struct timeval start; /**< Time of first retransmission */ | |
| int port; /**< destination port */ | | int interval; /**< delay between retransmi | |
| int sock; /**< socket to use */ | | ssion, in ms */ | |
| int counter; /**< start at 7 */ | | char *dest; /**< destination hos | |
| }; | | t */ | |
| | | int port; /**< destination por | |
| | | t */ | |
| | | int sock; /**< socket to use * | |
| | | / | |
| | | int counter; /**< start at 7 */ | |
| | | }; | |
| | | | |
| /** | | /** | |
| * Structure for osip handling. | | * Structure for osip handling. | |
| * In order to use osip, you have to manage at least one global instance | | * 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 | | * of an osip_t element. Then, you'll register a set of required callbacks | |
| * and a set of optional ones. | | * and a set of optional ones. | |
| * @var osip_t | | * @var osip_t | |
| */ | | */ | |
|
| typedef struct osip osip_t; | | typedef struct osip osip_t; | |
| | | | |
| /** | | /** | |
| * Structure for osip handling. | | * Structure for osip handling. | |
| * @struct osip | | * @struct osip | |
| */ | | */ | |
|
| struct osip | | struct osip { | |
| { | | | |
| | | | |
|
| void *application_context; /**< User defined Pointer */ | | void *application_context; | |
| | | /**< User de | |
| | | fined Pointer */ | |
| | | | |
|
| /* list of transactions for ict, ist, nict, nist */ | | /* list of transactions for ict, ist, nict, nist */ | |
| osip_list_t osip_ict_transactions; /**< list of ict transactions */ | | osip_list_t osip_ict_transactions; | |
| osip_list_t osip_ist_transactions; /**< list of ist transactions */ | | | |
| osip_list_t osip_nict_transactions; /**< list of nict transactions */ | | /**< list of ict transactions */ | |
| osip_list_t osip_nist_transactions; /**< list of nist transactions */ | | osip_list_t osip_ist_transactions; | |
| | | | |
| | | /**< list of ist transactions */ | |
| | | osip_list_t osip_nict_transactions; | |
| | | | |
| | | /**< list of nict transactions */ | |
| | | osip_list_t osip_nist_transactions; | |
| | | | |
| | | /**< list of nist transactions */ | |
| | | | |
|
| osip_list_t ixt_retransmissions; /**< list of ixt elements */ | | osip_list_t ixt_retransmissions;/**< list of ixt elements */ | |
| | | | |
|
| osip_message_cb_t msg_callbacks[OSIP_MESSAGE_CALLBACK_COUNT]; /* | | osip_message_cb_t msg_callbacks[OSIP_MESSAGE_CALLBACK_COUNT] | |
| *@internal */ | | ; /**@internal */ | |
| osip_kill_transaction_cb_t kill_callbacks[OSIP_KILL_CALLBACK_COUNT]; /* | | osip_kill_transaction_cb_t kill_callbacks[OSIP_KILL_CALLBACK | |
| *@internal */ | | _COUNT]; | |
| osip_transport_error_cb_t tp_error_callbacks[OSIP_TRANSPORT_ERROR_CALLB | | | |
| ACK_COUNT]; /**@internal */ | | /**@in | |
| | | ternal */ | |
| | | osip_transport_error_cb_t | |
| | | tp_error_callbacks[OSIP_TRANSPORT_ERROR_CALLBACK_COU | |
| | | NT]; | |
| | | | |
| | | | |
| | | /**@internal */ | |
| | | | |
|
| int (*cb_send_message) (osip_transaction_t *, osip_message_t *, char *, | | int (*cb_send_message) (osip_transaction_t *, osip_message_t | |
| int, int); | | *, char *, | |
| /**@internal */ | | int, int); | |
| | | | |
| | | /**@internal */ | |
| | | | |
| #if defined(HAVE_DICT_DICT_H) | | #if defined(HAVE_DICT_DICT_H) | |
|
| dict *osip_ict_hastable; /**< htable of ict transactions * | | dict *osip_ict_hastable; /**< htable of ict | |
| / | | transactions */ | |
| dict *osip_ist_hastable; /**< htable of ist transactions * | | dict *osip_ist_hastable; /**< htable of ist | |
| / | | transactions */ | |
| dict *osip_nict_hastable; /**< htable of nict transactions | | dict *osip_nict_hastable; /**< htable of nic | |
| */ | | t transactions */ | |
| dict *osip_nist_hastable; /**< htable of nist transactions | | dict *osip_nist_hastable; /**< htable of nis | |
| */ | | t transactions */ | |
| #endif | | #endif | |
|
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Set a callback for each transaction operation. | | * Set a callback for each transaction operation. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| * @param type The event type to hook on. | | * @param type The event type to hook on. | |
| * @param cb The method to be called upon the event. | | * @param cb The method to be called upon the event. | |
| */ | | */ | |
|
| int osip_set_message_callback (osip_t * osip, int type, osip_message_cb_t
cb); | | int osip_set_message_callback(osip_t * osip, int type, osip_message_
cb_t cb); | |
| | | | |
| /** | | /** | |
| * Set a callback for transaction operation related to the end of transacti
ons. | | * Set a callback for transaction operation related to the end of transacti
ons. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| * @param type The event type to hook on. | | * @param type The event type to hook on. | |
| * @param cb The method to be called upon the event. | | * @param cb The method to be called upon the event. | |
| */ | | */ | |
|
| int osip_set_kill_transaction_callback (osip_t * osip, int type, | | int osip_set_kill_transaction_callback(osip_t * osip, int type, | |
| osip_kill_transaction_cb_t cb); | | | |
| | | osip_kill_transaction_cb_t cb); | |
| | | | |
| /** | | /** | |
| * Set a callback for each transaction operation related to network error. | | * Set a callback for each transaction operation related to network error. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| * @param type The event type to hook on. | | * @param type The event type to hook on. | |
| * @param cb The method to be called upon the event. | | * @param cb The method to be called upon the event. | |
| */ | | */ | |
|
| int osip_set_transport_error_callback (osip_t * osip, int type, | | int osip_set_transport_error_callback(osip_t * osip, int type, | |
| osip_transport_error_cb_t cb); | | | |
| | | osip_transport_error_cb_t cb); | |
| | | | |
| /** | | /** | |
| * Structure for osip event handling. | | * Structure for osip event handling. | |
| * A osip_event_t element will have a type and will be related | | * 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 | | * to a transaction. In the general case, it is used by the | |
| * application layer to give SIP messages to the oSIP finite | | * application layer to give SIP messages to the oSIP finite | |
| * state machine. | | * state machine. | |
| * @var osip_event_t | | * @var osip_event_t | |
| */ | | */ | |
|
| typedef struct osip_event osip_event_t; | | typedef struct osip_event osip_event_t; | |
| | | | |
| /** | | /** | |
| * Structure for osip event handling. | | * Structure for osip event handling. | |
| * @struct osip_event | | * @struct osip_event | |
| */ | | */ | |
|
| struct osip_event | | struct osip_event { | |
| { | | type_t type; /**< Event Type */ | |
| type_t type; /**< Event Type */ | | int transactionid; /**< identifier of the related osip | |
| int transactionid; /**< identifier of the related osip transactio | | transaction */ | |
| n */ | | osip_message_t *sip; /**< SIP message (optional) */ | |
| osip_message_t *sip; /**< SIP message (optional) */ | | }; | |
| }; | | | |
| | | | |
| /** | | /** | |
| * Allocate an osip_transaction_t element. | | * Allocate an osip_transaction_t element. | |
| * @param transaction The element to allocate. | | * @param transaction The element to allocate. | |
| * @param ctx_type The type of transaction. (ICT, IST, NICT, NIST) | | * @param ctx_type The type of transaction. (ICT, IST, NICT, NIST) | |
| * @param osip The global instance of oSIP. | | * @param osip The global instance of oSIP. | |
| * @param request The SIP request that initiate the transaction. | | * @param request The SIP request that initiate the transaction. | |
| */ | | */ | |
|
| int osip_transaction_init (osip_transaction_t ** transaction, | | int osip_transaction_init(osip_transaction_t ** transaction, | |
| osip_fsm_type_t ctx_type, osip_t * osip, | | osip_fsm_type_t ct | |
| osip_message_t * request); | | x_type, osip_t * osip, | |
| | | osip_message_t * r | |
| | | equest); | |
| /** | | /** | |
| * Free all resource in a osip_transaction_t element. | | * Free all resource in a osip_transaction_t element. | |
| * @param transaction The element to free. | | * @param transaction The element to free. | |
| */ | | */ | |
|
| int osip_transaction_free (osip_transaction_t * transaction); | | int osip_transaction_free(osip_transaction_t * transaction); | |
| /** | | /** | |
| * Free all resource in a osip_transaction_t element. | | * Free all resource in a osip_transaction_t element. | |
| * This method does the same than osip_transaction_free() but it assumes | | * This method does the same than osip_transaction_free() but it assumes | |
| * that the transaction is already removed from the list of transaction | | * that the transaction is already removed from the list of transaction | |
| * in the osip stack. (to remove it use osip_xixt_remove(osip, transaction)
; | | * in the osip stack. (to remove it use osip_xixt_remove(osip, transaction)
; | |
| * @param transaction The element to free. | | * @param transaction The element to free. | |
| */ | | */ | |
|
| int osip_transaction_free2 (osip_transaction_t * transaction); | | int osip_transaction_free2(osip_transaction_t * transaction); | |
| | | | |
| /** | | /** | |
| * Search in a SIP response the destination where the message | | * Search in a SIP response the destination where the message | |
| * should be sent. | | * should be sent. | |
| * @param response the message to work on. | | * @param response the message to work on. | |
| * @param address a pointer to receive the allocated host address. | | * @param address a pointer to receive the allocated host address. | |
| * @param portnum a pointer to receive the host port. | | * @param portnum a pointer to receive the host port. | |
| */ | | */ | |
|
| void osip_response_get_destination (osip_message_t * response, | | void osip_response_get_destination(osip_message_t * response, | |
| char **address, int *portnum); | | c | |
| | | har **address, int *portnum); | |
| /** | | /** | |
| * Set the host and port destination used for sending the SIP message. | | * Set the host and port destination used for sending the SIP message. | |
| * This can be useful for an application with 'DIRECT ROOTING MODE' | | * This can be useful for an application with 'DIRECT ROOTING MODE' | |
| * NOTE: Instead, you should use the 'Route' header facility which | | * NOTE: Instead, you should use the 'Route' header facility which | |
| * leads to the same behaviour. | | * leads to the same behaviour. | |
| * @param ict The element to work on. | | * @param ict The element to work on. | |
| * @param destination The destination host. | | * @param destination The destination host. | |
| * @param port The destination port. | | * @param port The destination port. | |
| */ | | */ | |
|
| int osip_ict_set_destination (osip_ict_t * ict, char *destination, int po
rt); | | int osip_ict_set_destination(osip_ict_t * ict, char *destination, in
t port); | |
| | | | |
| /** | | /** | |
| * Set the host and port destination used for sending the SIP message. | | * Set the host and port destination used for sending the SIP message. | |
| * This can be useful for an application with 'DIRECT ROOTING MODE' | | * This can be useful for an application with 'DIRECT ROOTING MODE' | |
| * NOTE: Instead, you should use the 'Route' header facility which | | * NOTE: Instead, you should use the 'Route' header facility which | |
| * leads to the same behaviour. | | * leads to the same behaviour. | |
| * @param nict The element to work on. | | * @param nict The element to work on. | |
| * @param destination The destination host. | | * @param destination The destination host. | |
| * @param port The destination port. | | * @param port The destination port. | |
| */ | | */ | |
|
| int osip_nict_set_destination (osip_nict_t * nict, char *destination, int
port); | | int osip_nict_set_destination(osip_nict_t * nict, char *destination,
int port); | |
| | | | |
| /** | | /** | |
| * Add a SIP event in the fifo of a osip_transaction_t element. | | * Add a SIP event in the fifo of a osip_transaction_t element. | |
| * @param transaction The element to work on. | | * @param transaction The element to work on. | |
| * @param evt The event to add. | | * @param evt The event to add. | |
| */ | | */ | |
|
| int osip_transaction_add_event (osip_transaction_t * transaction, | | int osip_transaction_add_event(osip_transaction_t * transaction, | |
| osip_event_t * evt); | | osip_even | |
| | | t_t * evt); | |
| /** | | /** | |
| * Consume one osip_event_t element previously added in the fifo. | | * Consume one osip_event_t element previously added in the fifo. | |
| * NOTE: This method MUST NEVER be called within another call | | * NOTE: This method MUST NEVER be called within another call | |
| * of this method. (For example, you can't call osip_transaction_execute() | | * of this method. (For example, you can't call osip_transaction_execute() | |
| * in a callback registered in the osip_t element.) | | * in a callback registered in the osip_t element.) | |
| * @param transaction The element to free. | | * @param transaction The element to free. | |
| * @param evt The element to consume. | | * @param evt The element to consume. | |
| */ | | */ | |
|
| int osip_transaction_execute (osip_transaction_t * transaction, | | int osip_transaction_execute(osip_transaction_t * transaction, | |
| osip_event_t * evt); | | osip_event_ | |
| | | t * evt); | |
| /** | | /** | |
| * Set a pointer to your personal context associated with this transaction. | | * Set a pointer to your personal context associated with this transaction. | |
| * NOTE: this is a very useful method that allow you to avoid searching | | * NOTE: this is a very useful method that allow you to avoid searching | |
| * for your personal context inside the registered callbacks. | | * for your personal context inside the registered callbacks. | |
| * You can initialise this pointer to your context right after | | * You can initialise this pointer to your context right after | |
| * the creation of the osip_transaction_t element. Then, you'll be | | * the creation of the osip_transaction_t element. Then, you'll be | |
| * able to get the address of your context by calling | | * able to get the address of your context by calling | |
| * osip_transaction_get_your_instance(). | | * osip_transaction_get_your_instance(). | |
| * @param transaction The element to work on. | | * @param transaction The element to work on. | |
| * @param instance The address of your context. | | * @param instance The address of your context. | |
| */ | | */ | |
|
| int osip_transaction_set_your_instance (osip_transaction_t * transaction, | | int osip_transaction_set_your_instance(osip_transaction_t * transact | |
| void *instance); | | ion, | |
| | | | |
| | | void *instance); | |
| /** | | /** | |
| * Get a pointer to your personal context associated with this transaction. | | * Get a pointer to your personal context associated with this transaction. | |
| * @param transaction The element to work on. | | * @param transaction The element to work on. | |
| */ | | */ | |
|
| void *osip_transaction_get_your_instance (osip_transaction_t * transactio
n); | | void *osip_transaction_get_your_instance(osip_transaction_t * transa
ction); | |
| | | | |
| /** | | /** | |
| * Get target ip and port for this request. | | * Get target ip and port for this request. | |
| * (automaticly set by osip_transaction_init() for ict and nict) | | * (automaticly set by osip_transaction_init() for ict and nict) | |
| * @param transaction The element to work on. | | * @param transaction The element to work on. | |
| * @param ip The ip of host where to send initial request. | | * @param ip The ip of host where to send initial request. | |
| * @param port The port where to send initial request. | | * @param port The port where to send initial request. | |
| */ | | */ | |
|
| int osip_transaction_get_destination (osip_transaction_t * transaction, | | int osip_transaction_get_destination(osip_transaction_t * transactio | |
| char **ip, int *port); | | n, | |
| | | | |
| | | char **ip, int *port); | |
| | | | |
| /** | | /** | |
| * Set SRV lookup information to be used by state machine. | | * Set SRV lookup information to be used by state machine. | |
| * | | * | |
| * @param transaction The element to work on. | | * @param transaction The element to work on. | |
| * @param record The SRV lookup results for this transaction. | | * @param record The SRV lookup results for this transaction. | |
| */ | | */ | |
|
| int osip_transaction_set_srv_record(osip_transaction_t *transaction, osip | | int osip_transaction_set_srv_record(osip_transaction_t * transaction | |
| _srv_record_t *record); | | , | |
| | | | |
| | | osip_srv_record_t * record); | |
| | | | |
| /** | | /** | |
| * Set the socket for incoming message. | | * Set the socket for incoming message. | |
| * | | * | |
| * @param transaction The element to work on. | | * @param transaction The element to work on. | |
| * @param sock The socket for incoming message. | | * @param sock The socket for incoming message. | |
| */ | | */ | |
|
| int osip_transaction_set_in_socket (osip_transaction_t * transaction, int
sock); | | int osip_transaction_set_in_socket(osip_transaction_t * transaction,
int sock); | |
| /** | | /** | |
| * Set the socket for outgoing message. | | * Set the socket for outgoing message. | |
| * | | * | |
| * @param transaction The element to work on. | | * @param transaction The element to work on. | |
| * @param sock The socket for outgoing message. | | * @param sock The socket for outgoing message. | |
| */ | | */ | |
|
| int osip_transaction_set_out_socket (osip_transaction_t * transaction, in | | int osip_transaction_set_out_socket(osip_transaction_t * transaction | |
| t sock); | | , | |
| | | | |
| | | int sock); | |
| | | | |
| /** | | /** | |
| * Allocate an osip_t element. | | * Allocate an osip_t element. | |
| * @param osip the element to allocate. | | * @param osip the element to allocate. | |
| */ | | */ | |
|
| int osip_init (osip_t ** osip); | | int osip_init(osip_t ** osip); | |
| /** | | /** | |
| * Free all resource in a osip_t element. | | * Free all resource in a osip_t element. | |
| * @param osip The element to release. | | * @param osip The element to release. | |
| */ | | */ | |
|
| void osip_release (osip_t * osip); | | void osip_release(osip_t * osip); | |
| | | | |
| /** | | /** | |
| * Set a pointer in a osip_t element. | | * Set a pointer in a osip_t element. | |
| * This help to find your application layer in callbacks. | | * This help to find your application layer in callbacks. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| * @param pointer The element to set. | | * @param pointer The element to set. | |
| */ | | */ | |
|
| void osip_set_application_context (osip_t * osip, void *pointer); | | void osip_set_application_context(osip_t * osip, void *pointer); | |
| | | | |
| /** | | /** | |
| * Get a pointer in a osip_t element. | | * Get a pointer in a osip_t element. | |
| * This help to find your application layer in callbacks. | | * This help to find your application layer in callbacks. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| */ | | */ | |
|
| void *osip_get_application_context (osip_t * osip); | | void *osip_get_application_context(osip_t * osip); | |
| | | | |
| /** | | /** | |
| * Remove a transaction from the osip stack. | | * Remove a transaction from the osip stack. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| * @param ict The transaction to add. | | * @param ict The transaction to add. | |
| */ | | */ | |
|
| int osip_remove_transaction (osip_t * osip, osip_transaction_t * ict); | | int osip_remove_transaction(osip_t * osip, osip_transaction_t * ict)
; | |
| | | | |
| /** | | /** | |
| * Consume ALL pending osip_event_t previously added in the fifos of ict tr
ansactions. | | * Consume ALL pending osip_event_t previously added in the fifos of ict tr
ansactions. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| */ | | */ | |
|
| int osip_ict_execute (osip_t * osip); | | int osip_ict_execute(osip_t * osip); | |
| /** | | /** | |
| * Consume ALL pending osip_event_t previously added in the fifos of ist tr
ansactions. | | * Consume ALL pending osip_event_t previously added in the fifos of ist tr
ansactions. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| */ | | */ | |
|
| int osip_ist_execute (osip_t * osip); | | int osip_ist_execute(osip_t * osip); | |
| /** | | /** | |
| * Consume ALL pending osip_event_t previously added in the fifos of nict t
ransactions. | | * Consume ALL pending osip_event_t previously added in the fifos of nict t
ransactions. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| */ | | */ | |
|
| int osip_nict_execute (osip_t * osip); | | int osip_nict_execute(osip_t * osip); | |
| /** | | /** | |
| * Consume ALL pending osip_event_t previously added in the fifos of nist t
ransactions. | | * Consume ALL pending osip_event_t previously added in the fifos of nist t
ransactions. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| */ | | */ | |
|
| int osip_nist_execute (osip_t * osip); | | int osip_nist_execute(osip_t * osip); | |
| | | | |
| /** | | /** | |
| * Retreive the minimum timer value to be used by an application | | * Retreive the minimum timer value to be used by an application | |
| * so that the osip_timer_*_execute method don't have to be called | | * so that the osip_timer_*_execute method don't have to be called | |
| * often. | | * often. | |
| * | | * | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| * @param lower_tv The minimum timer when the application should wake up. | | * @param lower_tv The minimum timer when the application should wake up. | |
| */ | | */ | |
|
| void osip_timers_gettimeout (osip_t * osip, struct timeval *lower_tv); | | void osip_timers_gettimeout(osip_t * osip, struct timeval *lower_tv)
; | |
| | | | |
| /** | | /** | |
| * Check if an ict transactions needs a timer event. | | * Check if an ict transactions needs a timer event. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| */ | | */ | |
|
| void osip_timers_ict_execute (osip_t * osip); | | void osip_timers_ict_execute(osip_t * osip); | |
| /** | | /** | |
| * Check if an ist transactions needs a timer event. | | * Check if an ist transactions needs a timer event. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| */ | | */ | |
|
| void osip_timers_ist_execute (osip_t * osip); | | void osip_timers_ist_execute(osip_t * osip); | |
| /** | | /** | |
| * Check if a nict transactions needs a timer event. | | * Check if a nict transactions needs a timer event. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| */ | | */ | |
|
| void osip_timers_nict_execute (osip_t * osip); | | void osip_timers_nict_execute(osip_t * osip); | |
| /** | | /** | |
| * Check if a nist transactions needs a timer event. | | * Check if a nist transactions needs a timer event. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| */ | | */ | |
|
| void osip_timers_nist_execute (osip_t * osip); | | void osip_timers_nist_execute(osip_t * osip); | |
| | | | |
| /* Take care of mutlithreading issuewhile using this method */ | | /* Take care of mutlithreading issuewhile using this method */ | |
| /** | | /** | |
| * Search for a transaction that match this event (MUST be a MESSAGE event)
. | | * Search for a transaction that match this event (MUST be a MESSAGE event)
. | |
| * @param transactions The list of transactions to work on. | | * @param transactions The list of transactions to work on. | |
| * @param evt The element representing the SIP MESSAGE. | | * @param evt The element representing the SIP MESSAGE. | |
| */ | | */ | |
|
| osip_transaction_t *osip_transaction_find (osip_list_t * transactions, | | osip_transaction_t *osip_transaction_find(osip_list_t * transactions | |
| osip_event_t * evt); | | , | |
| | | | |
| | | osip_event_t * evt); | |
| | | | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| /** | | /** | |
| * Some race conditions can happen in multi threaded applications. | | * Some race conditions can happen in multi threaded applications. | |
| * Use this method carefully. | | * Use this method carefully. | |
| * <BR>Search for a transaction that match this event (MUST be a MESSAGE ev
ent). | | * <BR>Search for a transaction that match this event (MUST be a MESSAGE ev
ent). | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| * @param evt The element representing the SIP MESSAGE. | | * @param evt The element representing the SIP MESSAGE. | |
| */ | | */ | |
| #ifndef OSIP_MT | | #ifndef OSIP_MT | |
|
| osip_transaction_t *osip_find_transaction (osip_t * osip, osip_event_t *
evt); | | osip_transaction_t *osip_find_transaction(osip_t * osip, osip_event_
t * evt); | |
| #endif | | #endif | |
| | | | |
|
| osip_transaction_t *__osip_find_transaction (osip_t * osip, | | osip_transaction_t *__osip_find_transaction(osip_t * osip, | |
| osip_event_t * evt, int cons | | | |
| ume); | | osip_event_t * evt, int consume); | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * Search for a transaction that match this event (MUST be a MESSAGE event) | | * Search for a transaction that match this event (MUST be a MESSAGE event) | |
| * and add this event if a transaction is found.. | | * and add this event if a transaction is found.. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| * @param evt The element representing the SIP MESSAGE. | | * @param evt The element representing the SIP MESSAGE. | |
| */ | | */ | |
|
| int osip_find_transaction_and_add_event (osip_t * osip, osip_event_t * ev
t); | | int osip_find_transaction_and_add_event(osip_t * osip, osip_event_t
* evt); | |
| | | | |
| /** | | /** | |
| * Create a transaction for this event (MUST be a SIP REQUEST event). | | * Create a transaction for this event (MUST be a SIP REQUEST event). | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| * @param evt The element representing the new SIP REQUEST. | | * @param evt The element representing the new SIP REQUEST. | |
| */ | | */ | |
|
| osip_transaction_t *osip_create_transaction (osip_t * osip, osip_event_t
* evt); | | osip_transaction_t *osip_create_transaction(osip_t * osip, osip_even
t_t * evt); | |
| | | | |
| /** | | /** | |
| * Create a sipevent from a SIP message string. | | * Create a sipevent from a SIP message string. | |
| * @param buf The SIP message as a string. | | * @param buf The SIP message as a string. | |
| * @param length The length of the buffer to parse. | | * @param length The length of the buffer to parse. | |
| */ | | */ | |
|
| osip_event_t *osip_parse (const char *buf, size_t length); | | osip_event_t *osip_parse(const char *buf, size_t length); | |
| | | | |
| /** | | /** | |
| * Send required retransmissions | | * Send required retransmissions | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| */ | | */ | |
|
| void osip_retransmissions_execute (osip_t * osip); | | void osip_retransmissions_execute(osip_t * osip); | |
| | | | |
| /** | | /** | |
| * Start out of fsm 200 Ok retransmissions. This is usefull for user-agents
. | | * Start out of fsm 200 Ok retransmissions. This is usefull for user-agents
. | |
| * @param osip The osip_t structure. | | * @param osip The osip_t structure. | |
| * @param dialog The dialog the 200 Ok is part of. | | * @param dialog The dialog the 200 Ok is part of. | |
| * @param msg200ok The 200 ok response. | | * @param msg200ok The 200 ok response. | |
| * @param sock The socket to be used to send the message. (optional). | | * @param sock The socket to be used to send the message. (optional). | |
| */ | | */ | |
|
| void osip_start_200ok_retransmissions (osip_t * osip, | | void osip_start_200ok_retransmissions(osip_t * osip, | |
| struct osip_dialog *dialog, | | | |
| osip_message_t * msg200ok, int soc | | struct osip_dialog *dialog, | |
| k); | | | |
| | | osip_message_t * msg200ok, int sock); | |
| | | | |
| /** | | /** | |
| * Start out of fsm ACK retransmissions. This is usefull for user-agents. | | * Start out of fsm ACK retransmissions. This is usefull for user-agents. | |
| * @param osip The osip_t structure. | | * @param osip The osip_t structure. | |
| * @param dialog The dialog the ACK is part of. | | * @param dialog The dialog the ACK is part of. | |
| * @param ack The ACK that has just been sent in response to a 200 Ok. | | * @param ack The ACK that has just been sent in response to a 200 Ok. | |
| * @param dest The destination host. | | * @param dest The destination host. | |
| * @param port The destination port. | | * @param port The destination port. | |
| * @param sock The socket to be used to send the message. (optional). | | * @param sock The socket to be used to send the message. (optional). | |
| */ | | */ | |
|
| void osip_start_ack_retransmissions (osip_t * osip, | | void osip_start_ack_retransmissions(osip_t * osip, | |
| struct osip_dialog *dialog, | | | |
| osip_message_t * ack, char *dest, | | struct osip_dialog *dialog, | |
| int port, int sock); | | | |
| | | osip_message_t * ack, char *dest, | |
| | | | |
| | | int port, int sock); | |
| | | | |
| /** | | /** | |
| * Stop the out of fsm 200 Ok retransmissions matching an incoming ACK. | | * Stop the out of fsm 200 Ok retransmissions matching an incoming ACK. | |
| * @param osip The osip_t structure. | | * @param osip The osip_t structure. | |
| * @param ack The ack that has just been received. | | * @param ack The ack that has just been received. | |
| */ | | */ | |
|
| struct osip_dialog *osip_stop_200ok_retransmissions (osip_t * osip, | | struct osip_dialog *osip_stop_200ok_retransmissions(osip_t * osip, | |
| osip_message_t * ack | | | |
| ); | | osip_message_t * ack); | |
| | | | |
| /** | | /** | |
| * Stop out of fsm retransmissions (ACK or 200 Ok) associated to a given di
alog. | | * Stop out of fsm retransmissions (ACK or 200 Ok) associated to a given di
alog. | |
| * This function must be called before freeing a dialog if out of fsm retra
nsmissions | | * This function must be called before freeing a dialog if out of fsm retra
nsmissions | |
| * have been scheduled. | | * have been scheduled. | |
| * @param osip The osip_t structure | | * @param osip The osip_t structure | |
| * @param dialog The dialog. | | * @param dialog The dialog. | |
| */ | | */ | |
|
| void osip_stop_retransmissions_from_dialog (osip_t * osip, | | void osip_stop_retransmissions_from_dialog(osip_t * osip, | |
| struct osip_dialog *dialog); | | | |
| | | struct osip_dialog *dialog); | |
| | | | |
| /** | | /** | |
| * Allocate a sipevent (we know this message is an OUTGOING SIP message). | | * Allocate a sipevent (we know this message is an OUTGOING SIP message). | |
| * @param sip The SIP message we want to send. | | * @param sip The SIP message we want to send. | |
| */ | | */ | |
|
| osip_event_t *osip_new_outgoing_sipmessage (osip_message_t * sip); | | osip_event_t *osip_new_outgoing_sipmessage(osip_message_t * sip); | |
| | | | |
| /** | | /** | |
| * Free all ressource in a sipevent. | | * Free all ressource in a sipevent. | |
| * @param event The event to free. | | * @param event The event to free. | |
| */ | | */ | |
|
| void osip_event_free (osip_event_t * event); | | void osip_event_free(osip_event_t * event); | |
| | | | |
| /** | | /** | |
| * Register the callback used to send SIP message. | | * Register the callback used to send SIP message. | |
| * @param cf The osip element attached to the transaction. | | * @param cf The osip element attached to the transaction. | |
| * @param cb The method we want to register. | | * @param cb The method we want to register. | |
| */ | | */ | |
|
| void osip_set_cb_send_message (osip_t * cf, | | void osip_set_cb_send_message(osip_t * cf, | |
| int (*cb) (osip_transaction_t *, | | int (*cb) | |
| osip_message_t *, char *, int, | | (osip_transaction_t *, | |
| int)); | | | |
| | | osip_message_t *, char *, int, int)); | |
| | | | |
| /* FOR INCOMING TRANSACTION */ | | /* FOR INCOMING TRANSACTION */ | |
| /** | | /** | |
| * Check if the sipevent is of type RCV_REQINVITE. | | * Check if the sipevent is of type RCV_REQINVITE. | |
| * @param event the event to check. | | * @param event the event to check. | |
| */ | | */ | |
| #define EVT_IS_RCV_INVITE(event) (event->type==RCV_REQINVITE) | | #define EVT_IS_RCV_INVITE(event) (event->type==RCV_REQINVITE) | |
| /** | | /** | |
| * Check if the sipevent is of type RCV_REQACK. | | * Check if the sipevent is of type RCV_REQACK. | |
| * @param event the event to check. | | * @param event the event to check. | |
| | | | |
End of changes. 115 change blocks. |
| 405 lines changed or deleted | | 559 lines changed or added | |
|
| osip_parser.h | | osip_parser.h | |
| | | | |
| skipping to change at line 38 | | skipping to change at line 38 | |
| * | | * | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @defgroup oSIP_PARSER oSIP parser Handling | | * @defgroup oSIP_PARSER oSIP parser Handling | |
| * @ingroup osip2_parser | | * @ingroup osip2_parser | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
|
| extern "C" | | extern "C" { | |
| { | | | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * Initialise the oSIP parser. | | * Initialise the oSIP parser. | |
| */ | | */ | |
|
| int parser_init (void); | | int parser_init(void); | |
| | | | |
| /** | | /** | |
| * Fix the via header for INCOMING requests only. | | * Fix the via header for INCOMING requests only. | |
| * a copy of ip_addr is done. | | * a copy of ip_addr is done. | |
| */ | | */ | |
|
| int osip_message_fix_last_via_header (osip_message_t * request, | | int osip_message_fix_last_via_header(osip_message_t * request, | |
| const char *ip_addr, int port); | | | |
| | | const char *ip_addr, int port); | |
| | | | |
| /** | | /** | |
| * define this macro to avoid building several times | | * define this macro to avoid building several times | |
| * the message on retransmissions. If you have changed | | * the message on retransmissions. If you have changed | |
| * the osip_message_t element since last call of osip_message_to_str() you | | * the osip_message_t element since last call of osip_message_to_str() you | |
| * can call osip_message_force_update() to force a rebuild. | | * can call osip_message_force_update() to force a rebuild. | |
| */ | | */ | |
| /** | | /** | |
| * Check if the element is already built. (so osip_message_to_str won't bui
ld it again) | | * Check if the element is already built. (so osip_message_to_str won't bui
ld it again) | |
| * @param sip The element to check. | | * @param sip The element to check. | |
| */ | | */ | |
|
| int osip_message_get__property (const osip_message_t * sip); | | int osip_message_get__property(const osip_message_t * sip); | |
| | | | |
| /** | | /** | |
| * Force a osip_message_t element to be rebuild on next osip_message_to_str
() call. | | * Force a osip_message_t element to be rebuild on next osip_message_to_str
() call. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| */ | | */ | |
|
| int osip_message_force_update (osip_message_t * sip); | | int osip_message_force_update(osip_message_t * sip); | |
| | | | |
| /** | | /** | |
| * Get the usual reason phrase as defined in SIP for a specific status code
. | | * Get the usual reason phrase as defined in SIP for a specific status code
. | |
| * @param status_code A status code. | | * @param status_code A status code. | |
| */ | | */ | |
|
| const char *osip_message_get_reason (int status_code); | | const char *osip_message_get_reason(int status_code); | |
| | | | |
| /** | | /** | |
| * Set the Accept header. | | * Set the Accept header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_set_accept (osip_message_t * sip, const char *hvalue); | | int osip_message_set_accept(osip_message_t * sip, const char *hvalue
); | |
| #else | | #else | |
| #define osip_message_set_accept(sip,value) osip_message_set_head
er((osip_message_t *)sip,(const char *)"Accept",value) | | #define osip_message_set_accept(sip,value) osip_message_set_head
er((osip_message_t *)sip,(const char *)"Accept",value) | |
| #endif | | #endif | |
| /** | | /** | |
| * Get one Accept header. | | * Get one Accept header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_accept (const osip_message_t * sip, int pos, | | int osip_message_get_accept(const osip_message_t * sip, int pos, | |
| osip_accept_t ** dest); | | osip_accept_ | |
| | | t ** dest); | |
| #else | | #else | |
| #define osip_message_get_accept(sip,pos,dest) osip_message_header_
get_byname(( osip_message_t *)sip,(const char *)"accept",pos,(osip_header_t
**)dest) | | #define osip_message_get_accept(sip,pos,dest) osip_message_header_
get_byname(( osip_message_t *)sip,(const char *)"accept",pos,(osip_header_t
**)dest) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Accept-encoding header. | | * Set the Accept-encoding header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_set_accept_encoding (osip_message_t * sip, const char *h
value); | | int osip_message_set_accept_encoding(osip_message_t * sip, const cha
r *hvalue); | |
| #else | | #else | |
| #define osip_message_set_accept_encoding(sip,value) osip_message
_set_header((osip_message_t *)sip,(const char *)"Accept-Encoding",value) | | #define osip_message_set_accept_encoding(sip,value) osip_message
_set_header((osip_message_t *)sip,(const char *)"Accept-Encoding",value) | |
| #endif | | #endif | |
| /** | | /** | |
| * Get one Accept-encoding header. | | * Get one Accept-encoding header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_accept_encoding (const osip_message_t * sip, int pos | | int osip_message_get_accept_encoding(const osip_message_t * sip, int | |
| , | | pos, | |
| osip_accept_encoding_t ** dest); | | | |
| | | osip_accept_encoding_t ** dest); | |
| #else | | #else | |
| #define osip_message_get_accept_encoding(sip,pos,dest) osip_messag
e_header_get_byname(( osip_message_t *)sip,(const char *)"accept-encoding",
pos,(osip_header_t **)dest) | | #define osip_message_get_accept_encoding(sip,pos,dest) osip_messag
e_header_get_byname(( osip_message_t *)sip,(const char *)"accept-encoding",
pos,(osip_header_t **)dest) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Accept-language header. | | * Set the Accept-language header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_set_accept_language (osip_message_t * sip, const char *h
value); | | int osip_message_set_accept_language(osip_message_t * sip, const cha
r *hvalue); | |
| #else | | #else | |
| #define osip_message_set_accept_language(sip,value) osip_message
_set_header((osip_message_t *)sip,(const char *)"Accept-Language",value) | | #define osip_message_set_accept_language(sip,value) osip_message
_set_header((osip_message_t *)sip,(const char *)"Accept-Language",value) | |
| #endif | | #endif | |
| /** | | /** | |
| * Get one Accept-Language header. | | * Get one Accept-Language header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_accept_language (const osip_message_t * sip, int pos | | int osip_message_get_accept_language(const osip_message_t * sip, int | |
| , | | pos, | |
| osip_accept_language_t ** dest); | | | |
| | | osip_accept_language_t ** dest); | |
| #else | | #else | |
| #define osip_message_get_accept_language(sip,pos,dest) osip_messag
e_header_get_byname(( osip_message_t *)sip,(const char *)"accept-language",
pos,(osip_header_t **)dest) | | #define osip_message_get_accept_language(sip,pos,dest) osip_messag
e_header_get_byname(( osip_message_t *)sip,(const char *)"accept-language",
pos,(osip_header_t **)dest) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Alert-info header. | | * Set the Alert-info header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_set_alert_info (osip_message_t * sip, const char *hvalue
); | | int osip_message_set_alert_info(osip_message_t * sip, const char *hv
alue); | |
| #else | | #else | |
| #define osip_message_set_alert_info(sip,value) osip_message_set_
header((osip_message_t *)sip,(const char *)"Alert-Info",value) | | #define osip_message_set_alert_info(sip,value) osip_message_set_
header((osip_message_t *)sip,(const char *)"Alert-Info",value) | |
| #endif | | #endif | |
| /** | | /** | |
| * Get one Alert-info header. | | * Get one Alert-info header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_alert_info (const osip_message_t * sip, int pos, | | int osip_message_get_alert_info(const osip_message_t * sip, int pos, | |
| osip_alert_info_t ** dest); | | osip | |
| | | _alert_info_t ** dest); | |
| #else | | #else | |
| #define osip_message_get_alert_info(sip,pos,dest) osip_message_hea
der_get_byname(( osip_message_t *)sip,(const char *)"alert-info",pos,(osip_
header_t **)dest) | | #define osip_message_get_alert_info(sip,pos,dest) osip_message_hea
der_get_byname(( osip_message_t *)sip,(const char *)"alert-info",pos,(osip_
header_t **)dest) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Allow header. | | * Set the Allow header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_set_allow (osip_message_t * sip, const char *hvalue); | | int osip_message_set_allow(osip_message_t * sip, const char *hvalue)
; | |
| #else | | #else | |
| #define osip_message_set_allow(sip,value) osip_message_set_heade
r((osip_message_t *)sip,(const char *)"Allow",value) | | #define osip_message_set_allow(sip,value) osip_message_set_heade
r((osip_message_t *)sip,(const char *)"Allow",value) | |
| #endif | | #endif | |
| /** | | /** | |
| * Get one Allow header. | | * Get one Allow header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_allow (const osip_message_t * sip, int pos, | | int osip_message_get_allow(const osip_message_t * sip, int pos, | |
| osip_allow_t ** dest); | | osip_allow_t ** d | |
| | | est); | |
| #else | | #else | |
| #define osip_message_get_allow(sip,pos,dest) osip_message_header_g
et_byname(( osip_message_t *)sip,(const char *)"allow",pos,(osip_header_t *
*)dest) | | #define osip_message_get_allow(sip,pos,dest) osip_message_header_g
et_byname(( osip_message_t *)sip,(const char *)"allow",pos,(osip_header_t *
*)dest) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Authentication-info header. | | * Set the Authentication-info header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_set_authentication_info (osip_message_t * sip, | | int osip_message_set_authentication_info(osip_message_t * sip, | |
| const char *hvalue); | | | |
| | | const char *hvalue); | |
| #else | | #else | |
| #define osip_message_set_authentication_info(sip,value) osip_mes
sage_set_header((osip_message_t *)sip,(const char *)"Authentication-Info",v
alue) | | #define osip_message_set_authentication_info(sip,value) osip_mes
sage_set_header((osip_message_t *)sip,(const char *)"Authentication-Info",v
alue) | |
| #endif | | #endif | |
| /** | | /** | |
| * Get one Authentication-info header. | | * Get one Authentication-info header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_authentication_info (const osip_message_t * sip, | | int osip_message_get_authentication_info(const osip_message_t * sip, | |
| int pos, | | | |
| osip_authentication_info_t ** d | | int pos, | |
| est); | | | |
| | | osip_authentication_info_t ** dest); | |
| #else | | #else | |
| #define osip_message_get_authentication_info(sip,pos,dest) osip_me
ssage_header_get_byname(( osip_message_t *)sip,(const char *)"authenticatio
n-info",pos,(osip_header_t **)dest) | | #define osip_message_get_authentication_info(sip,pos,dest) osip_me
ssage_header_get_byname(( osip_message_t *)sip,(const char *)"authenticatio
n-info",pos,(osip_header_t **)dest) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Authorization header. | | * Set the Authorization header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_authorization (osip_message_t * sip, const char *hva
lue); | | int osip_message_set_authorization(osip_message_t * sip, const char
*hvalue); | |
| /** | | /** | |
| * Get one Authorization header. | | * Get one Authorization header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_authorization (const osip_message_t * sip, int pos, | | int osip_message_get_authorization(const osip_message_t * sip, int p | |
| osip_authorization_t ** dest); | | os, | |
| | | o | |
| | | sip_authorization_t ** dest); | |
| #else | | #else | |
| #define osip_message_get_authorization(sip, pos, dest) osip_message_get_kno
wnheaderlist((&(sip)->authorizations), pos, (void **)(dest)) | | #define osip_message_get_authorization(sip, pos, dest) osip_message_get_kno
wnheaderlist((&(sip)->authorizations), pos, (void **)(dest)) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Call-id header. | | * Set the Call-id header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_call_id (osip_message_t * sip, const char *hvalue); | | int osip_message_set_call_id(osip_message_t * sip, const char *hvalu
e); | |
| /** | | /** | |
| * Get one Call-id header. | | * Get one Call-id header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| osip_call_id_t *osip_message_get_call_id (const osip_message_t * sip); | | osip_call_id_t *osip_message_get_call_id(const osip_message_t * sip)
; | |
| #else | | #else | |
| #define osip_message_get_call_id(sip) ((sip)->call_id) | | #define osip_message_get_call_id(sip) ((sip)->call_id) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Call-info header. | | * Set the Call-info header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_set_call_info (osip_message_t * sip, const char *hvalue)
; | | int osip_message_set_call_info(osip_message_t * sip, const char *hva
lue); | |
| #else | | #else | |
| #define osip_message_set_call_info(sip,value) osip_message_set_h
eader((osip_message_t *)sip,(const char *)"Call-Info",value) | | #define osip_message_set_call_info(sip,value) osip_message_set_h
eader((osip_message_t *)sip,(const char *)"Call-Info",value) | |
| #endif | | #endif | |
| /** | | /** | |
| * Get one Call-info header. | | * Get one Call-info header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_call_info (const osip_message_t * sip, int pos, | | int osip_message_get_call_info(const osip_message_t * sip, int pos, | |
| osip_call_info_t ** dest); | | osip_call | |
| | | _info_t ** dest); | |
| #else | | #else | |
| #define osip_message_get_call_info(sip,pos,dest) osip_message_head
er_get_byname(( osip_message_t *)sip,(const char *)"call-info",pos,(osip_he
ader_t **)dest) | | #define osip_message_get_call_info(sip,pos,dest) osip_message_head
er_get_byname(( osip_message_t *)sip,(const char *)"call-info",pos,(osip_he
ader_t **)dest) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Contact header. | | * Set the Contact header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_contact (osip_message_t * sip, const char *hvalue); | | int osip_message_set_contact(osip_message_t * sip, const char *hvalu
e); | |
| /** | | /** | |
| * Get one Contact header. | | * Get one Contact header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_contact (const osip_message_t * sip, int pos, | | int osip_message_get_contact(const osip_message_t * sip, int pos, | |
| osip_contact_t ** dest); | | osip_contac | |
| | | t_t ** dest); | |
| #else | | #else | |
| #define osip_message_get_contact(sip, pos, dest) osip_message_get_knownhead
erlist((&(sip)->contacts), pos, (void **)(dest)) | | #define osip_message_get_contact(sip, pos, dest) osip_message_get_knownhead
erlist((&(sip)->contacts), pos, (void **)(dest)) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Content-encoding header. | | * Set the Content-encoding header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_set_content_encoding (osip_message_t * sip, const char * | | int osip_message_set_content_encoding(osip_message_t * sip, | |
| hvalue); | | | |
| | | const char *hvalue); | |
| #else | | #else | |
| #define osip_message_set_content_encoding(sip,value) osip_messag
e_set_header((osip_message_t *)sip,(const char *)"Content-Encoding",value) | | #define osip_message_set_content_encoding(sip,value) osip_messag
e_set_header((osip_message_t *)sip,(const char *)"Content-Encoding",value) | |
| #endif | | #endif | |
| /** | | /** | |
| * Get one Content-encoding header. | | * Get one Content-encoding header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_content_encoding (const osip_message_t * sip, int po | | int osip_message_get_content_encoding(const osip_message_t * sip, in | |
| s, | | t pos, | |
| osip_content_encoding_t ** dest); | | | |
| | | osip_content_encoding_t ** dest); | |
| #else | | #else | |
| #define osip_message_get_content_encoding(sip,pos,dest) osip_messa
ge_header_get_byname(( osip_message_t *)sip,(const char *)"content-encoding
",pos,(osip_header_t **)dest) | | #define osip_message_get_content_encoding(sip,pos,dest) osip_messa
ge_header_get_byname(( osip_message_t *)sip,(const char *)"content-encoding
",pos,(osip_header_t **)dest) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Content-length header. | | * Set the Content-length header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_content_length (osip_message_t * sip, const char *hv
alue); | | int osip_message_set_content_length(osip_message_t * sip, const char
*hvalue); | |
| /** | | /** | |
| * Get one Content-length header. | | * Get one Content-length header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| osip_content_length_t *osip_message_get_content_length (const osip_messag | | osip_content_length_t *osip_message_get_content_length(const osip_me | |
| e_t | | ssage_t | |
| * sip); | | | |
| | | * sip); | |
| #else | | #else | |
| #define osip_message_get_content_length(sip) ((sip)->content_length) | | #define osip_message_get_content_length(sip) ((sip)->content_length) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Content-type header. | | * Set the Content-type header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_content_type (osip_message_t * sip, const char *hval
ue); | | int osip_message_set_content_type(osip_message_t * sip, const char *
hvalue); | |
| /** | | /** | |
| * Get one Content-type header. | | * Get one Content-type header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| osip_content_type_t *osip_message_get_content_type (const osip_message_t
* sip); | | osip_content_type_t *osip_message_get_content_type(const osip_messag
e_t * sip); | |
| #else | | #else | |
| #define osip_message_get_content_type(sip) ((sip)->content_type) | | #define osip_message_get_content_type(sip) ((sip)->content_type) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Cseq header. | | * Set the Cseq header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_cseq (osip_message_t * sip, const char *hvalue); | | int osip_message_set_cseq(osip_message_t * sip, const char *hvalue); | |
| /** | | /** | |
| * Get one Cseq header. | | * Get one Cseq header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| osip_cseq_t *osip_message_get_cseq (const osip_message_t * sip); | | osip_cseq_t *osip_message_get_cseq(const osip_message_t * sip); | |
| #else | | #else | |
| #define osip_message_get_cseq(sip) ((sip)->cseq) | | #define osip_message_get_cseq(sip) ((sip)->cseq) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Error-info header. | | * Set the Error-info header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_set_error_info (osip_message_t * sip, const char *hvalue
); | | int osip_message_set_error_info(osip_message_t * sip, const char *hv
alue); | |
| #else | | #else | |
| #define osip_message_set_error_info(sip,value) osip_message_set_
header((osip_message_t *)sip,(const char *)"Error-Info",value) | | #define osip_message_set_error_info(sip,value) osip_message_set_
header((osip_message_t *)sip,(const char *)"Error-Info",value) | |
| #endif | | #endif | |
| /** | | /** | |
| * Get one Error-info header. | | * Get one Error-info header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_error_info (const osip_message_t * sip, int pos, | | int osip_message_get_error_info(const osip_message_t * sip, int pos, | |
| osip_error_info_t ** dest); | | osip | |
| | | _error_info_t ** dest); | |
| #else | | #else | |
| #define osip_message_get_error_info(sip,pos,dest) osip_message_hea
der_get_byname(( osip_message_t *)sip,(const char *)"error-info",pos,(osip_
header_t **)dest) | | #define osip_message_get_error_info(sip,pos,dest) osip_message_hea
der_get_byname(( osip_message_t *)sip,(const char *)"error-info",pos,(osip_
header_t **)dest) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the From header. | | * Set the From header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_from (osip_message_t * sip, const char *hvalue); | | int osip_message_set_from(osip_message_t * sip, const char *hvalue); | |
| /** | | /** | |
| * Get the From header. | | * Get the From header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| osip_from_t *osip_message_get_from (const osip_message_t * sip); | | osip_from_t *osip_message_get_from(const osip_message_t * sip); | |
| #else | | #else | |
| #define osip_message_get_from(sip) ((sip)->from) | | #define osip_message_get_from(sip) ((sip)->from) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the mime-version header. | | * Set the mime-version header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_mime_version (osip_message_t * sip, const char *hval
ue); | | int osip_message_set_mime_version(osip_message_t * sip, const char *
hvalue); | |
| /** | | /** | |
| * Get the Mime-version header. | | * Get the Mime-version header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| osip_mime_version_t *osip_message_get_mime_version (const osip_message_t
* sip); | | osip_mime_version_t *osip_message_get_mime_version(const osip_messag
e_t * sip); | |
| #else | | #else | |
| #define osip_message_get_mime_version(sip) ((sip)->mime_version) | | #define osip_message_get_mime_version(sip) ((sip)->mime_version) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Proxy-authenticate header. | | * Set the Proxy-authenticate header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_proxy_authenticate (osip_message_t * sip, | | int osip_message_set_proxy_authenticate(osip_message_t * sip, | |
| const char *hvalue); | | | |
| | | const char *hvalue); | |
| /** | | /** | |
| * Get the Proxy-authenticate header. | | * Get the Proxy-authenticate header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_proxy_authenticate (const osip_message_t * sip, | | int osip_message_get_proxy_authenticate(const osip_message_t * sip, | |
| int pos, | | | |
| osip_proxy_authenticate_t ** des | | int pos, | |
| t); | | | |
| | | osip_proxy_authenticate_t ** dest); | |
| #else | | #else | |
| #define osip_message_get_proxy_authenticate(sip, pos, dest) osip_message_ge
t_knownheaderlist((&(sip)->proxy_authenticates), pos, (void **)(dest)) | | #define osip_message_get_proxy_authenticate(sip, pos, dest) osip_message_ge
t_knownheaderlist((&(sip)->proxy_authenticates), pos, (void **)(dest)) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Proxy-authorization header. | | * Set the Proxy-authorization header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_proxy_authorization (osip_message_t * sip, | | int osip_message_set_proxy_authorization(osip_message_t * sip, | |
| const char *hvalue); | | | |
| | | const char *hvalue); | |
| /** | | /** | |
| * Get one Proxy-authorization header. | | * Get one Proxy-authorization header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_proxy_authorization (const osip_message_t * sip, | | int osip_message_get_proxy_authorization(const osip_message_t * sip, | |
| int pos, | | | |
| osip_proxy_authorization_t ** d | | int pos, | |
| est); | | | |
| | | osip_proxy_authorization_t ** dest); | |
| #else | | #else | |
| #define osip_message_get_proxy_authorization(sip, pos, dest) osip_message_g
et_knownheaderlist((&(sip)->proxy_authorizations), pos, (void **)(dest)) | | #define osip_message_get_proxy_authorization(sip, pos, dest) osip_message_g
et_knownheaderlist((&(sip)->proxy_authorizations), pos, (void **)(dest)) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Proxy-authentication-info header. | | * Set the Proxy-authentication-info header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_set_proxy_authentication_info (osip_message_t * sip, | | int osip_message_set_proxy_authentication_info(osip_message_t * sip, | |
| const char *hvalue); | | | |
| | | const char *hvalue); | |
| #else | | #else | |
| #define osip_message_set_proxy_authentication_info(sip,value) os
ip_message_set_header((osip_message_t *)sip,(const char *)"Proxy-Authentica
tion-Info",value) | | #define osip_message_set_proxy_authentication_info(sip,value) os
ip_message_set_header((osip_message_t *)sip,(const char *)"Proxy-Authentica
tion-Info",value) | |
| #endif | | #endif | |
| /** | | /** | |
| * Get the Proxy-authentication-info header. | | * Get the Proxy-authentication-info header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_proxy_authentication_info (const osip_message_t * si | | int osip_message_get_proxy_authentication_info(const osip_message_t | |
| p, | | * sip, | |
| int pos, | | | |
| osip_proxy_authentication | | int pos, | |
| _info_t | | | |
| ** dest); | | osip_proxy_authentication_info_t | |
| | | | |
| | | ** dest); | |
| #else | | #else | |
| #define osip_message_get_proxy_authentication_info(sip,pos,dest) o
sip_message_header_get_byname(( osip_message_t *)sip,(const char *)"proxy-a
uthentication-info",pos,(osip_header_t **)dest) | | #define osip_message_get_proxy_authentication_info(sip,pos,dest) o
sip_message_header_get_byname(( osip_message_t *)sip,(const char *)"proxy-a
uthentication-info",pos,(osip_header_t **)dest) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Record-Route header. | | * Set the Record-Route header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_record_route (osip_message_t * sip, const char *hval
ue); | | int osip_message_set_record_route(osip_message_t * sip, const char *
hvalue); | |
| /** | | /** | |
| * Get one Record-route header. | | * Get one Record-route header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_record_route (const osip_message_t * sip, int pos, | | int osip_message_get_record_route(const osip_message_t * sip, int po | |
| osip_record_route_t ** dest); | | s, | |
| | | os | |
| | | ip_record_route_t ** dest); | |
| #else | | #else | |
| #define osip_message_get_record_route(sip, pos, dest) osip_message_get_know
nheaderlist((&(sip)->record_routes), pos, (void **)(dest)) | | #define osip_message_get_record_route(sip, pos, dest) osip_message_get_know
nheaderlist((&(sip)->record_routes), pos, (void **)(dest)) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Route header. | | * Set the Route header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_route (osip_message_t * sip, const char *hvalue); | | int osip_message_set_route(osip_message_t * sip, const char *hvalue)
; | |
| /** | | /** | |
| * Get one Route header. | | * Get one Route header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_route (const osip_message_t * sip, int pos, | | int osip_message_get_route(const osip_message_t * sip, int pos, | |
| osip_route_t ** dest); | | osip_route_t ** d | |
| | | est); | |
| #else | | #else | |
| #define osip_message_get_route(sip, pos, dest) osip_message_get_knownheader
list((&(sip)->routes), pos, (void **)(dest)) | | #define osip_message_get_route(sip, pos, dest) osip_message_get_knownheader
list((&(sip)->routes), pos, (void **)(dest)) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the To header. | | * Set the To header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_to (osip_message_t * sip, const char *hvalue); | | int osip_message_set_to(osip_message_t * sip, const char *hvalue); | |
| /** | | /** | |
| * Get the To header. | | * Get the To header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| osip_to_t *osip_message_get_to (const osip_message_t * sip); | | osip_to_t *osip_message_get_to(const osip_message_t * sip); | |
| #else | | #else | |
| #define osip_message_get_to(sip) ((sip)->to) | | #define osip_message_get_to(sip) ((sip)->to) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Via header. | | * Set the Via header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_via (osip_message_t * sip, const char *hvalue); | | int osip_message_set_via(osip_message_t * sip, const char *hvalue); | |
| /** | | /** | |
| * Append a Via header. | | * Append a Via header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_append_via (osip_message_t * sip, const char *hvalue); | | int osip_message_append_via(osip_message_t * sip, const char *hvalue
); | |
| /** | | /** | |
| * Get one Via header. | | * Get one Via header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_via (const osip_message_t * sip, int pos, | | int osip_message_get_via(const osip_message_t * sip, int pos, | |
| osip_via_t ** dest); | | osip_via_t ** dest) | |
| | | ; | |
| #else | | #else | |
| #define osip_message_get_via(sip, pos, dest) osip_message_get_knownheaderli
st((&(sip)->vias), pos, (void **)(dest)) | | #define osip_message_get_via(sip, pos, dest) osip_message_get_knownheaderli
st((&(sip)->vias), pos, (void **)(dest)) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Www-authenticate header. | | * Set the Www-authenticate header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_www_authenticate (osip_message_t * sip, const char * | | int osip_message_set_www_authenticate(osip_message_t * sip, | |
| hvalue); | | | |
| | | const char *hvalue); | |
| /** | | /** | |
| * Get one Www-authenticate header. | | * Get one Www-authenticate header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_www_authenticate (const osip_message_t * sip, int po | | int osip_message_get_www_authenticate(const osip_message_t * sip, in | |
| s, | | t pos, | |
| osip_www_authenticate_t ** dest); | | | |
| | | osip_www_authenticate_t ** dest); | |
| #else | | #else | |
| #define osip_message_get_www_authenticate(sip, pos, dest) osip_message_get_
knownheaderlist((&(sip)->www_authenticates), pos, (void **)(dest)) | | #define osip_message_get_www_authenticate(sip, pos, dest) osip_message_get_
knownheaderlist((&(sip)->www_authenticates), pos, (void **)(dest)) | |
| #endif | | #endif | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| /** | | /** | |
| * Allocate and Add multiple header (not defined in oSIP). | | * Allocate and Add multiple header (not defined in oSIP). | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hname The token name. NAME MUST BE DYNAMICLY ALLOCATED | | * @param hname The token name. NAME MUST BE DYNAMICLY ALLOCATED | |
| * @param hvalue The token value. VALUE MUST BE DYNAMICLY ALLOCATED | | * @param hvalue The token value. VALUE MUST BE DYNAMICLY ALLOCATED | |
| */ | | */ | |
|
| int osip_message_set_multiple_header (osip_message_t * sip, char *hname, | | int osip_message_set_multiple_header(osip_message_t * sip, char *hna | |
| char *hvalue); | | me, | |
| | | | |
| | | char *hvalue); | |
| #endif | | #endif | |
| /** | | /** | |
| * Allocate and Add an "unknown" header (not defined in oSIP). | | * Allocate and Add an "unknown" header (not defined in oSIP). | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hname The token name. | | * @param hname The token name. | |
| * @param hvalue The token value. | | * @param hvalue The token value. | |
| */ | | */ | |
|
| int osip_message_set_header (osip_message_t * sip, const char *hname, | | int osip_message_set_header(osip_message_t * sip, const char *hname, | |
| const char *hvalue); | | const char * | |
| | | hvalue); | |
| /** | | /** | |
| * Allocate and Add/Replace an "unknown" header (not defined in oSIP). | | * Allocate and Add/Replace an "unknown" header (not defined in oSIP). | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hname The token name. | | * @param hname The token name. | |
| * @param hvalue The token value. | | * @param hvalue The token value. | |
| */ | | */ | |
|
| int osip_message_replace_header (osip_message_t * sip, const char *hname, | | int osip_message_replace_header(osip_message_t * sip, const char *hn | |
| const char *hvalue); | | ame, | |
| | | cons | |
| | | t char *hvalue); | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
| /** | | /** | |
| * Allocate and Add an "unknown" header (not defined in oSIP). | | * Allocate and Add an "unknown" header (not defined in oSIP). | |
| * The element is add on the top of the unknown header list. | | * The element is add on the top of the unknown header list. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hname The token name. | | * @param hname The token name. | |
| * @param hvalue The token value. | | * @param hvalue The token value. | |
| */ | | */ | |
|
| int osip_message_set_topheader (osip_message_t * sip, const char *hname, | | int osip_message_set_topheader(osip_message_t * sip, const char *hna | |
| const char *hvalue); | | me, | |
| | | const cha | |
| | | r *hvalue); | |
| #endif | | #endif | |
| /** | | /** | |
| * Find an "unknown" header. (not defined in oSIP) | | * Find an "unknown" header. (not defined in oSIP) | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hname The name of the header to find. | | * @param hname The name of the header to find. | |
| * @param pos The index where to start searching for the header. | | * @param pos The index where to start searching for the header. | |
| * @param dest A pointer to the header found. | | * @param dest A pointer to the header found. | |
| */ | | */ | |
|
| int osip_message_header_get_byname (const osip_message_t * sip, | | int osip_message_header_get_byname(const osip_message_t * sip, | |
| const char *hname, int pos, | | c | |
| osip_header_t ** dest); | | onst char *hname, int pos, | |
| | | o | |
| | | sip_header_t ** dest); | |
| /** | | /** | |
| * Get one "unknown" header. | | * Get one "unknown" header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| #ifndef MINISZE | | #ifndef MINISZE | |
|
| int osip_message_get_header (const osip_message_t * sip, int pos, | | int osip_message_get_header(const osip_message_t * sip, int pos, | |
| osip_header_t ** dest); | | osip_header_ | |
| | | t ** dest); | |
| #else | | #else | |
| #define osip_message_get_header(sip, pos, dest) osip_message_get_knownheade
rlist((&(sip)->headers), pos, (void **)(dest)) | | #define osip_message_get_header(sip, pos, dest) osip_message_get_knownheade
rlist((&(sip)->headers), pos, (void **)(dest)) | |
| #endif | | #endif | |
| /** | | /** | |
| * Set the Body of the SIP message. | | * Set the Body of the SIP message. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param buf The buffer containing the body. | | * @param buf The buffer containing the body. | |
| * @param length The length of the buffer. | | * @param length The length of the buffer. | |
| */ | | */ | |
|
| int osip_message_set_body (osip_message_t * sip, const char *buf, size_t | | int osip_message_set_body(osip_message_t * sip, const char *buf, | |
| length); | | size_t length); | |
| /** | | /** | |
| * Set the Body of the SIP message. (please report bugs) | | * Set the Body of the SIP message. (please report bugs) | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param buf the buffer containing the body. | | * @param buf the buffer containing the body. | |
| * @param length The length of the buffer. | | * @param length The length of the buffer. | |
| */ | | */ | |
|
| int osip_message_set_body_mime (osip_message_t * sip, const char *buf, | | int osip_message_set_body_mime(osip_message_t * sip, const char *buf | |
| size_t length); | | , | |
| | | size_t le | |
| | | ngth); | |
| /** | | /** | |
| * Get one body header. | | * Get one body header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the body found. | | * @param dest A pointer on the body found. | |
| */ | | */ | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_message_get_body (const osip_message_t * sip, int pos, | | int osip_message_get_body(const osip_message_t * sip, int pos, | |
| osip_body_t ** dest); | | osip_body_t ** des | |
| | | t); | |
| #else | | #else | |
| #define osip_message_get_body(sip, pos, dest) osip_message_get_knownheaderl
ist((&(sip)->bodies), pos, (void **)(dest)) | | #define osip_message_get_body(sip, pos, dest) osip_message_get_knownheaderl
ist((&(sip)->bodies), pos, (void **)(dest)) | |
| #endif | | #endif | |
| | | | |
| /* trace facilities */ | | /* trace facilities */ | |
|
| #ifndef DOXYGEN /* avoid DOXYGEN warning */ | | #ifndef DOXYGEN /* avoid DOXYGEN war
ning */ | |
| #ifdef ENABLE_TRACE | | #ifdef ENABLE_TRACE | |
|
| void msg_logrequest (osip_message_t * sip, char *fmt); | | void msg_logrequest(osip_message_t * sip, char *fmt); | |
| void msg_logresponse (osip_message_t * sip, char *fmt); | | void msg_logresponse(osip_message_t * sip, char *fmt); | |
| #else | | #else | |
| #define msg_logrequest(P,Q) ; | | #define msg_logrequest(P,Q) ; | |
| #define msg_logresponse(P,Q) ; | | #define msg_logresponse(P,Q) ; | |
| #endif | | #endif | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * Allocate and Add a new Date header. | | * Allocate and Add a new Date header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param value the value of the new header. | | * @param value the value of the new header. | |
| | | | |
End of changes. 68 change blocks. |
| 121 lines changed or deleted | | 162 lines changed or added | |
|
| osip_port.h | | osip_port.h | |
| | | | |
| skipping to change at line 82 | | skipping to change at line 82 | |
| #include <string.h> | | #include <string.h> | |
| #include <time.h> | | #include <time.h> | |
| #include <sys/times.h> | | #include <sys/times.h> | |
| #include <stdarg.h> | | #include <stdarg.h> | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #define VA_START(a, f) va_start(a, f) | | #define VA_START(a, f) va_start(a, f) | |
| | | | |
| #if defined(__VXWORKS_OS__) | | #if defined(__VXWORKS_OS__) | |
| /* VxWorks lacks support for snprintf */ | | /* VxWorks lacks support for snprintf */ | |
|
| int osip_vsnprintf (char *buf, int max, const char *fmt, va_list ap); | | int osip_vsnprintf(char *buf, int max, const char *fmt, va_list ap); | |
| int osip_snprintf (char *buf, int max, const char *fmt, ...); | | int osip_snprintf(char *buf, int max, const char *fmt, ...); | |
| | | | |
| #define snprintf osip_snprintf | | #define snprintf osip_snprintf | |
| #define vsnprintf osip_vsnprintf | | #define vsnprintf osip_vsnprintf | |
| #endif | | #endif | |
| | | | |
|
| #else /* end of __VXWORKS_OS__ */ | | #else /* end of __VXWORKS_
OS__ */ | |
| | | | |
| #if defined (HAVE_CONFIG_H) | | #if defined (HAVE_CONFIG_H) | |
| #include <config.h> | | #include <config.h> | |
| # if defined (HAVE_STRING_H) | | # if defined (HAVE_STRING_H) | |
| # include <string.h> | | # include <string.h> | |
| # else | | # else | |
| # include <strings.h> | | # include <strings.h> | |
|
| # endif /* HAVE_STRING_H */ | | # endif /* HAVE_STRING_H */ | |
| #else | | #else | |
| # include <string.h> | | # include <string.h> | |
|
| #endif /* !HAVE_CONFIG_H */ | | #endif /* !HAVE_CONFIG_H */ | |
| | | | |
| #if defined (HAVE_SYS_TYPES_H) | | #if defined (HAVE_SYS_TYPES_H) | |
| # include <sys/types.h> | | # include <sys/types.h> | |
| #endif | | #endif | |
| | | | |
| #ifdef STDC_HEADERS | | #ifdef STDC_HEADERS | |
| # include <stdlib.h> | | # include <stdlib.h> | |
|
| #endif /* !STDC_HEADERS */ | | #endif /* !STDC_HEADERS */ | |
| | | | |
| #if defined(HAVE_STDARG_H) || defined(WIN32) | | #if defined(HAVE_STDARG_H) || defined(WIN32) | |
| # include <stdarg.h> | | # include <stdarg.h> | |
| # define VA_START(a, f) va_start(a, f) | | # define VA_START(a, f) va_start(a, f) | |
| #else | | #else | |
| # if defined(HAVE_VARARGS_H) | | # if defined(HAVE_VARARGS_H) | |
| # include <varargs.h> | | # include <varargs.h> | |
| # define VA_START(a, f) va_start(a) | | # define VA_START(a, f) va_start(a) | |
| # else | | # else | |
| # include <stdarg.h> | | # include <stdarg.h> | |
| | | | |
| skipping to change at line 131 | | skipping to change at line 131 | |
| #endif | | #endif | |
| | | | |
| #ifdef HAVE_TIME_H | | #ifdef HAVE_TIME_H | |
| # include <time.h> | | # include <time.h> | |
| #endif | | #endif | |
| | | | |
| #if defined (HAVE_SYS_TIME_H) | | #if defined (HAVE_SYS_TIME_H) | |
| # include <sys/time.h> | | # include <sys/time.h> | |
| #endif | | #endif | |
| | | | |
|
| #endif /* end of !__VXWORKS_OS__ */ | | #endif /* end of !__VXWORKS
_OS__ */ | |
| | | | |
| #ifdef _WIN32_WCE | | #ifdef _WIN32_WCE | |
| #define VA_START(a, f) va_start(a, f) | | #define VA_START(a, f) va_start(a, f) | |
| #endif | | #endif | |
| | | | |
| #ifdef WIN32 | | #ifdef WIN32 | |
| #define VA_START(a, f) va_start(a, f) | | #define VA_START(a, f) va_start(a, f) | |
| #endif | | #endif | |
| | | | |
| #ifdef __PSOS__ | | #ifdef __PSOS__ | |
| | | | |
| skipping to change at line 177 | | skipping to change at line 177 | |
| | | | |
| #include <osipparser2/osip_list.h> | | #include <osipparser2/osip_list.h> | |
| | | | |
| #define SIP_SYNTAX_ERROR (-1) | | #define SIP_SYNTAX_ERROR (-1) | |
| #define SIP_NETWORK_ERROR (-2) | | #define SIP_NETWORK_ERROR (-2) | |
| #define SIP_ECONNREFUSED (-3) | | #define SIP_ECONNREFUSED (-3) | |
| #define SIP_RESSOURCE_ERROR (-4) | | #define SIP_RESSOURCE_ERROR (-4) | |
| #define SIP_GLOBAL_ERROR (-5) | | #define SIP_GLOBAL_ERROR (-5) | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
|
| extern "C" | | extern "C" { | |
| { | | | |
| #endif | | #endif | |
| | | | |
| /**************************/ | | /**************************/ | |
| /* MALLOC redirections */ | | /* MALLOC redirections */ | |
| /**************************/ | | /**************************/ | |
| | | | |
| #if !defined(WIN32) && !defined(_WIN32_WCE) | | #if !defined(WIN32) && !defined(_WIN32_WCE) | |
| | | | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| typedef void *osip_malloc_func_t (size_t size); | | typedef void *osip_malloc_func_t(size_t size); | |
| typedef void osip_free_func_t (void *ptr); | | typedef void osip_free_func_t(void *ptr); | |
| typedef void *osip_realloc_func_t (void *ptr, size_t size); | | typedef void *osip_realloc_func_t(void *ptr, size_t size); | |
| | | | |
|
| extern osip_malloc_func_t *osip_malloc_func; | | extern osip_malloc_func_t *osip_malloc_func; | |
| extern osip_realloc_func_t *osip_realloc_func; | | extern osip_realloc_func_t *osip_realloc_func; | |
| extern osip_free_func_t *osip_free_func; | | extern osip_free_func_t *osip_free_func; | |
| | | | |
|
| void osip_set_allocators (osip_malloc_func_t * malloc_func, | | void osip_set_allocators(osip_malloc_func_t * malloc_func, | |
| osip_realloc_func_t * realloc_func, | | osip_realloc_func_t | |
| osip_free_func_t * free_func); | | * realloc_func, | |
| | | osip_free_func_t * | |
| | | free_func); | |
| #endif | | #endif | |
| | | | |
| #ifdef DEBUG_MEM | | #ifdef DEBUG_MEM | |
| | | | |
|
| void *_osip_malloc (size_t size, char *file, unsigned short line); | | void *_osip_malloc(size_t size, char *file, unsigned short line); | |
| void _osip_free (void *ptr); | | void _osip_free(void *ptr); | |
| void *_osip_realloc (void *ptr, size_t size, char *file, unsigned short l | | void *_osip_realloc(void *ptr, size_t size, char *file, unsigned sho | |
| ine); | | rt line); | |
| | | | |
| #ifndef osip_malloc | | #ifndef osip_malloc | |
| #define osip_malloc(S) _osip_malloc(S,__FILE__,__LINE__) | | #define osip_malloc(S) _osip_malloc(S,__FILE__,__LINE__) | |
| #endif | | #endif | |
| #ifndef osip_realloc | | #ifndef osip_realloc | |
| #define osip_realloc(P,S) _osip_realloc(P,S,__FILE__,__LINE__) | | #define osip_realloc(P,S) _osip_realloc(P,S,__FILE__,__LINE__) | |
| #endif | | #endif | |
| #ifndef osip_free | | #ifndef osip_free | |
| #define osip_free(P) { if (P!=NULL) { _osip_free(P); } } | | #define osip_free(P) { if (P!=NULL) { _osip_free(P); } } | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 231 | | skipping to change at line 230 | |
| #define osip_malloc(S) (osip_malloc_func?osip_malloc_func(S):malloc(S)) | | #define osip_malloc(S) (osip_malloc_func?osip_malloc_func(S):malloc(S)) | |
| #endif | | #endif | |
| #ifndef osip_realloc | | #ifndef osip_realloc | |
| #define osip_realloc(P,S) (osip_realloc_func?osip_realloc_func(P,S):realloc
(P,S)) | | #define osip_realloc(P,S) (osip_realloc_func?osip_realloc_func(P,S):realloc
(P,S)) | |
| #endif | | #endif | |
| #ifndef osip_free | | #ifndef osip_free | |
| #define osip_free(P) { if (P!=NULL) { if (osip_free_func) osip_free_func(P)
; else free(P);} } | | #define osip_free(P) { if (P!=NULL) { if (osip_free_func) osip_free_func(P)
; else free(P);} } | |
| #endif | | #endif | |
| | | | |
| #else | | #else | |
|
| /* MINISIZE code */ | | /* MINISIZE code */ | |
| #ifndef osip_malloc | | #ifndef osip_malloc | |
| #define osip_malloc(S) malloc(S) | | #define osip_malloc(S) malloc(S) | |
| #endif | | #endif | |
| #ifndef osip_realloc | | #ifndef osip_realloc | |
| #define osip_realloc(P,S) realloc(P,S) | | #define osip_realloc(P,S) realloc(P,S) | |
| #endif | | #endif | |
| #ifndef osip_free | | #ifndef osip_free | |
| #define osip_free(P) { if (P!=NULL) { free(P);} } | | #define osip_free(P) { if (P!=NULL) { free(P);} } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
| #else | | #else | |
| | | | |
|
| void *osip_malloc (size_t size); | | void *osip_malloc(size_t size); | |
| void *osip_realloc (void *, size_t size); | | void *osip_realloc(void *, size_t size); | |
| void osip_free (void *); | | void osip_free(void *); | |
| | | | |
| #endif | | #endif | |
| | | | |
| #ifdef WIN32 | | #ifdef WIN32 | |
| #define alloca _alloca | | #define alloca _alloca | |
| #endif | | #endif | |
| | | | |
| /**************************/ | | /**************************/ | |
| /* RANDOM number support */ | | /* RANDOM number support */ | |
| /**************************/ | | /**************************/ | |
| | | | |
|
| unsigned int osip_build_random_number (void); | | unsigned int osip_build_random_number(void); | |
| | | | |
| /**************************/ | | /**************************/ | |
| /* TIMER support */ | | /* TIMER support */ | |
| /**************************/ | | /**************************/ | |
| | | | |
| #define SP " \0" | | #define SP " \0" | |
| | | | |
|
| void osip_usleep (int useconds); | | void osip_usleep(int useconds); | |
| | | | |
| #ifndef MINISIZE | | #ifndef MINISIZE | |
|
| int osip_atoi (const char *number); | | int osip_atoi(const char *number); | |
| int osip_strcasecmp (const char *s1, const char *s2); | | int osip_strcasecmp(const char *s1, const char *s2); | |
| int osip_strncasecmp (const char *s1, const char *s2, size_t len); | | int osip_strncasecmp(const char *s1, const char *s2, size_t len); | |
| | | char *osip_strcasestr(const char *haystack, const char *needle); | |
| | | | |
| #else | | #else | |
| #define osip_atoi atoi | | #define osip_atoi atoi | |
| #define osip_strcasecmp strcasecmp | | #define osip_strcasecmp strcasecmp | |
| #define osip_strncasecmp strncasecmp | | #define osip_strncasecmp strncasecmp | |
|
| | | #define osip_strcasestr strcasestr | |
| #endif | | #endif | |
| | | | |
| /**************************/ | | /**************************/ | |
| /* STRING support */ | | /* STRING support */ | |
| /**************************/ | | /**************************/ | |
| | | | |
|
| char *osip_strncpy (char *dest, const char *src, size_t length); | | char *osip_strncpy(char *dest, const char *src, size_t length); | |
| char *osip_strdup (const char *ch); | | char *osip_strdup(const char *ch); | |
| char *osip_strdup_without_quote (const char *ch); | | char *osip_strdup_without_quote(const char *ch); | |
| int osip_tolower (char *word); | | int osip_tolower(char *word); | |
| int osip_clrspace (char *word); | | int osip_clrspace(char *word); | |
| char *__osip_sdp_append_string (char *string, size_t size, | | char *__osip_sdp_append_string(char *string, size_t size, | |
| char *cur, char *string_osip_to_append); | | char *cur | |
| int __osip_set_next_token (char **dest, char *buf, int end_separator, | | , char *string_osip_to_append); | |
| char **next); | | int __osip_set_next_token(char **dest, char *buf, int end_separator, | |
| /* find the next unescaped quote and return its index. */ | | char **next); | |
| char *__osip_quote_find (const char *qstring); | | /* find the next unescaped quote and return its index. */ | |
| char *osip_enquote (const char *s); | | char *__osip_quote_find(const char *qstring); | |
| void osip_dequote (char *s); | | char *osip_enquote(const char *s); | |
| | | void osip_dequote(char *s); | |
| | | | |
|
| unsigned long osip_hash (const char *str); | | unsigned long osip_hash(const char *str); | |
| char *osip_str_append (char *dst, const char *src); | | char *osip_str_append(char *dst, const char *src); | |
| char *osip_strn_append (char *dst, const char *src, size_t len); | | char *osip_strn_append(char *dst, const char *src, size_t len); | |
| char *osip_clrncpy (char *dst, const char *src, size_t len); | | char *osip_clrncpy(char *dst, const char *src, size_t len); | |
| | | | |
| /**************************/ | | /**************************/ | |
| /* LOG&DEBUG support */ | | /* LOG&DEBUG support */ | |
| /**************************/ | | /**************************/ | |
| | | | |
| #define LOG_TRUE 1 | | #define LOG_TRUE 1 | |
| #define LOG_FALSE 0 | | #define LOG_FALSE 0 | |
| /* levels */ | | /* levels */ | |
|
| typedef enum _trace_level | | typedef enum _trace_level { | |
| { | | TRACE_LEVEL0 = 0, | |
| TRACE_LEVEL0 = 0, | | #define OSIP_FATAL TRACE_LEVEL0 | |
| #define OSIP_FATAL 0 | | TRACE_LEVEL1 = 1, | |
| TRACE_LEVEL1 = 1, | | #define OSIP_BUG TRACE_LEVEL1 | |
| #define OSIP_BUG 1 | | TRACE_LEVEL2 = 2, | |
| TRACE_LEVEL2 = 2, | | #define OSIP_ERROR TRACE_LEVEL2 | |
| #define OSIP_ERROR 2 | | TRACE_LEVEL3 = 3, | |
| TRACE_LEVEL3 = 3, | | #define OSIP_WARNING TRACE_LEVEL3 | |
| #define OSIP_WARNING 3 | | TRACE_LEVEL4 = 4, | |
| TRACE_LEVEL4 = 4, | | #define OSIP_INFO1 TRACE_LEVEL4 | |
| #define OSIP_INFO1 4 | | TRACE_LEVEL5 = 5, | |
| TRACE_LEVEL5 = 5, | | #define OSIP_INFO2 TRACE_LEVEL5 | |
| #define OSIP_INFO2 5 | | TRACE_LEVEL6 = 6, | |
| TRACE_LEVEL6 = 6, | | #define OSIP_INFO3 TRACE_LEVEL6 | |
| #define OSIP_INFO3 6 | | TRACE_LEVEL7 = 7, | |
| TRACE_LEVEL7 = 7, | | #define OSIP_INFO4 TRACE_LEVEL7 | |
| #define OSIP_INFO4 7 | | END_TRACE_LEVEL = 8 | |
| END_TRACE_LEVEL = 8 | | } osip_trace_level_t; | |
| } | | | |
| osip_trace_level_t; | | | |
| | | | |
|
| typedef void osip_trace_func_t (char *fi, int li, osip_trace_level_t leve | | typedef void osip_trace_func_t(char *fi, int li, osip_trace_level_t | |
| l, | | level, | |
| char *chfr, va_list ap); | | char *chf | |
| | | r, va_list ap); | |
| | | | |
| /* these are defined in all cases, but are empty when oSIP is compiled | | /* these are defined in all cases, but are empty when oSIP is compiled | |
| without trace */ | | without trace */ | |
|
| void osip_trace_initialize_func (osip_trace_level_t level, | | void osip_trace_initialize_func(osip_trace_level_t level, | |
| osip_trace_func_t * func); | | osip | |
| void osip_trace_initialize_syslog (osip_trace_level_t level, char *ident) | | _trace_func_t * func); | |
| ; | | void osip_trace_initialize_syslog(osip_trace_level_t level, char *id | |
| void osip_trace_initialize (osip_trace_level_t level, FILE * file); | | ent); | |
| void osip_trace_enable_until_level (osip_trace_level_t level); | | void osip_trace_initialize(osip_trace_level_t level, FILE * file); | |
| void osip_trace_enable_level (osip_trace_level_t level); | | void osip_trace_enable_until_level(osip_trace_level_t level); | |
| void osip_trace_disable_level (osip_trace_level_t level); | | void osip_trace_enable_level(osip_trace_level_t level); | |
| int osip_is_trace_level_activate (osip_trace_level_t level); | | void osip_trace_disable_level(osip_trace_level_t level); | |
| | | int osip_is_trace_level_activate(osip_trace_level_t level); | |
| | | | |
| #ifndef ENABLE_TRACE | | #ifndef ENABLE_TRACE | |
| | | | |
| #define TRACE_INITIALIZE(level, file) do { } while (0) | | #define TRACE_INITIALIZE(level, file) do { } while (0) | |
| #define TRACE_ENABLE_LEVEL(level) do { } while (0) | | #define TRACE_ENABLE_LEVEL(level) do { } while (0) | |
| #define TRACE_DISABLE_LEVEL(level) do { } while (0) | | #define TRACE_DISABLE_LEVEL(level) do { } while (0) | |
| #define IS_TRACE_LEVEL_ACTIVATE(level) (-1) | | #define IS_TRACE_LEVEL_ACTIVATE(level) (-1) | |
| | | | |
| #else | | #else | |
| | | | |
| | | | |
| skipping to change at line 369 | | skipping to change at line 369 | |
| #define TRACE_DISABLE_LEVEL(level) osip_trace_disable_level ( level ) | | #define TRACE_DISABLE_LEVEL(level) osip_trace_disable_level ( level ) | |
| #define IS_TRACE_LEVEL_ACTIVATE(level) osip_is_trace_level_activate( level
) | | #define IS_TRACE_LEVEL_ACTIVATE(level) osip_is_trace_level_activate( level
) | |
| | | | |
| #endif | | #endif | |
| | | | |
| /* log facility. */ | | /* log facility. */ | |
| /* if f is NULL, current default log file is used. */ | | /* if f is NULL, current default log file is used. */ | |
| /* INPUT: level | level of the trace */ | | /* INPUT: level | level of the trace */ | |
| /* INPUT: f | use f instead of default log file */ | | /* INPUT: f | use f instead of default log file */ | |
| /* INPUT: chfr | format string for next args */ | | /* INPUT: chfr | format string for next args */ | |
|
| int osip_trace (char *fi, int li, osip_trace_level_t level, FILE * f, | | int osip_trace(char *fi, int li, osip_trace_level_t level, FILE * f, | |
| char *chfr, ...); | | char *chfr, ...); | |
| | | | |
| #ifdef ENABLE_TRACE | | #ifdef ENABLE_TRACE | |
| #define OSIP_TRACE(P) P | | #define OSIP_TRACE(P) P | |
| #else | | #else | |
| #define OSIP_TRACE(P) do {} while (0) | | #define OSIP_TRACE(P) do {} while (0) | |
| #endif | | #endif | |
| | | | |
| #define REMOVE_ELEMENT(first_element, element) \ | | #define REMOVE_ELEMENT(first_element, element) \ | |
| if (element->parent==NULL) \ | | if (element->parent==NULL) \ | |
| { first_element = element->next; \ | | { first_element = element->next; \ | |
| | | | |
| skipping to change at line 419 | | skipping to change at line 419 | |
| element->parent = NULL; /* useless */ } \ | | element->parent = NULL; /* useless */ } \ | |
| else \ | | else \ | |
| { type_of_element_t *f; \ | | { type_of_element_t *f; \ | |
| for (f=first_element; f->next!=NULL; f=f->next) \ | | for (f=first_element; f->next!=NULL; f=f->next) \ | |
| { } \ | | { } \ | |
| f->next = element; \ | | f->next = element; \ | |
| element->parent = f; \ | | element->parent = f; \ | |
| element->next = NULL; \ | | element->next = NULL; \ | |
| } | | } | |
| | | | |
|
| const char *osip_strerror(int err); | | const char *osip_strerror(int err); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| #define OSIP_SUCCESS 0 | | #define OSIP_SUCCESS 0 | |
| #define OSIP_UNDEFINED_ERROR -1 | | #define OSIP_UNDEFINED_ERROR -1 | |
| #define OSIP_BADPARAMETER -2 | | #define OSIP_BADPARAMETER -2 | |
| #define OSIP_WRONG_STATE -3 | | #define OSIP_WRONG_STATE -3 | |
| #define OSIP_NOMEM -4 | | #define OSIP_NOMEM -4 | |
| #define OSIP_SYNTAXERROR -5 | | #define OSIP_SYNTAXERROR -5 | |
| #define OSIP_NOTFOUND -6 | | #define OSIP_NOTFOUND -6 | |
| #define OSIP_API_NOT_INITIALIZED -7 | | #define OSIP_API_NOT_INITIALIZED -7 | |
|
| | | | |
| #define OSIP_NO_NETWORK -10 | | #define OSIP_NO_NETWORK -10 | |
| #define OSIP_PORT_BUSY -11 | | #define OSIP_PORT_BUSY -11 | |
| #define OSIP_UNKNOWN_HOST -12 | | #define OSIP_UNKNOWN_HOST -12 | |
|
| | | | |
| #define OSIP_DISK_FULL -30 | | #define OSIP_DISK_FULL -30 | |
| #define OSIP_NO_RIGHTS -31 | | #define OSIP_NO_RIGHTS -31 | |
| #define OSIP_FILE_NOT_EXIST -32 | | #define OSIP_FILE_NOT_EXIST -32 | |
|
| | | | |
| #define OSIP_TIMEOUT -50 | | #define OSIP_TIMEOUT -50 | |
| #define OSIP_TOOMUCHCALL -51 | | #define OSIP_TOOMUCHCALL -51 | |
| #define OSIP_WRONG_FORMAT -52 | | #define OSIP_WRONG_FORMAT -52 | |
| #define OSIP_NOCOMMONCODEC -53 | | #define OSIP_NOCOMMONCODEC -53 | |
|
| | | #endif /* _PORT_H_ */ | |
| #endif /* _PORT_H_ */ | | | |
| | | | |
End of changes. 29 change blocks. |
| 88 lines changed or deleted | | 89 lines changed or added | |
|
| osip_uri.h | | osip_uri.h | |
| | | | |
| skipping to change at line 42 | | skipping to change at line 42 | |
| * scheme are stored in url->string. | | * scheme are stored in url->string. | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @defgroup oSIP_URLS oSIP url parser Handling | | * @defgroup oSIP_URLS oSIP url parser Handling | |
| * @ingroup osip2_parser | | * @ingroup osip2_parser | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
|
| extern "C" | | extern "C" { | |
| { | | | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * Structure for referencing url parameters. | | * Structure for referencing url parameters. | |
| * @var osip_uri_param_t | | * @var osip_uri_param_t | |
| */ | | */ | |
|
| typedef struct osip_uri_param osip_uri_param_t; | | typedef struct osip_uri_param osip_uri_param_t; | |
| | | | |
| /** | | /** | |
| * Structure for referencing url parameters. | | * Structure for referencing url parameters. | |
| * @struct osip_uri_param | | * @struct osip_uri_param | |
| */ | | */ | |
|
| struct osip_uri_param | | struct osip_uri_param { | |
| { | | char *gname;/**< uri parameter name */ | |
| char *gname; /**< uri parameter name */ | | char *gvalue; | |
| char *gvalue; /**< uri parameter value */ | | /**< uri parameter value */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Structure for referencing url headers. | | * Structure for referencing url headers. | |
| * @var osip_uri_header_t | | * @var osip_uri_header_t | |
| */ | | */ | |
|
| typedef osip_uri_param_t osip_uri_header_t; | | typedef osip_uri_param_t osip_uri_header_t; | |
| | | | |
| /** | | /** | |
| * Allocate a url parameter element. | | * Allocate a url parameter element. | |
| * @param url_param The element to work on. | | * @param url_param The element to work on. | |
| */ | | */ | |
|
| int osip_uri_param_init (osip_uri_param_t ** url_param); | | int osip_uri_param_init(osip_uri_param_t ** url_param); | |
| /** | | /** | |
| * Free a url parameter element. | | * Free a url parameter element. | |
| * @param url_param The element to work on. | | * @param url_param The element to work on. | |
| */ | | */ | |
|
| void osip_uri_param_free (osip_uri_param_t * url_param); | | void osip_uri_param_free(osip_uri_param_t * url_param); | |
| /** | | /** | |
| * Set values of a url parameter element. | | * Set values of a url parameter element. | |
| * @param url_param The element to work on. | | * @param url_param The element to work on. | |
| * @param name The token name. | | * @param name The token name. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| int osip_uri_param_set (osip_uri_param_t * url_param, char *name, char *v
alue); | | int osip_uri_param_set(osip_uri_param_t * url_param, char *name, cha
r *value); | |
| /** | | /** | |
| * Clone a url parameter element. | | * Clone a url parameter element. | |
| * @param url_param The element to work on. | | * @param url_param The element to work on. | |
| * @param dest The resulting new allocated element. | | * @param dest The resulting new allocated element. | |
| */ | | */ | |
|
| int osip_uri_param_clone (const osip_uri_param_t * url_param, | | int osip_uri_param_clone(const osip_uri_param_t * url_param, | |
| osip_uri_param_t ** dest); | | osip_uri_param_t ** | |
| | | dest); | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| /* | | /* | |
| * Free a list of a url parameter element. | | * Free a list of a url parameter element. | |
| * @param url_params The list of url parameter element to free. | | * @param url_params The list of url parameter element to free. | |
| */ | | */ | |
|
| void osip_uri_param_freelist (osip_list_t * url_params); | | void osip_uri_param_freelist(osip_list_t * url_params); | |
| #endif | | #endif | |
| /** | | /** | |
| * Allocate and add a url parameter element in a list. | | * Allocate and add a url parameter element in a list. | |
| * @param url_params The list of url parameter element to work on. | | * @param url_params The list of url parameter element to work on. | |
| * @param name The token name. | | * @param name The token name. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| int osip_uri_param_add (osip_list_t * url_params, char *name, char *value
); | | int osip_uri_param_add(osip_list_t * url_params, char *name, char *v
alue); | |
| /** | | /** | |
| * Find in a url parameter element in a list. | | * Find in a url parameter element in a list. | |
| * @param url_params The list of url parameter element to work on. | | * @param url_params The list of url parameter element to work on. | |
| * @param name The name of the parameter element to find. | | * @param name The name of the parameter element to find. | |
| * @param dest A pointer on the element found. | | * @param dest A pointer on the element found. | |
| */ | | */ | |
|
| int osip_uri_param_get_byname (osip_list_t * url_params, char *name, | | int osip_uri_param_get_byname(osip_list_t * url_params, char *name, | |
| osip_uri_param_t ** dest); | | osip_uri_p | |
| | | aram_t ** dest); | |
| | | | |
| /** | | /** | |
| * Allocate a generic parameter element. | | * Allocate a generic parameter element. | |
| * @param url_header The element to work on. | | * @param url_header The element to work on. | |
| */ | | */ | |
| #define osip_uri_header_init(url_header) osip_uri_param_init(url_header) | | #define osip_uri_header_init(url_header) osip_uri_param_init(url_header) | |
| /** | | /** | |
| * Free a generic parameter element. | | * Free a generic parameter element. | |
| * @param url_header The element to work on. | | * @param url_header The element to work on. | |
| */ | | */ | |
| | | | |
| skipping to change at line 164 | | skipping to change at line 163 | |
| * @param url_headers The list of generic parameter element to work on. | | * @param url_headers The list of generic parameter element to work on. | |
| * @param name The name of the parameter element to find. | | * @param name The name of the parameter element to find. | |
| * @param dest A pointer on the element found. | | * @param dest A pointer on the element found. | |
| */ | | */ | |
| #define osip_uri_header_get_byname(url_headers,name,dest) osip_uri_param_ge
t_byname(url_headers,name,dest) | | #define osip_uri_header_get_byname(url_headers,name,dest) osip_uri_param_ge
t_byname(url_headers,name,dest) | |
| | | | |
| /** | | /** | |
| * Structure for referencing SIP urls. | | * Structure for referencing SIP urls. | |
| * @var osip_uri_t | | * @var osip_uri_t | |
| */ | | */ | |
|
| typedef struct osip_uri osip_uri_t; | | typedef struct osip_uri osip_uri_t; | |
| | | | |
| /** | | /** | |
| * Structure for referencing SIP urls. | | * Structure for referencing SIP urls. | |
| * @struct osip_uri | | * @struct osip_uri | |
| */ | | */ | |
|
| struct osip_uri | | struct osip_uri { | |
| { | | char *scheme; /**< Uri Scheme (sip or sips) */ | |
| char *scheme; /**< Uri Scheme (sip or sips) */ | | char *username; /**< Username */ | |
| char *username; /**< Username */ | | char *password; /**< Password */ | |
| char *password; /**< Password */ | | char *host; /**< Domain */ | |
| char *host; /**< Domain */ | | char *port; /**< Port number */ | |
| char *port; /**< Port number */ | | osip_list_t url_params;/**< Uri parameters */ | |
| osip_list_t url_params; /**< Uri parameters */ | | osip_list_t url_headers; | |
| osip_list_t url_headers; /**< Uri headers */ | | /**< Uri headers | |
| | | */ | |
| | | | |
|
| char *string; /**< Space for other url schemes. (http, mailto...) */ | | char *string; | |
| }; | | /**< Space for other url schemes. (http, | |
| | | mailto...) */ | |
| | | }; | |
| | | | |
| /** | | /** | |
| * Allocate a url element. | | * Allocate a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| */ | | */ | |
|
| int osip_uri_init (osip_uri_t ** url); | | int osip_uri_init(osip_uri_t ** url); | |
| /** | | /** | |
| * Free a url element. | | * Free a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| */ | | */ | |
|
| void osip_uri_free (osip_uri_t * url); | | void osip_uri_free(osip_uri_t * url); | |
| /** | | /** | |
| * Parse a url. | | * Parse a url. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| * @param buf The buffer to parse. | | * @param buf The buffer to parse. | |
| */ | | */ | |
|
| int osip_uri_parse (osip_uri_t * url, const char *buf); | | int osip_uri_parse(osip_uri_t * url, const char *buf); | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| /** | | /** | |
| * Parse the header part of a url. | | * Parse the header part of a url. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| * @param buf The buffer to parse. | | * @param buf The buffer to parse. | |
| */ | | */ | |
|
| int osip_uri_parse_headers (osip_uri_t * url, const char *buf); | | int osip_uri_parse_headers(osip_uri_t * url, const char *buf); | |
| /** | | /** | |
| * Parse the parameter part of a url. | | * Parse the parameter part of a url. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| * @param buf The buffer to parse. | | * @param buf The buffer to parse. | |
| */ | | */ | |
|
| int osip_uri_parse_params (osip_uri_t * url, const char *buf); | | int osip_uri_parse_params(osip_uri_t * url, const char *buf); | |
| #endif | | #endif | |
| /** | | /** | |
| * Get a string representation of a url element. | | * Get a string representation of a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| * @param dest The resulting new allocated buffer. | | * @param dest The resulting new allocated buffer. | |
| */ | | */ | |
|
| int osip_uri_to_str (const osip_uri_t * url, char **dest); | | int osip_uri_to_str(const osip_uri_t * url, char **dest); | |
| /** | | /** | |
| * Clone a url element. | | * Clone a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| * @param dest The resulting new allocated element. | | * @param dest The resulting new allocated element. | |
| */ | | */ | |
|
| int osip_uri_clone (const osip_uri_t * url, osip_uri_t ** dest); | | int osip_uri_clone(const osip_uri_t * url, osip_uri_t ** dest); | |
| /** | | /** | |
| * Get a canonical string representation of a url element. | | * Get a canonical string representation of a url element. | |
| * as defined in 10.3-5 | | * as defined in 10.3-5 | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| * @param dest The resulting new allocated buffer. | | * @param dest The resulting new allocated buffer. | |
| */ | | */ | |
|
| int osip_uri_to_str_canonical (const osip_uri_t * url, char **dest); | | int osip_uri_to_str_canonical(const osip_uri_t * url, char **dest); | |
| | | | |
| /** | | /** | |
| * Set the scheme of a url element. | | * Set the scheme of a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| void osip_uri_set_scheme (osip_uri_t * url, char *value); | | void osip_uri_set_scheme(osip_uri_t * url, char *value); | |
| /** | | /** | |
| * Get the scheme of a url element. | | * Get the scheme of a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| */ | | */ | |
|
| char *osip_uri_get_scheme (osip_uri_t * url); | | char *osip_uri_get_scheme(osip_uri_t * url); | |
| /** | | /** | |
| * Set the host of a url element. | | * Set the host of a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| void osip_uri_set_host (osip_uri_t * url, char *value); | | void osip_uri_set_host(osip_uri_t * url, char *value); | |
| /** | | /** | |
| * Get the host of a url element. | | * Get the host of a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| */ | | */ | |
|
| char *osip_uri_get_host (osip_uri_t * url); | | char *osip_uri_get_host(osip_uri_t * url); | |
| /** | | /** | |
| * Set the username of a url element. | | * Set the username of a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| void osip_uri_set_username (osip_uri_t * url, char *value); | | void osip_uri_set_username(osip_uri_t * url, char *value); | |
| /** | | /** | |
| * Get the username of a url element. | | * Get the username of a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| */ | | */ | |
|
| char *osip_uri_get_username (osip_uri_t * url); | | char *osip_uri_get_username(osip_uri_t * url); | |
| /** | | /** | |
| * Set the password of a url element. | | * Set the password of a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| void osip_uri_set_password (osip_uri_t * url, char *value); | | void osip_uri_set_password(osip_uri_t * url, char *value); | |
| /** | | /** | |
| * Get the password of a url element. | | * Get the password of a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| */ | | */ | |
|
| char *osip_uri_get_password (osip_uri_t * url); | | char *osip_uri_get_password(osip_uri_t * url); | |
| /** | | /** | |
| * Set the port of a url element. | | * Set the port of a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| void osip_uri_set_port (osip_uri_t * url, char *value); | | void osip_uri_set_port(osip_uri_t * url, char *value); | |
| /** | | /** | |
| * Get the port of a url element. | | * Get the port of a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| */ | | */ | |
|
| char *osip_uri_get_port (osip_uri_t * url); | | char *osip_uri_get_port(osip_uri_t * url); | |
| | | | |
| /** | | /** | |
| * Set the transport parameter to UDP in a url element. | | * Set the transport parameter to UDP in a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| */ | | */ | |
| #define osip_uri_set_transport_udp(url) osip_uri_param_add((&(url)->url_p
arams), osip_strdup("transport"), osip_strdup("udp")) | | #define osip_uri_set_transport_udp(url) osip_uri_param_add((&(url)->url_p
arams), osip_strdup("transport"), osip_strdup("udp")) | |
| /** | | /** | |
| * Set the transport parameter to TCP in a url element. | | * Set the transport parameter to TCP in a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| */ | | */ | |
| | | | |
| skipping to change at line 407 | | skipping to change at line 407 | |
| /** | | /** | |
| * Find in a url header element in a url element. | | * Find in a url header element in a url element. | |
| * @param url The element to work on. | | * @param url The element to work on. | |
| * @param name The name of the url header element to find. | | * @param name The name of the url header element to find. | |
| * @param dest A pointer on the element found. | | * @param dest A pointer on the element found. | |
| */ | | */ | |
| #define osip_uri_uheader_get_byname(url,name,dest) osip_uri_header_get_byna
me((&(url)->url_headers),name,dest) | | #define osip_uri_uheader_get_byname(url,name,dest) osip_uri_header_get_byna
me((&(url)->url_headers),name,dest) | |
| | | | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| /* internal method */ | | /* internal method */ | |
|
| char *next_separator (const char *ch, int separator_osip_to_find, | | char *next_separator(const char *ch, int separator_osip_to_find, | |
| int before_separator); | | int before_separator); | |
| | | | |
|
| char *__osip_uri_escape_nonascii_and_nondef (const char *string, | | char *__osip_uri_escape_nonascii_and_nondef(const char *string, | |
| const char *def); | | | |
| char *__osip_uri_escape_userinfo (const char *string); | | const char *def); | |
| char *__osip_uri_escape_password (const char *string); | | char *__osip_uri_escape_userinfo(const char *string); | |
| char *__osip_uri_escape_uri_param (char *string); | | char *__osip_uri_escape_password(const char *string); | |
| char *__osip_uri_escape_header_param (char *string); | | char *__osip_uri_escape_uri_param(char *string); | |
| void __osip_uri_unescape (char *string); | | char *__osip_uri_escape_header_param(char *string); | |
| | | void __osip_uri_unescape(char *string); | |
| | | | |
| #endif | | #endif | |
| | | | |
| /** @} */ | | /** @} */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
|
| | | #endif /* _URLS_H_ */ | |
| #endif /* _URLS_H_ */ | | | |
| | | | |
End of changes. 35 change blocks. |
| 57 lines changed or deleted | | 62 lines changed or added | |
|
| sdp_message.h | | sdp_message.h | |
| | | | |
| skipping to change at line 43 | | skipping to change at line 43 | |
| * This is the SDP accessor and parser related API. | | * This is the SDP accessor and parser related API. | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| * @defgroup oSIP_SDP oSIP SDP parser Handling | | * @defgroup oSIP_SDP oSIP SDP parser Handling | |
| * @ingroup osip2_sdp | | * @ingroup osip2_sdp | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
|
| extern "C" | | extern "C" { | |
| { | | | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * Structure for referencing bandwidth header. | | * Structure for referencing bandwidth header. | |
| * @var sdp_bandwidth_t | | * @var sdp_bandwidth_t | |
| */ | | */ | |
|
| typedef struct sdp_bandwidth sdp_bandwidth_t; | | typedef struct sdp_bandwidth sdp_bandwidth_t; | |
| | | | |
| /** | | /** | |
| * SDP bandwidth definition. | | * SDP bandwidth definition. | |
| * @struct sdp_bandwidth | | * @struct sdp_bandwidth | |
| */ | | */ | |
|
| struct sdp_bandwidth | | struct sdp_bandwidth { | |
| { | | char *b_bwtype; /**< bandwidth type */ | |
| char *b_bwtype; /**< bandwidth type */ | | char *b_bandwidth; /**< bandwidth value */ | |
| char *b_bandwidth; /**< bandwidth value */ | | }; | |
| }; | | | |
| | | | |
| /** | | /** | |
| * Allocate a bandwidth element. | | * Allocate a bandwidth element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
|
| int sdp_bandwidth_init (sdp_bandwidth_t ** elem); | | int sdp_bandwidth_init(sdp_bandwidth_t ** elem); | |
| /** | | /** | |
| * Free a bandwidth element. | | * Free a bandwidth element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
|
| void sdp_bandwidth_free (sdp_bandwidth_t * elem); | | void sdp_bandwidth_free(sdp_bandwidth_t * elem); | |
| | | | |
| /** | | /** | |
| * Structure for referencing time description header. | | * Structure for referencing time description header. | |
| * @var sdp_time_descr_t | | * @var sdp_time_descr_t | |
| */ | | */ | |
|
| typedef struct sdp_time_descr sdp_time_descr_t; | | typedef struct sdp_time_descr sdp_time_descr_t; | |
| | | | |
| /** | | /** | |
| * SDP Time description definition. | | * SDP Time description definition. | |
| * @struct sdp_time_descr | | * @struct sdp_time_descr | |
| */ | | */ | |
|
| struct sdp_time_descr | | struct sdp_time_descr { | |
| { | | char *t_start_time; /**< start time */ | |
| char *t_start_time; /**< start time */ | | char *t_stop_time; /**< stop time */ | |
| char *t_stop_time; /**< stop time */ | | osip_list_t r_repeats; /**< repeat headers */ | |
| osip_list_t r_repeats; /**< repeat headers */ | | }; | |
| }; | | | |
| | | | |
| /** | | /** | |
| * Allocate a time description element. | | * Allocate a time description element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
|
| int sdp_time_descr_init (sdp_time_descr_t ** elem); | | int sdp_time_descr_init(sdp_time_descr_t ** elem); | |
| /** | | /** | |
| * Free a time description element. | | * Free a time description element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
|
| void sdp_time_descr_free (sdp_time_descr_t * elem); | | void sdp_time_descr_free(sdp_time_descr_t * elem); | |
| | | | |
| /** | | /** | |
| * Structure for referencing key header. | | * Structure for referencing key header. | |
| * @var sdp_key_t | | * @var sdp_key_t | |
| */ | | */ | |
|
| typedef struct sdp_key sdp_key_t; | | typedef struct sdp_key sdp_key_t; | |
| | | | |
| /** | | /** | |
| * SDP key definition. | | * SDP key definition. | |
| * @struct sdp_key | | * @struct sdp_key | |
| */ | | */ | |
|
| struct sdp_key | | struct sdp_key { | |
| { | | char *k_keytype;/**< Key Type (prompt, clear, base64, uri) * | |
| char *k_keytype; /**< Key Type (prompt, clear, base64, uri) */ | | / | |
| char *k_keydata; /**< key data */ | | char *k_keydata;/**< key data */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Allocate a key element. | | * Allocate a key element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
|
| int sdp_key_init (sdp_key_t ** elem); | | int sdp_key_init(sdp_key_t ** elem); | |
| /** | | /** | |
| * Free a key element. | | * Free a key element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
|
| void sdp_key_free (sdp_key_t * elem); | | void sdp_key_free(sdp_key_t * elem); | |
| | | | |
| /** | | /** | |
| * Structure for referencing an attribute header. | | * Structure for referencing an attribute header. | |
| * @var sdp_attribute_t | | * @var sdp_attribute_t | |
| */ | | */ | |
|
| typedef struct sdp_attribute sdp_attribute_t; | | typedef struct sdp_attribute sdp_attribute_t; | |
| | | | |
| /** | | /** | |
| * SDP attribute definition. | | * SDP attribute definition. | |
| * @struct sdp_attribute | | * @struct sdp_attribute | |
| */ | | */ | |
|
| struct sdp_attribute | | struct sdp_attribute { | |
| { | | char *a_att_field; /**< attribute field */ | |
| char *a_att_field; /**< attribute field */ | | char *a_att_value; /**< attribute value (option | |
| char *a_att_value; /**< attribute value (optional) */ | | al) */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Allocate an attribute element. | | * Allocate an attribute element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
|
| int sdp_attribute_init (sdp_attribute_t ** elem); | | int sdp_attribute_init(sdp_attribute_t ** elem); | |
| /** | | /** | |
| * Free a attribute element. | | * Free a attribute element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
|
| void sdp_attribute_free (sdp_attribute_t * elem); | | void sdp_attribute_free(sdp_attribute_t * elem); | |
| | | | |
| /** | | /** | |
| * Structure for referencing a connection header. | | * Structure for referencing a connection header. | |
| * @var sdp_connection_t | | * @var sdp_connection_t | |
| */ | | */ | |
|
| typedef struct sdp_connection sdp_connection_t; | | typedef struct sdp_connection sdp_connection_t; | |
| | | | |
| /** | | /** | |
| * SDP connection definition. | | * SDP connection definition. | |
| * @struct sdp_connection | | * @struct sdp_connection | |
| */ | | */ | |
|
| struct sdp_connection | | struct sdp_connection { | |
| { | | char *c_nettype; /**< Network Type */ | |
| char *c_nettype; /**< Network Type */ | | char *c_addrtype; /**< Network Address Type * | |
| char *c_addrtype; /**< Network Address Type */ | | / | |
| char *c_addr; /**< Address */ | | char *c_addr; /**< Address */ | |
| char *c_addr_multicast_ttl; /**< TTL value for multicast address */ | | char *c_addr_multicast_ttl; | |
| char *c_addr_multicast_int; /**< Number of multicast address */ | | /**< TTL va | |
| }; | | lue for multicast address */ | |
| | | char *c_addr_multicast_int; | |
| | | /**< Number | |
| | | of multicast address */ | |
| | | }; | |
| | | | |
| /** | | /** | |
| * Allocate a connection element. | | * Allocate a connection element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
|
| int sdp_connection_init (sdp_connection_t ** elem); | | int sdp_connection_init(sdp_connection_t ** elem); | |
| /** | | /** | |
| * Free a connection element. | | * Free a connection element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
|
| void sdp_connection_free (sdp_connection_t * elem); | | void sdp_connection_free(sdp_connection_t * elem); | |
| | | | |
| /** | | /** | |
| * Structure for referencing a media header. | | * Structure for referencing a media header. | |
| * @var sdp_media_t | | * @var sdp_media_t | |
| */ | | */ | |
|
| typedef struct sdp_media sdp_media_t; | | typedef struct sdp_media sdp_media_t; | |
| | | | |
| /** | | /** | |
| * SDP media definition. | | * SDP media definition. | |
| * @struct sdp_media | | * @struct sdp_media | |
| */ | | */ | |
|
| struct sdp_media | | struct sdp_media { | |
| { | | char *m_media; /**< media type */ | |
| char *m_media; /**< media type */ | | char *m_port; /**< port number */ | |
| char *m_port; /**< port number */ | | char *m_number_of_port; /**< number of port */ | |
| char *m_number_of_port; /**< number of port */ | | char *m_proto; /**< protocol to be used */ | |
| char *m_proto; /**< protocol to be used */ | | osip_list_t m_payloads;/**< list of payloads (as strings) */ | |
| osip_list_t m_payloads; /**< list of payloads (as strings) */ | | | |
| | | | |
|
| char *i_info; /**< information header */ | | char *i_info; /**< information header */ | |
| osip_list_t c_connections; /**< list of sdp_connection_t * */ | | osip_list_t c_connections; | |
| osip_list_t b_bandwidths; /**< list of sdp_bandwidth_t * */ | | /**< list of sdp_ | |
| osip_list_t a_attributes; /**< list of sdp_attribute_t * */ | | connection_t * */ | |
| sdp_key_t *k_key; /**< key informations */ | | osip_list_t b_bandwidths; | |
| }; | | /**< list of sdp_ | |
| | | bandwidth_t * */ | |
| | | osip_list_t a_attributes; | |
| | | /**< list of sdp_ | |
| | | attribute_t * */ | |
| | | sdp_key_t *k_key; /**< key informations */ | |
| | | }; | |
| | | | |
| /** | | /** | |
| * Allocate a media element. | | * Allocate a media element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
|
| int sdp_media_init (sdp_media_t ** elem); | | int sdp_media_init(sdp_media_t ** elem); | |
| /** | | /** | |
| * Free a media element. | | * Free a media element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
|
| void sdp_media_free (sdp_media_t * elem); | | void sdp_media_free(sdp_media_t * elem); | |
| | | | |
| /** | | /** | |
| * Structure for referencing a SDP packet. | | * Structure for referencing a SDP packet. | |
| * @var sdp_message_t | | * @var sdp_message_t | |
| */ | | */ | |
|
| typedef struct sdp_message sdp_message_t; | | typedef struct sdp_message sdp_message_t; | |
| | | | |
| /** | | /** | |
| * SDP message definition. | | * SDP message definition. | |
| * @struct sdp_message | | * @struct sdp_message | |
| */ | | */ | |
|
| struct sdp_message | | struct sdp_message { | |
| { | | char *v_version; /**< version header */ | |
| char *v_version; /**< version header */ | | char *o_username; /**< Username */ | |
| char *o_username; /**< Username */ | | char *o_sess_id; /**< Identifier for session | |
| char *o_sess_id; /**< Identifier for session */ | | */ | |
| char *o_sess_version; /**< Version of session */ | | char *o_sess_version; /**< Version of session */ | |
| char *o_nettype; /**< Network type */ | | char *o_nettype; /**< Network type */ | |
| char *o_addrtype; /**< Address type */ | | char *o_addrtype; /**< Address type */ | |
| char *o_addr; /**< Address */ | | char *o_addr; /**< Address */ | |
| char *s_name; /**< Subject header */ | | char *s_name; /**< Subject header */ | |
| char *i_info; /**< Information header */ | | char *i_info; /**< Information header */ | |
| char *u_uri; /**< Uri header */ | | char *u_uri; /**< Uri header */ | |
| osip_list_t e_emails; /**< list of mail address */ | | osip_list_t e_emails; /**< list of mail address */ | |
| osip_list_t p_phones; /**< list of phone numbers * */ | | osip_list_t p_phones; /**< list of phone numbers * */ | |
| sdp_connection_t *c_connection; /**< Connection information */ | | sdp_connection_t *c_connection; | |
| osip_list_t b_bandwidths; /**< list of bandwidth info (sdp_bandwidth_t | | /* | |
| ) */ | | *< Connection information */ | |
| osip_list_t t_descrs; /**< list of time description (sdp_time_desc | | osip_list_t b_bandwidths; | |
| r_t) */ | | /**< list of band | |
| char *z_adjustments; /**< Time adjustment header */ | | width info (sdp_bandwidth_t) */ | |
| sdp_key_t *k_key; /**< Key information header */ | | osip_list_t t_descrs; /**< list of time description (sdp_ti | |
| osip_list_t a_attributes; /**< list of global attributes (sdp_attribut | | me_descr_t) */ | |
| e_t) */ | | char *z_adjustments; /**< Time adjustment header */ | |
| osip_list_t m_medias; /**< list of supported media (sdp_media_t) * | | sdp_key_t *k_key; /**< Key information header | |
| / | | */ | |
| }; | | osip_list_t a_attributes; | |
| | | /**< list of glob | |
| | | al attributes (sdp_attribute_t) */ | |
| | | osip_list_t m_medias; /**< list of supported media (sdp_med | |
| | | ia_t) */ | |
| | | }; | |
| | | | |
| /** | | /** | |
| * Allocate a SDP packet. | | * Allocate a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| */ | | */ | |
|
| int sdp_message_init (sdp_message_t ** sdp); | | int sdp_message_init(sdp_message_t ** sdp); | |
| /** | | /** | |
| * Parse a SDP packet. | | * Parse a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param buf The buffer to parse. | | * @param buf The buffer to parse. | |
| */ | | */ | |
|
| int sdp_message_parse (sdp_message_t * sdp, const char *buf); | | int sdp_message_parse(sdp_message_t * sdp, const char *buf); | |
| /** | | /** | |
| * Get a string representation of a SDP packet. | | * Get a string representation of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param dest The resulting new allocated buffer. | | * @param dest The resulting new allocated buffer. | |
| */ | | */ | |
|
| int sdp_message_to_str (sdp_message_t * sdp, char **dest); | | int sdp_message_to_str(sdp_message_t * sdp, char **dest); | |
| /** | | /** | |
| * Free a SDP packet. | | * Free a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| */ | | */ | |
|
| void sdp_message_free (sdp_message_t * sdp); | | void sdp_message_free(sdp_message_t * sdp); | |
| /** | | /** | |
| * Clone a SDP packet. | | * Clone a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param dest The cloned element. | | * @param dest The cloned element. | |
| */ | | */ | |
|
| int sdp_message_clone (sdp_message_t * sdp, sdp_message_t ** dest); | | int sdp_message_clone(sdp_message_t * sdp, sdp_message_t ** dest); | |
| | | | |
| /** | | /** | |
| * Set the version in a SDP packet. | | * Set the version in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| int sdp_message_v_version_set (sdp_message_t * sdp, char *value); | | int sdp_message_v_version_set(sdp_message_t * sdp, char *value); | |
| /** | | /** | |
| * Get the version ('v' field) of a SDP packet. | | * Get the version ('v' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| */ | | */ | |
|
| char *sdp_message_v_version_get (sdp_message_t * sdp); | | char *sdp_message_v_version_get(sdp_message_t * sdp); | |
| /** | | /** | |
| * Set the origin field in a SDP packet. | | * Set the origin field in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param username The token value. | | * @param username The token value. | |
| * @param sess_id The token value. | | * @param sess_id The token value. | |
| * @param sess_version The token value. | | * @param sess_version The token value. | |
| * @param nettype The token value. | | * @param nettype The token value. | |
| * @param addrtype The token value. | | * @param addrtype The token value. | |
| * @param addr The token value. | | * @param addr The token value. | |
| */ | | */ | |
|
| int sdp_message_o_origin_set (sdp_message_t * sdp, char *username, | | int sdp_message_o_origin_set(sdp_message_t * sdp, char *username, | |
| char *sess_id, char *sess_version, | | char *sess_ | |
| char *nettype, char *addrtype, char *addr); | | id, char *sess_version, | |
| | | char *netty | |
| | | pe, char *addrtype, char *addr); | |
| /** | | /** | |
| * Get the username ('o' field) of a SDP packet. | | * Get the username ('o' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| */ | | */ | |
|
| char *sdp_message_o_username_get (sdp_message_t * sdp); | | char *sdp_message_o_username_get(sdp_message_t * sdp); | |
| /** | | /** | |
| * Get the session id ('o' field) of a SDP packet. | | * Get the session id ('o' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| */ | | */ | |
|
| char *sdp_message_o_sess_id_get (sdp_message_t * sdp); | | char *sdp_message_o_sess_id_get(sdp_message_t * sdp); | |
| /** | | /** | |
| * Get the session version ('o' field) of a SDP packet. | | * Get the session version ('o' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| */ | | */ | |
|
| char *sdp_message_o_sess_version_get (sdp_message_t * sdp); | | char *sdp_message_o_sess_version_get(sdp_message_t * sdp); | |
| /** | | /** | |
| * Get the nettype ('o' field) of a SDP packet. | | * Get the nettype ('o' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| */ | | */ | |
|
| char *sdp_message_o_nettype_get (sdp_message_t * sdp); | | char *sdp_message_o_nettype_get(sdp_message_t * sdp); | |
| /** | | /** | |
| * Get the addrtype ('o' field) of a SDP packet. | | * Get the addrtype ('o' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| */ | | */ | |
|
| char *sdp_message_o_addrtype_get (sdp_message_t * sdp); | | char *sdp_message_o_addrtype_get(sdp_message_t * sdp); | |
| /** | | /** | |
| * Get the addr ('o' field) of a SDP packet. | | * Get the addr ('o' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| */ | | */ | |
|
| char *sdp_message_o_addr_get (sdp_message_t * sdp); | | char *sdp_message_o_addr_get(sdp_message_t * sdp); | |
| /** | | /** | |
| * Set the session name in a SDP packet. | | * Set the session name in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| int sdp_message_s_name_set (sdp_message_t * sdp, char *value); | | int sdp_message_s_name_set(sdp_message_t * sdp, char *value); | |
| /** | | /** | |
| * Get the session name ('s' field) of a SDP packet. | | * Get the session name ('s' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| */ | | */ | |
|
| char *sdp_message_s_name_get (sdp_message_t * sdp); | | char *sdp_message_s_name_get(sdp_message_t * sdp); | |
| /** | | /** | |
| * Set the version in a SDP packet. | | * Set the version in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| int sdp_message_i_info_set (sdp_message_t * sdp, int pos_media, char *val
ue); | | int sdp_message_i_info_set(sdp_message_t * sdp, int pos_media, char
*value); | |
| /** | | /** | |
| * Get the session info ('i' field) of a SDP packet. | | * Get the session info ('i' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| */ | | */ | |
|
| char *sdp_message_i_info_get (sdp_message_t * sdp, int pos_media); | | char *sdp_message_i_info_get(sdp_message_t * sdp, int pos_media); | |
| /** | | /** | |
| * Set the session info in a SDP packet. | | * Set the session info in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| int sdp_message_u_uri_set (sdp_message_t * sdp, char *value); | | int sdp_message_u_uri_set(sdp_message_t * sdp, char *value); | |
| /** | | /** | |
| * Get the uri ('u' field) of a SDP packet. | | * Get the uri ('u' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| */ | | */ | |
|
| char *sdp_message_u_uri_get (sdp_message_t * sdp); | | char *sdp_message_u_uri_get(sdp_message_t * sdp); | |
| /** | | /** | |
| * Set the version in a SDP packet. | | * Set the version in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| int sdp_message_e_email_add (sdp_message_t * sdp, char *value); | | int sdp_message_e_email_add(sdp_message_t * sdp, char *value); | |
| /** | | /** | |
| * OBSOLETE: see sdp_message_e_email_get | | * OBSOLETE: see sdp_message_e_email_get | |
| * @def sdp_e_email_get | | * @def sdp_e_email_get | |
| */ | | */ | |
| #define sdp_e_email_get sdp_message_e_email_get | | #define sdp_e_email_get sdp_message_e_email_get | |
| /** | | /** | |
| * Get one of the email ('e' field) of a SDP packet. | | * Get one of the email ('e' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos the index of the email line. | | * @param pos the index of the email line. | |
| */ | | */ | |
|
| char *sdp_message_e_email_get (sdp_message_t * sdp, int pos); | | char *sdp_message_e_email_get(sdp_message_t * sdp, int pos); | |
| /** | | /** | |
| * Set the version in a SDP packet. | | * Set the version in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| int sdp_message_p_phone_add (sdp_message_t * sdp, char *value); | | int sdp_message_p_phone_add(sdp_message_t * sdp, char *value); | |
| /** | | /** | |
| * Get one of the phone ('p' field) of a SDP packet. | | * Get one of the phone ('p' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos the index of the phone line. | | * @param pos the index of the phone line. | |
| */ | | */ | |
|
| char *sdp_message_p_phone_get (sdp_message_t * sdp, int pos); | | char *sdp_message_p_phone_get(sdp_message_t * sdp, int pos); | |
| /** | | /** | |
| * Set the version in a SDP packet. | | * Set the version in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param nettype The token value. | | * @param nettype The token value. | |
| * @param addrtype The token value. | | * @param addrtype The token value. | |
| * @param addr The token value. | | * @param addr The token value. | |
| * @param addr_multicast_ttl The token value. | | * @param addr_multicast_ttl The token value. | |
| * @param addr_multicast_int The token value. | | * @param addr_multicast_int The token value. | |
| */ | | */ | |
|
| int sdp_message_c_connection_add (sdp_message_t * sdp, int pos_media, | | int sdp_message_c_connection_add(sdp_message_t * sdp, int pos_media, | |
| char *nettype, char *addrtype, | | cha | |
| char *addr, char *addr_multicast_ttl, | | r *nettype, char *addrtype, | |
| char *addr_multicast_int); | | cha | |
| | | r *addr, char *addr_multicast_ttl, | |
| | | cha | |
| | | r *addr_multicast_int); | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| /* this method should be internal only... */ | | /* this method should be internal only... */ | |
|
| sdp_connection_t *sdp_message_connection_get (sdp_message_t * sdp, | | sdp_connection_t *sdp_message_connection_get(sdp_message_t * sdp, | |
| int pos_media, int pos); | | | |
| | | int pos_media, int pos); | |
| #endif | | #endif | |
| /** | | /** | |
| * Get the network type ('c' field) of a SDP packet. | | * Get the network type ('c' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The index in the connection element list.. | | * @param pos The index in the connection element list.. | |
| */ | | */ | |
|
| char *sdp_message_c_nettype_get (sdp_message_t * sdp, int pos_media, int
pos); | | char *sdp_message_c_nettype_get(sdp_message_t * sdp, int pos_media,
int pos); | |
| /** | | /** | |
| * Get the address type ('c' field) of a SDP packet. | | * Get the address type ('c' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The index in the connection element list.. | | * @param pos The index in the connection element list.. | |
| */ | | */ | |
|
| char *sdp_message_c_addrtype_get (sdp_message_t * sdp, int pos_media, int
pos); | | char *sdp_message_c_addrtype_get(sdp_message_t * sdp, int pos_media,
int pos); | |
| /** | | /** | |
| * Get the address ('c' field) of a SDP packet. | | * Get the address ('c' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The index in the connection element list.. | | * @param pos The index in the connection element list.. | |
| */ | | */ | |
|
| char *sdp_message_c_addr_get (sdp_message_t * sdp, int pos_media, int pos
); | | char *sdp_message_c_addr_get(sdp_message_t * sdp, int pos_media, int
pos); | |
| /** | | /** | |
| * Get the multicast ttl ('c' field) of a SDP packet. | | * Get the multicast ttl ('c' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The index in the connection element list.. | | * @param pos The index in the connection element list.. | |
| */ | | */ | |
|
| char *sdp_message_c_addr_multicast_ttl_get (sdp_message_t * sdp, | | char *sdp_message_c_addr_multicast_ttl_get(sdp_message_t * sdp, | |
| int pos_media, int pos); | | | |
| | | int pos_media, int pos); | |
| /** | | /** | |
| * Get the multicast int info ('c' field) of a SDP packet. | | * Get the multicast int info ('c' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The index in the connection element list.. | | * @param pos The index in the connection element list.. | |
| */ | | */ | |
|
| char *sdp_message_c_addr_multicast_int_get (sdp_message_t * sdp, | | char *sdp_message_c_addr_multicast_int_get(sdp_message_t * sdp, | |
| int pos_media, int pos); | | | |
| | | int pos_media, int pos); | |
| /** | | /** | |
| * Set the version in a SDP packet. | | * Set the version in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param bwtype The token value. | | * @param bwtype The token value. | |
| * @param bandwidth The token value. | | * @param bandwidth The token value. | |
| */ | | */ | |
|
| int sdp_message_b_bandwidth_add (sdp_message_t * sdp, int pos_media, | | int sdp_message_b_bandwidth_add(sdp_message_t * sdp, int pos_media, | |
| char *bwtype, char *bandwidth); | | char | |
| | | *bwtype, char *bandwidth); | |
| /** | | /** | |
| * Get the bandwidth ('b' field) of a SDP packet. | | * Get the bandwidth ('b' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The index in the bandwidth element list.. | | * @param pos The index in the bandwidth element list.. | |
| */ | | */ | |
|
| sdp_bandwidth_t *sdp_message_bandwidth_get (sdp_message_t * sdp, | | sdp_bandwidth_t *sdp_message_bandwidth_get(sdp_message_t * sdp, | |
| int pos_media, int pos); | | | |
| | | int pos_media, int pos); | |
| /** | | /** | |
| * Get the bandwidth type ('b' field) of a SDP packet. | | * Get the bandwidth type ('b' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The index in the bandwidth element list.. | | * @param pos The index in the bandwidth element list.. | |
| */ | | */ | |
|
| char *sdp_message_b_bwtype_get (sdp_message_t * sdp, int pos_media, int p
os); | | char *sdp_message_b_bwtype_get(sdp_message_t * sdp, int pos_media, i
nt pos); | |
| /** | | /** | |
| * Get the bandwidth value ('b' field) of a SDP packet. | | * Get the bandwidth value ('b' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The index in the bandwidth element list.. | | * @param pos The index in the bandwidth element list.. | |
| */ | | */ | |
|
| char *sdp_message_b_bandwidth_get (sdp_message_t * sdp, int pos_media, in
t pos); | | char *sdp_message_b_bandwidth_get(sdp_message_t * sdp, int pos_media
, int pos); | |
| /** | | /** | |
| * Set the version in a SDP packet. | | * Set the version in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param start The token value. | | * @param start The token value. | |
| * @param stop The token value. | | * @param stop The token value. | |
| */ | | */ | |
|
| int sdp_message_t_time_descr_add (sdp_message_t * sdp, char *start, char
*stop); | | int sdp_message_t_time_descr_add(sdp_message_t * sdp, char *start, c
har *stop); | |
| /** | | /** | |
| * Get the start time value ('t' field) of a SDP packet. | | * Get the start time value ('t' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_td The time description line number. | | * @param pos_td The time description line number. | |
| */ | | */ | |
|
| char *sdp_message_t_start_time_get (sdp_message_t * sdp, int pos_td); | | char *sdp_message_t_start_time_get(sdp_message_t * sdp, int pos_td); | |
| /** | | /** | |
| * Get the stop time value ('t' field) of a SDP packet. | | * Get the stop time value ('t' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_td The time description line number. | | * @param pos_td The time description line number. | |
| */ | | */ | |
|
| char *sdp_message_t_stop_time_get (sdp_message_t * sdp, int pos_td); | | char *sdp_message_t_stop_time_get(sdp_message_t * sdp, int pos_td); | |
| /** | | /** | |
| * Set the repeat information ('r' field) in a SDP packet. | | * Set the repeat information ('r' field) in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_time_descr index of t field. | | * @param pos_time_descr index of t field. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| int sdp_message_r_repeat_add (sdp_message_t * sdp, int pos_time_descr, | | int sdp_message_r_repeat_add(sdp_message_t * sdp, int pos_time_descr | |
| char *value); | | , | |
| | | char *value | |
| | | ); | |
| /** | | /** | |
| * Get the repeat information ('r' field) in a SDP packet. | | * Get the repeat information ('r' field) in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_time_descr index of t field. | | * @param pos_time_descr index of t field. | |
| * @param pos_repeat index of element in the 'r' field. | | * @param pos_repeat index of element in the 'r' field. | |
| */ | | */ | |
|
| char *sdp_message_r_repeat_get (sdp_message_t * sdp, int pos_time_descr, | | char *sdp_message_r_repeat_get(sdp_message_t * sdp, int pos_time_des | |
| int pos_repeat); | | cr, | |
| | | int pos_r | |
| | | epeat); | |
| /** | | /** | |
| * Set the adjustments ('z' field) of a SDP packet. | | * Set the adjustments ('z' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
|
| int sdp_message_z_adjustments_set (sdp_message_t * sdp, char *value); | | int sdp_message_z_adjustments_set(sdp_message_t * sdp, char *value); | |
| /** | | /** | |
| * Get the adjustments ('z' field) of a SDP packet. | | * Get the adjustments ('z' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| */ | | */ | |
|
| char *sdp_message_z_adjustments_get (sdp_message_t * sdp); | | char *sdp_message_z_adjustments_get(sdp_message_t * sdp); | |
| /** | | /** | |
| * Add a key in a SDP packet. | | * Add a key in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media index of m field. | | * @param pos_media index of m field. | |
| * @param keytype The token value. | | * @param keytype The token value. | |
| * @param keydata The token value. | | * @param keydata The token value. | |
| */ | | */ | |
|
| int sdp_message_k_key_set (sdp_message_t * sdp, int pos_media, | | int sdp_message_k_key_set(sdp_message_t * sdp, int pos_media, | |
| char *keytype, char *keydata); | | char *keytype, cha | |
| | | r *keydata); | |
| /** | | /** | |
| * Get the key type ('k' field) of a SDP packet. | | * Get the key type ('k' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| */ | | */ | |
|
| char *sdp_message_k_keytype_get (sdp_message_t * sdp, int pos_media); | | char *sdp_message_k_keytype_get(sdp_message_t * sdp, int pos_media); | |
| /** | | /** | |
| * Get the key value ('k' field) of a SDP packet. | | * Get the key value ('k' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| */ | | */ | |
|
| char *sdp_message_k_keydata_get (sdp_message_t * sdp, int pos_media); | | char *sdp_message_k_keydata_get(sdp_message_t * sdp, int pos_media); | |
| /** | | /** | |
| * Set the version in a SDP packet. | | * Set the version in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| * @param att_field The token value. | | * @param att_field The token value. | |
| * @param att_value The token value. | | * @param att_value The token value. | |
| */ | | */ | |
|
| int sdp_message_a_attribute_add (sdp_message_t * sdp, int pos_media, | | int sdp_message_a_attribute_add(sdp_message_t * sdp, int pos_media, | |
| char *att_field, char *att_value); | | char | |
| | | *att_field, char *att_value); | |
| /** | | /** | |
| * delete all attribute fields specified by att_field. | | * delete all attribute fields specified by att_field. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| * @param att_field The value to remove. | | * @param att_field The value to remove. | |
| */ | | */ | |
|
| int sdp_message_a_attribute_del (sdp_message_t * sdp, int pos_media, | | int sdp_message_a_attribute_del(sdp_message_t * sdp, int pos_media, | |
| char *att_field); | | char | |
| | | *att_field); | |
| /** | | /** | |
| * delete one specific attribute fields specified by att_field. | | * delete one specific attribute fields specified by att_field. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| * @param att_field The value to remove. | | * @param att_field The value to remove. | |
| * @param pos_attr The index of attribute to remove. | | * @param pos_attr The index of attribute to remove. | |
| */ | | */ | |
|
| int sdp_message_a_attribute_del_at_index (sdp_message_t * sdp, | | int sdp_message_a_attribute_del_at_index(sdp_message_t * sdp, | |
| int pos_media, char *att_field, | | | |
| int pos_attr); | | int pos_media, char *att_field, | |
| | | | |
| | | int pos_attr); | |
| /** | | /** | |
| * Get one of the attribute ('a' field) of a SDP packet. | | * Get one of the attribute ('a' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The attribute line number. | | * @param pos The attribute line number. | |
| */ | | */ | |
|
| sdp_attribute_t *sdp_message_attribute_get (sdp_message_t * sdp, | | sdp_attribute_t *sdp_message_attribute_get(sdp_message_t * sdp, | |
| int pos_media, int pos); | | | |
| | | int pos_media, int pos); | |
| /** | | /** | |
| * Get the attribute name ('a' field) of a SDP packet. | | * Get the attribute name ('a' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The attribute line number. | | * @param pos The attribute line number. | |
| */ | | */ | |
|
| char *sdp_message_a_att_field_get (sdp_message_t * sdp, int pos_media, in
t pos); | | char *sdp_message_a_att_field_get(sdp_message_t * sdp, int pos_media
, int pos); | |
| /** | | /** | |
| * Get the attribute value ('a' field) of a SDP packet. | | * Get the attribute value ('a' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The attribute line number. | | * @param pos The attribute line number. | |
| */ | | */ | |
|
| char *sdp_message_a_att_value_get (sdp_message_t * sdp, int pos_media, in
t pos); | | char *sdp_message_a_att_value_get(sdp_message_t * sdp, int pos_media
, int pos); | |
| /** | | /** | |
| * Check if there is more media lines a SDP packet. | | * Check if there is more media lines a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos The attribute line number. | | * @param pos The attribute line number. | |
| */ | | */ | |
|
| int sdp_message_endof_media (sdp_message_t * sdp, int pos); | | int sdp_message_endof_media(sdp_message_t * sdp, int pos); | |
| /** | | /** | |
| * Add a media line in a SDP packet. | | * Add a media line in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param media The token value. | | * @param media The token value. | |
| * @param port The token value. | | * @param port The token value. | |
| * @param number_of_port The token value. | | * @param number_of_port The token value. | |
| * @param proto The token value. | | * @param proto The token value. | |
| */ | | */ | |
|
| int sdp_message_m_media_add (sdp_message_t * sdp, char *media, | | int sdp_message_m_media_add(sdp_message_t * sdp, char *media, | |
| char *port, char *number_of_port, char *prot | | char *port, | |
| o); | | char *number_of_port, char *proto); | |
| /** | | /** | |
| * Get the media type ('m' field) of a SDP packet. | | * Get the media type ('m' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| */ | | */ | |
|
| char *sdp_message_m_media_get (sdp_message_t * sdp, int pos_media); | | char *sdp_message_m_media_get(sdp_message_t * sdp, int pos_media); | |
| /** | | /** | |
| * Get the port number ('m' field) of a SDP packet. | | * Get the port number ('m' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| */ | | */ | |
|
| char *sdp_message_m_port_get (sdp_message_t * sdp, int pos_media); | | char *sdp_message_m_port_get(sdp_message_t * sdp, int pos_media); | |
| /** | | /** | |
| * Set the port number ('m' field) of a SDP packet. | | * Set the port number ('m' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| * @param port The new port to set (must be allocated with osip_malloc) | | * @param port The new port to set (must be allocated with osip_malloc) | |
| */ | | */ | |
|
| int sdp_message_m_port_set (sdp_message_t * sdp, int pos_media, char *por
t); | | int sdp_message_m_port_set(sdp_message_t * sdp, int pos_media, char
*port); | |
| /** | | /** | |
| * Get the number of port ('m' field) of a SDP packet. | | * Get the number of port ('m' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| */ | | */ | |
|
| char *sdp_message_m_number_of_port_get (sdp_message_t * sdp, int pos_medi
a); | | char *sdp_message_m_number_of_port_get(sdp_message_t * sdp, int pos_
media); | |
| /** | | /** | |
| * Get the protocol ('m' field) of a SDP packet. | | * Get the protocol ('m' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| */ | | */ | |
|
| char *sdp_message_m_proto_get (sdp_message_t * sdp, int pos_media); | | char *sdp_message_m_proto_get(sdp_message_t * sdp, int pos_media); | |
| /** | | /** | |
| * Set the payload in a SDP packet. | | * Set the payload in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| * @param payload The token value. | | * @param payload The token value. | |
| */ | | */ | |
|
| int sdp_message_m_payload_add (sdp_message_t * sdp, int pos_media, | | int sdp_message_m_payload_add(sdp_message_t * sdp, int pos_media, | |
| char *payload); | | char *payl | |
| | | oad); | |
| /** | | /** | |
| * Get one of the payload number ('m' field) of a SDP packet. | | * Get one of the payload number ('m' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| * @param pos The i th payload element. | | * @param pos The i th payload element. | |
| */ | | */ | |
|
| char *sdp_message_m_payload_get (sdp_message_t * sdp, int pos_media, int
pos); | | char *sdp_message_m_payload_get(sdp_message_t * sdp, int pos_media,
int pos); | |
| /** | | /** | |
| * Remove a payload in a SDP packet. | | * Remove a payload in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| * @param pos The position of the payload in the media line. | | * @param pos The position of the payload in the media line. | |
| */ | | */ | |
|
| int sdp_message_m_payload_del (sdp_message_t * sdp, int pos_media, int po
s); | | int sdp_message_m_payload_del(sdp_message_t * sdp, int pos_media, in
t pos); | |
| | | | |
| /** @} */ | | /** @} */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
|
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 90 change blocks. |
| 172 lines changed or deleted | | 203 lines changed or added | |
|