| osip.h | | osip.h | |
| | | | |
| skipping to change at line 27 | | skipping to change at line 27 | |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| */ | | */ | |
| | | | |
| #ifndef _OSIP_H_ | | #ifndef _OSIP_H_ | |
| #define _OSIP_H_ | | #define _OSIP_H_ | |
| | | | |
| #include <osipparser2/osip_const.h> | | #include <osipparser2/osip_const.h> | |
| | | | |
| #include <time.h> | | #include <time.h> | |
| | | | |
|
| | | #ifdef WIN32 | |
| | | #include <Winsock.h> | |
| | | #endif | |
| | | | |
| #ifdef __sun | | #ifdef __sun | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| #endif | | #endif | |
| | | | |
| #include <osipparser2/osip_parser.h> | | #include <osipparser2/osip_parser.h> | |
| #include <osip2/osip_fifo.h> | | #include <osip2/osip_fifo.h> | |
| | | | |
| /** | | /** | |
| * @file osip.h | | * @file osip.h | |
| * @brief oSIP fsm Routines | | * @brief oSIP fsm Routines | |
| | | | |
| skipping to change at line 389 | | skipping to change at line 393 | |
| SND_REQUEST, /**< Event is an outgoing NON-INVITE and NON-ACK requ
est */ | | SND_REQUEST, /**< Event is an outgoing NON-INVITE and NON-ACK requ
est */ | |
| SND_STATUS_1XX, /**< Event is an outgoing informational response */ | | SND_STATUS_1XX, /**< Event is an outgoing informational response */ | |
| SND_STATUS_2XX, /**< Event is an outgoing 2XX response */ | | SND_STATUS_2XX, /**< Event is an outgoing 2XX response */ | |
| SND_STATUS_3456XX,/**< Event is an outgoing final response (not 2XX) */ | | SND_STATUS_3456XX,/**< Event is an outgoing final response (not 2XX) */ | |
| | | | |
| KILL_TRANSACTION, /**< Event to 'kill' the transaction before terminati
on */ | | KILL_TRANSACTION, /**< Event to 'kill' the transaction before terminati
on */ | |
| UNKNOWN_EVT | | UNKNOWN_EVT | |
| } | | } | |
| type_t; | | type_t; | |
| | | | |
|
| #if 0 | | | |
| typedef struct osip_statemachine osip_statemachine_t; | | | |
| | | | |
| struct osip_statemachine | | | |
| { | | | |
| osip_list_t *transitions; | | | |
| }; | | | |
| #endif | | | |
| | | | |
| /** | | /** | |
| * 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 | |
| { | | { | |
| | | | |
| skipping to change at line 446 | | skipping to change at line 441 | |
| | | | |
| /** | | /** | |
| * Structure for INVITE CLIENT TRANSACTION (outgoing INVITE transaction). | | * Structure for INVITE CLIENT TRANSACTION (outgoing INVITE transaction). | |
| * @defvar osip_ict_t | | * @defvar osip_ict_t | |
| */ | | */ | |
| typedef struct osip_ict osip_ict_t; | | typedef struct osip_ict osip_ict_t; | |
| | | | |
| struct osip_ict | | struct osip_ict | |
| { | | { | |
| /* state machine is implied... */ | | /* state machine is implied... */ | |
|
| #ifdef NEW_TIMER | | int timer_a_length; /* A=T1, A=2xT1... (unreliable tr on | |
| int timer_a_length; /* A=T1, A=2xT1... (unreliable tr only) | | ly) */ | |
| */ | | | |
| struct timeval timer_a_start; | | struct timeval timer_a_start; | |
|
| int timer_b_length; /* B = 64* T1 | | int timer_b_length; /* B = 64* T1 | |
| */ | | */ | |
| struct timeval timer_b_start; /* fire when transaction timeouts | | struct timeval timer_b_start; /* fire when transaction timeouts | |
| */ | | */ | |
| int timer_d_length; /* D >= 32s for unreliable tr (or 0) | | int timer_d_length; /* D >= 32s for unreliable tr (or 0) | |
| */ | | */ | |
| struct timeval timer_d_start; /* should be equal to timer H | | struct timeval timer_d_start; /* should be equal to timer H | |
| */ | | */ | |
| #else | | char *destination; /* url used to send requests */ | |
| int timer_a_length; /* A=T1, A=2xT1... (unreliable transport | | int port; /* port of next hop */ | |
| only) */ | | | |
| time_t timer_a_start; | | | |
| int timer_b_length; /* B = 64* T1 | | | |
| */ | | | |
| time_t timer_b_start; /* fire when transaction timeouts | | | |
| */ | | | |
| int timer_d_length; /* D >= 32s for unreliable transport (else = 0) | | | |
| */ | | | |
| time_t timer_d_start; /* should be equal to timer H | | | |
| */ | | | |
| #endif | | | |
| char *destination; /* url used to send requests */ | | | |
| int port; /* 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). | |
| * @defvar osip_nict_t | | * @defvar osip_nict_t | |
| */ | | */ | |
| typedef struct osip_nict osip_nict_t; | | typedef struct osip_nict osip_nict_t; | |
| | | | |
| struct osip_nict | | struct osip_nict | |
| { | | { | |
| /* state machine is implied... */ | | /* state machine is implied... */ | |
| | | | |
|
| #ifdef NEW_TIMER | | int timer_e_length; /* A=T1, A=2xT1... (unreliable tr. o | |
| int timer_e_length; /* A=T1, A=2xT1... (unreliable tr. only) | | nly) */ | |
| */ | | struct timeval timer_e_start; /* (else = -1) not active | |
| struct timeval timer_e_start; /* (else = -1) not active | | */ | |
| */ | | int timer_f_length; /* B = 64* T1 | |
| int timer_f_length; /* B = 64* T1 | | */ | |
| */ | | struct timeval timer_f_start; /* fire when transaction timeouts | |
| struct timeval timer_f_start; /* fire when transaction timeouts | | */ | |
| */ | | int timer_k_length; /* K = T4 (else = 0) | |
| int timer_k_length; /* K = T4 (else = 0) | | */ | |
| */ | | | |
| struct timeval timer_k_start; | | struct timeval timer_k_start; | |
|
| #else | | char *destination; /* url used to send requests */ | |
| int timer_e_length; /* A=T1, A=2xT1... (unreliable transport only) | | int port; /* port of next hop */ | |
| */ | | | |
| time_t timer_e_start; /* (else = -1) not active | | | |
| */ | | | |
| int timer_f_length; /* B = 64* T1 | | | |
| */ | | | |
| time_t timer_f_start; /* fire when transaction timeouts | | | |
| */ | | | |
| int timer_k_length; /* K = T4 (else = 0) | | | |
| */ | | | |
| time_t timer_k_start; | | | |
| #endif | | | |
| char *destination; /* url used to send requests */ | | | |
| int port; /* port of next hop */ | | | |
| | | | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Structure for INVITE SERVER TRANSACTION (incoming INVITE transaction). | | * Structure for INVITE SERVER TRANSACTION (incoming INVITE transaction). | |
| * @defvar osip_ist_t | | * @defvar osip_ist_t | |
| */ | | */ | |
| typedef struct osip_ist osip_ist_t; | | typedef struct osip_ist osip_ist_t; | |
| | | | |
| struct osip_ist | | struct osip_ist | |
| { | | { | |
|
| #ifdef NEW_TIMER | | int timer_g_length; /* G=MIN(T1*2,T2) for unreliable tra | |
| int timer_g_length; /* G=MIN(T1*2,T2) for unreliable trans. | | ns. */ | |
| */ | | struct timeval timer_g_start; /* 0 when reliable transport is used | |
| struct timeval timer_g_start; /* 0 when reliable transport is used! | | ! */ | |
| */ | | int timer_h_length; /* H = 64* T1 | |
| int timer_h_length; /* H = 64* T1 | | */ | |
| */ | | struct timeval timer_h_start; /* fire when if no ACK is received | |
| struct timeval timer_h_start; /* fire when if no ACK is received | | */ | |
| */ | | int timer_i_length; /* I = T4 for unreliable transport ( | |
| int timer_i_length; /* I = T4 for unreliable transport (or 0 | | or 0) */ | |
| )*/ | | struct timeval timer_i_start; /* absorb all ACK | |
| struct timeval timer_i_start; /* absorb all ACK | | */ | |
| */ | | | |
| #else | | | |
| int timer_g_length; /* G=MIN(T1*2,T2) for unreliable transport */ | | | |
| time_t timer_g_start; /* else = 0 when reliable transport is used! */ | | | |
| int timer_h_length; /* H = 64* T1 | | | |
| */ | | | |
| time_t timer_h_start; /* fire when if no ACK is received */ | | | |
| int timer_i_length; /* I = T4 for unreliable transport (else = | | | |
| 0) */ | | | |
| time_t timer_i_start; /* absorb all ACK */ | | | |
| #endif | | | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Structure for NON-INVITE SERVER TRANSACTION (incoming SERVER transaction
). | | * Structure for NON-INVITE SERVER TRANSACTION (incoming SERVER transaction
). | |
| * @defvar osip_nist_t | | * @defvar osip_nist_t | |
| */ | | */ | |
| typedef struct osip_nist osip_nist_t; | | typedef struct osip_nist osip_nist_t; | |
| | | | |
| struct osip_nist | | struct osip_nist | |
| { | | { | |
|
| #ifdef NEW_TIMER | | | |
| int timer_j_length; /* J = 64*T1 (else 0) */ | | | |
| struct timeval timer_j_start; | | | |
| #else | | | |
| int timer_j_length; /* J = 64*T1 (else 0) */ | | int timer_j_length; /* J = 64*T1 (else 0) */ | |
|
| time_t timer_j_start; | | struct timeval timer_j_start; | |
| #endif | | | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Structure for transaction handling. | | * Structure for transaction handling. | |
| * @defvar osip_transaction_t | | * @defvar osip_transaction_t | |
| */ | | */ | |
| typedef struct osip_transaction osip_transaction_t; | | typedef struct osip_transaction osip_transaction_t; | |
| | | | |
| struct osip_transaction | | struct osip_transaction | |
| { | | { | |
| | | | |
| skipping to change at line 559 | | skipping to change at line 522 | |
| osip_fifo_t *transactionff; /* events must be added in this fifo
*/ | | osip_fifo_t *transactionff; /* events must be added in this fifo
*/ | |
| | | | |
| osip_via_t *topvia; /* CALL-LEG definition */ | | osip_via_t *topvia; /* CALL-LEG definition */ | |
| osip_from_t *from; /* CALL-LEG definition */ | | osip_from_t *from; /* CALL-LEG definition */ | |
| osip_to_t *to; | | osip_to_t *to; | |
| osip_call_id_t *callid; | | osip_call_id_t *callid; | |
| osip_cseq_t *cseq; | | osip_cseq_t *cseq; | |
| | | | |
| osip_message_t *orig_request; /* last request sent
*/ | | osip_message_t *orig_request; /* last request sent
*/ | |
| osip_message_t *last_response; /* last response received
*/ | | osip_message_t *last_response; /* last response received
*/ | |
|
| osip_message_t *ack; /* ack request sent
*/ | | osip_message_t *ack; /* ack request sent */ | |
| | | | |
| state_t state; /* state of transaction */ | | state_t state; /* state of transaction */ | |
| | | | |
| time_t birth_time; /* birth_date of transaction */ | | time_t birth_time; /* birth_date of transaction */ | |
| time_t completed_time; /* end date of transaction */ | | time_t completed_time; /* end date of transaction */ | |
| | | | |
| /* RESPONSE are received on this socket */ | | /* RESPONSE are received on this socket */ | |
| int in_socket; | | int in_socket; | |
| /* REQUESTS are sent on this socket */ | | /* REQUESTS are sent on this socket */ | |
| int out_socket; | | int out_socket; | |
| | | | |
| void *config; /* transaction is managed by config */ | | void *config; /* transaction is managed by config */ | |
| | | | |
| osip_fsm_type_t ctx_type; | | osip_fsm_type_t ctx_type; | |
| osip_ict_t *ict_context; | | osip_ict_t *ict_context; | |
| osip_ist_t *ist_context; | | osip_ist_t *ist_context; | |
| osip_nict_t *nict_context; | | osip_nict_t *nict_context; | |
| osip_nist_t *nist_context; | | osip_nist_t *nist_context; | |
| }; | | }; | |
| | | | |
|
| typedef enum osip_message_callback_type { | | /** | |
| OSIP_ICT_INVITE_SENT = 0, | | * Enumeration for callback type. | |
| OSIP_ICT_INVITE_SENT_AGAIN, | | */ | |
| OSIP_ICT_ACK_SENT, | | typedef enum osip_message_callback_type | |
| OSIP_ICT_ACK_SENT_AGAIN, | | { | |
| OSIP_ICT_STATUS_1XX_RECEIVED, | | OSIP_ICT_INVITE_SENT = 0, /**< INVITE MESSAGE SENT */ | |
| OSIP_ICT_STATUS_2XX_RECEIVED, | | OSIP_ICT_INVITE_SENT_AGAIN, /**< INVITE MESSAGE RETRANSMITT | |
| OSIP_ICT_STATUS_2XX_RECEIVED_AGAIN, | | ED */ | |
| OSIP_ICT_STATUS_3XX_RECEIVED, | | OSIP_ICT_ACK_SENT, /**< ACK MESSAGE SENT */ | |
| OSIP_ICT_STATUS_4XX_RECEIVED, | | OSIP_ICT_ACK_SENT_AGAIN, /**< ACK MESSAGE RETRANSMITTED | |
| OSIP_ICT_STATUS_5XX_RECEIVED, | | */ | |
| OSIP_ICT_STATUS_6XX_RECEIVED, | | OSIP_ICT_STATUS_1XX_RECEIVED, /**< 1XX FOR INVITE RECEIVED */ | |
| OSIP_ICT_STATUS_3456XX_RECEIVED_AGAIN, | | OSIP_ICT_STATUS_2XX_RECEIVED, /**< 2XX FOR INVITE RECEIVED */ | |
| | | OSIP_ICT_STATUS_2XX_RECEIVED_AGAIN, /**< 2XX FOR INVITE RECEIVED AG | |
| | | AIN */ | |
| | | OSIP_ICT_STATUS_3XX_RECEIVED, /**< 3XX FOR INVITE RECEIVED */ | |
| | | OSIP_ICT_STATUS_4XX_RECEIVED, /**< 4XX FOR INVITE RECEIVED */ | |
| | | OSIP_ICT_STATUS_5XX_RECEIVED, /**< 5XX FOR INVITE RECEIVED */ | |
| | | OSIP_ICT_STATUS_6XX_RECEIVED, /**< 6XX FOR INVITE RECEIVED */ | |
| | | OSIP_ICT_STATUS_3456XX_RECEIVED_AGAIN, /**< RESPONSE RECEIVED AGAIN */ | |
| | | | |
|
| OSIP_IST_INVITE_RECEIVED, | | OSIP_IST_INVITE_RECEIVED, /**< INVITE MESSAGE RECEIVED */ | |
| OSIP_IST_INVITE_RECEIVED_AGAIN, | | OSIP_IST_INVITE_RECEIVED_AGAIN, /**< INVITE MESSAGE RECEIVED AG | |
| OSIP_IST_ACK_RECEIVED, | | AN */ | |
| OSIP_IST_ACK_RECEIVED_AGAIN, | | OSIP_IST_ACK_RECEIVED, /**< ACK MESSAGE RECEIVED */ | |
| OSIP_IST_STATUS_1XX_SENT, | | OSIP_IST_ACK_RECEIVED_AGAIN, /**< ACK MESSAGE RECEIVED AGAIN | |
| OSIP_IST_STATUS_2XX_SENT, | | */ | |
| OSIP_IST_STATUS_2XX_SENT_AGAIN, | | OSIP_IST_STATUS_1XX_SENT, /**< 1XX FOR INVITE SENT */ | |
| OSIP_IST_STATUS_3XX_SENT, | | OSIP_IST_STATUS_2XX_SENT, /**< 2XX FOR INVITE SENT */ | |
| OSIP_IST_STATUS_4XX_SENT, | | OSIP_IST_STATUS_2XX_SENT_AGAIN, /**< 2XX FOR INVITE RETRANSMITT | |
| OSIP_IST_STATUS_5XX_SENT, | | ED */ | |
| OSIP_IST_STATUS_6XX_SENT, | | OSIP_IST_STATUS_3XX_SENT, /**< 3XX FOR INVITE SENT */ | |
| OSIP_IST_STATUS_3456XX_SENT_AGAIN, | | OSIP_IST_STATUS_4XX_SENT, /**< 4XX FOR INVITE SENT */ | |
| | | OSIP_IST_STATUS_5XX_SENT, /**< 5XX FOR INVITE SENT */ | |
| | | OSIP_IST_STATUS_6XX_SENT, /**< 6XX FOR INVITE SENT */ | |
| | | OSIP_IST_STATUS_3456XX_SENT_AGAIN, /**< RESPONSE RETRANSMITTED */ | |
| | | | |
|
| OSIP_NICT_REGISTER_SENT, | | OSIP_NICT_REGISTER_SENT, /**< REGISTER MESSAGE SENT */ | |
| OSIP_NICT_BYE_SENT, | | OSIP_NICT_BYE_SENT, /**< BYE MESSAGE SENT */ | |
| OSIP_NICT_OPTIONS_SENT, | | OSIP_NICT_OPTIONS_SENT, /**< OPTIONS MESSAGE SENT */ | |
| OSIP_NICT_INFO_SENT, | | OSIP_NICT_INFO_SENT, /**< INFO MESSAGE SENT */ | |
| OSIP_NICT_CANCEL_SENT, | | OSIP_NICT_CANCEL_SENT, /**< CANCEL MESSAGE SENT */ | |
| OSIP_NICT_NOTIFY_SENT, | | OSIP_NICT_NOTIFY_SENT, /**< NOTIFY MESSAGE SENT */ | |
| OSIP_NICT_SUBSCRIBE_SENT, | | OSIP_NICT_SUBSCRIBE_SENT, /**< SUBSCRIBE MESSAGE SENT */ | |
| OSIP_NICT_UNKNOWN_REQUEST_SENT, | | OSIP_NICT_UNKNOWN_REQUEST_SENT, /**< UNKNOWN REQUEST MESSAGE SE | |
| OSIP_NICT_REQUEST_SENT_AGAIN, | | NT */ | |
| OSIP_NICT_STATUS_1XX_RECEIVED, | | OSIP_NICT_REQUEST_SENT_AGAIN, /**< REQUEST MESSAGE RETRANMITT | |
| OSIP_NICT_STATUS_2XX_RECEIVED, | | ED */ | |
| OSIP_NICT_STATUS_2XX_RECEIVED_AGAIN, | | OSIP_NICT_STATUS_1XX_RECEIVED, /**< 1XX FOR MESSAGE RECEIVED * | |
| OSIP_NICT_STATUS_3XX_RECEIVED, | | / | |
| OSIP_NICT_STATUS_4XX_RECEIVED, | | OSIP_NICT_STATUS_2XX_RECEIVED, /**< 2XX FOR MESSAGE RECEIVED * | |
| OSIP_NICT_STATUS_5XX_RECEIVED, | | / | |
| OSIP_NICT_STATUS_6XX_RECEIVED, | | OSIP_NICT_STATUS_2XX_RECEIVED_AGAIN, /**< 2XX FOR MESSAGE RECEIVED A | |
| OSIP_NICT_STATUS_3456XX_RECEIVED_AGAIN, | | GAIN */ | |
| | | OSIP_NICT_STATUS_3XX_RECEIVED, /**< 3XX FOR MESSAGE RECEIVED * | |
| | | / | |
| | | OSIP_NICT_STATUS_4XX_RECEIVED, /**< 4XX FOR MESSAGE RECEIVED * | |
| | | / | |
| | | OSIP_NICT_STATUS_5XX_RECEIVED, /**< 5XX FOR MESSAGE RECEIVED * | |
| | | / | |
| | | OSIP_NICT_STATUS_6XX_RECEIVED, /**< 6XX FOR MESSAGE RECEIVED * | |
| | | / | |
| | | OSIP_NICT_STATUS_3456XX_RECEIVED_AGAIN, /**< RESPONSE RECEIVED AGAIN */ | |
| | | | |
|
| OSIP_NIST_REGISTER_RECEIVED, | | OSIP_NIST_REGISTER_RECEIVED, /**< REGISTER RECEIVED */ | |
| OSIP_NIST_BYE_RECEIVED, | | OSIP_NIST_BYE_RECEIVED, /**< BYE RECEIVED */ | |
| OSIP_NIST_OPTIONS_RECEIVED, | | OSIP_NIST_OPTIONS_RECEIVED, /**< OPTIONS RECEIVED */ | |
| OSIP_NIST_INFO_RECEIVED, | | OSIP_NIST_INFO_RECEIVED, /**< INFO RECEIVED */ | |
| OSIP_NIST_CANCEL_RECEIVED, | | OSIP_NIST_CANCEL_RECEIVED, /**< CANCEL RECEIVED */ | |
| OSIP_NIST_NOTIFY_RECEIVED, | | OSIP_NIST_NOTIFY_RECEIVED, /**< NOTIFY RECEIVED */ | |
| OSIP_NIST_SUBSCRIBE_RECEIVED, | | OSIP_NIST_SUBSCRIBE_RECEIVED, /**< SUBSCRIBE RECEIVED */ | |
| /* ... TO BE ADDED: All known and used method extensions */ | | | |
| OSIP_NIST_UNKNOWN_REQUEST_RECEIVED, | | | |
| OSIP_NIST_REQUEST_RECEIVED_AGAIN, | | | |
| OSIP_NIST_STATUS_1XX_SENT, | | | |
| OSIP_NIST_STATUS_2XX_SENT, | | | |
| OSIP_NIST_STATUS_2XX_SENT_AGAIN, | | | |
| OSIP_NIST_STATUS_3XX_SENT, | | | |
| OSIP_NIST_STATUS_4XX_SENT, | | | |
| OSIP_NIST_STATUS_5XX_SENT, | | | |
| OSIP_NIST_STATUS_6XX_SENT, | | | |
| OSIP_NIST_STATUS_3456XX_SENT_AGAIN, | | | |
| | | | |
|
| OSIP_MESSAGE_CALLBACK_COUNT | | OSIP_NIST_UNKNOWN_REQUEST_RECEIVED, /**< UNKNWON REQUEST RECEIVED * | |
| | | / | |
| | | OSIP_NIST_REQUEST_RECEIVED_AGAIN, /**< UNKNWON REQUEST RECEIVED A | |
| | | GAIN */ | |
| | | OSIP_NIST_STATUS_1XX_SENT, /**< 1XX FOR MESSAGE SENT */ | |
| | | OSIP_NIST_STATUS_2XX_SENT, /**< 2XX FOR MESSAGE SENT */ | |
| | | OSIP_NIST_STATUS_2XX_SENT_AGAIN, /**< 2XX FOR MESSAGE RETRANSMIT | |
| | | TED */ | |
| | | OSIP_NIST_STATUS_3XX_SENT, /**< 3XX FOR MESSAGE SENT */ | |
| | | OSIP_NIST_STATUS_4XX_SENT, /**< 4XX FOR MESSAGE SENT */ | |
| | | OSIP_NIST_STATUS_5XX_SENT, /**< 5XX FOR MESSAGE SENT */ | |
| | | OSIP_NIST_STATUS_6XX_SENT, /**< 6XX FOR MESSAGE SENT */ | |
| | | OSIP_NIST_STATUS_3456XX_SENT_AGAIN, /**< RESPONSE RETRANSMITTED */ | |
| | | | |
| | | OSIP_MESSAGE_CALLBACK_COUNT /**< END OF ENUM */ | |
| } osip_message_callback_type_t; | | } osip_message_callback_type_t; | |
| | | | |
|
| typedef enum osip_kill_callback_type { | | /** | |
| OSIP_ICT_KILL_TRANSACTION, | | * Enumeration for callback type used when transaction is over. | |
| OSIP_IST_KILL_TRANSACTION, | | */ | |
| OSIP_NICT_KILL_TRANSACTION, | | typedef enum osip_kill_callback_type | |
| OSIP_NIST_KILL_TRANSACTION, | | { | |
| | | OSIP_ICT_KILL_TRANSACTION, /**< end of Client INVITE transaction * | |
| | | / | |
| | | OSIP_IST_KILL_TRANSACTION, /**< end of Server INVITE transaction * | |
| | | / | |
| | | OSIP_NICT_KILL_TRANSACTION, /**< end of Client Non-INVITE transacti | |
| | | on */ | |
| | | OSIP_NIST_KILL_TRANSACTION, /**< end of Server Non-INVITE transacti | |
| | | on */ | |
| | | | |
|
| OSIP_KILL_CALLBACK_COUNT | | OSIP_KILL_CALLBACK_COUNT /**< END OF ENUM */ | |
| } osip_kill_callback_type_t; | | } osip_kill_callback_type_t; | |
| | | | |
|
| typedef enum osip_transport_error_callback_type { | | /** | |
| OSIP_ICT_TRANSPORT_ERROR, | | * Enumeration for callback type used when a transport error is detected. | |
| OSIP_IST_TRANSPORT_ERROR, | | */ | |
| OSIP_NICT_TRANSPORT_ERROR, | | typedef enum osip_transport_error_callback_type | |
| OSIP_NIST_TRANSPORT_ERROR, | | { | |
| | | OSIP_ICT_TRANSPORT_ERROR, /**< transport error for ICT */ | |
| | | OSIP_IST_TRANSPORT_ERROR, /**< transport error for IST */ | |
| | | OSIP_NICT_TRANSPORT_ERROR, /**< transport error for NICT */ | |
| | | OSIP_NIST_TRANSPORT_ERROR, /**< transport error for NIST */ | |
| | | | |
|
| OSIP_TRANSPORT_ERROR_CALLBACK_COUNT | | OSIP_TRANSPORT_ERROR_CALLBACK_COUNT /**< END OF ENUM */ | |
| } osip_transport_error_callback_type_t; | | } osip_transport_error_callback_type_t; | |
| | | | |
|
| typedef void (* osip_message_cb_t) (int type, osip_transaction_t *, osip_ | | typedef void (*osip_message_cb_t) (int type, osip_transaction_t *, | |
| message_t *); | | osip_message_t *); | |
| typedef void (* osip_kill_transaction_cb_t) (int type, osip_transaction_t | | typedef void (*osip_kill_transaction_cb_t) (int type, osip_transaction_t | |
| *); | | *); | |
| typedef void (* osip_transport_error_cb_t) (int type, osip_transaction_t | | typedef void (*osip_transport_error_cb_t) (int type, osip_transaction_t * | |
| *, | | , | |
| int error); | | int error); | |
| | | | |
| #ifdef OSIP_RETRANSMIT_2XX | | #ifdef OSIP_RETRANSMIT_2XX | |
| struct osip_dialog; | | struct osip_dialog; | |
| | | | |
| typedef struct ixt_t ixt_t; | | typedef struct ixt_t ixt_t; | |
| | | | |
| struct ixt_t | | struct ixt_t | |
| { | | { | |
|
| /* any ACK received that match this context will set counter to -1*/ | | /* any ACK received that match this context will set counter to -1 */ | |
| struct osip_dialog *dialog; | | struct osip_dialog *dialog; | |
|
| osip_message_t *msg2xx; /* copy of string to retransmit */ | | osip_message_t *msg2xx; /* copy of string to retransmit */ | |
| osip_message_t *ack; /* useless for ist */ | | osip_message_t *ack; /* useless for ist */ | |
| time_t start; | | time_t start; | |
|
| int interval; /* between each retransmission, in ms */ | | int interval; /* between each retransmission, in ms */ | |
| char *dest; | | char *dest; | |
| int port; | | int port; | |
| int sock; | | int sock; | |
|
| int counter; /* start at 7 */ | | int counter; /* start at 7 */ | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * 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. | |
| * @defvar osip_t | | * @defvar osip_t | |
| | | | |
| skipping to change at line 711 | | skipping to change at line 687 | |
| { | | { | |
| | | | |
| void *application_context; /* a pointer for your personnal usage */ | | void *application_context; /* a pointer for your personnal usage */ | |
| | | | |
| /* list of transactions for ict, ist, nict, nist */ | | /* list of transactions for ict, ist, nict, nist */ | |
| osip_list_t *osip_ict_transactions; | | osip_list_t *osip_ict_transactions; | |
| osip_list_t *osip_ist_transactions; | | osip_list_t *osip_ist_transactions; | |
| osip_list_t *osip_nict_transactions; | | osip_list_t *osip_nict_transactions; | |
| osip_list_t *osip_nist_transactions; | | osip_list_t *osip_nist_transactions; | |
| | | | |
|
| osip_list_t *ixt_retransmissions; /* for retransmission of 2xx & ACK fo
r INVITE */ | | osip_list_t *ixt_retransmissions; /* for retransmission of 2xx & ACK f
or INVITE */ | |
| | | | |
| osip_message_cb_t msg_callbacks[OSIP_MESSAGE_CALLBACK_COUNT]; | | osip_message_cb_t msg_callbacks[OSIP_MESSAGE_CALLBACK_COUNT]; | |
| osip_kill_transaction_cb_t kill_callbacks[OSIP_KILL_CALLBACK_COUNT]; | | osip_kill_transaction_cb_t kill_callbacks[OSIP_KILL_CALLBACK_COUNT]; | |
|
| osip_transport_error_cb_t tp_error_callbacks[OSIP_TRANSPORT_ERROR_CALLB | | osip_transport_error_cb_t | |
| ACK_COUNT]; | | tp_error_callbacks[OSIP_TRANSPORT_ERROR_CALLBACK_COUNT]; | |
| | | | |
| /* callbacks for sending messages */ | | /* callbacks for sending messages */ | |
|
| int (*cb_send_message) (osip_transaction_t *, osip_message_t *, char *, | | int (*cb_send_message) (osip_transaction_t *, osip_message_t *, char *, | |
| int, int); | | int, int); | |
| }; | | }; | |
| | | | |
|
| int osip_set_message_callback (osip_t *, int type, osip_message_cb_t cb); | | /** | |
| int osip_set_kill_transaction_callback (osip_t *, int type, | | * Set a callback for each transaction operation. | |
| | | * @param osip The element to work on. | |
| | | * @param type The event type to hook on. | |
| | | * @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); | |
| | | | |
| | | /** | |
| | | * Set a callback for transaction operation related to the end of transacti | |
| | | ons. | |
| | | * @param osip The element to work on. | |
| | | * @param type The event type to hook on. | |
| | | * @param cb The method to be called upon the event. | |
| | | */ | |
| | | int osip_set_kill_transaction_callback (osip_t *osip, int type, | |
| osip_kill_transaction_cb_t cb); | | osip_kill_transaction_cb_t cb); | |
|
| int osip_set_transport_error_callback (osip_t *, int type, | | | |
| | | /** | |
| | | * Set a callback for each transaction operation related to network error. | |
| | | * @param osip The element to work on. | |
| | | * @param type The event type to hook on. | |
| | | * @param cb The method to be called upon the event. | |
| | | */ | |
| | | int osip_set_transport_error_callback (osip_t *osip, int type, | |
| osip_transport_error_cb_t cb); | | osip_transport_error_cb_t cb); | |
| | | | |
| /** | | /** | |
| * Structure for sipevent handling. | | * Structure for sipevent 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. | |
| * @defvar osip_event_t | | * @defvar osip_event_t | |
| */ | | */ | |
| | | | |
| skipping to change at line 751 | | skipping to change at line 749 | |
| osip_message_t *sip; | | osip_message_t *sip; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * 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, osip_fsm_ty | | int osip_transaction_init (osip_transaction_t ** transaction, | |
| pe_t ctx_type, | | osip_fsm_type_t ctx_type, osip_t * osip, | |
| osip_t * osip, osip_message_t * request); | | osip_message_t * request); | |
| /** | | /** | |
| * 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)
; | |
| | | | |
| skipping to change at line 776 | | skipping to change at line 775 | |
| | | | |
| /** | | /** | |
| * 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 | | int osip_ict_set_destination (osip_ict_t * ict, char *destination, | |
| rt); | | int 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 | | int osip_nict_set_destination (osip_nict_t * nict, char *destination, | |
| port); | | 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, osip_ev | | int osip_transaction_add_event (osip_transaction_t * transaction, | |
| ent_t * evt); | | osip_event_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, osip_even | | int osip_transaction_execute (osip_transaction_t * transaction, | |
| t_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 * transaction, | |
|
| void *instance); | | 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 * transactio
n); | |
| | | | |
| /** | | /** | |
| * 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, ch | | int osip_transaction_get_destination (osip_transaction_t * transaction, | |
| ar **ip, int *port); | | char **ip, int *port); | |
| | | | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| | | | |
| /** | | /** | |
| * Set the socket for incoming message. | | * Set the socket for incoming message. | |
| * NOTE: THIS HAS NEVER TESTED! Please send feedback. | | * NOTE: THIS HAS NEVER TESTED! Please send feedback. | |
| * @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 | | int osip_transaction_set_in_socket (osip_transaction_t * transaction, | |
| sock); | | int sock); | |
| /** | | /** | |
| * Set the socket for outgoing message. | | * Set the socket for outgoing message. | |
| * NOTE: THIS HAS NEVER TESTED! Please send feedback. | | * NOTE: THIS HAS NEVER TESTED! Please send feedback. | |
| * @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); | |
| | | | |
| #if 0 | | #if 0 | |
| | | | |
| /** | | /** | |
| * Check if the first 2 parameters match the other ones. | | * Check if the first 2 parameters match the other ones. | |
| * NOTE: THIS IS AN INTERNAL METHOD ONLY | | * NOTE: THIS IS AN INTERNAL METHOD ONLY | |
| * @param to1 The initial to header. | | * @param to1 The initial to header. | |
| * @param from1 The initial from header. | | * @param from1 The initial from header. | |
| * @param to2 The new to header. | | * @param to2 The new to header. | |
| * @param from2 The new from header. | | * @param from2 The new from header. | |
| */ | | */ | |
|
| int callleg_match (osip_to_t * to1, osip_from_t * from1, osip_to_t * to2, | | int callleg_match (osip_to_t * to1, osip_from_t * from1, osip_to_t * to2, | |
| osip_from_t * from2); | | osip_from_t * from2); | |
| | | | |
| #endif | | #endif | |
| | | | |
| #endif /* endif DOXYGEN */ | | #endif /* endif DOXYGEN */ | |
| | | | |
| /** | | /** | |
| * 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); | |
| | | | |
| skipping to change at line 919 | | skipping to change at line 926 | |
| * 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); | |
| | | | |
|
| #ifdef NEW_TIMER | | | |
| /** | | /** | |
| * 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); | |
| #endif | | | |
| /** | | /** | |
| * 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); | |
| | | | |
| skipping to change at line 969 | | skipping to change at line 975 | |
| | | | |
| #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 * | | osip_transaction_t *osip_find_transaction (osip_t * osip, | |
| evt); | | 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, | | osip_event_t * evt, | |
| int consume); | | 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 * ev
t); | |
| | | | |
| /** | | /** | |
| * 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 | | osip_transaction_t *osip_create_transaction (osip_t * osip, | |
| * evt); | | osip_event_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. | |
| */ | | */ | |
| osip_event_t *osip_parse (char *buf); | | osip_event_t *osip_parse (char *buf); | |
| | | | |
| #ifdef OSIP_RETRANSMIT_2XX | | #ifdef OSIP_RETRANSMIT_2XX | |
| | | | |
|
| 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, struct osip_dialog *d | | void osip_start_200ok_retransmissions (osip_t * osip, | |
| ialog, osip_message_t *msg200ok, int sock); | | struct osip_dialog *dialog, | |
| | | 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 sock The destination port. | | * @param sock 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, struct osip_dialog *dia | | void osip_start_ack_retransmissions (osip_t * osip, | |
| log, osip_message_t *ack, char *dest, int port, int sock); | | struct osip_dialog *dialog, | |
| | | 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. | |
| */ | | */ | |
|
| void osip_stop_200ok_retransmissions(osip_t *osip, osip_message_t *ack); | | void osip_stop_200ok_retransmissions (osip_t * osip, 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, struct osip_dial | | void osip_stop_retransmissions_from_dialog (osip_t * osip, | |
| og *dialog); | | struct osip_dialog *dialog); | |
| | | | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * 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_transaction_t *, | |
| osip_message_t *, char *, | | osip_message_t *, char *, | |
| int, int)); | | int, int)); | |
| | | | |
End of changes. 49 change blocks. |
| 220 lines changed or deleted | | 230 lines changed or added | |
|
| osip_negotiation.h | | osip_negotiation.h | |
| | | | |
| skipping to change at line 157 | | skipping to change at line 157 | |
| * Free a negotiation context. | | * Free a negotiation context. | |
| * @param ctx The element to work on. | | * @param ctx The element to work on. | |
| */ | | */ | |
| void osip_negotiation_ctx_free (osip_negotiation_ctx_t * ctx); | | void osip_negotiation_ctx_free (osip_negotiation_ctx_t * ctx); | |
| | | | |
| /** | | /** | |
| * Set the context associated to this negotiation. | | * Set the context associated to this negotiation. | |
| * @param ctx The element to work on. | | * @param ctx The element to work on. | |
| * @param value A pointer to your personal context. | | * @param value A pointer to your personal context. | |
| */ | | */ | |
|
| int osip_negotiation_ctx_set_mycontext (osip_negotiation_ctx_t * ctx, voi | | int osip_negotiation_ctx_set_mycontext (osip_negotiation_ctx_t * ctx, | |
| d *value); | | void *value); | |
| /** | | /** | |
| * Get the context associated to this negotiation. | | * Get the context associated to this negotiation. | |
| * @param ctx The element to work on. | | * @param ctx The element to work on. | |
| */ | | */ | |
| void *osip_negotiation_ctx_get_mycontext (osip_negotiation_ctx_t * ctx); | | void *osip_negotiation_ctx_get_mycontext (osip_negotiation_ctx_t * ctx); | |
| | | | |
| /** | | /** | |
| * Set the local SDP packet associated to this negotiation. | | * Set the local SDP packet associated to this negotiation. | |
| * NOTE: This is done by the 'negotiator'. (You only need to give | | * NOTE: This is done by the 'negotiator'. (You only need to give | |
| * the remote SDP packet) | | * the remote SDP packet) | |
| * @param ctx The element to work on. | | * @param ctx The element to work on. | |
| * @param sdp The local SDP packet. | | * @param sdp The local SDP packet. | |
| */ | | */ | |
|
| int osip_negotiation_ctx_set_local_sdp (osip_negotiation_ctx_t * ctx, sdp | | int osip_negotiation_ctx_set_local_sdp (osip_negotiation_ctx_t * ctx, | |
| _message_t * sdp); | | sdp_message_t * sdp); | |
| /** | | /** | |
| * Get the local SDP packet associated to this negotiation. | | * Get the local SDP packet associated to this negotiation. | |
| * @param ctx The element to work on. | | * @param ctx The element to work on. | |
| */ | | */ | |
|
| sdp_message_t *osip_negotiation_ctx_get_local_sdp (osip_negotiation_ctx_t | | sdp_message_t *osip_negotiation_ctx_get_local_sdp (osip_negotiation_ctx_t | |
| * ctx); | | * | |
| | | ctx); | |
| /** | | /** | |
| * Set the remote SDP packet associated to this negotiation. | | * Set the remote SDP packet associated to this negotiation. | |
| * @param ctx The element to work on. | | * @param ctx The element to work on. | |
| * @param sdp The remote SDP packet. | | * @param sdp The remote SDP packet. | |
| */ | | */ | |
|
| int osip_negotiation_ctx_set_remote_sdp (osip_negotiation_ctx_t * ctx, sd | | int osip_negotiation_ctx_set_remote_sdp (osip_negotiation_ctx_t * ctx, | |
| p_message_t * sdp); | | sdp_message_t * sdp); | |
| /** | | /** | |
| * Get the remote SDP packet associated to this negotiation. | | * Get the remote SDP packet associated to this negotiation. | |
| * @param ctx The element to work on. | | * @param ctx The element to work on. | |
| */ | | */ | |
|
| sdp_message_t *osip_negotiation_ctx_get_remote_sdp (osip_negotiation_ctx_ | | sdp_message_t *osip_negotiation_ctx_get_remote_sdp (osip_negotiation_ctx_ | |
| t * ctx); | | t * | |
| | | ctx); | |
| | | | |
| /** | | /** | |
| * Structure for storing the global configuration management. | | * Structure for storing the global configuration management. | |
| * The information you store here is used when computing a | | * The information you store here is used when computing a | |
| * remote SDP packet to build a compliant answer. | | * remote SDP packet to build a compliant answer. | |
| * The main objectives is to: | | * The main objectives is to: | |
| * * automaticly refuse unknown media. | | * * automaticly refuse unknown media. | |
| * * accept some of the known media. | | * * accept some of the known media. | |
| * * make sure the SDP answer match the SDP offer. | | * * make sure the SDP answer match the SDP offer. | |
| * * simplify the SDP offer/answer model, as all unknown media | | * * simplify the SDP offer/answer model, as all unknown media | |
| | | | |
| skipping to change at line 244 | | skipping to change at line 249 | |
| char *(*fcn_get_audio_port) (void *, int); | | char *(*fcn_get_audio_port) (void *, int); | |
| char *(*fcn_get_video_port) (void *, int); | | char *(*fcn_get_video_port) (void *, int); | |
| char *(*fcn_get_other_port) (void *, int); | | char *(*fcn_get_other_port) (void *, int); | |
| | | | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Initialise (and Allocate) a sdp_config element (this element is global). | | * Initialise (and Allocate) a sdp_config element (this element is global). | |
| * Stores the initialized structure to conf_out. | | * Stores the initialized structure to conf_out. | |
| */ | | */ | |
|
| int osip_negotiation_init (osip_negotiation_t **conf_out); | | int osip_negotiation_init (osip_negotiation_t ** conf_out); | |
| /** | | /** | |
| * Free resource stored by a sdp_config element. | | * Free resource stored by a sdp_config element. | |
| * This method must be called once when the application is stopped. | | * This method must be called once when the application is stopped. | |
| */ | | */ | |
|
| void osip_negotiation_free (osip_negotiation_t *conf); | | void osip_negotiation_free (osip_negotiation_t * conf); | |
| | | | |
| /** | | /** | |
| * Set the local username ('o' field) of all local SDP packet. | | * Set the local username ('o' field) of all local SDP packet. | |
| * @param tmp The username. | | * @param tmp The username. | |
| */ | | */ | |
| int osip_negotiation_set_o_username (osip_negotiation_t *, char *tmp); | | int osip_negotiation_set_o_username (osip_negotiation_t *, char *tmp); | |
| /** | | /** | |
| * Set the local session id ('o' field) of all local SDP packet. | | * Set the local session id ('o' field) of all local SDP packet. | |
| * WARNING: this field should be updated for each new SDP packet? | | * WARNING: this field should be updated for each new SDP packet? | |
| * @param tmp The session id. | | * @param tmp The session id. | |
| */ | | */ | |
| int osip_negotiation_set_o_session_id (osip_negotiation_t *, char *tmp); | | int osip_negotiation_set_o_session_id (osip_negotiation_t *, char *tmp); | |
| /** | | /** | |
| * Set the local session version ('o' field) of all local SDP packet. | | * Set the local session version ('o' field) of all local SDP packet. | |
| * WARNING: this field should be updated for each new SDP packet? | | * WARNING: this field should be updated for each new SDP packet? | |
| * @param tmp The session version. | | * @param tmp The session version. | |
| */ | | */ | |
|
| int osip_negotiation_set_o_session_version (osip_negotiation_t *, char *t | | int osip_negotiation_set_o_session_version (osip_negotiation_t *, | |
| mp); | | char *tmp); | |
| /** | | /** | |
| * Set the local network type ('o' field) of all local SDP packet. | | * Set the local network type ('o' field) of all local SDP packet. | |
| * @param tmp The network type. | | * @param tmp The network type. | |
| */ | | */ | |
| int osip_negotiation_set_o_nettype (osip_negotiation_t *, char *tmp); | | int osip_negotiation_set_o_nettype (osip_negotiation_t *, char *tmp); | |
| /** | | /** | |
| * Set the local address type ('o' field) of all local SDP packet. | | * Set the local address type ('o' field) of all local SDP packet. | |
| * @param tmp The address type. | | * @param tmp The address type. | |
| */ | | */ | |
| int osip_negotiation_set_o_addrtype (osip_negotiation_t *, char *tmp); | | int osip_negotiation_set_o_addrtype (osip_negotiation_t *, char *tmp); | |
| | | | |
| skipping to change at line 303 | | skipping to change at line 309 | |
| int osip_negotiation_set_c_addrtype (osip_negotiation_t *, char *tmp); | | int osip_negotiation_set_c_addrtype (osip_negotiation_t *, char *tmp); | |
| /** | | /** | |
| * Set the local IP address ('c' field) of all local SDP packet. | | * Set the local IP address ('c' field) of all local SDP packet. | |
| * @param tmp The IP address. | | * @param tmp The IP address. | |
| */ | | */ | |
| int osip_negotiation_set_c_addr (osip_negotiation_t *, char *tmp); | | int osip_negotiation_set_c_addr (osip_negotiation_t *, char *tmp); | |
| /** | | /** | |
| * Set the local ttl for multicast address ('c' field) of all local SDP pac
ket. | | * Set the local ttl for multicast address ('c' field) of all local SDP pac
ket. | |
| * @param tmp The ttl for multicast address. | | * @param tmp The ttl for multicast address. | |
| */ | | */ | |
|
| int osip_negotiation_set_c_addr_multicast_ttl (osip_negotiation_t *, char | | int osip_negotiation_set_c_addr_multicast_ttl (osip_negotiation_t *, | |
| *tmp); | | char *tmp); | |
| /** | | /** | |
| * Set the local int for multicast address ('c' field) of all local SDP pac
ket. | | * Set the local int for multicast address ('c' field) of all local SDP pac
ket. | |
| * @param tmp The int for multicast address. | | * @param tmp The int for multicast address. | |
| */ | | */ | |
|
| int osip_negotiation_set_c_addr_multicast_int (osip_negotiation_t *, char | | int osip_negotiation_set_c_addr_multicast_int (osip_negotiation_t *, | |
| *tmp); | | char *tmp); | |
| | | | |
| /** | | /** | |
| * Add a supported audio codec. | | * Add a supported audio codec. | |
| * Those codecs will be accepted as long as you return 0 when | | * Those codecs will be accepted as long as you return 0 when | |
| * the callback 'fcn_accept_audio_codec' is called with the specific payloa
d. | | * the callback 'fcn_accept_audio_codec' is called with the specific payloa
d. | |
| * @param payload The payload. | | * @param payload The payload. | |
| * @param number_of_port The number of port (channel) for this codec. | | * @param number_of_port The number of port (channel) for this codec. | |
| * @param proto The protocol. | | * @param proto The protocol. | |
| * @param c_nettype The network type in the 'c' field. | | * @param c_nettype The network type in the 'c' field. | |
| * @param c_addrtype The address type in the 'c' field. | | * @param c_addrtype The address type in the 'c' field. | |
| * @param c_addr The address in the 'c' field. | | * @param c_addr The address in the 'c' field. | |
| * @param c_addr_multicast_ttl The ttl for multicast address in the 'c' fie
ld. | | * @param c_addr_multicast_ttl The ttl for multicast address in the 'c' fie
ld. | |
| * @param c_addr_multicast_int The int for multicast address in the 'c' fie
ld. | | * @param c_addr_multicast_int The int for multicast address in the 'c' fie
ld. | |
| * @param a_rtpmap The rtpmap attribute in the 'a' field. | | * @param a_rtpmap The rtpmap attribute in the 'a' field. | |
| */ | | */ | |
|
| int osip_negotiation_add_support_for_audio_codec (osip_negotiation_t *, c | | int osip_negotiation_add_support_for_audio_codec (osip_negotiation_t *, | |
| har *payload, | | char *payload, | |
| char *number_of_port, | | char *number_of_port, | |
| char *proto, char *c_nettype, | | char *proto, | |
| char *c_addrtype, char *c_addr | | char *c_nettype, | |
| , | | char *c_addrtype, | |
| char *c_addr_multicast_ttl, | | char *c_addr, | |
| char *c_addr_multicast_int, | | char | |
| char *a_rtpmap); | | *c_addr_multicast_ttl, | |
| | | char | |
| | | *c_addr_multicast_int, | |
| | | char *a_rtpmap); | |
| /** | | /** | |
| * Add a supported video codec. | | * Add a supported video codec. | |
| * Those codecs will be accepted as long as you return 0 when | | * Those codecs will be accepted as long as you return 0 when | |
| * the callback 'fcn_accept_video_codec' is called with the specific payloa
d. | | * the callback 'fcn_accept_video_codec' is called with the specific payloa
d. | |
| * @param payload The payload. | | * @param payload The payload. | |
| * @param number_of_port The number of port (channel) for this codec. | | * @param number_of_port The number of port (channel) for this codec. | |
| * @param proto The protocol. | | * @param proto The protocol. | |
| * @param c_nettype The network type in the 'c' field. | | * @param c_nettype The network type in the 'c' field. | |
| * @param c_addrtype The address type in the 'c' field. | | * @param c_addrtype The address type in the 'c' field. | |
| * @param c_addr The address in the 'c' field. | | * @param c_addr The address in the 'c' field. | |
| * @param c_addr_multicast_ttl The ttl for multicast address in the 'c' fie
ld. | | * @param c_addr_multicast_ttl The ttl for multicast address in the 'c' fie
ld. | |
| * @param c_addr_multicast_int The int for multicast address in the 'c' fie
ld. | | * @param c_addr_multicast_int The int for multicast address in the 'c' fie
ld. | |
| * @param a_rtpmap The rtpmap attribute in the 'a' field. | | * @param a_rtpmap The rtpmap attribute in the 'a' field. | |
| */ | | */ | |
|
| int osip_negotiation_add_support_for_video_codec (osip_negotiation_t *, c | | int osip_negotiation_add_support_for_video_codec (osip_negotiation_t *, | |
| har *payload, | | char *payload, | |
| char *number_of_port, | | char *number_of_port, | |
| char *proto, char *c_nettype, | | char *proto, | |
| char *c_addrtype, char *c_addr | | char *c_nettype, | |
| , | | char *c_addrtype, | |
| char *c_addr_multicast_ttl, | | char *c_addr, | |
| char *c_addr_multicast_int, | | char | |
| char *a_rtpmap); | | *c_addr_multicast_ttl, | |
| | | char | |
| | | *c_addr_multicast_int, | |
| | | char *a_rtpmap); | |
| /** | | /** | |
| * Add a supported (non-audio and non-video) codec. | | * Add a supported (non-audio and non-video) codec. | |
| * Those codecs will be accepted as long as you return 0 when | | * Those codecs will be accepted as long as you return 0 when | |
| * the callback 'fcn_accept_other_codec' is called with the specific payloa
d. | | * the callback 'fcn_accept_other_codec' is called with the specific payloa
d. | |
| * @param payload The payload. | | * @param payload The payload. | |
| * @param number_of_port The number of port (channel) for this codec. | | * @param number_of_port The number of port (channel) for this codec. | |
| * @param proto The protocol. | | * @param proto The protocol. | |
| * @param c_nettype The network type in the 'c' field. | | * @param c_nettype The network type in the 'c' field. | |
| * @param c_addrtype The address type in the 'c' field. | | * @param c_addrtype The address type in the 'c' field. | |
| * @param c_addr The address in the 'c' field. | | * @param c_addr The address in the 'c' field. | |
| * @param c_addr_multicast_ttl The ttl for multicast address in the 'c' fie
ld. | | * @param c_addr_multicast_ttl The ttl for multicast address in the 'c' fie
ld. | |
| * @param c_addr_multicast_int The int for multicast address in the 'c' fie
ld. | | * @param c_addr_multicast_int The int for multicast address in the 'c' fie
ld. | |
| * @param a_rtpmap The rtpmap attribute in the 'a' field. | | * @param a_rtpmap The rtpmap attribute in the 'a' field. | |
| */ | | */ | |
|
| int osip_negotiation_add_support_for_other_codec (osip_negotiation_t *, c | | int osip_negotiation_add_support_for_other_codec (osip_negotiation_t *, | |
| har *payload, | | char *payload, | |
| char *number_of_port, | | char *number_of_port, | |
| char *proto, char *c_nettype, | | char *proto, | |
| char *c_addrtype, char *c_addr | | char *c_nettype, | |
| , | | char *c_addrtype, | |
| char *c_addr_multicast_ttl, | | char *c_addr, | |
| char *c_addr_multicast_int, | | char | |
| char *a_rtpmap); | | *c_addr_multicast_ttl, | |
| | | char | |
| | | *c_addr_multicast_int, | |
| | | char *a_rtpmap); | |
| | | | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| /** | | /** | |
| * Free resource in the global sdp_config.. | | * Free resource in the global sdp_config.. | |
| */ | | */ | |
|
| int osip_negotiation_remove_audio_payloads (); | | int osip_negotiation_remove_audio_payloads (osip_negotiation_t * config); | |
| /** | | /** | |
| * Free resource in the global sdp_config.. | | * Free resource in the global sdp_config.. | |
| */ | | */ | |
|
| int osip_negotiation_remove_video_payloads (); | | int osip_negotiation_remove_video_payloads (osip_negotiation_t * config); | |
| /** | | /** | |
| * Free resource in the global sdp_config.. | | * Free resource in the global sdp_config.. | |
| */ | | */ | |
|
| int osip_negotiation_remove_other_payloads (); | | int osip_negotiation_remove_other_payloads (osip_negotiation_t * config); | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * Set the callback for setting info ('i' field) in a local SDP packet. | | * Set the callback for setting info ('i' field) in a local SDP packet. | |
| * This callback is called once each time we need an 'i' field. | | * This callback is called once each time we need an 'i' field. | |
| * @param fcn The callback. | | * @param fcn The callback. | |
| */ | | */ | |
| int osip_negotiation_set_fcn_set_info (osip_negotiation_t *, | | int osip_negotiation_set_fcn_set_info (osip_negotiation_t *, | |
|
| int (*fcn) (osip_negotiation_ctx_t * | | int (*fcn) (osip_negotiation_ctx_t | |
| , sdp_message_t *)); | | *, | |
| | | sdp_message_t *)); | |
| /** | | /** | |
| * Set the callback for setting a URI ('u' field) in a local SDP packet. | | * Set the callback for setting a URI ('u' field) in a local SDP packet. | |
| * This callback is called once each time we need an 'u' field. | | * This callback is called once each time we need an 'u' field. | |
| * @param fcn The callback. | | * @param fcn The callback. | |
| */ | | */ | |
| int osip_negotiation_set_fcn_set_uri (osip_negotiation_t *, | | int osip_negotiation_set_fcn_set_uri (osip_negotiation_t *, | |
|
| int (*fcn) (osip_negotiation_ctx_t *, | | int (*fcn) (osip_negotiation_ctx_t * | |
| sdp_message_t *)); | | , | |
| | | sdp_message_t *)); | |
| /** | | /** | |
| * Set the callback for setting an email ('e' field) in a local SDP packet. | | * Set the callback for setting an email ('e' field) in a local SDP packet. | |
| * This callback is called once each time we need an 'e' field. | | * This callback is called once each time we need an 'e' field. | |
| * @param fcn The callback. | | * @param fcn The callback. | |
| */ | | */ | |
| int osip_negotiation_set_fcn_set_emails (osip_negotiation_t *, | | int osip_negotiation_set_fcn_set_emails (osip_negotiation_t *, | |
|
| int (*fcn) (osip_negotiation_ctx_t | | int (*fcn) (osip_negotiation_ctx_ | |
| *, sdp_message_t *)); | | t | |
| | | *, sdp_message_t *)); | |
| /** | | /** | |
| * Set the callback for setting a phone ('p' field) in a local SDP packet. | | * Set the callback for setting a phone ('p' field) in a local SDP packet. | |
| * This callback is called once each time we need an 'p' field. | | * This callback is called once each time we need an 'p' field. | |
| * @param fcn The callback. | | * @param fcn The callback. | |
| */ | | */ | |
| int osip_negotiation_set_fcn_set_phones (osip_negotiation_t *, | | int osip_negotiation_set_fcn_set_phones (osip_negotiation_t *, | |
|
| int (*fcn) (osip_negotiation_ctx_t | | int (*fcn) (osip_negotiation_ctx_ | |
| *, sdp_message_t *)); | | t | |
| | | *, sdp_message_t *)); | |
| /** | | /** | |
| * Set the callback for setting an attribute ('a' field) in a local SDP pac
ket. | | * Set the callback for setting an attribute ('a' field) in a local SDP pac
ket. | |
| * This callback is called once each time we need an 'a' field. | | * This callback is called once each time we need an 'a' field. | |
| * @param fcn The callback. | | * @param fcn The callback. | |
| */ | | */ | |
| int | | int | |
| osip_negotiation_set_fcn_set_attributes (osip_negotiation_t *, | | osip_negotiation_set_fcn_set_attributes (osip_negotiation_t *, | |
|
| int (*fcn) (osip_negotiation_ctx | | int (*fcn) | |
| _t *, sdp_message_t *, int)); | | (osip_negotiation_ctx_t *, | |
| | | sdp_message_t *, int)); | |
| /** | | /** | |
| * Set the callback used to accept a codec during a negotiation. | | * Set the callback used to accept a codec during a negotiation. | |
| * This callback is called once each time we need to accept a codec. | | * This callback is called once each time we need to accept a codec. | |
| * @param fcn The callback. | | * @param fcn The callback. | |
| */ | | */ | |
| int | | int | |
| osip_negotiation_set_fcn_accept_audio_codec (osip_negotiation_t *, | | osip_negotiation_set_fcn_accept_audio_codec (osip_negotiation_t *, | |
|
| int (*fcn) (osip_negotiation | | int (*fcn) | |
| _ctx_t *, char *, char *, int, char *)); | | (osip_negotiation_ctx_t *, | |
| | | char *, char *, int, | |
| | | char *)); | |
| /** | | /** | |
| * Set the callback used to accept a codec during a negotiation. | | * Set the callback used to accept a codec during a negotiation. | |
| * This callback is called once each time we need to accept a codec. | | * This callback is called once each time we need to accept a codec. | |
| * @param fcn The callback. | | * @param fcn The callback. | |
| */ | | */ | |
| int | | int | |
| osip_negotiation_set_fcn_accept_video_codec (osip_negotiation_t *, | | osip_negotiation_set_fcn_accept_video_codec (osip_negotiation_t *, | |
|
| int (*fcn) (osip_negotiation | | int (*fcn) | |
| _ctx_t *, char *, char *, int, char *)); | | (osip_negotiation_ctx_t *, | |
| | | char *, char *, int, | |
| | | char *)); | |
| /** | | /** | |
| * Set the callback used to accept a codec during a negotiation. | | * Set the callback used to accept a codec during a negotiation. | |
| * This callback is called once each time we need to accept a codec. | | * This callback is called once each time we need to accept a codec. | |
| * @param fcn The callback. | | * @param fcn The callback. | |
| */ | | */ | |
| int | | int | |
| osip_negotiation_set_fcn_accept_other_codec (osip_negotiation_t *, | | osip_negotiation_set_fcn_accept_other_codec (osip_negotiation_t *, | |
|
| int (*fcn) (osip_negotiation | | int (*fcn) | |
| _ctx_t *, char *, char *, char *, char *)); | | (osip_negotiation_ctx_t *, | |
| | | char *, char *, char *, | |
| | | char *)); | |
| /** | | /** | |
| * Set the callback for setting the port number ('m' field) in a local SDP
packet. | | * Set the callback for setting the port number ('m' field) in a local SDP
packet. | |
| * This callback is called once each time a 'm' line is accepted. | | * This callback is called once each time a 'm' line is accepted. | |
| * @param fcn The callback. | | * @param fcn The callback. | |
| */ | | */ | |
|
| int osip_negotiation_set_fcn_get_audio_port (osip_negotiation_t *, char * | | int osip_negotiation_set_fcn_get_audio_port (osip_negotiation_t *, | |
| (*fcn) (osip_negotiation_ctx_t *, int)); | | char | |
| | | *(*fcn) (osip_negotiation_ctx | |
| | | _t | |
| | | *, int)); | |
| /** | | /** | |
| * Set the callback for setting the port number ('m' field) in a local SDP
packet. | | * Set the callback for setting the port number ('m' field) in a local SDP
packet. | |
| * This callback is called once each time a 'm' line is accepted. | | * This callback is called once each time a 'm' line is accepted. | |
| * @param fcn The callback. | | * @param fcn The callback. | |
| */ | | */ | |
|
| int osip_negotiation_set_fcn_get_video_port (osip_negotiation_t *, char * | | int osip_negotiation_set_fcn_get_video_port (osip_negotiation_t *, | |
| (*fcn) (osip_negotiation_ctx_t *, int)); | | char | |
| | | *(*fcn) (osip_negotiation_ctx | |
| | | _t | |
| | | *, int)); | |
| /** | | /** | |
| * Set the callback for setting the port number ('m' field) in a local SDP
packet. | | * Set the callback for setting the port number ('m' field) in a local SDP
packet. | |
| * This callback is called once each time a 'm' line is accepted. | | * This callback is called once each time a 'm' line is accepted. | |
| * @param fcn The callback. | | * @param fcn The callback. | |
| */ | | */ | |
|
| int osip_negotiation_set_fcn_get_other_port (osip_negotiation_t *, char * | | int osip_negotiation_set_fcn_get_other_port (osip_negotiation_t *, | |
| (*fcn) (osip_negotiation_ctx_t *, int)); | | char | |
| | | *(*fcn) (osip_negotiation_ctx | |
| | | _t | |
| | | *, int)); | |
| | | | |
| /** | | /** | |
| * Start the automatic negotiation for a UA | | * Start the automatic negotiation for a UA | |
| * NOTE: You can previously set context->mycontext to point to your | | * NOTE: You can previously set context->mycontext to point to your | |
| * personal context. This way you'll get access to your personal context | | * personal context. This way you'll get access to your personal context | |
| * in the callback and you can easily take the correct decisions. | | * in the callback and you can easily take the correct decisions. | |
| * After this method is called, the negotiation will happen and | | * After this method is called, the negotiation will happen and | |
| * callbacks will be called. You can modify, add, remove SDP fields, | | * callbacks will be called. You can modify, add, remove SDP fields, | |
| * and accept and refuse the codec from your preferred list by using | | * and accept and refuse the codec from your preferred list by using | |
| * those callbacks. | | * those callbacks. | |
| * Of course, after the negotiation happen, you can modify the | | * Of course, after the negotiation happen, you can modify the | |
| * SDP packet if you wish to improve it or just refine some attributes. | | * SDP packet if you wish to improve it or just refine some attributes. | |
| * @param ctx The context holding the remote SDP offer. | | * @param ctx The context holding the remote SDP offer. | |
| */ | | */ | |
| int osip_negotiation_ctx_execute_negotiation (osip_negotiation_t *, | | int osip_negotiation_ctx_execute_negotiation (osip_negotiation_t *, | |
| osip_negotiation_ctx_t * ctx
); | | osip_negotiation_ctx_t * ctx
); | |
| | | | |
| int osip_negotiation_sdp_build_offer (osip_negotiation_t *, | | int osip_negotiation_sdp_build_offer (osip_negotiation_t *, | |
| osip_negotiation_ctx_t * con, | | osip_negotiation_ctx_t * con, | |
| sdp_message_t ** sdp, | | sdp_message_t ** sdp, | |
|
| char *audio_port, | | char *audio_port, char *video_port); | |
| char *video_port); | | | |
| int __osip_negotiation_sdp_build_offer (osip_negotiation_t *, | | int __osip_negotiation_sdp_build_offer (osip_negotiation_t *, | |
|
| osip_negotiation_ctx_t * con, sdp_message_t ** sdp, | | osip_negotiation_ctx_t * con, | |
| char *audio_port, | | sdp_message_t ** sdp, | |
| char *video_port, char *audio_codec, char *video_co | | char *audio_port, char *video_port | |
| dec); | | , | |
| | | char *audio_codec, | |
| | | char *video_codec); | |
| | | | |
| /* for non "on-hold sdp" in outgoing invite */ | | /* for non "on-hold sdp" in outgoing invite */ | |
| int osip_negotiation_sdp_message_put_on_hold (sdp_message_t * sdp); | | int osip_negotiation_sdp_message_put_on_hold (sdp_message_t * sdp); | |
| /* for an "on hold sdp" in outgoing invite */ | | /* for an "on hold sdp" in outgoing invite */ | |
| int osip_negotiation_sdp_message_put_off_hold (sdp_message_t * sdp); | | int osip_negotiation_sdp_message_put_off_hold (sdp_message_t * sdp); | |
| | | | |
| /** @} */ | | /** @} */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| | | | |
End of changes. 29 change blocks. |
| 76 lines changed or deleted | | 108 lines changed or added | |
|
| osip_parser.h | | osip_parser.h | |
| | | | |
| skipping to change at line 45 | | skipping to change at line 45 | |
| */ | | */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" | | extern "C" | |
| { | | { | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * Initialise the oSIP parser. | | * Initialise the oSIP parser. | |
| */ | | */ | |
|
| int parser_init (); | | 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, const cha | | int osip_message_fix_last_via_header (osip_message_t * request, | |
| r *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. | |
| */ | | */ | |
|
| #ifdef USE_TMP_BUFFER | | | |
| /** | | /** | |
| * 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); | |
|
| #endif | | | |
| | | | |
| /** | | /** | |
| * 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. | |
| | | | |
| skipping to change at line 91 | | skipping to change at line 90 | |
| * @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_accept (osip_message_t * sip, const char *hvalue); | | int osip_message_set_accept (osip_message_t * sip, const char *hvalue); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
|
| int osip_message_get_accept (const osip_message_t * sip, int pos, osip_ac | | int osip_message_get_accept (const osip_message_t * sip, int pos, | |
| cept_t ** dest); | | osip_accept_t ** dest); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
|
| int osip_message_set_accept_encoding (osip_message_t * sip, const char *h | | int osip_message_set_accept_encoding (osip_message_t * sip, | |
| value); | | const char *hvalue); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
| 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); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
|
| int osip_message_set_accept_language (osip_message_t * sip, const char *h | | int osip_message_set_accept_language (osip_message_t * sip, | |
| value); | | const char *hvalue); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
| 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); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
| 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 *hvalue
); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
| 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); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
| int osip_message_set_allow (osip_message_t * sip, const char *hvalue); | | int osip_message_set_allow (osip_message_t * sip, const char *hvalue); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
|
| int osip_message_get_allow (const osip_message_t * sip, int pos, osip_all | | int osip_message_get_allow (const osip_message_t * sip, int pos, | |
| ow_t ** dest); | | osip_allow_t ** dest); | |
| /** | | /** | |
| * 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 | | int osip_message_set_authorization (osip_message_t * sip, | |
| lue); | | 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. | |
| */ | | */ | |
| int osip_message_get_authorization (const osip_message_t * sip, int pos, | | int osip_message_get_authorization (const osip_message_t * sip, int pos, | |
|
| osip_authorization_t ** dest); | | osip_authorization_t ** dest); | |
| /** | | /** | |
| * 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 *hvalue); | |
| /** | | /** | |
| * Get one Call-id header. | | * Get one Call-id header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| */ | | */ | |
| | | | |
| skipping to change at line 184 | | skipping to change at line 188 | |
| * @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_info (osip_message_t * sip, const char *hvalue)
; | | int osip_message_set_call_info (osip_message_t * sip, const char *hvalue)
; | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
|
| int osip_message_get_call_info (const osip_message_t * sip, int pos, osip | | int osip_message_get_call_info (const osip_message_t * sip, int pos, | |
| _call_info_t ** dest); | | osip_call_info_t ** dest); | |
| /** | | /** | |
| * 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 *hvalue); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
|
| int osip_message_get_contact (const osip_message_t * sip, int pos, osip_c | | int osip_message_get_contact (const osip_message_t * sip, int pos, | |
| ontact_t ** dest); | | osip_contact_t ** dest); | |
| /** | | /** | |
| * Set the Content-disposition header. | | * Set the Content-disposition 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_disposition (osip_message_t * sip, const cha | | int osip_message_set_content_disposition (osip_message_t * sip, | |
| r *hvalue); | | const char *hvalue); | |
| /** | | /** | |
| * Get one Content-disposition header. | | * Get one Content-disposition 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. | |
| */ | | */ | |
|
| int osip_message_get_content_disposition (const osip_message_t * sip, int | | int osip_message_get_content_disposition (const osip_message_t * sip, | |
| pos, | | int pos, | |
| osip_content_disposition_t ** dest); | | osip_content_disposition_t ** | |
| | | dest); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
|
| 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); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
| int osip_message_get_content_encoding (const osip_message_t * sip, int po
s, | | int osip_message_get_content_encoding (const osip_message_t * sip, int po
s, | |
|
| osip_content_encoding_t ** dest); | | osip_content_encoding_t ** dest); | |
| /** | | /** | |
| * 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 | | int osip_message_set_content_length (osip_message_t * sip, | |
| alue); | | 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. | |
| */ | | */ | |
|
| osip_content_length_t *osip_message_get_content_length (const osip_messag | | osip_content_length_t *osip_message_get_content_length (const osip_messag | |
| e_t * sip); | | e_t | |
| | | * sip); | |
| /** | | /** | |
| * 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 | | int osip_message_set_content_type (osip_message_t * sip, | |
| ue); | | 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. | |
| */ | | */ | |
|
| osip_content_type_t *osip_message_get_content_type (const osip_message_t | | osip_content_type_t *osip_message_get_content_type (const osip_message_t | |
| * sip); | | * | |
| | | sip); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
| | | | |
| skipping to change at line 272 | | skipping to change at line 286 | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
| 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 *hvalue
); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
| 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); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
| osip_from_t *osip_message_get_from (const osip_message_t * sip); | | osip_from_t *osip_message_get_from (const osip_message_t * sip); | |
| /** | | /** | |
| * 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 | | int osip_message_set_mime_version (osip_message_t * sip, | |
| ue); | | 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. | |
| */ | | */ | |
|
| osip_mime_version_t *osip_message_get_mime_version (const osip_message_t | | osip_mime_version_t *osip_message_get_mime_version (const osip_message_t | |
| * sip); | | * | |
| | | sip); | |
| /** | | /** | |
| * 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, const char | | int osip_message_set_proxy_authenticate (osip_message_t * sip, | |
| *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. | |
| */ | | */ | |
|
| int osip_message_get_proxy_authenticate (const osip_message_t * sip, int | | int osip_message_get_proxy_authenticate (const osip_message_t * sip, | |
| pos, | | int pos, | |
| osip_proxy_authenticate_t ** dest); | | osip_proxy_authenticate_t ** dest | |
| | | ); | |
| /** | | /** | |
| * 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, const cha | | int osip_message_set_proxy_authorization (osip_message_t * sip, | |
| r *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. | |
| */ | | */ | |
|
| int osip_message_get_proxy_authorization (const osip_message_t * sip, int | | int osip_message_get_proxy_authorization (const osip_message_t * sip, | |
| pos, | | int pos, | |
| osip_proxy_authorization_t ** dest); | | osip_proxy_authorization_t ** | |
| | | dest); | |
| /** | | /** | |
| * 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 | | int osip_message_set_record_route (osip_message_t * sip, | |
| ue); | | 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. | |
| */ | | */ | |
|
| int osip_message_get_record_route (const osip_message_t * sip, int pos, o | | int osip_message_get_record_route (const osip_message_t * sip, int pos, | |
| sip_record_route_t ** dest); | | osip_record_route_t ** dest); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
|
| int osip_message_get_route (const osip_message_t * sip, int pos, osip_rou | | int osip_message_get_route (const osip_message_t * sip, int pos, | |
| te_t ** dest); | | osip_route_t ** dest); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
| osip_to_t *osip_message_get_to (const osip_message_t * sip); | | osip_to_t *osip_message_get_to (const osip_message_t * sip); | |
| /** | | /** | |
| * 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. | |
| | | * @param sip The element to work on. | |
| | | * @param hvalue The string describing the element. | |
| | | */ | |
| | | 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. | |
| */ | | */ | |
|
| int osip_message_get_via (const osip_message_t * sip, int pos, osip_via_t | | int osip_message_get_via (const osip_message_t * sip, int pos, | |
| ** dest); | | osip_via_t ** dest); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
| int osip_message_get_www_authenticate (const osip_message_t * sip, int po
s, | | int osip_message_get_www_authenticate (const osip_message_t * sip, int po
s, | |
|
| osip_www_authenticate_t ** dest); | | osip_www_authenticate_t ** dest); | |
| /** | | /** | |
| * 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 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 *hname, | |
|
| const char *hvalue); | | const char *hvalue); | |
| | | | |
| /** | | /** | |
| * 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, const cha | | int osip_message_header_get_byname (const osip_message_t * sip, | |
| r *hname, int pos, | | const char *hname, int pos, | |
| osip_header_t ** dest); | | osip_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. | |
| */ | | */ | |
|
| int osip_message_get_header (const osip_message_t * sip, int pos, osip_he | | int osip_message_get_header (const osip_message_t * sip, int pos, | |
| ader_t ** dest); | | osip_header_t ** dest); | |
| | | | |
| /** | | /** | |
| * 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 string containing the body. | | * @param buf The string containing the body. | |
| */ | | */ | |
| int osip_message_set_body (osip_message_t * sip, const char *buf); | | int osip_message_set_body (osip_message_t * sip, const char *buf); | |
| /** | | /** | |
| * Set a type for a body. (NOT TESTED! use with care) | | * Set a type for a body. (NOT TESTED! use with care) | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param buf the mime type of body. | | * @param buf the mime type of body. | |
| */ | | */ | |
| 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); | |
| /** | | /** | |
| * 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. | |
| */ | | */ | |
|
| int osip_message_get_body (const osip_message_t * sip, int pos, osip_body | | int osip_message_get_body (const osip_message_t * sip, int pos, | |
| _t ** dest); | | osip_body_t ** dest); | |
| | | | |
| /* trace facilities */ | | /* trace facilities */ | |
| #ifndef DOXYGEN /* avoid DOXYGEN warning */ | | #ifndef DOXYGEN /* avoid DOXYGEN warning */ | |
| #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. | |
| */ | | */ | |
| #define osip_message_set_date(sip,value) osip_message_set_header
((osip_message_t *)sip,(const char *)"Date",value) | | #define osip_message_set_date(sip,value) osip_message_set_header
((osip_message_t *)sip,(const char *)"Date",value) | |
| /** | | /** | |
| | | | |
End of changes. 43 change blocks. |
| 76 lines changed or deleted | | 86 lines changed or added | |
|
| sdp_message.h | | sdp_message.h | |
| | | | |
| skipping to change at line 80 | | skipping to change at line 80 | |
| /** | | /** | |
| * Structure for referencing time description header. | | * Structure for referencing time description header. | |
| * @defvar sdp_time_descr_t | | * @defvar sdp_time_descr_t | |
| */ | | */ | |
| typedef struct sdp_time_descr sdp_time_descr_t; | | typedef struct sdp_time_descr sdp_time_descr_t; | |
| | | | |
| struct sdp_time_descr | | struct sdp_time_descr | |
| { | | { | |
| char *t_start_time; | | char *t_start_time; | |
| char *t_stop_time; | | char *t_stop_time; | |
|
| osip_list_t *r_repeats; /* list of char * */ | | osip_list_t *r_repeats; /* list of char * */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * 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. | |
| | | | |
| skipping to change at line 216 | | skipping to change at line 216 | |
| char *v_version; | | char *v_version; | |
| char *o_username; | | char *o_username; | |
| char *o_sess_id; | | char *o_sess_id; | |
| char *o_sess_version; | | char *o_sess_version; | |
| char *o_nettype; | | char *o_nettype; | |
| char *o_addrtype; | | char *o_addrtype; | |
| char *o_addr; | | char *o_addr; | |
| char *s_name; | | char *s_name; | |
| char *i_info; | | char *i_info; | |
| char *u_uri; | | char *u_uri; | |
|
| osip_list_t *e_emails; /* list of char * */ | | osip_list_t *e_emails; /* list of char * */ | |
| osip_list_t *p_phones; /* list of char * */ | | osip_list_t *p_phones; /* list of char * */ | |
| sdp_connection_t *c_connection; | | sdp_connection_t *c_connection; | |
| osip_list_t *b_bandwidths; /* list of sdp_bandwidth_t * */ | | osip_list_t *b_bandwidths; /* list of sdp_bandwidth_t * */ | |
|
| osip_list_t *t_descrs; /* list of sdp_time_descr_t * */ | | osip_list_t *t_descrs; /* list of sdp_time_descr_t * */ | |
| char *z_adjustments; | | char *z_adjustments; | |
| sdp_key_t *k_key; | | sdp_key_t *k_key; | |
| osip_list_t *a_attributes; /* list of sdp_attribute_t * */ | | osip_list_t *a_attributes; /* list of sdp_attribute_t * */ | |
|
| osip_list_t *m_medias; /* list of sdp_media_t * */ | | osip_list_t *m_medias; /* list of sdp_media_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. | |
| | | | |
| skipping to change at line 277 | | skipping to change at line 277 | |
| /** | | /** | |
| * 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, char * | | int sdp_message_o_origin_set (sdp_message_t * sdp, char *username, | |
| sess_id, | | char *sess_id, char *sess_version, | |
| char *sess_version, char *nettype, | | char *nettype, char *addrtype, char *addr); | |
| 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); | |
| | | | |
| skipping to change at line 327 | | skipping to change at line 327 | |
| * 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 | | int sdp_message_i_info_set (sdp_message_t * sdp, int pos_media, | |
| ue); | | 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. | |
| | | | |
| skipping to change at line 356 | | skipping to change at line 357 | |
| * 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); | |
| /** | | /** | |
| * 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_e_email_get (sdp_message_t * sdp, int pos); | | #define sdp_e_email_get sdp_message_e_email_get | |
| | | 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. | |
| | | | |
| skipping to change at line 380 | | skipping to change at line 382 | |
| * 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, | | char *nettype, char *addrtype, | |
| char *addr, char *addr_multicast_ttl, | | char *addr, char *addr_multicast_ttl, | |
| char *addr_multicast_int); | | char *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, int po | | sdp_connection_t *sdp_message_connection_get (sdp_message_t * sdp, | |
| s_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 | | char *sdp_message_c_nettype_get (sdp_message_t * sdp, int pos_media, | |
| pos); | | 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 | | char *sdp_message_c_addrtype_get (sdp_message_t * sdp, int pos_media, | |
| pos); | | 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, int pos_ | | char *sdp_message_c_addr_multicast_ttl_get (sdp_message_t * sdp, | |
| 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, int pos_ | | char *sdp_message_c_addr_multicast_int_get (sdp_message_t * sdp, | |
| 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, int pos_ | | sdp_bandwidth_t *sdp_message_bandwidth_get (sdp_message_t * sdp, | |
| 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 | | char *sdp_message_b_bwtype_get (sdp_message_t * sdp, int pos_media, | |
| os); | | int 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 | | char *sdp_message_b_bandwidth_get (sdp_message_t * sdp, int pos_media, | |
| t pos); | | 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 | | int sdp_message_t_time_descr_add (sdp_message_t * sdp, char *start, | |
| *stop); | | char *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, ch | | int sdp_message_r_repeat_add (sdp_message_t * sdp, int pos_time_descr, | |
| ar *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_descr, | |
| int pos_repeat); | | int pos_repeat); | |
| /** | | /** | |
| * 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, char *keyt | | int sdp_message_k_key_set (sdp_message_t * sdp, int pos_media, | |
| ype, | | char *keytype, char *keydata); | |
| char *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, char | | int sdp_message_a_attribute_add (sdp_message_t * sdp, int pos_media, | |
| *att_field, | | char *att_field, char *att_value); | |
| char *att_value); | | | |
| /** | | /** | |
| * 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, int pos_ | | sdp_attribute_t *sdp_message_attribute_get (sdp_message_t * sdp, | |
| 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 | | char *sdp_message_a_att_field_get (sdp_message_t * sdp, int pos_media, | |
| t pos); | | 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 | | char *sdp_message_a_att_value_get (sdp_message_t * sdp, int pos_media, | |
| t pos); | | 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 *proto); | | char *port, 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. | |
| | | | |
| skipping to change at line 593 | | skipping to change at line 609 | |
| * @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, char * | | int sdp_message_m_payload_add (sdp_message_t * sdp, int pos_media, | |
| payload); | | char *payload); | |
| /** | | /** | |
| * 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 | | char *sdp_message_m_payload_get (sdp_message_t * sdp, int pos_media, | |
| pos); | | int pos); | |
| | | | |
| /** @} */ | | /** @} */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 28 change blocks. |
| 55 lines changed or deleted | | 53 lines changed or added | |
|