| osip.h | | osip.h | |
| | | | |
| skipping to change at line 23 | | skipping to change at line 23 | |
| Lesser General Public License for more details. | | Lesser General Public License for more details. | |
| | | | |
| You should have received a copy of the GNU Lesser General Public | | You should have received a copy of the GNU Lesser General Public | |
| License along with this library; if not, write to the Free Software | | License along with this library; if not, write to the Free Software | |
| 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_ | |
| | | | |
|
| | | #if defined(HAVE_DICT_DICT_H) | |
| | | #include <dict/dict.h> | |
| | | #endif | |
| | | | |
| #include <osipparser2/osip_const.h> | | #include <osipparser2/osip_const.h> | |
| | | | |
| /* Time-related functions and data types */ | | /* Time-related functions and data types */ | |
| #include <osip2/osip_time.h> | | #include <osip2/osip_time.h> | |
| | | | |
| #ifdef __sun | | #ifdef __sun | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| #endif | | #endif | |
| | | | |
| #include <osipparser2/osip_parser.h> | | #include <osipparser2/osip_parser.h> | |
| | | | |
| skipping to change at line 90 | | skipping to change at line 94 | |
| /* STATES for NON-invite server transaction */ | | /* STATES for NON-invite server transaction */ | |
| NIST_PRE_TRYING, | | NIST_PRE_TRYING, | |
| NIST_TRYING, | | NIST_TRYING, | |
| NIST_PROCEEDING, | | NIST_PROCEEDING, | |
| NIST_COMPLETED, | | NIST_COMPLETED, | |
| NIST_TERMINATED, | | NIST_TERMINATED, | |
| | | | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| DIALOG_EARLY, | | DIALOG_EARLY, | |
| DIALOG_CONFIRMED, | | DIALOG_CONFIRMED, | |
|
| DIALOG_CLOSE /* ?? */ | | DIALOG_CLOSE /* ?? */ | |
| #endif | | #endif | |
| } | | } | |
| state_t; | | state_t; | |
| | | | |
| /** | | /** | |
| * Enumeration for event type. | | * Enumeration for event type. | |
| * <BR>The list of values that you need to know is reduced to this: | | * <BR>The list of values that you need to know is reduced to this: | |
| * <BR> RCV_REQINVITE, | | * <BR> RCV_REQINVITE, | |
| * <BR> RCV_REQACK, | | * <BR> RCV_REQACK, | |
| * <BR> RCV_REQUEST, | | * <BR> RCV_REQUEST, | |
| | | | |
| skipping to change at line 115 | | skipping to change at line 119 | |
| * <BR> SND_REQINVITE, | | * <BR> SND_REQINVITE, | |
| * <BR> SND_REQACK, | | * <BR> SND_REQACK, | |
| * <BR> SND_REQUEST, | | * <BR> SND_REQUEST, | |
| * <BR> SND_STATUS_1XX, | | * <BR> SND_STATUS_1XX, | |
| * <BR> SND_STATUS_2XX, | | * <BR> SND_STATUS_2XX, | |
| * <BR> SND_STATUS_3456XX, | | * <BR> SND_STATUS_3456XX, | |
| */ | | */ | |
| typedef enum type_t | | typedef enum type_t | |
| { | | { | |
| /* TIMEOUT EVENTS for ICT */ | | /* TIMEOUT EVENTS for ICT */ | |
|
| TIMEOUT_A, /**< Timer A */ | | TIMEOUT_A, /**< Timer A */ | |
| TIMEOUT_B, /**< Timer B */ | | TIMEOUT_B, /**< Timer B */ | |
| TIMEOUT_D, /**< Timer D */ | | TIMEOUT_D, /**< Timer D */ | |
| | | | |
| /* TIMEOUT EVENTS for NICT */ | | /* TIMEOUT EVENTS for NICT */ | |
|
| TIMEOUT_E, /**< Timer E */ | | TIMEOUT_E, /**< Timer E */ | |
| TIMEOUT_F, /**< Timer F */ | | TIMEOUT_F, /**< Timer F */ | |
| TIMEOUT_K, /**< Timer K */ | | TIMEOUT_K, /**< Timer K */ | |
| | | | |
| /* TIMEOUT EVENTS for IST */ | | /* TIMEOUT EVENTS for IST */ | |
|
| TIMEOUT_G, /**< Timer G */ | | TIMEOUT_G, /**< Timer G */ | |
| TIMEOUT_H, /**< Timer H */ | | TIMEOUT_H, /**< Timer H */ | |
| TIMEOUT_I, /**< Timer I */ | | TIMEOUT_I, /**< Timer I */ | |
| | | | |
| /* TIMEOUT EVENTS for NIST */ | | /* TIMEOUT EVENTS for NIST */ | |
|
| TIMEOUT_J, /**< Timer J */ | | TIMEOUT_J, /**< Timer J */ | |
| | | | |
| /* FOR INCOMING MESSAGE */ | | /* FOR INCOMING MESSAGE */ | |
| RCV_REQINVITE, /**< Event is an incoming INVITE request */ | | RCV_REQINVITE, /**< Event is an incoming INVITE request */ | |
|
| RCV_REQACK, /**< Event is an incoming ACK request */ | | RCV_REQACK, /**< Event is an incoming ACK request */ | |
| RCV_REQUEST, /**< Event is an incoming NON-INVITE and NON-ACK requ
est */ | | RCV_REQUEST, /**< Event is an incoming NON-INVITE and NON-ACK requ
est */ | |
| RCV_STATUS_1XX, /**< Event is an incoming informational response */ | | RCV_STATUS_1XX, /**< Event is an incoming informational response */ | |
| RCV_STATUS_2XX, /**< Event is an incoming 2XX response */ | | RCV_STATUS_2XX, /**< Event is an incoming 2XX response */ | |
| RCV_STATUS_3456XX,/**< Event is an incoming final response (not 2XX) */ | | RCV_STATUS_3456XX,/**< Event is an incoming final response (not 2XX) */ | |
| | | | |
| /* FOR OUTGOING MESSAGE */ | | /* FOR OUTGOING MESSAGE */ | |
| SND_REQINVITE, /**< Event is an outgoing INVITE request */ | | SND_REQINVITE, /**< Event is an outgoing INVITE request */ | |
|
| SND_REQACK, /**< Event is an outgoing ACK request */ | | SND_REQACK, /**< Event is an outgoing ACK request */ | |
| SND_REQUEST, /**< Event is an outgoing NON-INVITE and NON-ACK requ
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; | |
| | | | |
| | | | |
| skipping to change at line 175 | | skipping to change at line 179 | |
| NICT,/**< Non-Invite Client (outgoing) Transaction */ | | NICT,/**< Non-Invite Client (outgoing) Transaction */ | |
| NIST /**< Non-Invite Server (incoming) Transaction */ | | NIST /**< Non-Invite Server (incoming) Transaction */ | |
| } | | } | |
| osip_fsm_type_t; | | osip_fsm_type_t; | |
| | | | |
| #ifndef DEFAULT_T1 | | #ifndef DEFAULT_T1 | |
| /** | | /** | |
| * You can re-define the default value for T1. (T1 is defined in rfcxxxx) | | * You can re-define the default value for T1. (T1 is defined in rfcxxxx) | |
| * The default value is 500ms. | | * The default value is 500ms. | |
| */ | | */ | |
|
| #define DEFAULT_T1 500 /* 500 ms */ | | #define DEFAULT_T1 500 /* 500 ms */ | |
| #endif | | #endif | |
| #ifndef DEFAULT_T2 | | #ifndef DEFAULT_T2 | |
| /** | | /** | |
| * You can re-define the default value for T2. (T2 is defined in rfcxxxx) | | * You can re-define the default value for T2. (T2 is defined in rfcxxxx) | |
| * The default value is 4000ms. | | * The default value is 4000ms. | |
| */ | | */ | |
|
| #define DEFAULT_T2 4000 /* 4s */ | | #define DEFAULT_T2 4000 /* 4s */ | |
| #endif | | #endif | |
| #ifndef DEFAULT_T4 | | #ifndef DEFAULT_T4 | |
| /** | | /** | |
| * You can re-define the default value for T4. (T1 is defined in rfcxxxx) | | * You can re-define the default value for T4. (T1 is defined in rfcxxxx) | |
| * The default value is 5000ms. | | * The default value is 5000ms. | |
| */ | | */ | |
|
| #define DEFAULT_T4 5000 /* 5s */ | | #define DEFAULT_T4 5000 /* 5s */ | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * Structure for INVITE CLIENT TRANSACTION (outgoing INVITE transaction). | | * Structure for INVITE CLIENT TRANSACTION (outgoing INVITE transaction). | |
| * @var osip_ict_t | | * @var osip_ict_t | |
| */ | | */ | |
| typedef struct osip_ict osip_ict_t; | | typedef struct osip_ict osip_ict_t; | |
| | | | |
| /** | | /** | |
| * Structure for INVITE CLIENT TRANSACTION. | | * Structure for INVITE CLIENT TRANSACTION. | |
| * @struct osip_ict | | * @struct osip_ict | |
| */ | | */ | |
| struct osip_ict | | struct osip_ict | |
| { | | { | |
|
| int timer_a_length; /**@internal A=T1, A=2xT1... (unre
liable only) */ | | int timer_a_length; /**@internal A=T1, A=2xT1... (unreliable
only) */ | |
| struct timeval timer_a_start; /**@internal */ | | struct timeval timer_a_start; /**@internal */ | |
|
| int timer_b_length; /**@internal B = 64* T1 */ | | int timer_b_length; /**@internal B = 64* T1 */ | |
| struct timeval timer_b_start; /**@internal fire when transaction timeou
ts */ | | struct timeval timer_b_start; /**@internal fire when transaction timeou
ts */ | |
|
| int timer_d_length; /**@internal D >= 32s for unreliab
le tr (or 0) */ | | int timer_d_length; /**@internal D >= 32s for unreliable tr (
or 0) */ | |
| struct timeval timer_d_start; /**@internal should be equal to timer H *
/ | | struct timeval timer_d_start; /**@internal should be equal to timer H *
/ | |
|
| char *destination; /**@internal url used to send requests */ | | char *destination; /**@internal url used to send requests */ | |
| int port; /**@internal port of next hop */ | | int port; /**@internal port of next hop */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Structure for NON-INVITE CLIENT TRANSACTION (outgoing NON-INVITE transac
tion). | | * Structure for NON-INVITE CLIENT TRANSACTION (outgoing NON-INVITE transac
tion). | |
| * @var osip_nict_t | | * @var osip_nict_t | |
| */ | | */ | |
| typedef struct osip_nict osip_nict_t; | | typedef struct osip_nict osip_nict_t; | |
| | | | |
| /** | | /** | |
| * Structure for NON-INVITE CLIENT TRANSACTION. | | * Structure for NON-INVITE CLIENT TRANSACTION. | |
| * @struct osip_nict | | * @struct osip_nict | |
| */ | | */ | |
| struct osip_nict | | struct osip_nict | |
| { | | { | |
|
| int timer_e_length; /**@internal A=T1, A=2xT1... (unre
liable only) */ | | int timer_e_length; /**@internal A=T1, A=2xT1... (unreliable
only) */ | |
| struct timeval timer_e_start; /**@internal */ | | struct timeval timer_e_start; /**@internal */ | |
|
| int timer_f_length; /**@internal B = 64* T1 */ | | int timer_f_length; /**@internal B = 64* T1 */ | |
| struct timeval timer_f_start; /**@internal fire when transaction timeou
ts */ | | struct timeval timer_f_start; /**@internal fire when transaction timeou
ts */ | |
|
| int timer_k_length; /**@internal K = T4 (else = 0) */ | | int timer_k_length; /**@internal K = T4 (else = 0) */ | |
| struct timeval timer_k_start; /**@internal */ | | struct timeval timer_k_start; /**@internal */ | |
|
| char *destination; /**@internal url used to send requests */ | | char *destination; /**@internal url used to send requests */ | |
| int port; /**@internal port of next hop */ | | int port; /**@internal port of next hop */ | |
| | | | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Structure for INVITE SERVER TRANSACTION (incoming INVITE transaction). | | * Structure for INVITE SERVER TRANSACTION (incoming INVITE transaction). | |
| * @var osip_ist_t | | * @var osip_ist_t | |
| */ | | */ | |
| typedef struct osip_ist osip_ist_t; | | typedef struct osip_ist osip_ist_t; | |
| | | | |
| /** | | /** | |
| * Structure for INVITE SERVER TRANSACTION. | | * Structure for INVITE SERVER TRANSACTION. | |
| * @struct osip_ist | | * @struct osip_ist | |
| */ | | */ | |
| struct osip_ist | | struct osip_ist | |
| { | | { | |
|
| int timer_g_length; /**@internal G=MIN(T1*2,T2) for unrelia
ble trans. */ | | int timer_g_length; /**@internal G=MIN(T1*2,T2) for unreliable tra
ns. */ | |
| struct timeval timer_g_start; /**@internal 0 when reliable transport is
used */ | | struct timeval timer_g_start; /**@internal 0 when reliable transport is
used */ | |
|
| int timer_h_length; /**@internal H = 64* T1 */ | | int timer_h_length; /**@internal H = 64* T1 */ | |
| struct timeval timer_h_start; /**@internal fire when if no ACK is recei
ved */ | | struct timeval timer_h_start; /**@internal fire when if no ACK is recei
ved */ | |
|
| int timer_i_length; /**@internal I = T4 for unreliable
(or 0) */ | | int timer_i_length; /**@internal I = T4 for unreliable (or 0)
*/ | |
| struct timeval timer_i_start; /**@internal absorb all ACK */ | | struct timeval timer_i_start; /**@internal absorb all ACK */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Structure for NON-INVITE SERVER TRANSACTION (incoming SERVER transaction
). | | * Structure for NON-INVITE SERVER TRANSACTION (incoming SERVER transaction
). | |
| * @var osip_nist_t | | * @var osip_nist_t | |
| */ | | */ | |
| typedef struct osip_nist osip_nist_t; | | typedef struct osip_nist osip_nist_t; | |
| | | | |
| /** | | /** | |
| * Structure for NON-INVITE SERVER TRANSACTION. | | * Structure for NON-INVITE SERVER TRANSACTION. | |
| * @struct osip_nist | | * @struct osip_nist | |
| */ | | */ | |
| struct osip_nist | | struct osip_nist | |
| { | | { | |
|
| int timer_j_length; /**@internal J = 64*T1 (else 0) *
/ | | int timer_j_length; /**@internal J = 64*T1 (else 0) */ | |
| struct timeval timer_j_start; /**@internal */ | | struct timeval timer_j_start; /**@internal */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Structure for transaction handling. | | * Structure for transaction handling. | |
| * @var osip_transaction_t | | * @var osip_transaction_t | |
| */ | | */ | |
| typedef struct osip_transaction osip_transaction_t; | | typedef struct osip_transaction osip_transaction_t; | |
| | | | |
| /** | | /** | |
| * Structure for transaction handling | | * Structure for transaction handling | |
| * @struct osip_transaction | | * @struct osip_transaction | |
| */ | | */ | |
| struct osip_transaction | | struct osip_transaction | |
| { | | { | |
| | | | |
|
| void *your_instance; /**< User Defined Pointer. */ | | void *your_instance; /**< User Defined Pointer. */ | |
| int transactionid; /**< Internal Transaction Identifier. */ | | int transactionid; /**< Internal Transaction Identifier. */ | |
| osip_fifo_t *transactionff; /**< events must be added in this fi | | osip_fifo_t *transactionff; /**< events must be added in this fifo */ | |
| fo */ | | | |
| | | | |
|
| osip_via_t *topvia; /**< CALL-LEG definition (Top Via) * | | osip_via_t *topvia; /**< CALL-LEG definition (Top Via) */ | |
| / | | osip_from_t *from; /**< CALL-LEG definition (From) */ | |
| osip_from_t *from; /**< CALL-LEG definition (From) */ | | | |
| osip_to_t *to; /**< CALL-LEG definition (To) */ | | osip_to_t *to; /**< CALL-LEG definition (To) */ | |
| osip_call_id_t *callid; /**< CALL-LEG definition (Call-ID) */ | | osip_call_id_t *callid; /**< CALL-LEG definition (Call-ID) */ | |
| osip_cseq_t *cseq; /**< CALL-LEG definition (CSeq) */ | | osip_cseq_t *cseq; /**< CALL-LEG definition (CSeq) */ | |
| | | | |
| osip_message_t *orig_request; /**< Initial request */ | | osip_message_t *orig_request; /**< Initial request */ | |
| osip_message_t *last_response; /**< Last response */ | | osip_message_t *last_response; /**< Last response */ | |
|
| osip_message_t *ack; /**< ack request sent */ | | osip_message_t *ack; /**< ack request sent */ | |
| | | | |
|
| state_t state; /**< Current state of the transaction */ | | state_t state; /**< Current state of the 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 */ | |
| | | | |
| int in_socket; /**< Optional socket for incoming message *
/ | | int in_socket; /**< Optional socket for incoming message *
/ | |
| int out_socket; /**< Optional place for outgoing message */ | | int out_socket; /**< Optional place for outgoing message */ | |
| | | | |
|
| void *config; /**@internal transaction is managed by osip_
t */ | | void *config; /**@internal transaction is managed by osip
_t */ | |
| | | | |
| osip_fsm_type_t ctx_type; /**< Type of the transaction */ | | osip_fsm_type_t ctx_type; /**< Type of the transaction */ | |
| osip_ict_t *ict_context; /**@internal */ | | osip_ict_t *ict_context; /**@internal */ | |
| osip_ist_t *ist_context; /**@internal */ | | osip_ist_t *ist_context; /**@internal */ | |
| osip_nict_t *nict_context; /**@internal */ | | osip_nict_t *nict_context; /**@internal */ | |
| osip_nist_t *nist_context; /**@internal */ | | osip_nist_t *nist_context; /**@internal */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Enumeration for callback type. | | * Enumeration for callback type. | |
| | | | |
| skipping to change at line 423 | | skipping to change at line 427 | |
| OSIP_NIST_TRANSPORT_ERROR, /**< transport error for NIST */ | | OSIP_NIST_TRANSPORT_ERROR, /**< transport error for NIST */ | |
| | | | |
| OSIP_TRANSPORT_ERROR_CALLBACK_COUNT /**< END OF ENUM */ | | OSIP_TRANSPORT_ERROR_CALLBACK_COUNT /**< END OF ENUM */ | |
| } osip_transport_error_callback_type_t; | | } osip_transport_error_callback_type_t; | |
| | | | |
| /** | | /** | |
| * Callback definition for message announcements. | | * Callback definition for message announcements. | |
| * @var osip_message_cb_t | | * @var osip_message_cb_t | |
| */ | | */ | |
| typedef void (*osip_message_cb_t) (int type, osip_transaction_t *, | | typedef void (*osip_message_cb_t) (int type, osip_transaction_t *, | |
|
| osip_message_t *); | | osip_message_t *); | |
| /** | | /** | |
| * Callback definition for end of transaction announcements. | | * Callback definition for end of transaction announcements. | |
| * @var osip_kill_transaction_cb_t | | * @var osip_kill_transaction_cb_t | |
| */ | | */ | |
| typedef void (*osip_kill_transaction_cb_t) (int type, osip_transaction_t
*); | | typedef void (*osip_kill_transaction_cb_t) (int type, osip_transaction_t
*); | |
| /** | | /** | |
| * Callback definition for transport error announcements. | | * Callback definition for transport error announcements. | |
| * @var osip_transport_error_cb_t | | * @var osip_transport_error_cb_t | |
| */ | | */ | |
| typedef void (*osip_transport_error_cb_t) (int type, osip_transaction_t *
, | | typedef void (*osip_transport_error_cb_t) (int type, osip_transaction_t *
, | |
|
| int error); | | int error); | |
| | | | |
| struct osip_dialog; | | struct osip_dialog; | |
| | | | |
| /** | | /** | |
| * Structure for 2XX retransmission management. | | * Structure for 2XX retransmission management. | |
| * @var ixt_t | | * @var ixt_t | |
| */ | | */ | |
| typedef struct ixt_t ixt_t; | | typedef struct ixt_t ixt_t; | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 459 | | skipping to change at line 463 | |
| { | | { | |
| /* 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; /**< related dialog */ | | struct osip_dialog *dialog; /**< related dialog */ | |
| osip_message_t *msg2xx; /**< buffer to retransmit */ | | osip_message_t *msg2xx; /**< buffer to retransmit */ | |
| osip_message_t *ack; /**< ack message if needed */ | | osip_message_t *ack; /**< ack message if needed */ | |
| time_t start; /**< Time of first retransmission */ | | time_t start; /**< Time of first retransmission */ | |
| int interval; /**< delay between retransmission, in ms */ | | int interval; /**< delay between retransmission, in ms */ | |
| char *dest; /**< destination host */ | | char *dest; /**< destination host */ | |
| int port; /**< destination port */ | | int port; /**< destination port */ | |
| int sock; /**< socket to use */ | | int sock; /**< socket to use */ | |
|
| int counter; /**< start at 7 */ | | int counter; /**< start at 7 */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Structure for osip handling. | | * Structure for osip handling. | |
| * In order to use osip, you have to manage at least one global instance | | * In order to use osip, you have to manage at least one global instance | |
| * of an osip_t element. Then, you'll register a set of required callbacks | | * of an osip_t element. Then, you'll register a set of required callbacks | |
| * and a set of optional ones. | | * and a set of optional ones. | |
| * @var osip_t | | * @var osip_t | |
| */ | | */ | |
| typedef struct osip osip_t; | | typedef struct osip osip_t; | |
| | | | |
| /** | | /** | |
| * Structure for osip handling. | | * Structure for osip handling. | |
| * @struct osip | | * @struct osip | |
| */ | | */ | |
| struct osip | | struct osip | |
| { | | { | |
| | | | |
|
| void *application_context; /**< User defined Pointer */ | | void *application_context; /**< User defined Pointer */ | |
| | | | |
| /* list of transactions for ict, ist, nict, nist */ | | /* list of transactions for ict, ist, nict, nist */ | |
|
| osip_list_t *osip_ict_transactions; /**< list of ict transactions */ | | osip_list_t *osip_ict_transactions; /**< list of ict transactions */ | |
| osip_list_t *osip_ist_transactions; /**< list of ist transactions */ | | osip_list_t *osip_ist_transactions; /**< list of ist transactions */ | |
| osip_list_t *osip_nict_transactions; /**< list of nict transactions */ | | osip_list_t *osip_nict_transactions; /**< list of nict transactions */ | |
| osip_list_t *osip_nist_transactions; /**< list of nist transactions */ | | osip_list_t *osip_nist_transactions; /**< list of nist transactions */ | |
| | | | |
|
| osip_list_t *ixt_retransmissions; /**< list of ixt elements */ | | osip_list_t *ixt_retransmissions; /**< list of ixt elements */ | |
| | | | |
| osip_message_cb_t msg_callbacks[OSIP_MESSAGE_CALLBACK_COUNT]; /*
*@internal */ | | osip_message_cb_t msg_callbacks[OSIP_MESSAGE_CALLBACK_COUNT]; /*
*@internal */ | |
| osip_kill_transaction_cb_t kill_callbacks[OSIP_KILL_CALLBACK_COUNT]; /*
*@internal */ | | osip_kill_transaction_cb_t kill_callbacks[OSIP_KILL_CALLBACK_COUNT]; /*
*@internal */ | |
| osip_transport_error_cb_t tp_error_callbacks[OSIP_TRANSPORT_ERROR_CALLB
ACK_COUNT]; /**@internal */ | | osip_transport_error_cb_t tp_error_callbacks[OSIP_TRANSPORT_ERROR_CALLB
ACK_COUNT]; /**@internal */ | |
| | | | |
| int (*cb_send_message) (osip_transaction_t *, osip_message_t *, char *, | | int (*cb_send_message) (osip_transaction_t *, osip_message_t *, char *, | |
|
| int, int); /**@internal */ | | int, int); | |
| | | /**@internal */ | |
| | | | |
| | | #if defined(HAVE_DICT_DICT_H) | |
| | | dict *osip_ict_hastable; /**< htable of ict transactions * | |
| | | / | |
| | | dict *osip_ist_hastable; /**< htable of ist transactions * | |
| | | / | |
| | | dict *osip_nict_hastable; /**< htable of nict transactions | |
| | | */ | |
| | | dict *osip_nist_hastable; /**< htable of nist transactions | |
| | | */ | |
| | | #endif | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Set a callback for each transaction operation. | | * Set a callback for each transaction operation. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| * @param type The event type to hook on. | | * @param type The event type to hook on. | |
| * @param cb The method to be called upon the event. | | * @param cb The method to be called upon the event. | |
| */ | | */ | |
|
| int osip_set_message_callback (osip_t *osip, int type, osip_message_cb_t
cb); | | int osip_set_message_callback (osip_t * osip, int type, osip_message_cb_t
cb); | |
| | | | |
| /** | | /** | |
| * Set a callback for transaction operation related to the end of transacti
ons. | | * Set a callback for transaction operation related to the end of transacti
ons. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| * @param type The event type to hook on. | | * @param type The event type to hook on. | |
| * @param cb The method to be called upon the event. | | * @param cb The method to be called upon the event. | |
| */ | | */ | |
|
| int osip_set_kill_transaction_callback (osip_t *osip, int type, | | int osip_set_kill_transaction_callback (osip_t * osip, int type, | |
| osip_kill_transaction_cb_t cb); | | osip_kill_transaction_cb_t cb); | |
| | | | |
| /** | | /** | |
| * Set a callback for each transaction operation related to network error. | | * Set a callback for each transaction operation related to network error. | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| * @param type The event type to hook on. | | * @param type The event type to hook on. | |
| * @param cb The method to be called upon the event. | | * @param cb The method to be called upon the event. | |
| */ | | */ | |
|
| int osip_set_transport_error_callback (osip_t *osip, int type, | | int osip_set_transport_error_callback (osip_t * osip, int type, | |
| osip_transport_error_cb_t cb); | | osip_transport_error_cb_t cb); | |
| | | | |
| /** | | /** | |
| * Structure for osip event handling. | | * Structure for osip event handling. | |
| * A osip_event_t element will have a type and will be related | | * A osip_event_t element will have a type and will be related | |
| * to a transaction. In the general case, it is used by the | | * to a transaction. In the general case, it is used by the | |
| * application layer to give SIP messages to the oSIP finite | | * application layer to give SIP messages to the oSIP finite | |
| * state machine. | | * state machine. | |
| * @var osip_event_t | | * @var osip_event_t | |
| */ | | */ | |
| typedef struct osip_event osip_event_t; | | typedef struct osip_event osip_event_t; | |
| | | | |
| skipping to change at line 551 | | skipping to change at line 563 | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Allocate an osip_transaction_t element. | | * Allocate an osip_transaction_t element. | |
| * @param transaction The element to allocate. | | * @param transaction The element to allocate. | |
| * @param ctx_type The type of transaction. (ICT, IST, NICT, NIST) | | * @param ctx_type The type of transaction. (ICT, IST, NICT, NIST) | |
| * @param osip The global instance of oSIP. | | * @param osip The global instance of oSIP. | |
| * @param request The SIP request that initiate the transaction. | | * @param request The SIP request that initiate the transaction. | |
| */ | | */ | |
| int osip_transaction_init (osip_transaction_t ** transaction, | | int osip_transaction_init (osip_transaction_t ** transaction, | |
|
| osip_fsm_type_t ctx_type, osip_t * osip, | | osip_fsm_type_t ctx_type, 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 575 | | skipping to change at line 587 | |
| int osip_transaction_free2 (osip_transaction_t * transaction); | | int osip_transaction_free2 (osip_transaction_t * transaction); | |
| | | | |
| /** | | /** | |
| * Search in a SIP response the destination where the message | | * Search in a SIP response the destination where the message | |
| * should be sent. | | * should be sent. | |
| * @param response the message to work on. | | * @param response the message to work on. | |
| * @param address a pointer to receive the allocated host address. | | * @param address a pointer to receive the allocated host address. | |
| * @param portnum a pointer to receive the host port. | | * @param portnum a pointer to receive the host port. | |
| */ | | */ | |
| void osip_response_get_destination (osip_message_t * response, | | void osip_response_get_destination (osip_message_t * response, | |
|
| char **address, | | char **address, int *portnum); | |
| int *portnum); | | | |
| /** | | /** | |
| * Set the host and port destination used for sending the SIP message. | | * Set the host and port destination used for sending the SIP message. | |
| * This can be useful for an application with 'DIRECT ROOTING MODE' | | * This can be useful for an application with 'DIRECT ROOTING MODE' | |
| * NOTE: Instead, you should use the 'Route' header facility which | | * NOTE: Instead, you should use the 'Route' header facility which | |
| * leads to the same behaviour. | | * leads to the same behaviour. | |
| * @param ict The element to work on. | | * @param ict The element to work on. | |
| * @param destination The destination host. | | * @param destination The destination host. | |
| * @param port The destination port. | | * @param port The destination port. | |
| */ | | */ | |
|
| int osip_ict_set_destination (osip_ict_t * ict, char *destination, | | int osip_ict_set_destination (osip_ict_t * ict, char *destination, int po | |
| int port); | | rt); | |
| | | | |
| /** | | /** | |
| * 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 osip_nict_set_destination (osip_nict_t * nict, char *destination, int | |
| int port); | | port); | |
| | | | |
| /** | | /** | |
| * Add a SIP event in the fifo of a osip_transaction_t element. | | * Add a SIP event in the fifo of a osip_transaction_t element. | |
| * @param transaction The element to work on. | | * @param transaction The element to work on. | |
| * @param evt The event to add. | | * @param evt The event to add. | |
| */ | | */ | |
| int osip_transaction_add_event (osip_transaction_t * transaction, | | int osip_transaction_add_event (osip_transaction_t * transaction, | |
|
| osip_event_t * evt); | | osip_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, | | int osip_transaction_execute (osip_transaction_t * transaction, | |
|
| osip_event_t * evt); | | osip_event_t * evt); | |
| /** | | /** | |
| * Set a pointer to your personal context associated with this transaction. | | * Set a pointer to your personal context associated with this transaction. | |
| * NOTE: this is a very useful method that allow you to avoid searching | | * NOTE: this is a very useful method that allow you to avoid searching | |
| * for your personal context inside the registered callbacks. | | * for your personal context inside the registered callbacks. | |
| * You can initialise this pointer to your context right after | | * You can initialise this pointer to your context right after | |
| * the creation of the osip_transaction_t element. Then, you'll be | | * the creation of the osip_transaction_t element. Then, you'll be | |
| * able to get the address of your context by calling | | * able to get the address of your context by calling | |
| * osip_transaction_get_your_instance(). | | * osip_transaction_get_your_instance(). | |
| * @param transaction The element to work on. | | * @param transaction The element to work on. | |
| * @param instance The address of your context. | | * @param instance The address of your context. | |
| */ | | */ | |
| int osip_transaction_set_your_instance (osip_transaction_t * transaction, | | int osip_transaction_set_your_instance (osip_transaction_t * 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, | | int osip_transaction_get_destination (osip_transaction_t * transaction, | |
|
| char **ip, int *port); | | char **ip, int *port); | |
| | | | |
| /** | | /** | |
| * 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 osip_transaction_set_in_socket (osip_transaction_t * transaction, int | |
| int sock); | | 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, | | int osip_transaction_set_out_socket (osip_transaction_t * transaction, in | |
| int sock); | | t sock); | |
| | | | |
| /** | | /** | |
| * Allocate an osip_t element. | | * Allocate an osip_t element. | |
| * @param osip the element to allocate. | | * @param osip the element to allocate. | |
| */ | | */ | |
| int osip_init (osip_t ** osip); | | int osip_init (osip_t ** osip); | |
| /** | | /** | |
| * Free all resource in a osip_t element. | | * Free all resource in a osip_t element. | |
| * @param osip The element to release. | | * @param osip The element to release. | |
| */ | | */ | |
| | | | |
| skipping to change at line 756 | | skipping to change at line 763 | |
| */ | | */ | |
| void osip_timers_nist_execute (osip_t * osip); | | void osip_timers_nist_execute (osip_t * osip); | |
| | | | |
| /* Take care of mutlithreading issuewhile using this method */ | | /* Take care of mutlithreading issuewhile using this method */ | |
| /** | | /** | |
| * Search for a transaction that match this event (MUST be a MESSAGE event)
. | | * Search for a transaction that match this event (MUST be a MESSAGE event)
. | |
| * @param transactions The list of transactions to work on. | | * @param transactions The list of transactions to work on. | |
| * @param evt The element representing the SIP MESSAGE. | | * @param evt The element representing the SIP MESSAGE. | |
| */ | | */ | |
| osip_transaction_t *osip_transaction_find (osip_list_t * transactions, | | osip_transaction_t *osip_transaction_find (osip_list_t * transactions, | |
|
| osip_event_t * evt); | | osip_event_t * evt); | |
| | | | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| /** | | /** | |
| * Some race conditions can happen in multi threaded applications. | | * Some race conditions can happen in multi threaded applications. | |
| * Use this method carefully. | | * Use this method carefully. | |
| * <BR>Search for a transaction that match this event (MUST be a MESSAGE ev
ent). | | * <BR>Search for a transaction that match this event (MUST be a MESSAGE ev
ent). | |
| * @param osip The element to work on. | | * @param osip The element to work on. | |
| * @param evt The element representing the SIP MESSAGE. | | * @param evt The element representing the SIP MESSAGE. | |
| */ | | */ | |
| #ifndef OSIP_MT | | #ifndef OSIP_MT | |
|
| osip_transaction_t *osip_find_transaction (osip_t * osip, | | osip_transaction_t *osip_find_transaction (osip_t * osip, osip_event_t * | |
| osip_event_t * evt); | | 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 cons | |
| int consume); | | ume); | |
| #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_transaction_t *osip_create_transaction (osip_t * osip, osip_event_t | |
| osip_event_t * evt); | | * evt); | |
| | | | |
| /** | | /** | |
| * Create a sipevent from a SIP message string. | | * Create a sipevent from a SIP message string. | |
| * @param buf The SIP message as a string. | | * @param buf The SIP message as a string. | |
| * @param length The length of the buffer to parse. | | * @param length The length of the buffer to parse. | |
| */ | | */ | |
| osip_event_t *osip_parse (const char *buf, size_t length); | | osip_event_t *osip_parse (const char *buf, size_t length); | |
| | | | |
| /** | | /** | |
| * Send required retransmissions | | * Send required retransmissions | |
| | | | |
| skipping to change at line 813 | | skipping to change at line 817 | |
| void osip_retransmissions_execute (osip_t * osip); | | void osip_retransmissions_execute (osip_t * osip); | |
| | | | |
| /** | | /** | |
| * Start out of fsm 200 Ok retransmissions. This is usefull for user-agents
. | | * Start out of fsm 200 Ok retransmissions. This is usefull for user-agents
. | |
| * @param osip The osip_t structure. | | * @param osip The osip_t structure. | |
| * @param dialog The dialog the 200 Ok is part of. | | * @param dialog The dialog the 200 Ok is part of. | |
| * @param msg200ok The 200 ok response. | | * @param msg200ok The 200 ok response. | |
| * @param sock The socket to be used to send the message. (optional). | | * @param sock The socket to be used to send the message. (optional). | |
| */ | | */ | |
| void osip_start_200ok_retransmissions (osip_t * osip, | | void osip_start_200ok_retransmissions (osip_t * osip, | |
|
| struct osip_dialog *dialog, | | struct osip_dialog *dialog, | |
| osip_message_t * msg200ok, int sock | | osip_message_t * msg200ok, int soc | |
| ); | | k); | |
| | | | |
| /** | | /** | |
| * Start out of fsm ACK retransmissions. This is usefull for user-agents. | | * Start out of fsm ACK retransmissions. This is usefull for user-agents. | |
| * @param osip The osip_t structure. | | * @param osip The osip_t structure. | |
| * @param dialog The dialog the ACK is part of. | | * @param dialog The dialog the ACK is part of. | |
| * @param ack The ACK that has just been sent in response to a 200 Ok. | | * @param ack The ACK that has just been sent in response to a 200 Ok. | |
| * @param dest The destination host. | | * @param dest The destination host. | |
| * @param port The destination port. | | * @param port The destination port. | |
| * @param sock The socket to be used to send the message. (optional). | | * @param sock The socket to be used to send the message. (optional). | |
| */ | | */ | |
| void osip_start_ack_retransmissions (osip_t * osip, | | void osip_start_ack_retransmissions (osip_t * osip, | |
|
| struct osip_dialog *dialog, | | struct osip_dialog *dialog, | |
| osip_message_t * ack, char *dest, | | osip_message_t * ack, char *dest, | |
| int port, int sock); | | int port, int sock); | |
| | | | |
| /** | | /** | |
| * Stop the out of fsm 200 Ok retransmissions matching an incoming ACK. | | * Stop the out of fsm 200 Ok retransmissions matching an incoming ACK. | |
| * @param osip The osip_t structure. | | * @param osip The osip_t structure. | |
| * @param ack The ack that has just been received. | | * @param ack The ack that has just been received. | |
| */ | | */ | |
|
| struct osip_dialog *osip_stop_200ok_retransmissions (osip_t * osip, osip_ | | struct osip_dialog *osip_stop_200ok_retransmissions (osip_t * osip, | |
| message_t * ack); | | osip_message_t * ack | |
| | | ); | |
| | | | |
| /** | | /** | |
| * Stop out of fsm retransmissions (ACK or 200 Ok) associated to a given di
alog. | | * Stop out of fsm retransmissions (ACK or 200 Ok) associated to a given di
alog. | |
| * This function must be called before freeing a dialog if out of fsm retra
nsmissions | | * This function must be called before freeing a dialog if out of fsm retra
nsmissions | |
| * have been scheduled. | | * have been scheduled. | |
| * @param osip The osip_t structure | | * @param osip The osip_t structure | |
| * @param dialog The dialog. | | * @param dialog The dialog. | |
| */ | | */ | |
| void osip_stop_retransmissions_from_dialog (osip_t * osip, | | void osip_stop_retransmissions_from_dialog (osip_t * osip, | |
|
| struct osip_dialog *dialog); | | struct osip_dialog *dialog); | |
| | | | |
| /** | | /** | |
| * Allocate a sipevent (we know this message is an OUTGOING SIP message). | | * Allocate a sipevent (we know this message is an OUTGOING SIP message). | |
| * @param sip The SIP message we want to send. | | * @param sip The SIP message we want to send. | |
| */ | | */ | |
| osip_event_t *osip_new_outgoing_sipmessage (osip_message_t * sip); | | osip_event_t *osip_new_outgoing_sipmessage (osip_message_t * sip); | |
| | | | |
| /** | | /** | |
| * Free all ressource in a sipevent. | | * Free all ressource in a sipevent. | |
| * @param event The event to free. | | * @param event The event to free. | |
| */ | | */ | |
| void osip_event_free (osip_event_t * event); | | void osip_event_free (osip_event_t * event); | |
| | | | |
| /** | | /** | |
| * Register the callback used to send SIP message. | | * Register the callback used to send SIP message. | |
| * @param cf The osip element attached to the transaction. | | * @param cf The osip element attached to the transaction. | |
| * @param cb The method we want to register. | | * @param cb The method we want to register. | |
| */ | | */ | |
| void osip_set_cb_send_message (osip_t * cf, | | void osip_set_cb_send_message (osip_t * cf, | |
|
| int (*cb) (osip_transaction_t *, | | int (*cb) (osip_transaction_t *, | |
| osip_message_t *, char *, | | osip_message_t *, char *, int, | |
| int, int)); | | int)); | |
| | | | |
| /* FOR INCOMING TRANSACTION */ | | /* FOR INCOMING TRANSACTION */ | |
| /** | | /** | |
| * Check if the sipevent is of type RCV_REQINVITE. | | * Check if the sipevent is of type RCV_REQINVITE. | |
| * @param event the event to check. | | * @param event the event to check. | |
| */ | | */ | |
| #define EVT_IS_RCV_INVITE(event) (event->type==RCV_REQINVITE) | | #define EVT_IS_RCV_INVITE(event) (event->type==RCV_REQINVITE) | |
| /** | | /** | |
| * Check if the sipevent is of type RCV_REQACK. | | * Check if the sipevent is of type RCV_REQACK. | |
| * @param event the event to check. | | * @param event the event to check. | |
| | | | |
End of changes. 58 change blocks. |
| 91 lines changed or deleted | | 105 lines changed or added | |
|
| osip_dialog.h | | osip_dialog.h | |
| | | | |
| skipping to change at line 103 | | skipping to change at line 103 | |
| * Allocate a osip_dialog_t element as a UAC. | | * Allocate a osip_dialog_t element as a UAC. | |
| * NOTE1: The dialog should be created when the first response is received. | | * NOTE1: The dialog should be created when the first response is received. | |
| * (except for a 100 Trying) | | * (except for a 100 Trying) | |
| * NOTE2: Remote UA should be compliant! If not (not tag in the to header?) | | * NOTE2: Remote UA should be compliant! If not (not tag in the to header?) | |
| * the old mechanism is used to match the request but if 2 uncomplia
nt | | * the old mechanism is used to match the request but if 2 uncomplia
nt | |
| * UA both answer 200 OK for the same transaction, they won't be det
ected. | | * UA both answer 200 OK for the same transaction, they won't be det
ected. | |
| * This is a major BUG in the old rfc. | | * This is a major BUG in the old rfc. | |
| * @param dialog The element to allocate. | | * @param dialog The element to allocate. | |
| * @param response The response containing the informations. | | * @param response The response containing the informations. | |
| */ | | */ | |
|
| int osip_dialog_init_as_uac (osip_dialog_t ** dialog, | | int osip_dialog_init_as_uac (osip_dialog_t ** dialog, osip_message_t * re | |
| osip_message_t * response); | | sponse); | |
| /** | | /** | |
| * Allocate a osip_dialog_t element as a UAC. | | * Allocate a osip_dialog_t element as a UAC. | |
| * <UL><LI>This could be used to initiate dialog with a NOTIFY coming | | * <UL><LI>This could be used to initiate dialog with a NOTIFY coming | |
| * before the answer for a subscribe has reached us.</LI></UL> | | * before the answer for a subscribe has reached us.</LI></UL> | |
| * @param dialog The element to allocate. | | * @param dialog The element to allocate. | |
| * @param next_request The response containing the informations. | | * @param next_request The response containing the informations. | |
| * @param local_cseq The local cseq | | * @param local_cseq The local cseq | |
| */ | | */ | |
| int osip_dialog_init_as_uac_with_remote_request (osip_dialog_t ** dialog, | | int osip_dialog_init_as_uac_with_remote_request (osip_dialog_t ** dialog, | |
|
| osip_message_t *next_requ | | osip_message_t * | |
| est, | | next_request, int local_ | |
| int local_cseq); | | cseq); | |
| | | | |
| /** | | /** | |
| * Allocate a osip_dialog_t element as a UAS. | | * Allocate a osip_dialog_t element as a UAS. | |
| * NOTE1: The dialog should be created when the first response is sent. | | * NOTE1: The dialog should be created when the first response is sent. | |
| * (except for a 100 Trying) | | * (except for a 100 Trying) | |
| * @param dialog The element to allocate. | | * @param dialog The element to allocate. | |
| * @param invite The INVITE request containing some informations. | | * @param invite The INVITE request containing some informations. | |
| * @param response The response containing other informations. | | * @param response The response containing other informations. | |
| */ | | */ | |
| int osip_dialog_init_as_uas (osip_dialog_t ** dialog, | | int osip_dialog_init_as_uas (osip_dialog_t ** dialog, | |
|
| osip_message_t * invite, | | osip_message_t * invite, osip_message_t * re | |
| osip_message_t * response); | | sponse); | |
| /** | | /** | |
| * Free all resource in a osip_dialog_t element. | | * Free all resource in a osip_dialog_t element. | |
| * @param dialog The element to free. | | * @param dialog The element to free. | |
| */ | | */ | |
| void osip_dialog_free (osip_dialog_t * dialog); | | void osip_dialog_free (osip_dialog_t * dialog); | |
| /** | | /** | |
| * Set the state of the dialog. | | * Set the state of the dialog. | |
| * This is useful to keep information on who is the initiator of the call. | | * This is useful to keep information on who is the initiator of the call. | |
| * @param dialog The element to work on. | | * @param dialog The element to work on. | |
| * @param type The type of dialog (CALLEE or CALLER). | | * @param type The type of dialog (CALLEE or CALLER). | |
| | | | |
| skipping to change at line 151 | | skipping to change at line 149 | |
| * Update the Route-Set as UAS of a dialog. | | * Update the Route-Set as UAS of a dialog. | |
| * NOTE: bis-09 says that only INVITE transactions can update the route-set
. | | * NOTE: bis-09 says that only INVITE transactions can update the route-set
. | |
| * NOTE: bis-09 says that updating the route-set means: update the contact | | * NOTE: bis-09 says that updating the route-set means: update the contact | |
| * field only (AND NOT THE ROUTE-SET). This method follow this behavi
our. | | * field only (AND NOT THE ROUTE-SET). This method follow this behavi
our. | |
| * NOTE: This method should be called for each request | | * NOTE: This method should be called for each request | |
| * received for a dialog. | | * received for a dialog. | |
| * @param dialog The element to work on. | | * @param dialog The element to work on. | |
| * @param invite The invite received. | | * @param invite The invite received. | |
| */ | | */ | |
| int osip_dialog_update_route_set_as_uas (osip_dialog_t * dialog, | | int osip_dialog_update_route_set_as_uas (osip_dialog_t * dialog, | |
|
| osip_message_t * invite); | | osip_message_t * invite); | |
| /** | | /** | |
| * Update the CSeq (remote cseq) during a UAS transaction of a dialog. | | * Update the CSeq (remote cseq) during a UAS transaction of a dialog. | |
| * NOTE: All INCOMING transactions MUST update the remote CSeq. | | * NOTE: All INCOMING transactions MUST update the remote CSeq. | |
| * @param dialog The element to work on. | | * @param dialog The element to work on. | |
| * @param request The request received. | | * @param request The request received. | |
| */ | | */ | |
| int osip_dialog_update_osip_cseq_as_uas (osip_dialog_t * dialog, | | int osip_dialog_update_osip_cseq_as_uas (osip_dialog_t * dialog, | |
|
| osip_message_t * request); | | osip_message_t * request); | |
| | | | |
| /** | | /** | |
| * Match a response received with a dialog. | | * Match a response received with a dialog. | |
| * @param dialog The element to work on. | | * @param dialog The element to work on. | |
| * @param response The response received. | | * @param response The response received. | |
| */ | | */ | |
|
| int osip_dialog_match_as_uac (osip_dialog_t * dialog, | | int osip_dialog_match_as_uac (osip_dialog_t * dialog, osip_message_t * re | |
| osip_message_t * response); | | sponse); | |
| /** | | /** | |
| * Update the tag as UAC of a dialog?. (this could be needed if the 180 | | * Update the tag as UAC of a dialog?. (this could be needed if the 180 | |
| * does not contains any tag, but the 200 contains one. | | * does not contains any tag, but the 200 contains one. | |
| * @param dialog The element to work on. | | * @param dialog The element to work on. | |
| * @param response The response received. | | * @param response The response received. | |
| */ | | */ | |
| int osip_dialog_update_tag_as_uac (osip_dialog_t * dialog, | | int osip_dialog_update_tag_as_uac (osip_dialog_t * dialog, | |
|
| osip_message_t * response); | | osip_message_t * response); | |
| /** | | /** | |
| * Update the Route-Set as UAC of a dialog. | | * Update the Route-Set as UAC of a dialog. | |
| * NOTE: bis-09 says that only INVITE transactions can update the route-set
. | | * NOTE: bis-09 says that only INVITE transactions can update the route-set
. | |
| * NOTE: bis-09 says that updating the route-set means: update the contact | | * NOTE: bis-09 says that updating the route-set means: update the contact | |
| * field only (AND NOT THE ROUTE-SET). This method follow this behavi
our. | | * field only (AND NOT THE ROUTE-SET). This method follow this behavi
our. | |
| * NOTE: This method should be called for each request (except 100 Trying) | | * NOTE: This method should be called for each request (except 100 Trying) | |
| * received for a dialog. | | * received for a dialog. | |
| * @param dialog The element to work on. | | * @param dialog The element to work on. | |
| * @param response The response received. | | * @param response The response received. | |
| */ | | */ | |
| int osip_dialog_update_route_set_as_uac (osip_dialog_t * dialog, | | int osip_dialog_update_route_set_as_uac (osip_dialog_t * dialog, | |
|
| osip_message_t * response); | | osip_message_t * response); | |
| | | | |
| /** | | /** | |
| * Match a request (response sent?) received with a dialog. | | * Match a request (response sent?) received with a dialog. | |
| * @param dialog The element to work on. | | * @param dialog The element to work on. | |
| * @param request The request received. | | * @param request The request received. | |
| */ | | */ | |
|
| int osip_dialog_match_as_uas (osip_dialog_t * dialog, | | int osip_dialog_match_as_uas (osip_dialog_t * dialog, osip_message_t * re | |
| osip_message_t * request); | | quest); | |
| | | | |
| /** | | /** | |
| * @internal | | * @internal | |
| * Is dialog initiated by as CALLER | | * Is dialog initiated by as CALLER | |
| * @param dialog The element to work on. | | * @param dialog The element to work on. | |
| */ | | */ | |
| int osip_dialog_is_originator (osip_dialog_t * dialog); | | int osip_dialog_is_originator (osip_dialog_t * dialog); | |
| /** | | /** | |
| * @internal | | * @internal | |
| * Is dialog initiated by as CALLEE | | * Is dialog initiated by as CALLEE | |
| | | | |
End of changes. 9 change blocks. |
| 15 lines changed or deleted | | 15 lines changed or added | |
|
| osip_negotiation.h | | osip_negotiation.h | |
| | | | |
| skipping to change at line 60 | | skipping to change at line 60 | |
| * @var osip_negotiation_ctx_t | | * @var osip_negotiation_ctx_t | |
| */ | | */ | |
| typedef struct osip_negotiation_ctx osip_negotiation_ctx_t; | | typedef struct osip_negotiation_ctx osip_negotiation_ctx_t; | |
| | | | |
| /** | | /** | |
| * Structure for applying the SDP offer/answer negotiation. | | * Structure for applying the SDP offer/answer negotiation. | |
| * @struct osip_negotiation_ctx | | * @struct osip_negotiation_ctx | |
| */ | | */ | |
| struct osip_negotiation_ctx | | struct osip_negotiation_ctx | |
| { | | { | |
|
| void *mycontext; /**< User Defined Pointer */ | | void *mycontext; /**< User Defined Pointer */ | |
| sdp_message_t *remote; /**< Remote SDP offer */ | | sdp_message_t *remote; /**< Remote SDP offer */ | |
| sdp_message_t *local; /**< generated SDP answer */ | | sdp_message_t *local; /**< generated SDP answer */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Allocate a negotiation context. | | * Allocate a negotiation context. | |
| * @param ctx The element to work on. | | * @param ctx The element to work on. | |
| */ | | */ | |
| int osip_negotiation_ctx_init (osip_negotiation_ctx_t ** ctx); | | int osip_negotiation_ctx_init (osip_negotiation_ctx_t ** ctx); | |
| /** | | /** | |
| | | | |
| skipping to change at line 82 | | skipping to change at line 82 | |
| * @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, | | int osip_negotiation_ctx_set_mycontext (osip_negotiation_ctx_t * ctx, | |
|
| void *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, | | int osip_negotiation_ctx_set_local_sdp (osip_negotiation_ctx_t * ctx, | |
|
| sdp_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, | | int osip_negotiation_ctx_set_remote_sdp (osip_negotiation_ctx_t * ctx, | |
|
| sdp_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_
t * | | sdp_message_t *osip_negotiation_ctx_get_remote_sdp (osip_negotiation_ctx_
t * | |
|
| ctx); | | 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 200 | | skipping to change at line 199 | |
| * 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 *, | | int osip_negotiation_set_o_session_version (osip_negotiation_t *, char *t | |
| char *tmp); | | mp); | |
| /** | | /** | |
| * 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 237 | | skipping to change at line 235 | |
| 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 *, | | int osip_negotiation_set_c_addr_multicast_ttl (osip_negotiation_t *, char | |
| char *tmp); | | *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 *, | | int osip_negotiation_set_c_addr_multicast_int (osip_negotiation_t *, char | |
| char *tmp); | | *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 *, | | int osip_negotiation_add_support_for_audio_codec (osip_negotiation_t *, | |
|
| char *payload, | | char *payload, | |
| char *number_of_port, | | char *number_of_port, | |
| char *proto, | | char *proto, | |
| char *c_nettype, | | char *c_nettype, | |
| char *c_addrtype, | | char *c_addrtype, | |
| char *c_addr, | | char *c_addr, | |
| char | | char | |
| *c_addr_multicast_ttl, | | *c_addr_multicast_ttl, | |
| char | | char | |
| *c_addr_multicast_int, | | *c_addr_multicast_int, | |
| char *a_rtpmap); | | 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 *, | | int osip_negotiation_add_support_for_video_codec (osip_negotiation_t *, | |
|
| char *payload, | | char *payload, | |
| char *number_of_port, | | char *number_of_port, | |
| char *proto, | | char *proto, | |
| char *c_nettype, | | char *c_nettype, | |
| char *c_addrtype, | | char *c_addrtype, | |
| char *c_addr, | | char *c_addr, | |
| char | | char | |
| *c_addr_multicast_ttl, | | *c_addr_multicast_ttl, | |
| char | | char | |
| *c_addr_multicast_int, | | *c_addr_multicast_int, | |
| char *a_rtpmap); | | 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 *, | | int osip_negotiation_add_support_for_other_codec (osip_negotiation_t *, | |
|
| char *payload, | | char *payload, | |
| char *number_of_port, | | char *number_of_port, | |
| char *proto, | | char *proto, | |
| char *c_nettype, | | char *c_nettype, | |
| char *c_addrtype, | | char *c_addrtype, | |
| char *c_addr, | | char *c_addr, | |
| char | | char | |
| *c_addr_multicast_ttl, | | *c_addr_multicast_ttl, | |
| char | | char | |
| *c_addr_multicast_int, | | *c_addr_multicast_int, | |
| char *a_rtpmap); | | 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 (osip_negotiation_t * config); | | 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 (osip_negotiation_t * config); | | int osip_negotiation_remove_video_payloads (osip_negotiation_t * config); | |
| | | | |
| skipping to change at line 346 | | skipping to change at line 342 | |
| */ | | */ | |
| int osip_negotiation_remove_other_payloads (osip_negotiation_t * config); | | 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_ | | int (*fcn) (osip_negotiation_ctx | |
| t | | _t | |
| *, sdp_message_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_ | | int (*fcn) (osip_negotiation_ctx | |
| t | | _t | |
| *, sdp_message_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) | | int (*fcn) | |
| (osip_negotiation_ctx_t *, | | (osip_negotiation_ctx_t *, | |
| sdp_message_t *, int)); | | 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) | | int (*fcn) | |
| (osip_negotiation_ctx_t *, | | (osip_negotiation_ctx_t *, | |
| char *, char *, int, | | char *, char *, int, char | |
| 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) | | int (*fcn) | |
| (osip_negotiation_ctx_t *, | | (osip_negotiation_ctx_t *, | |
| char *, char *, int, | | char *, char *, int, char | |
| 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) | | int (*fcn) | |
| (osip_negotiation_ctx_t *, | | (osip_negotiation_ctx_t *, | |
| char *, char *, char *, | | char *, char *, char *, c | |
| char *)); | | har *)); | |
| /** | | /** | |
| * 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 *, | | int osip_negotiation_set_fcn_get_audio_port (osip_negotiation_t *, | |
|
| char | | char | |
| *(*fcn) (osip_negotiation_ctx | | *(*fcn) (osip_negotiation_ct | |
| _t | | x_t | |
| *, int)); | | *, 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 *, | | int osip_negotiation_set_fcn_get_video_port (osip_negotiation_t *, | |
|
| char | | char | |
| *(*fcn) (osip_negotiation_ctx | | *(*fcn) (osip_negotiation_ct | |
| _t | | x_t | |
| *, int)); | | *, 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 *, | | int osip_negotiation_set_fcn_get_other_port (osip_negotiation_t *, | |
|
| char | | char | |
| *(*fcn) (osip_negotiation_ctx | | *(*fcn) (osip_negotiation_ct | |
| _t | | x_t | |
| *, int)); | | *, 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 * ct
x); | |
| | | | |
| /** Put the SDP message on hold in outgoing invite | | /** Put the SDP message on hold in outgoing invite | |
| * @param ctx The element to work on. | | * @param ctx The element to work on. | |
| * @param sdp The sdp message to build. | | * @param sdp The sdp message to build. | |
| * @param audio_port The port for audio stream. | | * @param audio_port The port for audio stream. | |
| * @param video_port The port for video stream. | | * @param video_port The port for video stream. | |
| */ | | */ | |
| int osip_negotiation_sdp_build_offer (osip_negotiation_t *, | | int osip_negotiation_sdp_build_offer (osip_negotiation_t *, | |
|
| osip_negotiation_ctx_t * ctx, | | osip_negotiation_ctx_t * ctx, | |
| sdp_message_t ** sdp, | | sdp_message_t ** sdp, | |
| char *audio_port, char *video_port); | | char *audio_port, char *video_port) | |
| | | ; | |
| /** | | /** | |
| *@internal | | *@internal | |
| */ | | */ | |
| int __osip_negotiation_sdp_build_offer (osip_negotiation_t *, | | int __osip_negotiation_sdp_build_offer (osip_negotiation_t *, | |
|
| osip_negotiation_ctx_t * ctx, | | osip_negotiation_ctx_t * ctx, | |
| sdp_message_t ** sdp, | | sdp_message_t ** sdp, | |
| char *audio_port, char *video_port | | char *audio_port, char *video_por | |
| , | | t, | |
| char *audio_codec, | | char *audio_codec, char *video_co | |
| char *video_codec); | | dec); | |
| | | | |
| /** Put the SDP message on hold in outgoing invite | | /** Put the SDP message on hold in outgoing invite | |
| * @param sdp The sdp message to modify. | | * @param sdp The sdp message to modify. | |
| */ | | */ | |
| int osip_negotiation_sdp_message_put_on_hold (sdp_message_t * sdp); | | int osip_negotiation_sdp_message_put_on_hold (sdp_message_t * sdp); | |
| | | | |
| /** Put the SDP message off hold in outgoing invite | | /** Put the SDP message off hold in outgoing invite | |
| * @param sdp The sdp message to modify. | | * @param sdp The sdp message to modify. | |
| */ | | */ | |
| int osip_negotiation_sdp_message_put_off_hold (sdp_message_t * sdp); | | int osip_negotiation_sdp_message_put_off_hold (sdp_message_t * sdp); | |
| | | | |
End of changes. 26 change blocks. |
| 96 lines changed or deleted | | 98 lines changed or added | |
|
| osip_parser.h | | osip_parser.h | |
| | | | |
| skipping to change at line 52 | | skipping to change at line 52 | |
| /** | | /** | |
| * Initialise the oSIP parser. | | * Initialise the oSIP parser. | |
| */ | | */ | |
| int parser_init (void); | | int parser_init (void); | |
| | | | |
| /** | | /** | |
| * Fix the via header for INCOMING requests only. | | * Fix the via header for INCOMING requests only. | |
| * a copy of ip_addr is done. | | * a copy of ip_addr is done. | |
| */ | | */ | |
| int osip_message_fix_last_via_header (osip_message_t * request, | | int osip_message_fix_last_via_header (osip_message_t * request, | |
|
| const char *ip_addr, int port); | | const char *ip_addr, int port); | |
| | | | |
| /** | | /** | |
| * define this macro to avoid building several times | | * define this macro to avoid building several times | |
| * the message on retransmissions. If you have changed | | * the message on retransmissions. If you have changed | |
| * the osip_message_t element since last call of osip_message_to_str() you | | * the osip_message_t element since last call of osip_message_to_str() you | |
| * can call osip_message_force_update() to force a rebuild. | | * can call osip_message_force_update() to force a rebuild. | |
| */ | | */ | |
| /** | | /** | |
| * Check if the element is already built. (so osip_message_to_str won't bui
ld it again) | | * Check if the element is already built. (so osip_message_to_str won't bui
ld it again) | |
| * @param sip The element to check. | | * @param sip The element to check. | |
| | | | |
| skipping to change at line 91 | | skipping to change at line 91 | |
| * @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, | | int osip_message_get_accept (const osip_message_t * sip, int pos, | |
|
| osip_accept_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, | | int osip_message_set_accept_encoding (osip_message_t * sip, const char *h | |
| const char *hvalue); | | value); | |
| /** | | /** | |
| * 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, | | int osip_message_set_accept_language (osip_message_t * sip, const char *h | |
| const char *hvalue); | | value); | |
| /** | | /** | |
| * 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, | | int osip_message_get_allow (const osip_message_t * sip, int pos, | |
|
| osip_allow_t ** dest); | | osip_allow_t ** dest); | |
| /** | | /** | |
| * Set the Authentication-info header. | | * Set the Authentication-info header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
|
| int osip_message_set_authentication_info (osip_message_t * sip, const cha | | int osip_message_set_authentication_info (osip_message_t * sip, | |
| r *hvalue); | | const char *hvalue); | |
| /** | | /** | |
| * Get one Authentication-info header. | | * Get one Authentication-info header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
|
| int osip_message_get_authentication_info (const osip_message_t * sip, int | | int osip_message_get_authentication_info (const osip_message_t * sip, | |
| pos, | | int pos, | |
| osip_authentication_info_t ** dest); | | osip_authentication_info_t ** d | |
| | | est); | |
| /** | | /** | |
| * 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, | | int osip_message_set_authorization (osip_message_t * sip, const char *hva | |
| const char *hvalue); | | lue); | |
| /** | | /** | |
| * 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 203 | | skipping to change at line 202 | |
| * @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, | | int osip_message_get_call_info (const osip_message_t * sip, int pos, | |
|
| osip_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, | | int osip_message_get_contact (const osip_message_t * sip, int pos, | |
|
| osip_contact_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, | | int osip_message_set_content_disposition (osip_message_t * sip, | |
|
| const char *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 osip_message_get_content_disposition (const osip_message_t * sip, | |
|
| int pos, | | int pos, | |
| osip_content_disposition_t ** | | osip_content_disposition_t ** d | |
| dest); | | est); | |
| /** | | /** | |
| * 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, | | int osip_message_set_content_encoding (osip_message_t * sip, const char * | |
| const char *hvalue); | | 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, | | int osip_message_set_content_length (osip_message_t * sip, const char *hv | |
| const char *hvalue); | | alue); | |
| /** | | /** | |
| * 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
e_t | | osip_content_length_t *osip_message_get_content_length (const osip_messag
e_t | |
|
| * sip); | | * 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, | | int osip_message_set_content_type (osip_message_t * sip, const char *hval | |
| const char *hvalue); | | ue); | |
| /** | | /** | |
| * 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 300 | | skipping to change at line 294 | |
| * @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, | | int osip_message_set_mime_version (osip_message_t * sip, const char *hval | |
| const char *hvalue); | | ue); | |
| /** | | /** | |
| * 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, | | int osip_message_set_proxy_authenticate (osip_message_t * sip, | |
|
| const char *hvalue); | | const char *hvalue); | |
| /** | | /** | |
| * Get the Proxy-authenticate header. | | * Get the Proxy-authenticate header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| int osip_message_get_proxy_authenticate (const osip_message_t * sip, | | int osip_message_get_proxy_authenticate (const osip_message_t * sip, | |
|
| int pos, | | int pos, | |
| osip_proxy_authenticate_t ** dest | | osip_proxy_authenticate_t ** des | |
| ); | | t); | |
| /** | | /** | |
| * Set the Proxy-authorization header. | | * Set the Proxy-authorization header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
| int osip_message_set_proxy_authorization (osip_message_t * sip, | | int osip_message_set_proxy_authorization (osip_message_t * sip, | |
|
| const char *hvalue); | | const char *hvalue); | |
| /** | | /** | |
| * Get one Proxy-authorization header. | | * Get one Proxy-authorization header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| int osip_message_get_proxy_authorization (const osip_message_t * sip, | | int osip_message_get_proxy_authorization (const osip_message_t * sip, | |
|
| int pos, | | int pos, | |
| osip_proxy_authorization_t ** | | osip_proxy_authorization_t ** d | |
| dest); | | est); | |
| /** | | /** | |
| * Set the Proxy-authentication-info header. | | * Set the Proxy-authentication-info header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
| int osip_message_set_proxy_authentication_info (osip_message_t * sip, | | int osip_message_set_proxy_authentication_info (osip_message_t * sip, | |
|
| const char *hvalue); | | const char *hvalue); | |
| /** | | /** | |
| * Get the Proxy-authentication-info header. | | * Get the Proxy-authentication-info header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| int osip_message_get_proxy_authentication_info (const osip_message_t * si
p, | | int osip_message_get_proxy_authentication_info (const osip_message_t * si
p, | |
|
| int pos, | | int pos, | |
| osip_proxy_authentication_info_t ** de | | osip_proxy_authentication | |
| st); | | _info_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, | | int osip_message_set_record_route (osip_message_t * sip, const char *hval | |
| const char *hvalue); | | ue); | |
| /** | | /** | |
| * 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, | | int osip_message_get_record_route (const osip_message_t * sip, int pos, | |
|
| osip_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, | | int osip_message_get_route (const osip_message_t * sip, int pos, | |
|
| osip_route_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. | |
| */ | | */ | |
| | | | |
| skipping to change at line 433 | | skipping to change at line 424 | |
| * @param hvalue The string describing the element. | | * @param hvalue The string describing the element. | |
| */ | | */ | |
| int osip_message_append_via (osip_message_t * sip, const char *hvalue); | | int osip_message_append_via (osip_message_t * sip, const char *hvalue); | |
| /** | | /** | |
| * Get one Via header. | | * Get one Via header. | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param pos The index of the element to get. | | * @param pos The index of the element to get. | |
| * @param dest A pointer on the header found. | | * @param dest A pointer on the header found. | |
| */ | | */ | |
| int osip_message_get_via (const osip_message_t * sip, int pos, | | int osip_message_get_via (const osip_message_t * sip, int pos, | |
|
| osip_via_t ** dest); | | osip_via_t ** dest); | |
| /** | | /** | |
| * 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, | | int osip_message_set_www_authenticate (osip_message_t * sip, const char * | |
| const char *hvalue); | | 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); | |
| #ifndef DOXYGEN | | #ifndef DOXYGEN | |
| /** | | /** | |
| * Allocate and Add multiple header (not defined in oSIP). | | * Allocate and Add multiple header (not defined in oSIP). | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hname The token name. NAME MUST BE DYNAMICLY ALLOCATED | | * @param hname The token name. NAME MUST BE DYNAMICLY ALLOCATED | |
| * @param hvalue The token value. VALUE MUST BE DYNAMICLY ALLOCATED | | * @param hvalue The token value. VALUE MUST BE DYNAMICLY ALLOCATED | |
| */ | | */ | |
| int osip_message_set_multiple_header (osip_message_t * sip, char *hname, | | int osip_message_set_multiple_header (osip_message_t * sip, char *hname, | |
|
| char *hvalue); | | char *hvalue); | |
| #endif | | #endif | |
| /** | | /** | |
| * Allocate and Add an "unknown" header (not defined in oSIP). | | * Allocate and Add an "unknown" header (not defined in oSIP). | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param hname The token name. | | * @param hname The token name. | |
| * @param hvalue The token value. | | * @param hvalue The token value. | |
| */ | | */ | |
| int osip_message_set_header (osip_message_t * sip, const char *hname, | | int osip_message_set_header (osip_message_t * sip, const char *hname, | |
|
| const char *hvalue); | | const char *hvalue); | |
| /** | | /** | |
| * Allocate and Add 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, | | int osip_message_header_get_byname (const osip_message_t * sip, | |
|
| const char *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, | | int osip_message_get_header (const osip_message_t * sip, int pos, | |
|
| osip_header_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 buffer containing the body. | | * @param buf The buffer containing the body. | |
| * @param length The length of the buffer. | | * @param length The length of the buffer. | |
| */ | | */ | |
| int osip_message_set_body (osip_message_t * sip, const char *buf, size_t
length); | | int osip_message_set_body (osip_message_t * sip, const char *buf, size_t
length); | |
| /** | | /** | |
| * Set the Body of the SIP message. (please report bugs) | | * Set the Body of the SIP message. (please report bugs) | |
| * @param sip The element to work on. | | * @param sip The element to work on. | |
| * @param buf the buffer containing the body. | | * @param buf the buffer containing the body. | |
| * @param length The length of the buffer. | | * @param length The length of the buffer. | |
| */ | | */ | |
|
| int osip_message_set_body_mime (osip_message_t * sip, const char *buf, si | | int osip_message_set_body_mime (osip_message_t * sip, const char *buf, | |
| ze_t length); | | size_t length); | |
| /** | | /** | |
| * 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, | | int osip_message_get_body (const osip_message_t * sip, int pos, | |
|
| osip_body_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 | |
| | | | |
| /** | | /** | |
| | | | |
End of changes. 45 change blocks. |
| 71 lines changed or deleted | | 71 lines changed or added | |
|
| osip_port.h | | osip_port.h | |
| | | | |
| skipping to change at line 74 | | skipping to change at line 74 | |
| #ifdef __VXWORKS_OS__ | | #ifdef __VXWORKS_OS__ | |
| #include <string.h> | | #include <string.h> | |
| #include <time.h> | | #include <time.h> | |
| #include <sys/times.h> | | #include <sys/times.h> | |
| #include <stdarg.h> | | #include <stdarg.h> | |
| #include <sys/types.h> | | #include <sys/types.h> | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #define VA_START(a, f) va_start(a, f) | | #define VA_START(a, f) va_start(a, f) | |
| | | | |
| /* VxWorks lacks support for snprintf */ | | /* VxWorks lacks support for snprintf */ | |
|
| int osip_vsnprintf( char* buf, int max, const char *fmt, va_list ap); | | int osip_vsnprintf (char *buf, int max, const char *fmt, va_list ap); | |
| int osip_snprintf( char *buf, int max, const char *fmt, ...); | | int osip_snprintf (char *buf, int max, const char *fmt, ...); | |
| | | | |
| #define snprintf osip_snprintf | | #define snprintf osip_snprintf | |
| #define vsnprintf osip_vsnprintf | | #define vsnprintf osip_vsnprintf | |
| | | | |
| #else /* end of __VXWORKS_OS__ */ | | #else /* end of __VXWORKS_OS__ */ | |
| | | | |
| #if defined (HAVE_CONFIG_H) | | #if defined (HAVE_CONFIG_H) | |
| #include <config.h> | | #include <config.h> | |
| # if defined (HAVE_STRING_H) | | # if defined (HAVE_STRING_H) | |
| # include <string.h> | | # include <string.h> | |
| | | | |
| skipping to change at line 134 | | skipping to change at line 134 | |
| #ifdef _WIN32_WCE | | #ifdef _WIN32_WCE | |
| #define VA_START(a, f) va_start(a, f) | | #define VA_START(a, f) va_start(a, f) | |
| #endif | | #endif | |
| | | | |
| #ifdef WIN32 | | #ifdef WIN32 | |
| #define VA_START(a, f) va_start(a, f) | | #define VA_START(a, f) va_start(a, f) | |
| #endif | | #endif | |
| | | | |
| #ifdef __PSOS__ | | #ifdef __PSOS__ | |
| #define VA_START(a, f) va_start(a, f) | | #define VA_START(a, f) va_start(a, f) | |
|
| | | #include "pna.h" | |
| | | #include "stdlib.h" | |
| | | #include "time.h" | |
| | | #define timercmp(tvp, uvp, cmp) \ | |
| | | ((tvp)->tv_sec cmp (uvp)->tv_sec || \ | |
| | | (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_use | |
| | | c) | |
| | | #define snprintf osip_snprintf | |
| | | #ifndef INT_MAX | |
| | | #define INT_MAX 0x7FFFFFFF | |
| | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
| #if __STDC__ | | #if __STDC__ | |
| # ifndef NOPROTOS | | # ifndef NOPROTOS | |
| # define PARAMS(args) args | | # define PARAMS(args) args | |
| # endif | | # endif | |
| #endif | | #endif | |
| | | | |
| #ifndef PARAMS | | #ifndef PARAMS | |
| # define PARAMS(args) () | | # define PARAMS(args) () | |
| | | | |
| skipping to change at line 167 | | skipping to change at line 178 | |
| extern "C" | | extern "C" | |
| { | | { | |
| #endif | | #endif | |
| | | | |
| /**************************/ | | /**************************/ | |
| /* MALLOC redirections */ | | /* MALLOC redirections */ | |
| /**************************/ | | /**************************/ | |
| | | | |
| #ifndef WIN32 | | #ifndef WIN32 | |
| | | | |
|
| typedef void *osip_malloc_func_t(size_t size); | | typedef void *osip_malloc_func_t (size_t size); | |
| typedef void osip_free_func_t(void *ptr); | | typedef void osip_free_func_t (void *ptr); | |
| typedef void *osip_realloc_func_t(void *ptr, size_t size); | | typedef void *osip_realloc_func_t (void *ptr, size_t size); | |
| | | | |
|
| extern osip_malloc_func_t *osip_malloc_func; | | extern osip_malloc_func_t *osip_malloc_func; | |
| extern osip_realloc_func_t *osip_realloc_func; | | extern osip_realloc_func_t *osip_realloc_func; | |
| extern osip_free_func_t *osip_free_func; | | extern osip_free_func_t *osip_free_func; | |
| | | | |
|
| void osip_set_allocators(osip_malloc_func_t *malloc_func, | | void osip_set_allocators (osip_malloc_func_t * malloc_func, | |
| osip_realloc_func_t *realloc_func, | | osip_realloc_func_t * realloc_func, | |
| osip_free_func_t *free_func); | | osip_free_func_t * free_func); | |
| | | | |
| | | #ifdef DEBUG_MEM | |
| | | | |
| | | void *_osip_malloc (size_t size, char *file, unsigned short line); | |
| | | void _osip_free (void *ptr); | |
| | | void *_osip_realloc (void *ptr, size_t size, char *file, unsigned short l | |
| | | ine); | |
| | | | |
| | | #ifndef osip_malloc | |
| | | #define osip_malloc(S) _osip_malloc(S,__FILE__,__LINE__) | |
| | | #endif | |
| | | #ifndef osip_realloc | |
| | | #define osip_realloc(P,S) _osip_realloc(P,S,__FILE__,__LINE__) | |
| | | #endif | |
| | | #ifndef osip_free | |
| | | #define osip_free(P) { if (P!=NULL) { _osip_free(P); } } | |
| | | #endif | |
| | | | |
| | | #else | |
| | | | |
| #ifndef osip_malloc | | #ifndef osip_malloc | |
| #define osip_malloc(S) (osip_malloc_func?osip_malloc_func(S):malloc(S)) | | #define osip_malloc(S) (osip_malloc_func?osip_malloc_func(S):malloc(S)) | |
| #endif | | #endif | |
| #ifndef osip_realloc | | #ifndef osip_realloc | |
| #define osip_realloc(P,S) (osip_realloc_func?osip_realloc_func(P,S):realloc
(P,S)) | | #define osip_realloc(P,S) (osip_realloc_func?osip_realloc_func(P,S):realloc
(P,S)) | |
| #endif | | #endif | |
| #ifndef osip_free | | #ifndef osip_free | |
| #define osip_free(P) { if (P!=NULL) { if (osip_free_func) osip_free_func(P)
; else free(P);} } | | #define osip_free(P) { if (P!=NULL) { if (osip_free_func) osip_free_func(P)
; else free(P);} } | |
| #endif | | #endif | |
| | | | |
|
| | | #endif | |
| | | | |
| #else | | #else | |
|
| void *osip_malloc(size_t size); | | | |
| void *osip_realloc(void *, size_t size); | | void *osip_malloc (size_t size); | |
| void osip_free(void *); | | void *osip_realloc (void *, size_t size); | |
| | | void osip_free (void *); | |
| | | | |
| #endif | | #endif | |
| | | | |
| #ifdef WIN32 | | #ifdef WIN32 | |
| #define alloca _alloca | | #define alloca _alloca | |
| #endif | | #endif | |
| | | | |
| /**************************/ | | /**************************/ | |
| /* RANDOM number support */ | | /* RANDOM number support */ | |
| /**************************/ | | /**************************/ | |
| | | | |
| | | | |
| skipping to change at line 224 | | skipping to change at line 257 | |
| /* STRING support */ | | /* STRING support */ | |
| /**************************/ | | /**************************/ | |
| | | | |
| int osip_atoi (const char *number); | | int osip_atoi (const char *number); | |
| char *osip_strncpy (char *dest, const char *src, size_t length); | | char *osip_strncpy (char *dest, const char *src, size_t length); | |
| char *osip_strdup (const char *ch); | | char *osip_strdup (const char *ch); | |
| char *osip_strdup_without_quote (const char *ch); | | char *osip_strdup_without_quote (const char *ch); | |
| int osip_tolower (char *word); | | int osip_tolower (char *word); | |
| int osip_clrspace (char *word); | | int osip_clrspace (char *word); | |
| char *__osip_sdp_append_string (char *string, size_t size, | | char *__osip_sdp_append_string (char *string, size_t size, | |
|
| char *cur, char *string_osip_to_append); | | char *cur, char *string_osip_to_append); | |
| int __osip_set_next_token (char **dest, char *buf, int end_separator, | | int __osip_set_next_token (char **dest, char *buf, int end_separator, | |
|
| char **next); | | char **next); | |
| /* find the next unescaped quote and return its index. */ | | /* find the next unescaped quote and return its index. */ | |
| char *__osip_quote_find (const char *qstring); | | char *__osip_quote_find (const char *qstring); | |
| char *osip_enquote (const char *s); | | char *osip_enquote (const char *s); | |
| void osip_dequote (char *s); | | void osip_dequote (char *s); | |
| | | | |
| int osip_strcasecmp (const char *s1, const char *s2); | | int osip_strcasecmp (const char *s1, const char *s2); | |
| int osip_strncasecmp (const char *s1, const char *s2, size_t len); | | int osip_strncasecmp (const char *s1, const char *s2, size_t len); | |
| | | | |
|
| | | unsigned long osip_hash (const char *str); | |
| | | char *osip_str_append (char *dst, const char *src); | |
| | | char *osip_strn_append (char *dst, const char *src, size_t len); | |
| | | char *osip_clrncpy (char *dst, const char *src, size_t len); | |
| | | | |
| /**************************/ | | /**************************/ | |
| /* LOG&DEBUG support */ | | /* LOG&DEBUG support */ | |
| /**************************/ | | /**************************/ | |
| | | | |
| #define LOG_TRUE 1 | | #define LOG_TRUE 1 | |
| #define LOG_FALSE 0 | | #define LOG_FALSE 0 | |
| /* levels */ | | /* levels */ | |
| typedef enum _trace_level | | typedef enum _trace_level | |
| { | | { | |
| TRACE_LEVEL0 = 0, | | TRACE_LEVEL0 = 0, | |
| | | | |
| skipping to change at line 264 | | skipping to change at line 302 | |
| TRACE_LEVEL5 = 5, | | TRACE_LEVEL5 = 5, | |
| #define OSIP_INFO2 5 | | #define OSIP_INFO2 5 | |
| TRACE_LEVEL6 = 6, | | TRACE_LEVEL6 = 6, | |
| #define OSIP_INFO3 6 | | #define OSIP_INFO3 6 | |
| TRACE_LEVEL7 = 7, | | TRACE_LEVEL7 = 7, | |
| #define OSIP_INFO4 7 | | #define OSIP_INFO4 7 | |
| END_TRACE_LEVEL = 8 | | END_TRACE_LEVEL = 8 | |
| } | | } | |
| osip_trace_level_t; | | osip_trace_level_t; | |
| | | | |
|
| typedef void osip_trace_func_t(char *fi, int li, osip_trace_level_t level, | | typedef void osip_trace_func_t (char *fi, int li, osip_trace_level_t leve | |
| char *chfr, va_list ap); | | l, | |
| | | char *chfr, va_list ap); | |
| | | | |
| /* these are defined in all cases, but are empty when oSIP is compiled | | /* these are defined in all cases, but are empty when oSIP is compiled | |
| without trace */ | | without trace */ | |
|
| void osip_trace_initialize_func (osip_trace_level_t level, osip_trace_fun | | void osip_trace_initialize_func (osip_trace_level_t level, | |
| c_t *func); | | osip_trace_func_t * func); | |
| void osip_trace_initialize_syslog (osip_trace_level_t level, char *ident)
; | | void osip_trace_initialize_syslog (osip_trace_level_t level, char *ident)
; | |
| void osip_trace_initialize (osip_trace_level_t level, FILE * file); | | void osip_trace_initialize (osip_trace_level_t level, FILE * file); | |
| void osip_trace_enable_until_level (osip_trace_level_t level); | | void osip_trace_enable_until_level (osip_trace_level_t level); | |
| void osip_trace_enable_level (osip_trace_level_t level); | | void osip_trace_enable_level (osip_trace_level_t level); | |
| void osip_trace_disable_level (osip_trace_level_t level); | | void osip_trace_disable_level (osip_trace_level_t level); | |
| int osip_is_trace_level_activate (osip_trace_level_t level); | | int osip_is_trace_level_activate (osip_trace_level_t level); | |
| | | | |
| #ifndef ENABLE_TRACE | | #ifndef ENABLE_TRACE | |
| | | | |
| #define TRACE_INITIALIZE(level, file) do { } while (0) | | #define TRACE_INITIALIZE(level, file) do { } while (0) | |
| | | | |
| skipping to change at line 298 | | skipping to change at line 338 | |
| #define IS_TRACE_LEVEL_ACTIVATE(level) osip_is_trace_level_activate( level
) | | #define IS_TRACE_LEVEL_ACTIVATE(level) osip_is_trace_level_activate( level
) | |
| | | | |
| #endif | | #endif | |
| | | | |
| /* log facility. */ | | /* log facility. */ | |
| /* if f is NULL, current default log file is used. */ | | /* if f is NULL, current default log file is used. */ | |
| /* INPUT: level | level of the trace */ | | /* INPUT: level | level of the trace */ | |
| /* INPUT: f | use f instead of default log file */ | | /* INPUT: f | use f instead of default log file */ | |
| /* INPUT: chfr | format string for next args */ | | /* INPUT: chfr | format string for next args */ | |
| int osip_trace (char *fi, int li, osip_trace_level_t level, FILE * f, | | int osip_trace (char *fi, int li, osip_trace_level_t level, FILE * f, | |
|
| char *chfr, ...); | | char *chfr, ...); | |
| | | | |
| #ifdef ENABLE_TRACE | | #ifdef ENABLE_TRACE | |
| #define OSIP_TRACE(P) P | | #define OSIP_TRACE(P) P | |
| #else | | #else | |
| #define OSIP_TRACE(P) do {} while (0) | | #define OSIP_TRACE(P) do {} while (0) | |
| #endif | | #endif | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
|
| #endif /* _PORT_H_ */ | | #endif /* _PORT_H_ */ | |
| | | | |
End of changes. 14 change blocks. |
| 21 lines changed or deleted | | 62 lines changed or added | |
|
| osip_rfc3264.h | | osip_rfc3264.h | |
| | | | |
| skipping to change at line 114 | | skipping to change at line 114 | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| */ | | */ | |
| int osip_rfc3264_reset_media (struct osip_rfc3264 *config); | | int osip_rfc3264_reset_media (struct osip_rfc3264 *config); | |
| | | | |
| /** | | /** | |
| * Add a media in the configuration. | | * Add a media in the configuration. | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param med The media element to add. | | * @param med The media element to add. | |
| * @param pos The index of the media element to add. | | * @param pos The index of the media element to add. | |
| */ | | */ | |
|
| int osip_rfc3264_add_audio_media (struct osip_rfc3264 *config, sdp_media_ | | int osip_rfc3264_add_audio_media (struct osip_rfc3264 *config, | |
| t *med, int pos); | | sdp_media_t * med, int pos); | |
| | | | |
| /** | | /** | |
| * Remove a media in the configuration. | | * Remove a media in the configuration. | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param pos The index of the media element to remove. | | * @param pos The index of the media element to remove. | |
| */ | | */ | |
| int osip_rfc3264_del_audio_media (struct osip_rfc3264 *config, int pos); | | int osip_rfc3264_del_audio_media (struct osip_rfc3264 *config, int pos); | |
| | | | |
| /** | | /** | |
| * Add a media (for T.38) in the configuration. | | * Add a media (for T.38) in the configuration. | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param med The media element to add. | | * @param med The media element to add. | |
| * @param pos The index of the media element to add. | | * @param pos The index of the media element to add. | |
| */ | | */ | |
|
| int osip_rfc3264_add_t38_media (struct osip_rfc3264 *config, sdp_media_t | | int osip_rfc3264_add_t38_media (struct osip_rfc3264 *config, | |
| *med, int pos); | | sdp_media_t * med, int pos); | |
| | | | |
| /** | | /** | |
| * Remove a media (for T.38) in the configuration. | | * Remove a media (for T.38) in the configuration. | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param pos The index of the media element to remove. | | * @param pos The index of the media element to remove. | |
| */ | | */ | |
| int osip_rfc3264_del_t38_media (struct osip_rfc3264 *config, int pos); | | int osip_rfc3264_del_t38_media (struct osip_rfc3264 *config, int pos); | |
| | | | |
| /** | | /** | |
| * Add a media (for video) in the configuration. | | * Add a media (for video) in the configuration. | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param med The media element to add. | | * @param med The media element to add. | |
| * @param pos The index of the media element to add. | | * @param pos The index of the media element to add. | |
| */ | | */ | |
|
| int osip_rfc3264_add_video_media (struct osip_rfc3264 *config, sdp_media_ | | int osip_rfc3264_add_video_media (struct osip_rfc3264 *config, | |
| t *med, int pos); | | sdp_media_t * med, int pos); | |
| | | | |
| /** | | /** | |
| * Remove a media in the configuration. | | * Remove a media in the configuration. | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param pos The index of the media element to remove. | | * @param pos The index of the media element to remove. | |
| */ | | */ | |
| int osip_rfc3264_del_video_media (struct osip_rfc3264 *config, int pos); | | int osip_rfc3264_del_video_media (struct osip_rfc3264 *config, int pos); | |
| | | | |
| /** | | /** | |
| * Search for support of a special codec. | | * Search for support of a special codec. | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| */ | | */ | |
|
| sdp_media_t *osip_rfc3264_find_audio (struct osip_rfc3264 *config, char * | | sdp_media_t *osip_rfc3264_find_audio (struct osip_rfc3264 *config, | |
| payload, | | char *payload, char *rtpmap); | |
| char *rtpmap); | | | |
| | | | |
| /** | | /** | |
| * Search for support of a special codec. | | * Search for support of a special codec. | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param payload The payload to find. | | * @param payload The payload to find. | |
| * @param rtpmap The rtpmap for the payload. | | * @param rtpmap The rtpmap for the payload. | |
| */ | | */ | |
|
| sdp_media_t *osip_rfc3264_find_video (struct osip_rfc3264 *config, char * | | sdp_media_t *osip_rfc3264_find_video (struct osip_rfc3264 *config, | |
| payload, | | char *payload, char *rtpmap); | |
| char *rtpmap); | | | |
| | | | |
| /** | | /** | |
| * Search for support of a special codec. | | * Search for support of a special codec. | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param payload The payload to find. | | * @param payload The payload to find. | |
| */ | | */ | |
| sdp_media_t *osip_rfc3264_find_t38 (struct osip_rfc3264 *config, char *pa
yload); | | sdp_media_t *osip_rfc3264_find_t38 (struct osip_rfc3264 *config, char *pa
yload); | |
| | | | |
| /** | | /** | |
| * Search for support of a special codec. | | * Search for support of a special codec. | |
| | | | |
| skipping to change at line 195 | | skipping to change at line 198 | |
| * Only one media line is checked. | | * Only one media line is checked. | |
| * | | * | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param remote_sdp The remote SDP packet. | | * @param remote_sdp The remote SDP packet. | |
| * @param audio_tab The local list of media supported by both side. | | * @param audio_tab The local list of media supported by both side. | |
| * @param video_tab The local list of media supported by both side. | | * @param video_tab The local list of media supported by both side. | |
| * @param t38_tab The local list of media supported by both side. | | * @param t38_tab The local list of media supported by both side. | |
| * @param app_tab The local list of media supported by both side. | | * @param app_tab The local list of media supported by both side. | |
| * @param pos_media The position of the media line to match. | | * @param pos_media The position of the media line to match. | |
| */ | | */ | |
|
| int osip_rfc3264_match(struct osip_rfc3264 *config, | | int osip_rfc3264_match (struct osip_rfc3264 *config, | |
| sdp_message_t *remote_sdp, | | sdp_message_t * remote_sdp, | |
| sdp_media_t *audio_tab[], | | sdp_media_t * audio_tab[], | |
| sdp_media_t *video_tab[], | | sdp_media_t * video_tab[], | |
| sdp_media_t *t38_tab[], | | sdp_media_t * t38_tab[], | |
| sdp_media_t *app_tab[], | | sdp_media_t * app_tab[], int pos_media); | |
| int pos_media); | | | |
| | | | |
| /** | | /** | |
| * Compare remote sdp packet against local supported media for audio. | | * Compare remote sdp packet against local supported media for audio. | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param remote_sdp The remote SDP packet. | | * @param remote_sdp The remote SDP packet. | |
| * @param remote_med The remote Media SDP line. | | * @param remote_med The remote Media SDP line. | |
| * @param audio_tab The local list of media supported by both side. | | * @param audio_tab The local list of media supported by both side. | |
| */ | | */ | |
|
| int osip_rfc3264_match_audio(struct osip_rfc3264 *config, | | int osip_rfc3264_match_audio (struct osip_rfc3264 *config, | |
| sdp_message_t *remote_sdp, | | sdp_message_t * remote_sdp, | |
| sdp_media_t *remote_med, | | sdp_media_t * remote_med, | |
| sdp_media_t *audio_tab[]); | | sdp_media_t * audio_tab[]); | |
| | | | |
| /** | | /** | |
| * Compare remote sdp packet against local supported media for video. | | * Compare remote sdp packet against local supported media for video. | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param remote_sdp The remote SDP packet. | | * @param remote_sdp The remote SDP packet. | |
| * @param remote_med The remote Media SDP line. | | * @param remote_med The remote Media SDP line. | |
| * @param video_tab The local list of media supported by both side. | | * @param video_tab The local list of media supported by both side. | |
| */ | | */ | |
|
| int osip_rfc3264_match_video(struct osip_rfc3264 *config, | | int osip_rfc3264_match_video (struct osip_rfc3264 *config, | |
| sdp_message_t *remote_sdp, | | sdp_message_t * remote_sdp, | |
| sdp_media_t *remote_med, | | sdp_media_t * remote_med, | |
| sdp_media_t *video_tab[]); | | sdp_media_t * video_tab[]); | |
| | | | |
| /** | | /** | |
| * Compare remote sdp packet against local supported media for t38. | | * Compare remote sdp packet against local supported media for t38. | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param remote_sdp The remote SDP packet. | | * @param remote_sdp The remote SDP packet. | |
| * @param remote_med The remote Media SDP line. | | * @param remote_med The remote Media SDP line. | |
| * @param t38_tab The local list of media supported by both side. | | * @param t38_tab The local list of media supported by both side. | |
| */ | | */ | |
|
| int osip_rfc3264_match_t38(struct osip_rfc3264 *config, | | int osip_rfc3264_match_t38 (struct osip_rfc3264 *config, | |
| sdp_message_t *remote_sdp, | | sdp_message_t * remote_sdp, | |
| sdp_media_t *remote_med, | | sdp_media_t * remote_med, sdp_media_t * t38_t | |
| sdp_media_t *t38_tab[]); | | ab[]); | |
| | | | |
| /** | | /** | |
| * Compare remote sdp packet against local supported media for application. | | * Compare remote sdp packet against local supported media for application. | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param remote_sdp The remote SDP packet. | | * @param remote_sdp The remote SDP packet. | |
| * @param remote_med The remote Media SDP line. | | * @param remote_med The remote Media SDP line. | |
| * @param app_tab The local list of media supported by both side. | | * @param app_tab The local list of media supported by both side. | |
| */ | | */ | |
|
| int osip_rfc3264_match_app(struct osip_rfc3264 *config, | | int osip_rfc3264_match_app (struct osip_rfc3264 *config, | |
| sdp_message_t *remote_sdp, | | sdp_message_t * remote_sdp, | |
| sdp_media_t *remote_med, | | sdp_media_t * remote_med, sdp_media_t * app_t | |
| sdp_media_t *app_tab[]); | | ab[]); | |
| | | | |
| /** | | /** | |
| * Prepare an uncomplete answer. | | * Prepare an uncomplete answer. | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param remote_sdp The remote SDP packet. | | * @param remote_sdp The remote SDP packet. | |
| * @param local_sdp The local SDP packet to prepare. | | * @param local_sdp The local SDP packet to prepare. | |
| * @param length The local SDP packet's length. | | * @param length The local SDP packet's length. | |
| */ | | */ | |
|
| int osip_rfc3264_prepare_answer(struct osip_rfc3264 *config, | | int osip_rfc3264_prepare_answer (struct osip_rfc3264 *config, | |
| sdp_message_t *remote_sdp, | | sdp_message_t * remote_sdp, | |
| char *local_sdp, int length); | | char *local_sdp, int length); | |
| | | | |
| /** | | /** | |
| * Agree to support a specific codec. | | * Agree to support a specific codec. | |
| * This method should be called for each codec returned by | | * This method should be called for each codec returned by | |
| * osip_rfc3264_match(...) that the calle agree to support. | | * osip_rfc3264_match(...) that the calle agree to support. | |
| * | | * | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param remote_sdp The remote SDP packet. | | * @param remote_sdp The remote SDP packet. | |
| * @param local_sdp The local SDP packet to complete. | | * @param local_sdp The local SDP packet to complete. | |
| * @param med One of the media returned by osip_rfc3264_match. | | * @param med One of the media returned by osip_rfc3264_match. | |
| * @param mline The position of the media line to complete. | | * @param mline The position of the media line to complete. | |
| */ | | */ | |
|
| int | | int | |
| osip_rfc3264_complete_answer(struct osip_rfc3264 *config, | | osip_rfc3264_complete_answer (struct osip_rfc3264 *config, | |
| sdp_message_t *remote_sdp, | | sdp_message_t * remote_sdp, | |
| sdp_message_t *local_sdp, | | sdp_message_t * local_sdp, | |
| sdp_media_t *med, | | sdp_media_t * med, int mline); | |
| int mline); | | | |
| | | | |
| /** | | /** | |
| * Agree to support a specific codec. | | * Agree to support a specific codec. | |
| * This method should be called for each codec returned by | | * This method should be called for each codec returned by | |
| * osip_rfc3264_match(...) | | * osip_rfc3264_match(...) | |
| * | | * | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| * @param med One of the media returned by osip_rfc3264_match | | * @param med One of the media returned by osip_rfc3264_match | |
| * @param remote_sdp The remote SDP packet. | | * @param remote_sdp The remote SDP packet. | |
| * @param local_sdp The local SDP packet to prepare. | | * @param local_sdp The local SDP packet to prepare. | |
| */ | | */ | |
|
| int osip_rfc3264_accept_codec(struct osip_rfc3264 *config, | | int osip_rfc3264_accept_codec (struct osip_rfc3264 *config, | |
| sdp_media_t *med, | | sdp_media_t * med, | |
| sdp_message_t *remote_sdp, | | sdp_message_t * remote_sdp, | |
| sdp_message_t *local_sdp); | | sdp_message_t * local_sdp); | |
| | | | |
| /** | | /** | |
| * List supported codecs. (for debugging purpose only) | | * List supported codecs. (for debugging purpose only) | |
| * | | * | |
| * @param config The element to work on. | | * @param config The element to work on. | |
| */ | | */ | |
|
| int __osip_rfc3264_print_codecs(struct osip_rfc3264 *config); | | int __osip_rfc3264_print_codecs (struct osip_rfc3264 *config); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 14 change blocks. |
| 49 lines changed or deleted | | 45 lines changed or added | |
|
| sdp_message.h | | sdp_message.h | |
| | | | |
| skipping to change at line 114 | | skipping to change at line 114 | |
| * @var sdp_key_t | | * @var sdp_key_t | |
| */ | | */ | |
| typedef struct sdp_key sdp_key_t; | | typedef struct sdp_key sdp_key_t; | |
| | | | |
| /** | | /** | |
| * SDP key definition. | | * SDP key definition. | |
| * @struct sdp_key | | * @struct sdp_key | |
| */ | | */ | |
| struct sdp_key | | struct sdp_key | |
| { | | { | |
|
| char *k_keytype; /**< Key Type (prompt, clear, base64, uri) */ | | char *k_keytype; /**< Key Type (prompt, clear, base64, uri) */ | |
| char *k_keydata; /**< key data */ | | char *k_keydata; /**< key data */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Allocate a key element. | | * Allocate a key element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
| int sdp_key_init (sdp_key_t ** elem); | | int sdp_key_init (sdp_key_t ** elem); | |
| /** | | /** | |
| * Free a key element. | | * Free a key element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| | | | |
| skipping to change at line 142 | | skipping to change at line 142 | |
| */ | | */ | |
| typedef struct sdp_attribute sdp_attribute_t; | | typedef struct sdp_attribute sdp_attribute_t; | |
| | | | |
| /** | | /** | |
| * SDP attribute definition. | | * SDP attribute definition. | |
| * @struct sdp_attribute | | * @struct sdp_attribute | |
| */ | | */ | |
| struct sdp_attribute | | struct sdp_attribute | |
| { | | { | |
| char *a_att_field; /**< attribute field */ | | char *a_att_field; /**< attribute field */ | |
|
| char *a_att_value; /**< attribute value (optional) */ | | char *a_att_value; /**< attribute value (optional) */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Allocate an attribute element. | | * Allocate an attribute element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
| int sdp_attribute_init (sdp_attribute_t ** elem); | | int sdp_attribute_init (sdp_attribute_t ** elem); | |
| /** | | /** | |
| * Free a attribute element. | | * Free a attribute element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| | | | |
| skipping to change at line 171 | | skipping to change at line 171 | |
| | | | |
| /** | | /** | |
| * SDP connection definition. | | * SDP connection definition. | |
| * @struct sdp_connection | | * @struct sdp_connection | |
| */ | | */ | |
| struct sdp_connection | | struct sdp_connection | |
| { | | { | |
| char *c_nettype; /**< Network Type */ | | char *c_nettype; /**< Network Type */ | |
| char *c_addrtype; /**< Network Address Type */ | | char *c_addrtype; /**< Network Address Type */ | |
| char *c_addr; /**< Address */ | | char *c_addr; /**< Address */ | |
|
| char *c_addr_multicast_ttl; /**< TTL value for multicast addres | | char *c_addr_multicast_ttl; /**< TTL value for multicast address */ | |
| s */ | | char *c_addr_multicast_int; /**< Number of multicast address */ | |
| char *c_addr_multicast_int; /**< Number of multicast address */ | | | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Allocate a connection element. | | * Allocate a connection element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
| int sdp_connection_init (sdp_connection_t ** elem); | | int sdp_connection_init (sdp_connection_t ** elem); | |
| /** | | /** | |
| * Free a connection element. | | * Free a connection element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| | | | |
| skipping to change at line 205 | | skipping to change at line 205 | |
| */ | | */ | |
| struct sdp_media | | struct sdp_media | |
| { | | { | |
| char *m_media; /**< media type */ | | char *m_media; /**< media type */ | |
| char *m_port; /**< port number */ | | char *m_port; /**< port number */ | |
| char *m_number_of_port; /**< number of port */ | | char *m_number_of_port; /**< number of port */ | |
| char *m_proto; /**< protocol to be used */ | | char *m_proto; /**< protocol to be used */ | |
| osip_list_t *m_payloads; /**< list of payloads (as strings) */ | | osip_list_t *m_payloads; /**< list of payloads (as strings) */ | |
| | | | |
| char *i_info; /**< information header */ | | char *i_info; /**< information header */ | |
|
| osip_list_t *c_connections; /**< list of sdp_connection_t * */ | | osip_list_t *c_connections; /**< list of sdp_connection_t * */ | |
| osip_list_t *b_bandwidths; /**< list of sdp_bandwidth_t * */ | | osip_list_t *b_bandwidths; /**< list of sdp_bandwidth_t * */ | |
| osip_list_t *a_attributes; /**< list of sdp_attribute_t * */ | | osip_list_t *a_attributes; /**< list of sdp_attribute_t * */ | |
| sdp_key_t *k_key; /**< key informations */ | | sdp_key_t *k_key; /**< key informations */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Allocate a media element. | | * Allocate a media element. | |
| * @param elem The element to work on. | | * @param elem The element to work on. | |
| */ | | */ | |
| int sdp_media_init (sdp_media_t ** elem); | | int sdp_media_init (sdp_media_t ** elem); | |
| /** | | /** | |
| * Free a media element. | | * Free a media element. | |
| | | | |
| skipping to change at line 244 | | skipping to change at line 244 | |
| char *v_version; /**< version header */ | | char *v_version; /**< version header */ | |
| char *o_username; /**< Username */ | | char *o_username; /**< Username */ | |
| char *o_sess_id; /**< Identifier for session */ | | char *o_sess_id; /**< Identifier for session */ | |
| char *o_sess_version; /**< Version of session */ | | char *o_sess_version; /**< Version of session */ | |
| char *o_nettype; /**< Network type */ | | char *o_nettype; /**< Network type */ | |
| char *o_addrtype; /**< Address type */ | | char *o_addrtype; /**< Address type */ | |
| char *o_addr; /**< Address */ | | char *o_addr; /**< Address */ | |
| char *s_name; /**< Subject header */ | | char *s_name; /**< Subject header */ | |
| char *i_info; /**< Information header */ | | char *i_info; /**< Information header */ | |
| char *u_uri; /**< Uri header */ | | char *u_uri; /**< Uri header */ | |
|
| osip_list_t *e_emails; /**< list of mail address */ | | osip_list_t *e_emails; /**< list of mail address */ | |
| osip_list_t *p_phones; /**< list of phone numbers * */ | | osip_list_t *p_phones; /**< list of phone numbers * */ | |
| sdp_connection_t *c_connection; /**< Connection information */ | | sdp_connection_t *c_connection; /**< Connection information */ | |
|
| osip_list_t *b_bandwidths; /**< list of bandwidth info (sdp_bandwidth_t | | osip_list_t *b_bandwidths; /**< list of bandwidth info (sdp_bandwidth_ | |
| ) */ | | t) */ | |
| osip_list_t *t_descrs; /**< list of time description (sdp_time_desc | | osip_list_t *t_descrs; /**< list of time description (sdp_time_des | |
| r_t) */ | | cr_t) */ | |
| char *z_adjustments; /**< Time adjustment header */ | | char *z_adjustments; /**< Time adjustment header */ | |
| sdp_key_t *k_key; /**< Key information header */ | | sdp_key_t *k_key; /**< Key information header */ | |
|
| osip_list_t *a_attributes; /**< list of global attributes (sdp_attribut | | osip_list_t *a_attributes; /**< list of global attributes (sdp_attribu | |
| e_t) */ | | te_t) */ | |
| osip_list_t *m_medias; /**< list of supported media (sdp_media_t) * | | osip_list_t *m_medias; /**< list of supported media (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 306 | | skipping to change at line 306 | |
| * Set the origin field in a SDP packet. | | * Set the origin field in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param username The token value. | | * @param username The token value. | |
| * @param sess_id The token value. | | * @param sess_id The token value. | |
| * @param sess_version The token value. | | * @param sess_version The token value. | |
| * @param nettype The token value. | | * @param nettype The token value. | |
| * @param addrtype The token value. | | * @param addrtype The token value. | |
| * @param addr The token value. | | * @param addr The token value. | |
| */ | | */ | |
| int sdp_message_o_origin_set (sdp_message_t * sdp, char *username, | | int sdp_message_o_origin_set (sdp_message_t * sdp, char *username, | |
|
| char *sess_id, char *sess_version, | | char *sess_id, char *sess_version, | |
| char *nettype, char *addrtype, char *addr); | | char *nettype, 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 355 | | skipping to change at line 355 | |
| * 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, | | int sdp_message_i_info_set (sdp_message_t * sdp, int pos_media, char *val | |
| char *value); | | ue); | |
| /** | | /** | |
| * 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 384 | | skipping to change at line 383 | |
| /** | | /** | |
| * Set the version in a SDP packet. | | * Set the version in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
| int sdp_message_e_email_add (sdp_message_t * sdp, char *value); | | int sdp_message_e_email_add (sdp_message_t * sdp, char *value); | |
| /** | | /** | |
| * OBSOLETE: see sdp_message_e_email_get | | * OBSOLETE: see sdp_message_e_email_get | |
| * @def sdp_e_email_get | | * @def sdp_e_email_get | |
| */ | | */ | |
|
| #define sdp_e_email_get sdp_message_e_email_get | | #define sdp_e_email_get sdp_message_e_email_get | |
| /** | | /** | |
| * Get one of the email ('e' field) of a SDP packet. | | * Get one of the email ('e' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos the index of the email line. | | * @param pos the index of the email line. | |
| */ | | */ | |
| char *sdp_message_e_email_get (sdp_message_t * sdp, int pos); | | char *sdp_message_e_email_get (sdp_message_t * sdp, int pos); | |
| /** | | /** | |
| * Set the version in a SDP packet. | | * Set the version in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param value The token value. | | * @param value The token value. | |
| | | | |
| skipping to change at line 414 | | skipping to change at line 413 | |
| * 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, | | sdp_connection_t *sdp_message_connection_get (sdp_message_t * sdp, | |
|
| int pos_media, int pos); | | int pos_media, int pos); | |
| #endif | | #endif | |
| /** | | /** | |
| * Get the network type ('c' field) of a SDP packet. | | * Get the network type ('c' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The index in the connection element list.. | | * @param pos The index in the connection element list.. | |
| */ | | */ | |
|
| char *sdp_message_c_nettype_get (sdp_message_t * sdp, int pos_media, | | char *sdp_message_c_nettype_get (sdp_message_t * sdp, int pos_media, int | |
| int pos); | | 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, | | char *sdp_message_c_addrtype_get (sdp_message_t * sdp, int pos_media, int | |
| int pos); | | pos); | |
| /** | | /** | |
| * Get the address ('c' field) of a SDP packet. | | * Get the address ('c' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The index in the connection element list.. | | * @param pos The index in the connection element list.. | |
| */ | | */ | |
| char *sdp_message_c_addr_get (sdp_message_t * sdp, int pos_media, int pos
); | | char *sdp_message_c_addr_get (sdp_message_t * sdp, int pos_media, int pos
); | |
| /** | | /** | |
| * Get the multicast ttl ('c' field) of a SDP packet. | | * Get the multicast ttl ('c' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The index in the connection element list.. | | * @param pos The index in the connection element list.. | |
| */ | | */ | |
| char *sdp_message_c_addr_multicast_ttl_get (sdp_message_t * sdp, | | char *sdp_message_c_addr_multicast_ttl_get (sdp_message_t * sdp, | |
|
| int pos_media, int pos); | | int pos_media, int pos); | |
| /** | | /** | |
| * Get the multicast int info ('c' field) of a SDP packet. | | * Get the multicast int info ('c' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The index in the connection element list.. | | * @param pos The index in the connection element list.. | |
| */ | | */ | |
| char *sdp_message_c_addr_multicast_int_get (sdp_message_t * sdp, | | char *sdp_message_c_addr_multicast_int_get (sdp_message_t * sdp, | |
|
| int pos_media, int pos); | | int pos_media, int pos); | |
| /** | | /** | |
| * Set the version in a SDP packet. | | * Set the version in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param bwtype The token value. | | * @param bwtype The token value. | |
| * @param bandwidth The token value. | | * @param bandwidth The token value. | |
| */ | | */ | |
| int sdp_message_b_bandwidth_add (sdp_message_t * sdp, int pos_media, | | int sdp_message_b_bandwidth_add (sdp_message_t * sdp, int pos_media, | |
|
| char *bwtype, char *bandwidth); | | char *bwtype, char *bandwidth); | |
| /** | | /** | |
| * Get the bandwidth ('b' field) of a SDP packet. | | * Get the bandwidth ('b' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The index in the bandwidth element list.. | | * @param pos The index in the bandwidth element list.. | |
| */ | | */ | |
| sdp_bandwidth_t *sdp_message_bandwidth_get (sdp_message_t * sdp, | | sdp_bandwidth_t *sdp_message_bandwidth_get (sdp_message_t * sdp, | |
|
| int pos_media, int pos); | | int pos_media, int pos); | |
| /** | | /** | |
| * Get the bandwidth type ('b' field) of a SDP packet. | | * Get the bandwidth type ('b' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The index in the bandwidth element list.. | | * @param pos The index in the bandwidth element list.. | |
| */ | | */ | |
|
| char *sdp_message_b_bwtype_get (sdp_message_t * sdp, int pos_media, | | char *sdp_message_b_bwtype_get (sdp_message_t * sdp, int pos_media, int p | |
| int pos); | | os); | |
| /** | | /** | |
| * 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, | | char *sdp_message_b_bandwidth_get (sdp_message_t * sdp, int pos_media, in | |
| int pos); | | t 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, | | int sdp_message_t_time_descr_add (sdp_message_t * sdp, char *start, char | |
| char *stop); | | *stop); | |
| /** | | /** | |
| * Get the start time value ('t' field) of a SDP packet. | | * Get the start time value ('t' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_td The time description line number. | | * @param pos_td The time description line number. | |
| */ | | */ | |
| char *sdp_message_t_start_time_get (sdp_message_t * sdp, int pos_td); | | char *sdp_message_t_start_time_get (sdp_message_t * sdp, int pos_td); | |
| /** | | /** | |
| * Get the stop time value ('t' field) of a SDP packet. | | * Get the stop time value ('t' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_td The time description line number. | | * @param pos_td The time description line number. | |
| */ | | */ | |
| char *sdp_message_t_stop_time_get (sdp_message_t * sdp, int pos_td); | | char *sdp_message_t_stop_time_get (sdp_message_t * sdp, int pos_td); | |
| /** | | /** | |
| * Set the repeat information ('r' field) in a SDP packet. | | * Set the repeat information ('r' field) in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_time_descr index of t field. | | * @param pos_time_descr index of t field. | |
| * @param value The token value. | | * @param value The token value. | |
| */ | | */ | |
| int sdp_message_r_repeat_add (sdp_message_t * sdp, int pos_time_descr, | | int sdp_message_r_repeat_add (sdp_message_t * sdp, int pos_time_descr, | |
|
| char *value); | | char *value); | |
| /** | | /** | |
| * Get the repeat information ('r' field) in a SDP packet. | | * Get the repeat information ('r' field) in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_time_descr index of t field. | | * @param pos_time_descr index of t field. | |
| * @param pos_repeat index of element in the 'r' field. | | * @param pos_repeat index of element in the 'r' field. | |
| */ | | */ | |
| char *sdp_message_r_repeat_get (sdp_message_t * sdp, int pos_time_descr, | | char *sdp_message_r_repeat_get (sdp_message_t * sdp, int pos_time_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, | | int sdp_message_k_key_set (sdp_message_t * sdp, int pos_media, | |
|
| char *keytype, char *keydata); | | char *keytype, 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, | | int sdp_message_a_attribute_add (sdp_message_t * sdp, int pos_media, | |
|
| char *att_field, char *att_value); | | char *att_field, char *att_value); | |
| /** | | /** | |
| * delete all attribute fields specified by att_field. | | * delete all attribute fields specified by att_field. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| * @param att_field The value to remove. | | * @param att_field The value to remove. | |
| */ | | */ | |
| int sdp_message_a_attribute_del (sdp_message_t * sdp, int pos_media, | | int sdp_message_a_attribute_del (sdp_message_t * sdp, int pos_media, | |
|
| char *att_field); | | char *att_field); | |
| /** | | /** | |
| * delete one specific attribute fields specified by att_field. | | * delete one specific attribute fields specified by att_field. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| * @param att_field The value to remove. | | * @param att_field The value to remove. | |
| * @param pos_attr The index of attribute to remove. | | * @param pos_attr The index of attribute to remove. | |
| */ | | */ | |
|
| int sdp_message_a_attribute_del_at_index (sdp_message_t * sdp, int pos_me | | int sdp_message_a_attribute_del_at_index (sdp_message_t * sdp, | |
| dia, | | int pos_media, char *att_field, | |
| char *att_field, int pos_attr); | | int pos_attr); | |
| /** | | /** | |
| * Get one of the attribute ('a' field) of a SDP packet. | | * Get one of the attribute ('a' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The attribute line number. | | * @param pos The attribute line number. | |
| */ | | */ | |
| sdp_attribute_t *sdp_message_attribute_get (sdp_message_t * sdp, | | sdp_attribute_t *sdp_message_attribute_get (sdp_message_t * sdp, | |
|
| int pos_media, int pos); | | int pos_media, int pos); | |
| /** | | /** | |
| * Get the attribute name ('a' field) of a SDP packet. | | * Get the attribute name ('a' field) of a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The media line number. | | * @param pos_media The media line number. | |
| * @param pos The attribute line number. | | * @param pos The attribute line number. | |
| */ | | */ | |
|
| char *sdp_message_a_att_field_get (sdp_message_t * sdp, int pos_media, | | char *sdp_message_a_att_field_get (sdp_message_t * sdp, int pos_media, in | |
| int pos); | | t 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, | | char *sdp_message_a_att_value_get (sdp_message_t * sdp, int pos_media, in | |
| int pos); | | t 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 *prot
o); | |
| /** | | /** | |
| * 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 666 | | skipping to change at line 659 | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| */ | | */ | |
| char *sdp_message_m_proto_get (sdp_message_t * sdp, int pos_media); | | char *sdp_message_m_proto_get (sdp_message_t * sdp, int pos_media); | |
| /** | | /** | |
| * Set the payload in a SDP packet. | | * Set the payload in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| * @param payload The token value. | | * @param payload The token value. | |
| */ | | */ | |
| int sdp_message_m_payload_add (sdp_message_t * sdp, int pos_media, | | int sdp_message_m_payload_add (sdp_message_t * sdp, int pos_media, | |
|
| char *payload); | | char *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, | | char *sdp_message_m_payload_get (sdp_message_t * sdp, int pos_media, int | |
| int pos); | | pos); | |
| /** | | /** | |
| * Remove a payload in a SDP packet. | | * Remove a payload in a SDP packet. | |
| * @param sdp The element to work on. | | * @param sdp The element to work on. | |
| * @param pos_media The line number. | | * @param pos_media The line number. | |
| * @param pos The position of the payload in the media line. | | * @param pos The position of the payload in the media line. | |
| */ | | */ | |
|
| int sdp_message_m_payload_del (sdp_message_t * sdp, int pos_media, | | int sdp_message_m_payload_del (sdp_message_t * sdp, int pos_media, int po | |
| int pos); | | s); | |
| | | | |
| /** @} */ | | /** @} */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 34 change blocks. |
| 61 lines changed or deleted | | 60 lines changed or added | |
|