osip.h   osip.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
skipping to change at line 60 skipping to change at line 60
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Enumeration for transaction state. * Enumeration for transaction state.
* Those states are extracted from the diagram found in rfc3261.txt * Those states are extracted from the diagram found in rfc3261.txt
* *
*/ */
typedef enum _state_t { typedef enum _state_t {
/* STATES for invite client transaction */ /* STATES for invite client transaction */
ICT_PRE_CALLING, ICT_PRE_CALLING,
ICT_CALLING, ICT_CALLING,
ICT_PROCEEDING, ICT_PROCEEDING,
ICT_COMPLETED, ICT_COMPLETED,
ICT_TERMINATED, ICT_TERMINATED,
/* STATES for invite server transaction */ /* STATES for invite server transaction */
IST_PRE_PROCEEDING, IST_PRE_PROCEEDING,
IST_PROCEEDING, IST_PROCEEDING,
IST_COMPLETED, IST_COMPLETED,
IST_CONFIRMED, IST_CONFIRMED,
IST_TERMINATED, IST_TERMINATED,
/* STATES for NON-invite client transaction */ /* STATES for NON-invite client transaction */
NICT_PRE_TRYING, NICT_PRE_TRYING,
NICT_TRYING, NICT_TRYING,
NICT_PROCEEDING, NICT_PROCEEDING,
NICT_COMPLETED, NICT_COMPLETED,
NICT_TERMINATED, NICT_TERMINATED,
/* STATES for NON-invite server transaction */ /* STATES for NON-invite server transaction */
NIST_PRE_TRYING, NIST_PRE_TRYING,
NIST_TRYING, NIST_TRYING,
NIST_PROCEEDING, NIST_PROCEEDING,
NIST_COMPLETED, NIST_COMPLETED,
NIST_TERMINATED, NIST_TERMINATED,
#ifndef DOXYGEN #ifndef DOXYGEN
DIALOG_EARLY, DIALOG_EARLY,
DIALOG_CONFIRMED, DIALOG_CONFIRMED,
DIALOG_CLOSE /* ?? */ DIALOG_CLOSE /* ?? */
#endif #endif
} state_t; } state_t;
/** /**
* Enumeration for event type. * Enumeration for event type.
* <BR>The list of values that you need to know is reduced to this: * <BR>The list of values that you need to know is reduced to this:
* <BR> RCV_REQINVITE, * <BR> RCV_REQINVITE,
* <BR> RCV_REQACK, * <BR> RCV_REQACK,
* <BR> RCV_REQUEST, * <BR> RCV_REQUEST,
* <BR> RCV_STATUS_1XX, * <BR> RCV_STATUS_1XX,
* <BR> RCV_STATUS_2XX, * <BR> RCV_STATUS_2XX,
* <BR> RCV_STATUS_3456XX, * <BR> RCV_STATUS_3456XX,
*<BR> *<BR>
* <BR> SND_REQINVITE, * <BR> SND_REQINVITE,
* <BR> SND_REQACK, * <BR> SND_REQACK,
* <BR> SND_REQUEST, * <BR> SND_REQUEST,
* <BR> SND_STATUS_1XX, * <BR> SND_STATUS_1XX,
* <BR> SND_STATUS_2XX, * <BR> SND_STATUS_2XX,
* <BR> SND_STATUS_3456XX, * <BR> SND_STATUS_3456XX,
*/ */
typedef enum type_t { typedef enum type_t {
/* TIMEOUT EVENTS for ICT */ /* TIMEOUT EVENTS for ICT */
TIMEOUT_A, TIMEOUT_A, /**< Timer A */
/**< Timer A */ TIMEOUT_B, /**< Timer B */
TIMEOUT_B, TIMEOUT_D, /**< Timer D */
/**< Timer B */
TIMEOUT_D, /* TIMEOUT EVENTS for NICT */
/**< Timer D */ TIMEOUT_E, /**< Timer E */
TIMEOUT_F, /**< Timer F */
/* TIMEOUT EVENTS for NICT */ TIMEOUT_K, /**< Timer K */
TIMEOUT_E,
/**< Timer E */ /* TIMEOUT EVENTS for IST */
TIMEOUT_F, TIMEOUT_G, /**< Timer G */
/**< Timer F */ TIMEOUT_H, /**< Timer H */
TIMEOUT_K, TIMEOUT_I, /**< Timer I */
/**< Timer K */
/* TIMEOUT EVENTS for NIST */
/* TIMEOUT EVENTS for IST */ TIMEOUT_J, /**< Timer J */
TIMEOUT_G,
/**< Timer G */ /* FOR INCOMING MESSAGE */
TIMEOUT_H, RCV_REQINVITE, /**< Event is an incoming INVITE request *
/**< Timer H */ /
TIMEOUT_I, RCV_REQACK, /**< Event is an incoming ACK request */
/**< Timer I */ RCV_REQUEST, /**< Event is an incoming NON-INVITE and N
ON-ACK request */
/* TIMEOUT EVENTS for NIST */ RCV_STATUS_1XX, /**< Event is an incoming informational re
TIMEOUT_J, sponse */
/**< Timer J */ RCV_STATUS_2XX, /**< Event is an incoming 2XX response */
RCV_STATUS_3456XX, /**< Event is an incoming final response (
/* FOR INCOMING MESSAGE */ not 2XX) */
RCV_REQINVITE,/**< Event is an incoming INVITE request */
RCV_REQACK, /**< Event is an incoming ACK request */ /* FOR OUTGOING MESSAGE */
RCV_REQUEST, /**< Event is an incoming NON-INVITE and NON-A SND_REQINVITE, /**< Event is an outgoing INVITE request *
CK request */ /
RCV_STATUS_1XX, SND_REQACK, /**< Event is an outgoing ACK request */
/**< Event is an incoming informat SND_REQUEST, /**< Event is an outgoing NON-INVITE and N
ional response */ ON-ACK request */
RCV_STATUS_2XX, SND_STATUS_1XX, /**< Event is an outgoing informational re
/**< Event is an incoming 2XX resp sponse */
onse */ SND_STATUS_2XX, /**< Event is an outgoing 2XX response */
RCV_STATUS_3456XX, SND_STATUS_3456XX, /**< Event is an outgoing final response (
/**< Event is an incoming final re not 2XX) */
sponse (not 2XX) */
KILL_TRANSACTION, /**< Event to 'kill' the transaction befor
/* FOR OUTGOING MESSAGE */ e termination */
SND_REQINVITE,/**< Event is an outgoing INVITE request */ UNKNOWN_EVT /**< Max event */
SND_REQACK, /**< Event is an outgoing ACK request */ } type_t;
SND_REQUEST, /**< Event is an outgoing NON-INVITE and NON-A
CK request */
SND_STATUS_1XX,
/**< Event is an outgoing informat
ional response */
SND_STATUS_2XX,
/**< Event is an outgoing 2XX resp
onse */
SND_STATUS_3456XX,
/**< Event is an outgoing final re
sponse (not 2XX) */
KILL_TRANSACTION,
/**< Event to 'kill' the transacti
on before termination */
UNKNOWN_EVT
} type_t;
/** /**
* Enumeration for transaction type. * Enumeration for transaction type.
* A transaction can be either of: * A transaction can be either of:
* ICT, * ICT,
* IST, * IST,
* NICT, * NICT,
* NIST, * NIST,
*/ */
typedef enum osip_fsm_type_t { typedef enum osip_fsm_type_t {
ICT, ICT, /**< Invite Client (outgoing) Transaction */
/**< Invite Client (outgoing) Transaction */ IST, /**< Invite Server (incoming) Transaction */
IST, NICT, /**< Non-Invite Client (outgoing) Transaction */
/**< Invite Server (incoming) Transaction */ NIST /**< Non-Invite Server (incoming) Transaction */
NICT, } osip_fsm_type_t;
/**< Non-Invite Client (outgoing) Transaction */
NIST
/**< Non-Invite Server (incoming) Transaction */
} osip_fsm_type_t;
#ifndef DEFAULT_T1 #ifndef DEFAULT_T1
/** /**
* You can re-define the default value for T1. (T1 is defined in rfcxxxx) * You can re-define the default value for T1. (T1 is defined in rfcxxxx)
* The default value is 500ms. * The default value is 500ms.
*/ */
#define DEFAULT_T1 500 /* 500 ms */ #define DEFAULT_T1 500 /* 500 ms */
#endif #endif
#ifndef DEFAULT_T2 #ifndef DEFAULT_T2
/** /**
* You can re-define the default value for T2. (T2 is defined in rfcxxxx) * You can re-define the default value for T2. (T2 is defined in rfcxxxx)
* The default value is 4000ms. * The default value is 4000ms.
*/ */
#define DEFAULT_T2 4000 /* 4s */ #define DEFAULT_T2 4000 /* 4s */
#endif #endif
#ifndef DEFAULT_T4 #ifndef DEFAULT_T4
/** /**
* You can re-define the default value for T4. (T1 is defined in rfcxxxx) * You can re-define the default value for T4. (T1 is defined in rfcxxxx)
* The default value is 5000ms. * The default value is 5000ms.
*/ */
#define DEFAULT_T4 5000 /* 5s */ #define DEFAULT_T4 5000 /* 5s */
#endif #endif
/** /**
* Structure for INVITE CLIENT TRANSACTION (outgoing INVITE transaction). * Structure for INVITE CLIENT TRANSACTION (outgoing INVITE transaction).
* @var osip_ict_t * @var osip_ict_t
*/ */
typedef struct osip_ict osip_ict_t; typedef struct osip_ict osip_ict_t;
/** /**
* Structure for INVITE CLIENT TRANSACTION. * Structure for INVITE CLIENT TRANSACTION.
* @struct osip_ict * @struct osip_ict
*/ */
struct osip_ict { struct osip_ict {
int timer_a_length; /**@internal A=T1, A=2xT1. int timer_a_length; /**< Timer A A=T1, A=2xT1
.. (unreliable only) */ ... (unreliable only) */
struct timeval timer_a_start; struct timeval timer_a_start; /**< Timer A (retransmiss
/**@intern ion) */
al */ int timer_b_length; /**< Timer B B = 64* T1 *
int timer_b_length; /**@internal B = 64* T1 */ /
struct timeval timer_b_start; struct timeval timer_b_start; /**< Timer B (fire when t
/**@intern ransaction timeout) */
al fire when transaction timeouts */ int timer_d_length; /**< Timer D D >= 32s for
int timer_d_length; /**@internal D >= 32s for unreliable tr (or 0) */
unreliable tr (or 0) */ struct timeval timer_d_start; /**< Timer D */
struct timeval timer_d_start; char *destination; /**< IP used to send requ
/**@intern ests */
al should be equal to timer H */ int port; /**< port of next hop */
char *destination; /**@internal url used to s };
end requests */
int port; /**@internal port
of next hop */
};
/** /**
* Structure for NON-INVITE CLIENT TRANSACTION (outgoing NON-INVITE transac tion). * Structure for NON-INVITE CLIENT TRANSACTION (outgoing NON-INVITE transac tion).
* @var osip_nict_t * @var osip_nict_t
*/ */
typedef struct osip_nict osip_nict_t; typedef struct osip_nict osip_nict_t;
/** /**
* Structure for NON-INVITE CLIENT TRANSACTION. * Structure for NON-INVITE CLIENT TRANSACTION.
* @struct osip_nict * @struct osip_nict
*/ */
struct osip_nict { struct osip_nict {
int timer_e_length; /**@internal A=T1, A=2xT1. int timer_e_length; /**< Timer E A=T1, A=2xT1
.. (unreliable only) */ ... (unreliable only) */
struct timeval timer_e_start; struct timeval timer_e_start; /**< Timer E (retransmiss
/**@intern ion) */
al */ int timer_f_length; /**< Timer F B = 64* T1 *
int timer_f_length; /**@internal B = 64* T1 */ /
struct timeval timer_f_start; struct timeval timer_f_start; /**< Timer F (fire when t
/**@intern ransaction timeout) */
al fire when transaction timeouts */ int timer_k_length; /**< Timer K K = T4 (else
int timer_k_length; /**@internal K = T4 (else = 0) */
= 0) */ struct timeval timer_k_start; /**< Timer K */
struct timeval timer_k_start; char *destination; /**< IP used to send requ
/**@intern ests */
al */ int port; /**< port of next hop */
char *destination; /**@internal url used to s
end requests */
int port; /**@internal port
of next hop */
}; };
/** /**
* Structure for INVITE SERVER TRANSACTION (incoming INVITE transaction). * Structure for INVITE SERVER TRANSACTION (incoming INVITE transaction).
* @var osip_ist_t * @var osip_ist_t
*/ */
typedef struct osip_ist osip_ist_t; typedef struct osip_ist osip_ist_t;
/** /**
* Structure for INVITE SERVER TRANSACTION. * Structure for INVITE SERVER TRANSACTION.
* @struct osip_ist * @struct osip_ist
*/ */
struct osip_ist { struct osip_ist {
int timer_g_length; /**@internal G=MIN(T1*2,T2) for unr int timer_g_length; /**< Timer G G=MIN(T1*2,T
eliable trans. */ 2) for unreliable trans. */
struct timeval timer_g_start; struct timeval timer_g_start; /**< Timer G (0 when reli
/**@intern able transport is used) */
al 0 when reliable transport is used */ int timer_h_length; /**< Timer H H = 64* T1 *
int timer_h_length; /**@internal H = 64* T1 */ /
struct timeval timer_h_start; struct timeval timer_h_start; /**< Timer H (fire if no
/**@intern ACK is received) */
al fire when if no ACK is received */ int timer_i_length; /**< Timer I I = T4 for u
int timer_i_length; /**@internal I = T4 for un nreliable (or 0) */
reliable (or 0) */ struct timeval timer_i_start; /**< Timer I (absorb all
struct timeval timer_i_start; ACK) */
/**@intern };
al absorb all ACK */
};
/** /**
* Structure for NON-INVITE SERVER TRANSACTION (incoming SERVER transaction ). * Structure for NON-INVITE SERVER TRANSACTION (incoming SERVER transaction ).
* @var osip_nist_t * @var osip_nist_t
*/ */
typedef struct osip_nist osip_nist_t; typedef struct osip_nist osip_nist_t;
/** /**
* Structure for NON-INVITE SERVER TRANSACTION. * Structure for NON-INVITE SERVER TRANSACTION.
* @struct osip_nist * @struct osip_nist
*/ */
struct osip_nist { struct osip_nist {
int timer_j_length; /**@internal J = 64*T1 (e int timer_j_length; /**< Timer J = 64*T1 (el
lse 0) */ se 0) */
struct timeval timer_j_start; struct timeval timer_j_start; /**< Timer J */
/**@inter };
nal */
};
/** /**
* Structure for SRV record entry. * Structure for SRV record entry.
* @var osip_srv_entry_t * @var osip_srv_entry_t
*/ */
typedef struct osip_srv_entry osip_srv_entry_t; typedef struct osip_srv_entry osip_srv_entry_t;
/** /**
* Structure for SRV record entry. * Structure for SRV record entry.
* @struct osip_srv_entry * @struct osip_srv_entry
*/ */
struct osip_srv_entry { struct osip_srv_entry {
char srv[512]; char srv[512]; /**< srv */
int priority; int priority; /**< priority */
int weight; int weight; /**< weight */
int rweight; int rweight; /**< rweight */
int port; int port; /**< port */
char ipaddress[512]; char ipaddress[512]; /**< ipaddress result */
}; };
#define OSIP_SRV_STATE_UNKNOWN 0 #define OSIP_SRV_STATE_UNKNOWN 0 /**< unknown */
/* #define OSIP_SRV_STATE_INPROGRESS 1 */ #define OSIP_SRV_STATE_RETRYLATER 2 /**< retry later */
#define OSIP_SRV_STATE_RETRYLATER 2 #define OSIP_SRV_STATE_COMPLETED 3 /**< completed */
#define OSIP_SRV_STATE_COMPLETED 3 #define OSIP_SRV_STATE_NOTSUPPORTED 4 /**< not supported */
#define OSIP_SRV_STATE_NOTSUPPORTED 4
/** /**
* Structure for SRV record. * Structure for SRV record.
* @var osip_srv_record_t * @var osip_srv_record_t
*/ */
typedef struct osip_srv_record osip_srv_record_t; typedef struct osip_srv_record osip_srv_record_t;
/** /**
* Structure for SRV record entry. * Structure for SRV record entry.
* @struct osip_srv_record * @struct osip_srv_record
*/ */
struct osip_srv_record { struct osip_srv_record {
char name[512]; char name[512]; /**< name */
int srv_state; int srv_state; /**< srv state */
char protocol[64]; char protocol[64]; /**< transport protocol*/
int order; int order; /**< order */
int preference; int preference; /**< preference */
int index; int index; /**< index */
osip_srv_entry_t srventry[10]; osip_srv_entry_t srventry[10]; /**< result table */
}; };
#define OSIP_NAPTR_STATE_UNKNOWN 0 #define OSIP_NAPTR_STATE_UNKNOWN 0 /**< unknown */
#define OSIP_NAPTR_STATE_INPROGRESS 1 #define OSIP_NAPTR_STATE_INPROGRESS 1 /**< in progress */
#define OSIP_NAPTR_STATE_NAPTRDONE 2 #define OSIP_NAPTR_STATE_NAPTRDONE 2 /**< naptr done */
#define OSIP_NAPTR_STATE_SRVINPROGRESS 3 #define OSIP_NAPTR_STATE_SRVINPROGRESS 3 /**< srv in progress */
#define OSIP_NAPTR_STATE_SRVDONE 4 #define OSIP_NAPTR_STATE_SRVDONE 4 /**< srv done */
#define OSIP_NAPTR_STATE_RETRYLATER 5 #define OSIP_NAPTR_STATE_RETRYLATER 5 /**< retry later */
#define OSIP_NAPTR_STATE_NOTSUPPORTED 6 #define OSIP_NAPTR_STATE_NOTSUPPORTED 6 /**< not supported */
/** /**
* Structure for NAPTR record. * Structure for NAPTR record.
* @var osip_naptr_t * @var osip_naptr_t
*/ */
typedef struct osip_naptr osip_naptr_t; typedef struct osip_naptr osip_naptr_t;
/** /**
* Structure for NAPTR record entry. * Structure for NAPTR record entry.
* @struct osip_naptr * @struct osip_naptr
*/ */
struct osip_naptr { struct osip_naptr {
char domain[512]; char domain[512]; /**< domain */
int naptr_state; int naptr_state; /**< naptr state */
void *arg; void *arg; /**< arg */
int keep_in_cache; int keep_in_cache; /**< keep in cache value */
struct osip_srv_record sipudp_record; struct osip_srv_record sipudp_record; /**< udp SRV result */
struct osip_srv_record siptcp_record; struct osip_srv_record siptcp_record; /**< tcp SRV result */
struct osip_srv_record siptls_record; struct osip_srv_record siptls_record; /**< tls SRV result */
struct osip_srv_record sipdtls_record; struct osip_srv_record sipdtls_record; /**< dtls SRV result */
struct osip_srv_record sipsctp_record; struct osip_srv_record sipsctp_record; /**< sctp SRV result */
}; };
/** /**
* 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 Id int transactionid; /**< Internal Transaction Identifie
entifier. */ r. */
osip_fifo_t *transactionff; osip_fifo_t *transactionff; /**< events must be added in this f
/**< events ifo */
must be added in this fifo */
osip_via_t *topvia; /**< CALL-LEG definition (Top Via)
osip_via_t *topvia; /**< CALL-LEG definition (To */
p Via) */ osip_from_t *from; /**< CALL-LEG definition (From)
osip_from_t *from; /**< CALL-LEG definition (Fr */
om) */ 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 (CS */
eq) */
osip_message_t *orig_request; /**< Initial request */
osip_message_t *orig_request; osip_message_t *last_response; /**< Last response */
/**< Init osip_message_t *ack; /**< ack request sent */
ial request */
osip_message_t *last_response; state_t state; /**< Current state of the transacti
/**< Last on */
response */
osip_message_t *ack; /**< ack request sent * time_t birth_time; /**< birth date of transaction
/ */
time_t completed_time; /**< end date of transaction
state_t state; /**< Current state of the tr */
ansaction */
int in_socket; /**< Optional socket for incoming m
time_t birth_time; /**< birth date of transacti essage */
on */ int out_socket; /**< Optional place for outgoing me
time_t completed_time; /**< end date of transaction ssage */
*/
void *config; /**< (internal) transaction is mana
int in_socket; /**< Optional socket for inc ged by osip_t */
oming message */
int out_socket; /**< Optional place for outg osip_fsm_type_t ctx_type; /**< Type of the transaction */
oing message */ osip_ict_t *ict_context; /**< internal ict context */
osip_ist_t *ist_context; /**< internal ist context */
void *config; /**@internal transaction is osip_nict_t *nict_context; /**< internal nict context */
managed by osip_t */ osip_nist_t *nist_context; /**< internal nist context */
osip_fsm_type_t ctx_type; osip_srv_record_t record; /**< memory space for SRV record */
/**< Type of osip_naptr_t *naptr_record; /**< memory space for NAPTR record
the transaction */ */
osip_ict_t *ict_context;/**@internal */ void *reserved1; /**< User Defined Pointer. */
osip_ist_t *ist_context;/**@internal */ void *reserved2; /**< User Defined Pointer. */
osip_nict_t *nict_context; void *reserved3; /**< User Defined Pointer. */
/**@internal void *reserved4; /**< User Defined Pointer. */
*/ void *reserved5; /**< User Defined Pointer. */
osip_nist_t *nist_context; void *reserved6; /**< User Defined Pointer. */
/**@internal };
*/
osip_srv_record_t record;
osip_naptr_t *naptr_record;
/**@internal
*/
};
/** /**
* Enumeration for callback type. * Enumeration for callback type.
*/ */
typedef enum osip_message_callback_type { typedef enum osip_message_callback_type {
OSIP_ICT_INVITE_SENT = 0, /**< INVITE OSIP_ICT_INVITE_SENT = 0, /**< INVITE MESSAGE
MESSAGE SENT */ SENT */
OSIP_ICT_INVITE_SENT_AGAIN, /**< INVITE OSIP_ICT_INVITE_SENT_AGAIN, /**< INVITE MESSAGE
MESSAGE RETRANSMITTED */ RETRANSMITTED */
OSIP_ICT_ACK_SENT, /**< OSIP_ICT_ACK_SENT, /**< ACK MESSAGE SE
ACK MESSAGE SENT */ NT */
OSIP_ICT_ACK_SENT_AGAIN, /**< ACK MES OSIP_ICT_ACK_SENT_AGAIN, /**< ACK MESSAGE RE
SAGE RETRANSMITTED */ TRANSMITTED */
OSIP_ICT_STATUS_1XX_RECEIVED, /**< 1XX FOR INVITE OSIP_ICT_STATUS_1XX_RECEIVED, /**< 1XX FOR INVITE
RECEIVED */ RECEIVED */
OSIP_ICT_STATUS_2XX_RECEIVED, /**< 2XX FOR INVITE OSIP_ICT_STATUS_2XX_RECEIVED, /**< 2XX FOR INVITE
RECEIVED */ RECEIVED */
OSIP_ICT_STATUS_2XX_RECEIVED_AGAIN, /**< 2XX FOR INVITE OSIP_ICT_STATUS_2XX_RECEIVED_AGAIN, /**< 2XX FOR INVITE
RECEIVED AGAIN */ RECEIVED AGAIN */
OSIP_ICT_STATUS_3XX_RECEIVED, /**< 3XX FOR INVITE OSIP_ICT_STATUS_3XX_RECEIVED, /**< 3XX FOR INVITE
RECEIVED */ RECEIVED */
OSIP_ICT_STATUS_4XX_RECEIVED, /**< 4XX FOR INVITE OSIP_ICT_STATUS_4XX_RECEIVED, /**< 4XX FOR INVITE
RECEIVED */ RECEIVED */
OSIP_ICT_STATUS_5XX_RECEIVED, /**< 5XX FOR INVITE OSIP_ICT_STATUS_5XX_RECEIVED, /**< 5XX FOR INVITE
RECEIVED */ RECEIVED */
OSIP_ICT_STATUS_6XX_RECEIVED, /**< 6XX FOR INVITE OSIP_ICT_STATUS_6XX_RECEIVED, /**< 6XX FOR INVITE
RECEIVED */ RECEIVED */
OSIP_ICT_STATUS_3456XX_RECEIVED_AGAIN, OSIP_ICT_STATUS_3456XX_RECEIVED_AGAIN, /**< RESPONSE RECEI
VED AGAIN */
/**< RESPONSE RECEIVED AGAIN */
OSIP_IST_INVITE_RECEIVED, /**< INVITE MESSAGE
OSIP_IST_INVITE_RECEIVED, /**< INVITE RECEIVED */
MESSAGE RECEIVED */ OSIP_IST_INVITE_RECEIVED_AGAIN, /**< INVITE MESSAGE
OSIP_IST_INVITE_RECEIVED_AGAIN, /**< INVITE MESSAGE RECEIVED AGAN */
RECEIVED AGAN */ OSIP_IST_ACK_RECEIVED, /**< ACK MESSAGE RE
OSIP_IST_ACK_RECEIVED, /**< ACK MES CEIVED */
SAGE RECEIVED */ OSIP_IST_ACK_RECEIVED_AGAIN, /**< ACK MESSAGE RE
OSIP_IST_ACK_RECEIVED_AGAIN, /**< ACK MESSAGE REC CEIVED AGAIN */
EIVED AGAIN */ OSIP_IST_STATUS_1XX_SENT, /**< 1XX FOR INVITE
OSIP_IST_STATUS_1XX_SENT, /**< 1XX FOR SENT */
INVITE SENT */ OSIP_IST_STATUS_2XX_SENT, /**< 2XX FOR INVITE
OSIP_IST_STATUS_2XX_SENT, /**< 2XX FOR SENT */
INVITE SENT */ OSIP_IST_STATUS_2XX_SENT_AGAIN, /**< 2XX FOR INVITE
OSIP_IST_STATUS_2XX_SENT_AGAIN, /**< 2XX FOR INVITE RETRANSMITTED */
RETRANSMITTED */ OSIP_IST_STATUS_3XX_SENT, /**< 3XX FOR INVITE
OSIP_IST_STATUS_3XX_SENT, /**< 3XX FOR SENT */
INVITE SENT */ OSIP_IST_STATUS_4XX_SENT, /**< 4XX FOR INVITE
OSIP_IST_STATUS_4XX_SENT, /**< 4XX FOR SENT */
INVITE SENT */ OSIP_IST_STATUS_5XX_SENT, /**< 5XX FOR INVITE
OSIP_IST_STATUS_5XX_SENT, /**< 5XX FOR SENT */
INVITE SENT */ OSIP_IST_STATUS_6XX_SENT, /**< 6XX FOR INVITE
OSIP_IST_STATUS_6XX_SENT, /**< 6XX FOR SENT */
INVITE SENT */ OSIP_IST_STATUS_3456XX_SENT_AGAIN, /**< RESPONSE RETRA
OSIP_IST_STATUS_3456XX_SENT_AGAIN, /**< RESPONSE RETRAN NSMITTED */
SMITTED */
OSIP_NICT_REGISTER_SENT, /**< REGISTER MESSA
OSIP_NICT_REGISTER_SENT, /**< REGISTE GE SENT */
R MESSAGE SENT */ OSIP_NICT_BYE_SENT, /**< BYE MESSAGE SE
OSIP_NICT_BYE_SENT, /**< NT */
BYE MESSAGE SENT */ OSIP_NICT_OPTIONS_SENT, /**< OPTIONS MESSAG
OSIP_NICT_OPTIONS_SENT, /**< OPTIONS E SENT */
MESSAGE SENT */ OSIP_NICT_INFO_SENT, /**< INFO MESSAGE S
OSIP_NICT_INFO_SENT, /**< INFO ME ENT */
SSAGE SENT */ OSIP_NICT_CANCEL_SENT, /**< CANCEL MESSAGE
OSIP_NICT_CANCEL_SENT, /**< CANCEL SENT */
MESSAGE SENT */ OSIP_NICT_NOTIFY_SENT, /**< NOTIFY MESSAGE
OSIP_NICT_NOTIFY_SENT, /**< NOTIFY SENT */
MESSAGE SENT */ OSIP_NICT_SUBSCRIBE_SENT, /**< SUBSCRIBE MESS
OSIP_NICT_SUBSCRIBE_SENT, /**< SUBSCRI AGE SENT */
BE MESSAGE SENT */ OSIP_NICT_UNKNOWN_REQUEST_SENT, /**< UNKNOWN REQUES
OSIP_NICT_UNKNOWN_REQUEST_SENT, /**< UNKNOWN REQUEST T MESSAGE SENT */
MESSAGE SENT */ OSIP_NICT_REQUEST_SENT_AGAIN, /**< REQUEST MESSAG
OSIP_NICT_REQUEST_SENT_AGAIN, /**< REQUEST MESSAGE E RETRANMITTED */
RETRANMITTED */ OSIP_NICT_STATUS_1XX_RECEIVED, /**< 1XX FOR MESSAG
OSIP_NICT_STATUS_1XX_RECEIVED, /**< 1XX FOR MESSAGE E RECEIVED */
RECEIVED */ OSIP_NICT_STATUS_2XX_RECEIVED, /**< 2XX FOR MESSAG
OSIP_NICT_STATUS_2XX_RECEIVED, /**< 2XX FOR MESSAGE E RECEIVED */
RECEIVED */ OSIP_NICT_STATUS_2XX_RECEIVED_AGAIN, /**< 2XX FOR MESSAG
OSIP_NICT_STATUS_2XX_RECEIVED_AGAIN,/**< 2XX FOR MESSAGE REC E RECEIVED AGAIN */
EIVED AGAIN */ OSIP_NICT_STATUS_3XX_RECEIVED, /**< 3XX FOR MESSAG
OSIP_NICT_STATUS_3XX_RECEIVED, /**< 3XX FOR MESSAGE E RECEIVED */
RECEIVED */ OSIP_NICT_STATUS_4XX_RECEIVED, /**< 4XX FOR MESSAG
OSIP_NICT_STATUS_4XX_RECEIVED, /**< 4XX FOR MESSAGE E RECEIVED */
RECEIVED */ OSIP_NICT_STATUS_5XX_RECEIVED, /**< 5XX FOR MESSAG
OSIP_NICT_STATUS_5XX_RECEIVED, /**< 5XX FOR MESSAGE E RECEIVED */
RECEIVED */ OSIP_NICT_STATUS_6XX_RECEIVED, /**< 6XX FOR MESSAG
OSIP_NICT_STATUS_6XX_RECEIVED, /**< 6XX FOR MESSAGE E RECEIVED */
RECEIVED */ OSIP_NICT_STATUS_3456XX_RECEIVED_AGAIN, /**< RESPONSE RECEI
OSIP_NICT_STATUS_3456XX_RECEIVED_AGAIN, VED AGAIN */
/**< RESPONSE RECEIVED AGAIN */ OSIP_NIST_REGISTER_RECEIVED, /**< REGISTER RECEI
VED */
OSIP_NIST_REGISTER_RECEIVED, /**< REGISTER RECEIV OSIP_NIST_BYE_RECEIVED, /**< BYE RECEIVED *
ED */ /
OSIP_NIST_BYE_RECEIVED, /**< BYE REC OSIP_NIST_OPTIONS_RECEIVED, /**< OPTIONS RECEIV
EIVED */ ED */
OSIP_NIST_OPTIONS_RECEIVED, /**< OPTIONS OSIP_NIST_INFO_RECEIVED, /**< INFO RECEIVED
RECEIVED */ */
OSIP_NIST_INFO_RECEIVED, /**< INFO RE OSIP_NIST_CANCEL_RECEIVED, /**< CANCEL RECEIVE
CEIVED */ D */
OSIP_NIST_CANCEL_RECEIVED, /**< CANCEL OSIP_NIST_NOTIFY_RECEIVED, /**< NOTIFY RECEIVE
RECEIVED */ D */
OSIP_NIST_NOTIFY_RECEIVED, /**< NOTIFY OSIP_NIST_SUBSCRIBE_RECEIVED, /**< SUBSCRIBE RECE
RECEIVED */ IVED */
OSIP_NIST_SUBSCRIBE_RECEIVED, /**< SUBSCRIBE RECEI
VED */ OSIP_NIST_UNKNOWN_REQUEST_RECEIVED, /**< UNKNWON REQUES
T RECEIVED */
OSIP_NIST_UNKNOWN_REQUEST_RECEIVED, /**< UNKNWON REQUEST OSIP_NIST_REQUEST_RECEIVED_AGAIN, /**< UNKNWON REQUES
RECEIVED */ T RECEIVED AGAIN */
OSIP_NIST_REQUEST_RECEIVED_AGAIN, /**< UNKNWON REQUEST OSIP_NIST_STATUS_1XX_SENT, /**< 1XX FOR MESSAG
RECEIVED AGAIN */ E SENT */
OSIP_NIST_STATUS_1XX_SENT, /**< 1XX FOR OSIP_NIST_STATUS_2XX_SENT, /**< 2XX FOR MESSAG
MESSAGE SENT */ E SENT */
OSIP_NIST_STATUS_2XX_SENT, /**< 2XX FOR OSIP_NIST_STATUS_2XX_SENT_AGAIN, /**< 2XX FOR MESSAG
MESSAGE SENT */ E RETRANSMITTED */
OSIP_NIST_STATUS_2XX_SENT_AGAIN, /**< 2XX FOR MESSAGE OSIP_NIST_STATUS_3XX_SENT, /**< 3XX FOR MESSAG
RETRANSMITTED */ E SENT */
OSIP_NIST_STATUS_3XX_SENT, /**< 3XX FOR OSIP_NIST_STATUS_4XX_SENT, /**< 4XX FOR MESSAG
MESSAGE SENT */ E SENT */
OSIP_NIST_STATUS_4XX_SENT, /**< 4XX FOR OSIP_NIST_STATUS_5XX_SENT, /**< 5XX FOR MESSAG
MESSAGE SENT */ E SENT */
OSIP_NIST_STATUS_5XX_SENT, /**< 5XX FOR OSIP_NIST_STATUS_6XX_SENT, /**< 6XX FOR MESSAG
MESSAGE SENT */ E SENT */
OSIP_NIST_STATUS_6XX_SENT, /**< 6XX FOR OSIP_NIST_STATUS_3456XX_SENT_AGAIN, /**< RESPONSE RETRA
MESSAGE SENT */ NSMITTED */
OSIP_NIST_STATUS_3456XX_SENT_AGAIN, /**< RESPONSE RETRAN
SMITTED */
OSIP_ICT_STATUS_TIMEOUT, /**< TIMER B OSIP_ICT_STATUS_TIMEOUT, /**< TIMER B EXPIRA
EXPIRATION: NO REMOTE ANSWER */ TION: NO REMOTE ANSWER */
OSIP_NICT_STATUS_TIMEOUT, /**< TIMER F OSIP_NICT_STATUS_TIMEOUT, /**< TIMER F EXPIRA
EXPIRATION: NO REMOTE ANSWER */ TION: NO REMOTE ANSWER */
OSIP_MESSAGE_CALLBACK_COUNT /**< END OF OSIP_MESSAGE_CALLBACK_COUNT /**< END OF ENUM */
ENUM */ } osip_message_callback_type_t;
} osip_message_callback_type_t;
/** /**
* Enumeration for callback type used when transaction is over. * Enumeration for callback type used when transaction is over.
*/ */
typedef enum osip_kill_callback_type { typedef enum osip_kill_callback_type {
OSIP_ICT_KILL_TRANSACTION, /**< end of Client INVITE tr OSIP_ICT_KILL_TRANSACTION, /**< end of Client INVITE t
ansaction */ ransaction */
OSIP_IST_KILL_TRANSACTION, /**< end of Server INVITE tr OSIP_IST_KILL_TRANSACTION, /**< end of Server INVITE t
ansaction */ ransaction */
OSIP_NICT_KILL_TRANSACTION, /**< end of Client Non-INVIT OSIP_NICT_KILL_TRANSACTION, /**< end of Client Non-INVI
E transaction */ TE transaction */
OSIP_NIST_KILL_TRANSACTION, /**< end of Server Non-INVIT OSIP_NIST_KILL_TRANSACTION, /**< end of Server Non-INVI
E transaction */ TE transaction */
OSIP_KILL_CALLBACK_COUNT /**< END OF ENUM */ OSIP_KILL_CALLBACK_COUNT /**< END OF ENUM */
} osip_kill_callback_type_t; } osip_kill_callback_type_t;
/** /**
* Enumeration for callback type used when a transport error is detected. * Enumeration for callback type used when a transport error is detected.
* @var osip_transport_error_callback_type_t
*/ */
typedef enum osip_transport_error_callback_type { typedef enum osip_transport_error_callback_type {
OSIP_ICT_TRANSPORT_ERROR, /**< transport err OSIP_ICT_TRANSPORT_ERROR, /**< transport er
or for ICT */ ror for ICT */
OSIP_IST_TRANSPORT_ERROR, /**< transport err OSIP_IST_TRANSPORT_ERROR, /**< transport er
or for IST */ ror for IST */
OSIP_NICT_TRANSPORT_ERROR, /**< transport err OSIP_NICT_TRANSPORT_ERROR, /**< transport er
or for NICT */ ror for NICT */
OSIP_NIST_TRANSPORT_ERROR, /**< transport err OSIP_NIST_TRANSPORT_ERROR, /**< transport er
or for NIST */ ror for NIST */
OSIP_TRANSPORT_ERROR_CALLBACK_COUNT OSIP_TRANSPORT_ERROR_CALLBACK_COUNT /**< END OF ENUM
*/
/**< 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_m
o essage_t *);
sip_message_t *);
/** /**
* Callback definition for end of transaction announcements. * Callback definition for end of transaction announcements.
* @var osip_kill_transaction_cb_t * @var osip_kill_transaction_cb_t
*/ */
typedef void (*osip_kill_transaction_cb_t) (int type, osip_transacti on_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_transactio typedef void (*osip_transport_error_cb_t) (int type, osip_transaction_t *
n_t *, , int error);
int error);
struct osip_dialog; struct osip_dialog;
/** /**
* Structure for 2XX retransmission management. * Structure for 2XX retransmission management.
* @var ixt_t * @var ixt_t
*/ */
typedef struct ixt_t ixt_t; typedef struct ixt ixt_t;
/** /**
* Structure for 2XX retransmission management. * Structure for 2XX retransmission management.
* @struct ixt * @struct ixt
*/ */
struct ixt_t { struct ixt {
/* any ACK received that match this context will set counter /* any ACK received that match this context will set counter to -1 */
to -1 */ struct osip_dialog *dialog; /**< related dialog */
struct osip_dialog *dialog; osip_message_t *msg2xx; /**< buffer to retransmit */
/**< related osip_message_t *ack; /**< ack message if needed */
dialog */ struct timeval start; /**< Time of first retransmission *
osip_message_t *msg2xx; /**< buffer to retransmit */ /
osip_message_t *ack; /**< ack message if needed */ int interval; /**< delay between retransmission,
struct timeval start; /**< Time of first retransmission */ in ms */
int interval; /**< delay between retransmi char *dest; /**< destination host */
ssion, in ms */ int port; /**< destination port */
char *dest; /**< destination hos int sock; /**< socket to use */
t */ int counter; /**< start at 7 */
int port; /**< destination por };
t */
int sock; /**< socket to use *
/
int counter; /**< start at 7 */
};
/** /**
* Structure for osip handling. * Structure for osip handling.
* In order to use osip, you have to manage at least one global instance * In order to use osip, you have to manage at least one global instance
* of an osip_t element. Then, you'll register a set of required callbacks * of an osip_t element. Then, you'll register a set of required callbacks
* and a set of optional ones. * and a set of optional ones.
* @var osip_t * @var osip_t
*/ */
typedef struct osip osip_t; typedef struct osip osip_t;
/** /**
* Structure for osip handling. * Structure for osip handling.
* @struct osip * @struct osip
*/ */
struct osip { struct osip {
void *application_context; /**< User defined Pointer */
void *application_context; void *ict_fastmutex; /**< mutex for ICT transaction */
/**< User de void *ist_fastmutex; /**< mutex for IST transaction */
fined Pointer */ void *nict_fastmutex; /**< mutex for NICT transaction */
void *nist_fastmutex; /**< mutex for NIST transaction */
void *ixt_fastmutex; /**< mutex for IXT transaction */
void *id_mutex; /**< mutex for unique transaction id gen
eration */
int transactionid; /**< previous unique transaction id gene
ration */
/* list of transactions for ict, ist, nict, nist */
osip_list_t osip_ict_transactions; /**< list of ict transactio
ns */
osip_list_t osip_ist_transactions; /**< list of ist transactio
ns */
osip_list_t osip_nict_transactions; /**< list of nict transacti
ons */
osip_list_t osip_nist_transactions; /**< list of nist transacti
ons */
osip_list_t ixt_retransmissions; /**< list of ixt elements *
/
osip_message_cb_t msg_callbacks[OSIP_MESSAGE_CALLBACK_COUNT];
/**< message callbacks */
osip_kill_transaction_cb_t kill_callbacks[OSIP_KILL_CALLBACK_COUNT];
/**< kill callbacks */
osip_transport_error_cb_t tp_error_callbacks[OSIP_TRANSPORT_ERROR_CALLB
ACK_COUNT]; /**< transport error callback */
/* list of transactions for ict, ist, nict, nist */ int (*cb_send_message) (osip_transaction_t *, osip_message_t *, char *,
osip_list_t osip_ict_transactions; int, int); /**< callback to send message */
/**< list of ict transactions */
osip_list_t osip_ist_transactions;
/**< list of ist transactions */
osip_list_t osip_nict_transactions;
/**< list of nict transactions */
osip_list_t osip_nist_transactions;
/**< list of nist transactions */
osip_list_t ixt_retransmissions;/**< list of ixt elements */
osip_message_cb_t msg_callbacks[OSIP_MESSAGE_CALLBACK_COUNT]
; /**@internal */
osip_kill_transaction_cb_t kill_callbacks[OSIP_KILL_CALLBACK
_COUNT];
/**@in
ternal */
osip_transport_error_cb_t
tp_error_callbacks[OSIP_TRANSPORT_ERROR_CALLBACK_COU
NT];
/**@internal */
int (*cb_send_message) (osip_transaction_t *, osip_message_t
*, char *,
int, int);
/**@internal */
#if defined(HAVE_DICT_DICT_H) #if defined(HAVE_DICT_DICT_H)
dict *osip_ict_hastable; /**< htable of ict dict *osip_ict_hastable; /**< htable of ic
transactions */ t transactions */
dict *osip_ist_hastable; /**< htable of ist dict *osip_ist_hastable; /**< htable of is
transactions */ t transactions */
dict *osip_nict_hastable; /**< htable of nic dict *osip_nict_hastable; /**< htable of ni
t transactions */ ct transactions */
dict *osip_nist_hastable; /**< htable of nis dict *osip_nist_hastable; /**< htable of ni
t transactions */ st transactions */
#endif #endif
}; };
/** /**
* Set a callback for each transaction operation. * Set a callback for each transaction operation.
* @param osip The element to work on. * @param osip The element to work on.
* @param type The event type to hook on. * @param type The event type to hook on.
* @param cb The method to be called upon the event. * @param cb The method to be called upon the event.
*/ */
int osip_set_message_callback(osip_t * osip, int type, osip_message_ cb_t cb); int osip_set_message_callback (osip_t * osip, int type, osip_message_cb_t cb);
/** /**
* Set a callback for transaction operation related to the end of transacti ons. * Set a callback for transaction operation related to the end of transacti ons.
* @param osip The element to work on. * @param osip The element to work on.
* @param type The event type to hook on. * @param type The event type to hook on.
* @param cb The method to be called upon the event. * @param cb The method to be called upon the event.
*/ */
int osip_set_kill_transaction_callback(osip_t * osip, int type, int osip_set_kill_transaction_callback (osip_t * osip, int type, osip_kil
l_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_tran
sport_error_cb_t cb);
osip_transport_error_cb_t cb);
/** /**
* Structure for osip event handling. * Structure for osip event handling.
* A osip_event_t element will have a type and will be related * A osip_event_t element will have a type and will be related
* to a transaction. In the general case, it is used by the * to a transaction. In the general case, it is used by the
* application layer to give SIP messages to the oSIP finite * application layer to give SIP messages to the oSIP finite
* state machine. * state machine.
* @var osip_event_t * @var osip_event_t
*/ */
typedef struct osip_event osip_event_t; typedef struct osip_event osip_event_t;
/** /**
* Structure for osip event handling. * Structure for osip event handling.
* @struct osip_event * @struct osip_event
*/ */
struct osip_event { struct osip_event {
type_t type; /**< Event Type */ type_t type; /**< Event Type */
int transactionid; /**< identifier of the related osip int transactionid; /**< identifier of the related osip tr
transaction */ ansaction */
osip_message_t *sip; /**< SIP message (optional) */ osip_message_t *sip; /**< SIP message (optional) */
}; };
/** /**
* Allocate an osip_transaction_t element. * Allocate an osip_transaction_t element.
* @param transaction The element to allocate. * @param transaction The element to allocate.
* @param ctx_type The type of transaction. (ICT, IST, NICT, NIST) * @param ctx_type The type of transaction. (ICT, IST, NICT, NIST)
* @param osip The global instance of oSIP. * @param osip The global instance of oSIP.
* @param request The SIP request that initiate the transaction. * @param request The SIP request that initiate the transaction.
*/ */
int osip_transaction_init(osip_transaction_t ** transaction, int osip_transaction_init (osip_transaction_t ** transaction, osip_fsm_ty
osip_fsm_type_t ct pe_t ctx_type, osip_t * osip, osip_message_t * request);
x_type, osip_t * osip,
osip_message_t * r
equest);
/** /**
* Free all resource in a osip_transaction_t element. * Free all resource in a osip_transaction_t element.
* @param transaction The element to free. * @param transaction The element to free.
*/ */
int osip_transaction_free(osip_transaction_t * transaction); int osip_transaction_free (osip_transaction_t * transaction);
/** /**
* Free all resource in a osip_transaction_t element. * Free all resource in a osip_transaction_t element.
* This method does the same than osip_transaction_free() but it assumes * This method does the same than osip_transaction_free() but it assumes
* that the transaction is already removed from the list of transaction * that the transaction is already removed from the list of transaction
* in the osip stack. (to remove it use osip_xixt_remove(osip, transaction) ; * in the osip stack. (to remove it use osip_xixt_remove(osip, transaction) ;
* @param transaction The element to free. * @param transaction The element to free.
*/ */
int osip_transaction_free2(osip_transaction_t * transaction); int osip_transaction_free2 (osip_transaction_t * transaction);
/** /**
* Search in a SIP response the destination where the message * Search in a SIP response the destination where the message
* should be sent. * should be sent.
* @param response the message to work on. * @param response the message to work on.
* @param address a pointer to receive the allocated host address. * @param address a pointer to receive the allocated host address.
* @param portnum a pointer to receive the host port. * @param portnum a pointer to receive the host port.
*/ */
void osip_response_get_destination(osip_message_t * response, void osip_response_get_destination (osip_message_t * response, char **add
c ress, int *portnum);
har **address, int *portnum);
/** /**
* Set the host and port destination used for sending the SIP message. * Set the host and port destination used for sending the SIP message.
* This can be useful for an application with 'DIRECT ROOTING MODE' * This can be useful for an application with 'DIRECT ROOTING MODE'
* NOTE: Instead, you should use the 'Route' header facility which * NOTE: Instead, you should use the 'Route' header facility which
* leads to the same behaviour. * leads to the same behaviour.
* @param ict The element to work on. * @param ict The element to work on.
* @param destination The destination host. * @param destination The destination host.
* @param port The destination port. * @param port The destination port.
*/ */
int osip_ict_set_destination(osip_ict_t * ict, char *destination, in t port); int osip_ict_set_destination (osip_ict_t * ict, char *destination, int po 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 port); int osip_nict_set_destination (osip_nict_t * nict, char *destination, int port);
/** /**
* Add a SIP event in the fifo of a osip_transaction_t element. * Add a SIP event in the fifo of a osip_transaction_t element.
* @param transaction The element to work on. * @param transaction The element to work on.
* @param evt The event to add. * @param evt The event to add.
*/ */
int osip_transaction_add_event(osip_transaction_t * transaction, int osip_transaction_add_event (osip_transaction_t * transaction, osip_ev
osip_even ent_t * evt);
t_t * evt);
/** /**
* Consume one osip_event_t element previously added in the fifo. * Consume one osip_event_t element previously added in the fifo.
* NOTE: This method MUST NEVER be called within another call * NOTE: This method MUST NEVER be called within another call
* of this method. (For example, you can't call osip_transaction_execute() * of this method. (For example, you can't call osip_transaction_execute()
* in a callback registered in the osip_t element.) * in a callback registered in the osip_t element.)
* @param transaction The element to free. * @param transaction The element to free.
* @param evt The element to consume. * @param evt The element to consume.
*/ */
int osip_transaction_execute(osip_transaction_t * transaction, int osip_transaction_execute (osip_transaction_t * transaction, osip_even
osip_event_ t_t * evt);
t * evt);
/** /**
* Set a pointer to your personal context associated with this transaction. * Set a pointer to your personal context associated with this transaction.
* OBSOLETE: see osip_transaction_set_reserved1...
* NOTE: this is a very useful method that allow you to avoid searching * 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 ptr The address of your context.
*/
int osip_transaction_set_your_instance (osip_transaction_t * transaction,
void *ptr);
/**
* Set a pointer to your personal context associated with this transaction.
* NOTE: this is a very useful method that allow you to avoid searching
* for your personal context inside the registered callbacks.
* You can initialise this pointer to your context right after
* the creation of the osip_transaction_t element. Then, you'll be
* able to get the address of your context by calling
* osip_transaction_get_reserved1().
* @param transaction The element to work on.
* @param ptr The address of your context.
*/
int osip_transaction_set_reserved1 (osip_transaction_t * transaction, voi
d *ptr);
/**
* Set a pointer to your personal context associated with this transaction.
* NOTE: see osip_transaction_set_reserved1
* @param transaction The element to work on.
* @param ptr The address of your context.
*/
int osip_transaction_set_reserved2 (osip_transaction_t * transaction, voi
d *ptr);
/**
* Set a pointer to your personal context associated with this transaction.
* NOTE: see osip_transaction_set_reserved1
* @param transaction The element to work on.
* @param ptr The address of your context.
*/
int osip_transaction_set_reserved3 (osip_transaction_t * transaction, voi
d *ptr);
/**
* Set a pointer to your personal context associated with this transaction.
* NOTE: see osip_transaction_set_reserved1
* @param transaction The element to work on.
* @param ptr The address of your context.
*/ */
int osip_transaction_set_your_instance(osip_transaction_t * transact int osip_transaction_set_reserved4 (osip_transaction_t * transaction, voi
ion, d *ptr);
void *instance); /**
* Set a pointer to your personal context associated with this transaction.
* NOTE: see osip_transaction_set_reserved1
* @param transaction The element to work on.
* @param ptr The address of your context.
*/
int osip_transaction_set_reserved5 (osip_transaction_t * transaction, voi
d *ptr);
/**
* Set a pointer to your personal context associated with this transaction.
* NOTE: see osip_transaction_set_reserved1
* @param transaction The element to work on.
* @param ptr The address of your context.
*/
int osip_transaction_set_reserved6 (osip_transaction_t * transaction, voi
d *ptr);
/**
* Get a pointer to your personal context associated with this transaction.
* OBSOLETE: see osip_transaction_get_reserved1...
* @param transaction The element to work on.
*/
void *osip_transaction_get_your_instance (osip_transaction_t * transactio
n);
/**
* Get a pointer to your personal context associated with this transaction.
* @param transaction The element to work on.
*/
void *osip_transaction_get_reserved1 (osip_transaction_t * transaction);
/**
* Get a pointer to your personal context associated with this transaction.
* @param transaction The element to work on.
*/
void *osip_transaction_get_reserved2 (osip_transaction_t * transaction);
/**
* Get a pointer to your personal context associated with this transaction.
* @param transaction The element to work on.
*/
void *osip_transaction_get_reserved3 (osip_transaction_t * transaction);
/**
* Get a pointer to your personal context associated with this transaction.
* @param transaction The element to work on.
*/
void *osip_transaction_get_reserved4 (osip_transaction_t * transaction);
/**
* Get a pointer to your personal context associated with this transaction.
* @param transaction The element to work on.
*/
void *osip_transaction_get_reserved5 (osip_transaction_t * transaction);
/** /**
* 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 * transa ction); void *osip_transaction_get_reserved6 (osip_transaction_t * transaction);
/** /**
* 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 * transactio int osip_transaction_get_destination (osip_transaction_t * transaction, c
n, har **ip, int *port);
char **ip, int *port);
/** /**
* Set SRV lookup information to be used by state machine. * Set SRV lookup information to be used by state machine.
* *
* @param transaction The element to work on. * @param transaction The element to work on.
* @param record The SRV lookup results for this transaction. * @param record The SRV lookup results for this transaction.
*/ */
int osip_transaction_set_srv_record(osip_transaction_t * transaction int osip_transaction_set_srv_record (osip_transaction_t * transaction, os
, ip_srv_record_t * record);
osip_srv_record_t * record);
/** /**
* Set NAPTR lookup information to be used by state machine. * Set NAPTR lookup information to be used by state machine.
* *
* @param transaction The element to work on. * @param transaction The element to work on.
* @param record The NAPTR lookup results for this transaction. * @param record The NAPTR lookup results for this transaction.
*/ */
int osip_transaction_set_naptr_record(osip_transaction_t * transacti int osip_transaction_set_naptr_record (osip_transaction_t * transaction,
on, osip_naptr_t * record);
osip_naptr_t * record);
/** /**
* Set the socket for incoming message. * Set the socket for incoming message.
* *
* @param transaction The element to work on. * @param transaction The element to work on.
* @param sock The socket for incoming message. * @param sock The socket for incoming message.
*/ */
int osip_transaction_set_in_socket(osip_transaction_t * transaction, int sock); int osip_transaction_set_in_socket (osip_transaction_t * transaction, int sock);
/** /**
* Set the socket for outgoing message. * Set the socket for outgoing message.
* *
* @param transaction The element to work on. * @param transaction The element to work on.
* @param sock The socket for outgoing message. * @param sock The socket for outgoing message.
*/ */
int osip_transaction_set_out_socket(osip_transaction_t * transaction int osip_transaction_set_out_socket (osip_transaction_t * transaction, in
, t sock);
int sock);
/** /**
* Allocate an osip_t element. * Allocate an osip_t element.
* @param osip the element to allocate. * @param osip the element to allocate.
*/ */
int osip_init(osip_t ** osip); int osip_init (osip_t ** osip);
/** /**
* Free all resource in a osip_t element. * Free all resource in a osip_t element.
* @param osip The element to release. * @param osip The element to release.
*/ */
void osip_release(osip_t * osip); void osip_release (osip_t * osip);
/** /**
* Set a pointer in a osip_t element. * Set a pointer in a osip_t element.
* This help to find your application layer in callbacks. * This help to find your application layer in callbacks.
* @param osip The element to work on. * @param osip The element to work on.
* @param pointer The element to set. * @param pointer The element to set.
*/ */
void osip_set_application_context(osip_t * osip, void *pointer); void osip_set_application_context (osip_t * osip, void *pointer);
/** /**
* Get a pointer in a osip_t element. * Get a pointer in a osip_t element.
* This help to find your application layer in callbacks. * This help to find your application layer in callbacks.
* @param osip The element to work on. * @param osip The element to work on.
*/ */
void *osip_get_application_context(osip_t * osip); void *osip_get_application_context (osip_t * osip);
/** /**
* Remove a transaction from the osip stack. * Remove a transaction from the osip stack.
* @param osip The element to work on. * @param osip The element to work on.
* @param ict The transaction to add. * @param ict The transaction to add.
*/ */
int osip_remove_transaction(osip_t * osip, osip_transaction_t * ict) ; int osip_remove_transaction (osip_t * osip, osip_transaction_t * ict);
/** /**
* Consume ALL pending osip_event_t previously added in the fifos of ict tr ansactions. * Consume ALL pending osip_event_t previously added in the fifos of ict tr ansactions.
* @param osip The element to work on. * @param osip The element to work on.
*/ */
int osip_ict_execute(osip_t * osip); int osip_ict_execute (osip_t * osip);
/** /**
* Consume ALL pending osip_event_t previously added in the fifos of ist tr ansactions. * Consume ALL pending osip_event_t previously added in the fifos of ist tr ansactions.
* @param osip The element to work on. * @param osip The element to work on.
*/ */
int osip_ist_execute(osip_t * osip); int osip_ist_execute (osip_t * osip);
/** /**
* Consume ALL pending osip_event_t previously added in the fifos of nict t ransactions. * Consume ALL pending osip_event_t previously added in the fifos of nict t ransactions.
* @param osip The element to work on. * @param osip The element to work on.
*/ */
int osip_nict_execute(osip_t * osip); int osip_nict_execute (osip_t * osip);
/** /**
* Consume ALL pending osip_event_t previously added in the fifos of nist t ransactions. * Consume ALL pending osip_event_t previously added in the fifos of nist t ransactions.
* @param osip The element to work on. * @param osip The element to work on.
*/ */
int osip_nist_execute(osip_t * osip); int osip_nist_execute (osip_t * osip);
/** /**
* Retreive the minimum timer value to be used by an application * Retreive the minimum timer value to be used by an application
* so that the osip_timer_*_execute method don't have to be called * so that the osip_timer_*_execute method don't have to be called
* often. * often.
* *
* @param osip The element to work on. * @param osip The element to work on.
* @param lower_tv The minimum timer when the application should wake up. * @param lower_tv The minimum timer when the application should wake up.
*/ */
void osip_timers_gettimeout(osip_t * osip, struct timeval *lower_tv) ; void osip_timers_gettimeout (osip_t * osip, struct timeval *lower_tv);
/** /**
* Check if an ict transactions needs a timer event. * Check if an ict transactions needs a timer event.
* @param osip The element to work on. * @param osip The element to work on.
*/ */
void osip_timers_ict_execute(osip_t * osip); void osip_timers_ict_execute (osip_t * osip);
/** /**
* Check if an ist transactions needs a timer event. * Check if an ist transactions needs a timer event.
* @param osip The element to work on. * @param osip The element to work on.
*/ */
void osip_timers_ist_execute(osip_t * osip); void osip_timers_ist_execute (osip_t * osip);
/** /**
* Check if a nict transactions needs a timer event. * Check if a nict transactions needs a timer event.
* @param osip The element to work on. * @param osip The element to work on.
*/ */
void osip_timers_nict_execute(osip_t * osip); void osip_timers_nict_execute (osip_t * osip);
/** /**
* Check if a nist transactions needs a timer event. * Check if a nist transactions needs a timer event.
* @param osip The element to work on. * @param osip The element to work on.
*/ */
void osip_timers_nist_execute(osip_t * osip); void osip_timers_nist_execute (osip_t * osip);
/* Take care of mutlithreading issuewhile using this method */ /* Take care of mutlithreading issuewhile using this method */
/** /**
* Search for a transaction that match this event (MUST be a MESSAGE event) . * Search for a transaction that match this event (MUST be a MESSAGE event) .
* @param transactions The list of transactions to work on. * @param transactions The list of transactions to work on.
* @param evt The element representing the SIP MESSAGE. * @param evt The element representing the SIP MESSAGE.
*/ */
osip_transaction_t *osip_transaction_find(osip_list_t * transactions osip_transaction_t *osip_transaction_find (osip_list_t * transactions, os
, ip_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 #ifdef OSIP_MONOTHREAD
osip_transaction_t *osip_find_transaction(osip_t * osip, osip_event_ osip_transaction_t *osip_find_transaction (osip_t * osip, osip_event_t *
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, int consume);
osip_event_t * evt, int consume);
#endif #endif
/** /**
* Search for a transaction that match this event (MUST be a MESSAGE event) * Search for a transaction that match this event (MUST be a MESSAGE event)
* and add this event if a transaction is found.. * and add this event if a transaction is found..
* @param osip The element to work on. * @param osip The element to work on.
* @param evt The element representing the SIP MESSAGE. * @param evt The element representing the SIP MESSAGE.
*/ */
int osip_find_transaction_and_add_event(osip_t * osip, osip_event_t * evt); 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_even t_t * evt); osip_transaction_t *osip_create_transaction (osip_t * osip, osip_event_t * evt);
/** /**
* Create a sipevent from a SIP message string. * Create a sipevent from a SIP message string.
* @param buf The SIP message as a string. * @param buf The SIP message as a string.
* @param length The length of the buffer to parse. * @param length The length of the buffer to parse.
*/ */
osip_event_t *osip_parse(const char *buf, size_t length); osip_event_t *osip_parse (const char *buf, size_t length);
/** /**
* Send required retransmissions * Send required retransmissions
* @param osip The element to work on. * @param osip The element to work on.
*/ */
void osip_retransmissions_execute(osip_t * osip); void osip_retransmissions_execute (osip_t * osip);
/** /**
* Start out of fsm 200 Ok retransmissions. This is usefull for user-agents . * Start out of fsm 200 Ok retransmissions. This is usefull for user-agents .
* @param osip The osip_t structure. * @param osip The osip_t structure.
* @param dialog The dialog the 200 Ok is part of. * @param dialog The dialog the 200 Ok is part of.
* @param msg200ok The 200 ok response. * @param msg200ok The 200 ok response.
* @param sock The socket to be used to send the message. (optional). * @param sock The socket to be used to send the message. (optional).
*/ */
void osip_start_200ok_retransmissions(osip_t * osip, void osip_start_200ok_retransmissions (osip_t * osip, struct osip_dialog
*dialog, osip_message_t * msg200ok, int sock);
struct osip_dialog *dialog,
osip_message_t * msg200ok, int sock);
/** /**
* Start out of fsm ACK retransmissions. This is usefull for user-agents. * Start out of fsm ACK retransmissions. This is usefull for user-agents.
* @param osip The osip_t structure. * @param osip The osip_t structure.
* @param dialog The dialog the ACK is part of. * @param dialog The dialog the ACK is part of.
* @param ack The ACK that has just been sent in response to a 200 Ok. * @param ack The ACK that has just been sent in response to a 200 Ok.
* @param dest The destination host. * @param dest The destination host.
* @param 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 *d
ialog, osip_message_t * ack, char *dest, int port, int sock);
struct osip_dialog *dialog,
osip_message_t * ack, char *dest,
int port, int sock);
/** /**
* Stop the out of fsm 200 Ok retransmissions matching an incoming ACK. * Stop the out of fsm 200 Ok retransmissions matching an incoming ACK.
* @param osip The osip_t structure. * @param osip The osip_t structure.
* @param ack The ack that has just been received. * @param ack The ack that has just been received.
*/ */
struct osip_dialog *osip_stop_200ok_retransmissions(osip_t * osip, struct osip_dialog *osip_stop_200ok_retransmissions (osip_t * osip, osip_
message_t * ack);
osip_message_t * ack);
/** /**
* Stop out of fsm retransmissions (ACK or 200 Ok) associated to a given di alog. * Stop out of fsm retransmissions (ACK or 200 Ok) associated to a given di alog.
* This function must be called before freeing a dialog if out of fsm retra nsmissions * This function must be called before freeing a dialog if out of fsm retra nsmissions
* have been scheduled. * have been scheduled.
* @param osip The osip_t structure * @param osip The osip_t structure
* @param dialog The dialog. * @param dialog The dialog.
*/ */
void osip_stop_retransmissions_from_dialog(osip_t * osip, void osip_stop_retransmissions_from_dialog (osip_t * osip, struct osip_di
alog *dialog);
struct osip_dialog *dialog);
/** /**
* Allocate a sipevent (we know this message is an OUTGOING SIP message). * Allocate a sipevent (we know this message is an OUTGOING SIP message).
* @param sip The SIP message we want to send. * @param sip The SIP message we want to send.
*/ */
osip_event_t *osip_new_outgoing_sipmessage(osip_message_t * sip); osip_event_t *osip_new_outgoing_sipmessage (osip_message_t * sip);
/** /**
* Free all ressource in a sipevent. * Free all ressource in a sipevent.
* @param event The event to free. * @param event The event to free.
*/ */
void osip_event_free(osip_event_t * event); void osip_event_free (osip_event_t * event);
/** /**
* Register the callback used to send SIP message. * Register the callback used to send SIP message.
* @param cf The osip element attached to the transaction. * @param cf The osip element attached to the transaction.
* @param cb The method we want to register. * @param cb The method we want to register.
*/ */
void osip_set_cb_send_message(osip_t * cf, void osip_set_cb_send_message (osip_t * cf, int (*cb) (osip_transaction_t
int (*cb) *, osip_message_t *, char *, int, int));
(osip_transaction_t *,
osip_message_t *, char *, int, int));
/* FOR INCOMING TRANSACTION */ /* FOR INCOMING TRANSACTION */
/** /**
* Check if the sipevent is of type RCV_REQINVITE. * Check if the sipevent is of type RCV_REQINVITE.
* @param event the event to check. * @param event the event to check.
*/ */
#define EVT_IS_RCV_INVITE(event) (event->type==RCV_REQINVITE) #define EVT_IS_RCV_INVITE(event) (event->type==RCV_REQINVITE)
/** /**
* Check if the sipevent is of type RCV_REQACK. * Check if the sipevent is of type RCV_REQACK.
* @param event the event to check. * @param event the event to check.
 End of changes. 96 change blocks. 
624 lines changed or deleted 631 lines changed or added


 osip_accept.h   osip_accept.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_accept_encoding.h   osip_accept_encoding.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_accept_language.h   osip_accept_language.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_alert_info.h   osip_alert_info.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_allow.h   osip_allow.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_authentication_info.h   osip_authentication_info.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_authorization.h   osip_authorization.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_body.h   osip_body.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
skipping to change at line 48 skipping to change at line 48
* Structure for holding Body * Structure for holding Body
* @var osip_body_t * @var osip_body_t
*/ */
typedef struct osip_body osip_body_t; typedef struct osip_body osip_body_t;
/** /**
* Structure for holding Body * Structure for holding Body
* @struct osip_body * @struct osip_body
*/ */
struct osip_body { struct osip_body {
char *body; /**< buffer char *body; /**< buffe
containing data */ r containing data */
size_t length; /**< length of data size_t length; /**< length of dat
*/ a */
osip_list_t *headers; /**< List of headers (when osip_list_t *headers; /**< List of headers (when
mime is used) */ mime is used) */
osip_content_type_t *content_type; osip_content_type_t *content_type;
/** /*
< Content-Type (when mime is used) */ *< Content-Type (when mime is used) */
}; };
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Allocate a osip_body_t element. * Allocate a osip_body_t element.
* @param body The element to work on. * @param body The element to work on.
*/ */
int osip_body_init(osip_body_t ** body); int osip_body_init (osip_body_t ** body);
/** /**
* Free a osip_body_t element. * Free a osip_body_t element.
* @param body The element to work on. * @param body The element to work on.
*/ */
void osip_body_free(osip_body_t * body); void osip_body_free (osip_body_t * body);
/** /**
* Parse a osip_body_t element. * Parse a osip_body_t element.
* @param body The element to work on. * @param body The element to work on.
* @param buf The buffer to parse. * @param buf The buffer to parse.
* @param length The length of the buffer to parse. * @param length The length of the buffer to parse.
*/ */
int osip_body_parse(osip_body_t * body, const char *buf, size_t leng th); int osip_body_parse (osip_body_t * body, const char *buf, size_t length);
/** /**
* Clone a osip_body_t element. * Clone a osip_body_t element.
* @param body The element to clone. * @param body The element to clone.
* @param dest The cloned element. * @param dest The cloned element.
*/ */
int osip_body_clone(const osip_body_t * body, osip_body_t ** dest); int osip_body_clone (const osip_body_t * body, osip_body_t ** dest);
/** /**
* Parse a osip_body_t element. (for mime message format) (NOT TESTED, use with care) * Parse a osip_body_t element. (for mime message format) (NOT TESTED, use with care)
* @param body The element to work on. * @param body The element to work on.
* @param buf The buffer to parse. * @param buf The buffer to parse.
* @param length The length of the buffer to parse. * @param length The length of the buffer to parse.
*/ */
int osip_body_parse_mime(osip_body_t * body, const char *buf, size_t length); int osip_body_parse_mime (osip_body_t * body, const char *buf, size_t len gth);
/** /**
* Get a string representation of a osip_body_t element. * Get a string representation of a osip_body_t element.
* @param body The element to work on. * @param body The element to work on.
* @param dest The resulting buffer. * @param dest The resulting buffer.
* @param length The length of the returned buffer. * @param length The length of the returned buffer.
*/ */
int osip_body_to_str(const osip_body_t * body, char **dest, size_t * length); int osip_body_to_str (const osip_body_t * body, char **dest, size_t * len gth);
/** /**
* Set the Content-Type header in the osip_body_t element. * Set the Content-Type header in the osip_body_t element.
* @param body The element to work on. * @param body The element to work on.
* @param hvalue The content type string value. * @param hvalue The content type string value.
*/ */
int osip_body_set_contenttype(osip_body_t * body, const char *hvalue ); int osip_body_set_contenttype (osip_body_t * body, const char *hvalue);
/** /**
* Add a header in the osip_body_t element. * Add a header in the osip_body_t element.
* @param body The element to work on. * @param body The element to work on.
* @param hname The header string name. * @param hname The header string name.
* @param hvalue The header string value. * @param hvalue The header string value.
*/ */
int osip_body_set_header(osip_body_t * body, const char *hname, int osip_body_set_header (osip_body_t * body, const char *hname, const ch
const char *hvalue) ar *hvalue);
;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/** @} */ /** @} */
#endif #endif
 End of changes. 10 change blocks. 
20 lines changed or deleted 19 lines changed or added


 osip_call_id.h   osip_call_id.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_call_info.h   osip_call_info.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_condv.h   osip_condv.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
skipping to change at line 25 skipping to change at line 25
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_CONDV_H__ #ifndef __OSIP_CONDV_H__
#define __OSIP_CONDV_H__ #define __OSIP_CONDV_H__
#include <stdio.h> #include <stdio.h>
#ifdef OSIP_MT #ifndef OSIP_MONOTHREAD
#ifdef ENABLE_MPATROL
#include <mpatrol.h>
#endif
/** /**
* @file osip_condv.h * @file osip_condv.h
* @brief oSIP condition variables definitions * @brief oSIP condition variables definitions
* *
* Those methods are only available if the library is compile * Those methods are only available if the library is compile
* in multi threaded mode. This is the default for oSIP. * in multi threaded mode. This is the default for oSIP.
*/ */
/** /**
skipping to change at line 64 skipping to change at line 60
/* condv implementation */ /* condv implementation */
#if defined(WIN32) || defined(_WIN32_WCE) #if defined(WIN32) || defined(_WIN32_WCE)
/* Prevent struct redefinition if Pthreads for Win32 is used */ /* Prevent struct redefinition if Pthreads for Win32 is used */
#ifndef HAVE_STRUCT_TIMESPEC #ifndef HAVE_STRUCT_TIMESPEC
#define HAVE_STRUCT_TIMESPEC 1 #define HAVE_STRUCT_TIMESPEC 1
/** /**
* timespec structure * timespec structure
* @struct timespec * @struct timespec
*/ */
struct timespec { struct timespec {
long tv_sec; long tv_sec;
long tv_nsec; long tv_nsec;
}; };
#endif #endif
#endif #endif
struct osip_cond; struct osip_cond;
/** /**
* Allocate and Initialise a condition variable * Allocate and Initialise a condition variable
*/ */
struct osip_cond *osip_cond_init(void); struct osip_cond *osip_cond_init (void);
/** /**
* Destroy a condition variable * Destroy a condition variable
* @param cond The condition variable to destroy. * @param cond The condition variable to destroy.
*/ */
int osip_cond_destroy(struct osip_cond *cond); int osip_cond_destroy (struct osip_cond *cond);
/** /**
* Signal the condition variable. * Signal the condition variable.
* @param cond The condition variable to signal. * @param cond The condition variable to signal.
*/ */
int osip_cond_signal(struct osip_cond *cond); int osip_cond_signal (struct osip_cond *cond);
/** /**
* Wait on the condition variable. * Wait on the condition variable.
* @param cond The condition variable to wait on. * @param cond The condition variable to wait on.
* @param mut The external mutex * @param mut The external mutex
*/ */
int osip_cond_wait(struct osip_cond *cond, struct osip_mutex *mut); int osip_cond_wait (struct osip_cond *cond, struct osip_mutex *mut);
/** /**
* Timed wait on the condition variable. * Timed wait on the condition variable.
* @param cond The condition variable to wait on. * @param cond The condition variable to wait on.
* @param mut The external mutex * @param mut The external mutex
* @param abstime time to wait until * @param abstime time to wait until
*/ */
int osip_cond_timedwait(struct osip_cond *cond, struct osip_mutex *m int osip_cond_timedwait (struct osip_cond *cond, struct osip_mutex *mut,
ut, const struct timespec *abstime);
const struct timespe
c *abstime);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
/** @} */ /** @} */
#endif #endif
#endif #endif
 End of changes. 9 change blocks. 
19 lines changed or deleted 13 lines changed or added


 osip_const.h   osip_const.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
skipping to change at line 155 skipping to change at line 155
#define OSIP_IS_SIP_SUCCESS(x) (((x) >= 200)&&((x) < 300)) #define OSIP_IS_SIP_SUCCESS(x) (((x) >= 200)&&((x) < 300))
/** is the status code a redirect */ /** is the status code a redirect */
#define OSIP_IS_SIP_REDIRECT(x) (((x) >= 300)&&((x) < 400)) #define OSIP_IS_SIP_REDIRECT(x) (((x) >= 300)&&((x) < 400))
/** is the status code a error (client or server) */ /** is the status code a error (client or server) */
#define OSIP_IS_SIP_ERROR(x) (((x) >= 400)&&((x) < 600)) #define OSIP_IS_SIP_ERROR(x) (((x) >= 400)&&((x) < 600))
/** is the status code a client error */ /** is the status code a client error */
#define OSIP_IS_SIP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500)) #define OSIP_IS_SIP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500))
/** is the status code a server error */ /** is the status code a server error */
#define OSIP_IS_SIP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600)) #define OSIP_IS_SIP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600))
#endif /* _CONST_H_ */ #endif /* _CONST_H_ */
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_contact.h   osip_contact.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_content_disposition.h   osip_content_disposition.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_content_encoding.h   osip_content_encoding.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_content_length.h   osip_content_length.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_content_type.h   osip_content_type.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_cseq.h   osip_cseq.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_dialog.h   osip_dialog.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
skipping to change at line 41 skipping to change at line 41
/** /**
* @defgroup oSIP_DIALOG oSIP dialog Handling * @defgroup oSIP_DIALOG oSIP dialog Handling
* @{ * @{
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef DOXYGEN #ifndef DOXYGEN
typedef enum _osip_dialog_type_t { typedef enum _osip_dialog_type_t {
CALLER, CALLER,
CALLEE CALLEE
} osip_dialog_type_t; } osip_dialog_type_t;
#endif #endif
/** /**
* Structure for referencing a dialog. * Structure for referencing a dialog.
* @var osip_dialog_t * @var osip_dialog_t
*/ */
typedef struct osip_dialog osip_dialog_t; typedef struct osip_dialog osip_dialog_t;
/** /**
* Structure for referencing a dialog. * Structure for referencing a dialog.
* @struct osip_dialog * @struct osip_dialog
*/ */
struct osip_dialog { struct osip_dialog {
char *call_id; /**< Call-I char *call_id; /**< Call-
D*/ ID*/
char *local_tag; /**< local char *local_tag; /**< local
tag */ tag */
char *remote_tag; /**< remote char *remote_tag; /**< remot
tag */ e tag */
char *line_param; /**< line p char *line_param; /**< line
aram from request uri for incoming calls */ param from request uri for incoming calls */
osip_list_t route_set; /**< route set */ osip_list_t route_set; /**< route set */
int local_cseq; /**< last l int local_cseq; /**< last
ocal cseq */ local cseq */
int remote_cseq; /**< last r int remote_cseq; /**< last
emote cseq*/ remote cseq*/
osip_to_t *remote_uri; /**< remote_uri */ osip_to_t *remote_uri; /**< remote_uri */
osip_from_t *local_uri; /**< local_uri */ osip_from_t *local_uri; /**< local_uri */
osip_contact_t *remote_contact_uri; osip_contact_t *remote_contact_uri;
/**< remote contact_uri */ /**< remote contact_uri */
int secure; /** int secure; /*
< use secure transport layer */ *< use secure transport layer */
osip_dialog_type_t type; /**< type of dialog osip_dialog_type_t type; /**< type of dialo
(CALLEE or CALLER) */ g (CALLEE or CALLER) */
state_t state; /**< DIALOG state_t state; /**< DIALO
_EARLY || DIALOG_CONFIRMED || DIALOG_CLOSED */ G_EARLY || DIALOG_CONFIRMED || DIALOG_CLOSED */
void *your_instance; /**< for applicatio void *your_instance; /**< for applicati
n data reference */ on data reference */
}; };
/** /**
* Link osip dialog to application * Link osip dialog to application
* @param dialog The osip dialog * @param dialog The osip dialog
* @param instance The application instance * @param instance The application instance
*/ */
#define osip_dialog_set_instance(dialog,instance) (dialog)->your_instance = (void*)(instance) #define osip_dialog_set_instance(dialog,instance) (dialog)->your_instance = (void*)(instance)
/** /**
* Retrieve application instance from dialog * Retrieve application instance from dialog
* @param dialog The osip dialog * @param dialog The osip dialog
* @param instance The application instance * @return instance The application instance
*/ */
#define osip_dialog_get_instance(dialog) (dialog)->your_instance #define osip_dialog_get_instance(dialog) (dialog)->your_instance
/** /**
* 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 sponse);
_t * response);
/** /**
* 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 ** dia int osip_dialog_init_as_uac_with_remote_request (osip_dialog_t ** dialog,
log, osip_message_t * next_request, int local_cseq);
osip_message_t *
next_request, int local_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 * in
osip_message vite, osip_message_t * response);
_t * invite,
osip_message
_t * response);
/** /**
* 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).
*/ */
void osip_dialog_set_state(osip_dialog_t * dialog, state_t type); void osip_dialog_set_state (osip_dialog_t * dialog, state_t type);
/** /**
* 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_mes
sage_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_mes
sage_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_messag sponse);
e_t * response);
/** /**
* 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
os * response);
ip_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_mes
sage_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, osip_message_t * request); int osip_dialog_match_as_uas (osip_dialog_t * dialog, osip_message_t * re quest);
/** /**
* @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
* Is dialog initiated by as CALLEE * Is dialog initiated by as CALLEE
* @param dialog The element to work on. * @param dialog The element to work on.
*/ */
int osip_dialog_is_callee(osip_dialog_t * dialog); int osip_dialog_is_callee (osip_dialog_t * dialog);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/** @} */ /** @} */
#endif #endif
 End of changes. 20 change blocks. 
72 lines changed or deleted 57 lines changed or added


 osip_error_info.h   osip_error_info.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_fifo.h   osip_fifo.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
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 _FIFO_H_ #ifndef _FIFO_H_
#define _FIFO_H_ #define _FIFO_H_
#ifdef OSIP_MT #ifndef OSIP_MONOTHREAD
#include <osip2/osip_mt.h> #include <osip2/osip_mt.h>
#endif #endif
#include <osipparser2/osip_list.h> #include <osipparser2/osip_list.h>
/** /**
* @file osip_fifo.h * @file osip_fifo.h
* @brief oSIP fifo Routines * @brief oSIP fifo Routines
* *
* This is a very simple implementation of a fifo. * This is a very simple implementation of a fifo.
* <BR>There is not much to say about it... * <BR>There is not much to say about it...
skipping to change at line 48 skipping to change at line 48
* @ingroup osip2_port * @ingroup osip2_port
* @{ * @{
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef DOXYGEN #ifndef DOXYGEN
#define MAX_LEN 1000 typedef enum { osip_ok, osip_empty } osip_fifo_state;
typedef enum { osip_ok, osip_full, osip_empty } osip_fifo_state;
#endif #endif
/** /**
* Structure for referencing a fifo. * Structure for referencing a fifo.
* @var osip_fifo_t * @var osip_fifo_t
*/ */
typedef struct osip_fifo osip_fifo_t; typedef struct osip_fifo osip_fifo_t;
/** /**
* Structure for referencing a fifo. * Structure for referencing a fifo.
* @struct osip_fifo * @struct osip_fifo
*/ */
struct osip_fifo { struct osip_fifo {
#ifdef OSIP_MT #ifndef OSIP_MONOTHREAD
struct osip_mutex *qislocked; struct osip_mutex *qislocked; /**< mutex for fifo */
/**@inter struct osip_sem *qisempty; /**< semaphore for fifo */
nal */ #endif
struct osip_sem *qisempty; /**@internal */ osip_list_t queue; /**< list of nodes containing el
#endif ements */
osip_list_t queue; /**< list of nodes contai int nb_elt; /**< nb of elements */
ning elements */ osip_fifo_state state; /**< state of the fifo */
int nb_elt; /**< nb of elemen };
ts */
osip_fifo_state state; /**@internal state of the f
ifo */
};
/** /**
* Initialise a osip_fifo_t element. * Initialise a osip_fifo_t element.
* NOTE: this element MUST be previously allocated with * NOTE: this element MUST be previously allocated with
* osip_malloc(). The osip_free() call on the fifo is * osip_malloc(). The osip_free() call on the fifo is
* still automatically done by osip_fifo_free(). This * still automatically done by osip_fifo_free(). This
* also means you can't use a static osip_fifo_t variable * also means you can't use a static osip_fifo_t variable
* if you want to use osip_fifo_free(). * if you want to use osip_fifo_free().
* @param ff The element to initialise. * @param ff The element to initialise.
*/ */
void osip_fifo_init(osip_fifo_t * ff); void osip_fifo_init (osip_fifo_t * ff);
/** /**
* Free a fifo element. * Free a fifo element.
* @param ff The element to work on. * @param ff The element to work on.
*/ */
void osip_fifo_free(osip_fifo_t * ff); void osip_fifo_free (osip_fifo_t * ff);
/** /**
* Insert an element in a fifo (at the beginning). * Insert an element in a fifo (at the beginning).
* @param ff The element to work on. * @param ff The element to work on.
* @param element The pointer on the element to insert. * @param element The pointer on the element to insert.
*/ */
int osip_fifo_insert(osip_fifo_t * ff, void *element); int osip_fifo_insert (osip_fifo_t * ff, void *element);
/** /**
* Add an element in a fifo. * Add an element in a fifo.
* @param ff The element to work on. * @param ff The element to work on.
* @param element The pointer on the element to add. * @param element The pointer on the element to add.
*/ */
int osip_fifo_add(osip_fifo_t * ff, void *element); int osip_fifo_add (osip_fifo_t * ff, void *element);
/** /**
* Get the number of element in a fifo. * Get the number of element in a fifo.
* @param ff The element to work on. * @param ff The element to work on.
*/ */
int osip_fifo_size(osip_fifo_t * ff); int osip_fifo_size (osip_fifo_t * ff);
#ifdef OSIP_MT #ifndef OSIP_MONOTHREAD
/** /**
* Get an element from a fifo or block until one is added. * Get an element from a fifo or block until one is added.
* @param ff The element to work on. * @param ff The element to work on.
*/ */
void *osip_fifo_get(osip_fifo_t * ff); void *osip_fifo_get (osip_fifo_t * ff);
#endif #endif
/** /**
* Try to get an element from a fifo, but do not block if there is no eleme nt. * Try to get an element from a fifo, but do not block if there is no eleme nt.
* @param ff The element to work on. * @param ff The element to work on.
*/ */
void *osip_fifo_tryget(osip_fifo_t * ff); void *osip_fifo_tryget (osip_fifo_t * ff);
/** @} */ /** @} */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 12 change blocks. 
27 lines changed or deleted 22 lines changed or added


 osip_from.h   osip_from.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_header.h   osip_header.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_headers.h   osip_headers.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_list.h   osip_list.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
skipping to change at line 31 skipping to change at line 31
#define _LIST_H_ #define _LIST_H_
#ifdef ENABLE_MPATROL #ifdef ENABLE_MPATROL
#include <mpatrol.h> #include <mpatrol.h>
#endif #endif
/** /**
* @file osip_list.h * @file osip_list.h
* @brief oSIP list Routines * @brief oSIP list Routines
* *
* This is a very simple implementation of a linked list. * This is a simple implementation of a linked list.
* <BR>There is not much to say about it... Except that it
* could be a lot improved. Sadly, it would be difficult
* to improve it without breaking the compatibility with
* older version!
*/ */
/** /**
* @defgroup oSIP_LIST oSIP list Handling * @defgroup oSIP_LIST oSIP list Handling
* @{ * @{
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef DOXYGEN #ifndef DOXYGEN
/** /**
* Structure for referencing a node in a osip_list_t element. * Structure for referencing a node in a osip_list_t element.
* @var __node_t * @var __node_t
*/ */
typedef struct __node __node_t; typedef struct __node __node_t;
/** /**
* Structure for referencing a node in a osip_list_t element. * Structure for referencing a node in a osip_list_t element.
* @struct __node * @struct __node
*/ */
struct __node { struct __node {
__node_t *next; /**< next __node_t c __node_t *next; /**< next __node_t containing element */
ontaining element */ void *element; /**< element in Current node */
void *element; /**< element in Current node };
*/
};
#endif #endif
/** /**
* Structure for referencing a list of elements. * Structure for referencing a list of elements.
* @var osip_list_t * @var osip_list_t
*/ */
typedef struct osip_list osip_list_t; typedef struct osip_list osip_list_t;
/** /**
* Structure used to iterate list. * Structure used to iterate list.
* @var osip_list_iterator_t * @var osip_list_iterator_t
*/ */
typedef struct { typedef struct {
__node_t *actual; __node_t *actual; /**< actual */
__node_t **prev; __node_t **prev; /**< prev */
osip_list_t *li; osip_list_t *li; /**< li */
int pos; int pos; /**< pos */
} osip_list_iterator_t; } osip_list_iterator_t;
/** /**
* Structure for referencing a list of elements. * Structure for referencing a list of elements.
* @struct osip_list * @struct osip_list
*/ */
struct osip_list { struct osip_list {
int nb_elt; /**< Number of element in the list * int nb_elt; /**< Number of element in the list */
/ __node_t *node; /**< Next node containing element */
__node_t *node; /**< Next node containing element */
}; };
/** /**
* Initialise a osip_list_t element. * Initialise a osip_list_t element.
* NOTE: this element MUST be previously allocated with * NOTE: this element MUST be previously allocated with
* osip_malloc(). The osip_free() call on the list is * osip_malloc(). The osip_free() call on the list is
* still automatically done by osip_list_free(). This * still automatically done by osip_list_free(). This
* also means you can't use a static osip_list_t variable * also means you can't use a static osip_list_t variable
* if you want to use osip_list_free(). * if you want to use osip_list_free().
* @param li The element to initialise. * @param li The element to initialise.
*/ */
int osip_list_init(osip_list_t * li); int osip_list_init (osip_list_t * li);
/** /**
* Free a list of element. * Free a list of element.
* Each element will be free with the method given as the second parameter. * Each element will be free with the method given as the second parameter.
* @param li The element to work on. * @param li The element to work on.
* @param free_func The method that is able to release one element of the l ist. * @param free_func The method that is able to release one element of the l ist.
*/ */
void osip_list_special_free(osip_list_t * li, void (*free_func) (voi d *)); void osip_list_special_free (osip_list_t * li, void (*free_func) (void *) );
/** /**
* Clone a list of element. * Clone a list of element.
* Each element will be cloned with the method given as the second paramete r. * Each element will be cloned with the method given as the second paramete r.
* @param src The element to work on. * @param src The element to work on.
* @param dst The element to work on. * @param dst The element to work on.
* @param clone_func The method that is able to release one element of the list. * @param clone_func The method that is able to release one element of the list.
*/ */
int osip_list_clone(const osip_list_t * src, osip_list_t * dst, int osip_list_clone (const osip_list_t * src, osip_list_t * dst, int (*cl
int (*clone_func) (void *, v one_func) (void *, void **));
oid **));
/** /**
* Free a list of element where elements are pointer to 'char'. * Free a list of element where elements are pointer to 'char'.
* @param li The element to work on. * @param li The element to work on.
*/ */
void osip_list_ofchar_free(osip_list_t * li); void osip_list_ofchar_free (osip_list_t * li);
/** /**
* Get the size of a list of element. * Get the size of a list of element.
* @param li The element to work on. * @param li The element to work on.
*/ */
int osip_list_size(const osip_list_t * li); int osip_list_size (const osip_list_t * li);
/** /**
* Check if the end of list is detected . * Check if the end of list is detected .
* @param li The element to work on. * @param li The element to work on.
* @param pos The index of the possible element. * @param pos The index of the possible element.
*/ */
int osip_list_eol(const osip_list_t * li, int pos); int osip_list_eol (const osip_list_t * li, int pos);
/** /**
* Add an element in a list. * Add an element in a list.
* @param li The element to work on. * @param li The element to work on.
* @param element The pointer on the element to add. * @param element The pointer on the element to add.
* @param pos the index of the element to add. (or -1 to append the element at the end) * @param pos the index of the element to add. (or -1 to append the element at the end)
*/ */
int osip_list_add(osip_list_t * li, void *element, int pos); int osip_list_add (osip_list_t * li, void *element, int pos);
/** /**
* Get an element from a list. * Get an element from a list.
* @param li The element to work on. * @param li The element to work on.
* @param pos the index of the element to get. * @param pos the index of the element to get.
*/ */
void *osip_list_get(const osip_list_t * li, int pos); void *osip_list_get (const osip_list_t * li, int pos);
/** /**
* Remove an element from a list. * Remove an element from a list.
* @param li The element to work on. * @param li The element to work on.
* @param pos the index of the element to remove. * @param pos the index of the element to remove.
*/ */
int osip_list_remove(osip_list_t * li, int pos); int osip_list_remove (osip_list_t * li, int pos);
/** /**
* Check current iterator state. * Check current iterator state.
* @param it The element to work on. * @param it The element to work on.
*/ */
#define osip_list_iterator_has_elem( it ) ( 0 != (it).actual && (it).pos < (it).li->nb_elt ) #define osip_list_iterator_has_elem( it ) ( 0 != (it).actual && (it).pos < (it).li->nb_elt )
/** /**
* Get first iterator from list. * Get first iterator from list.
* @param li The element to work on. * @param li The element to work on.
* @param it The iterator. * @param it The iterator.
*/ */
void *osip_list_get_first(osip_list_t * li, osip_list_iterator_t * i t); void *osip_list_get_first (osip_list_t * li, osip_list_iterator_t * it);
/** /**
* GEt next iterator. * GEt next iterator.
* @param it The element to work on. * @param it The element to work on.
*/ */
void *osip_list_get_next(osip_list_iterator_t * it); void *osip_list_get_next (osip_list_iterator_t * it);
/** /**
* Remove current iterator. * Remove current iterator.
* @param it The element to work on. * @param it The element to work on.
*/ */
void *osip_list_iterator_remove(osip_list_iterator_t * it); void *osip_list_iterator_remove (osip_list_iterator_t * it);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/** @} */ /** @} */
#endif #endif
 End of changes. 21 change blocks. 
39 lines changed or deleted 31 lines changed or added


 osip_md5.h   osip_md5.h 
skipping to change at line 43 skipping to change at line 43
#endif #endif
/* modified for oSIP: GCC supports this feature */ /* modified for oSIP: GCC supports this feature */
#define PROTOTYPES 1 #define PROTOTYPES 1
#ifndef PROTOTYPES #ifndef PROTOTYPES
#define PROTOTYPES 0 #define PROTOTYPES 0
#endif #endif
/* POINTER defines a generic pointer type */ /* POINTER defines a generic pointer type */
typedef unsigned char *POINTER; typedef unsigned char *POINTER;
/* UINT2 defines a two byte word */ /* UINT2 defines a two byte word */
typedef unsigned short int UINT2; typedef unsigned short int UINT2;
/* UINT4 defines a four byte word */ /* UINT4 defines a four byte word */
typedef unsigned int UINT4; typedef unsigned int UINT4;
/* PROTO_LIST is defined depending on how PROTOTYPES is defined above. /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
returns an empty list. returns an empty list.
*/ */
#if PROTOTYPES #if PROTOTYPES
#define PROTO_LIST(list) list #define PROTO_LIST(list) list
#else #else
#define PROTO_LIST(list) () #define PROTO_LIST(list) ()
#endif #endif
/** /**
* Structure for holding MD5 context. * Structure for holding MD5 context.
* @var MD5_CTX * @var MD5_CTX
*/ */
typedef struct { typedef struct {
UINT4 state[4]; /* state (ABCD) */ UINT4 state[4]; /* state (ABCD) */
UINT4 count[2]; /* number of bits, modulo 2^ UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first)
64 (lsb first) */ */
unsigned char buffer[64]; /* input buffer */ unsigned char buffer[64]; /* input buffer */
} osip_MD5_CTX; } osip_MD5_CTX;
void osip_MD5Init PROTO_LIST((osip_MD5_CTX *)); void osip_MD5Init PROTO_LIST ((osip_MD5_CTX *));
void osip_MD5Update void osip_MD5Update PROTO_LIST ((osip_MD5_CTX *, unsigned char *, unsigne
PROTO_LIST((osip_MD5_CTX *, unsigned char *, unsigned int)); d int));
void osip_MD5Final PROTO_LIST((unsigned char[16], osip_MD5_CTX *)); void osip_MD5Final PROTO_LIST ((unsigned char[16], osip_MD5_CTX *));
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
#endif #endif
 End of changes. 4 change blocks. 
14 lines changed or deleted 14 lines changed or added


 osip_message.h   osip_message.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
skipping to change at line 48 skipping to change at line 48
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Structure for SIP Message (REQUEST and RESPONSE). * Structure for SIP Message (REQUEST and RESPONSE).
* @var osip_message_t * @var osip_message_t
*/ */
typedef struct osip_message osip_message_t; typedef struct osip_message osip_message_t;
/** /**
* Structure for SIP Message (REQUEST and RESPONSE). * Structure for SIP Message (REQUEST and RESPONSE).
* @struct osip_message * @struct osip_message
*/ */
struct osip_message { struct osip_message {
char *sip_version; /**< SIP version ( char *sip_version; /**< SIP version (SIP req
SIP request only) */ uest only) */
osip_uri_t *req_uri; /**< Request-Uri (SIP requ osip_uri_t *req_uri; /**< Request-Uri (SIP req
est only) */ uest only) */
char *sip_method; /**< METHOD (SIP r char *sip_method; /**< METHOD (SIP request
equest only) */ only) */
int status_code; /**< Status Code ( int status_code; /**< Status Code (SIP ans
SIP answer only) */ wer only) */
char *reason_phrase; /**< Reason Phrase (SIP an char *reason_phrase; /**< Reason Phrase (SIP a
swer only) */ nswer only) */
#ifndef MINISIZE #ifndef MINISIZE
osip_list_t accepts; /**< Accept headers */ osip_list_t accepts; /**< Accept headers */
osip_list_t accept_encodings;/**< Accept-Encoding headers */ osip_list_t accept_encodings; /**< Accept-Encoding head
osip_list_t accept_languages;/**< Accept-Language headers */ ers */
osip_list_t alert_infos; /**< Alert-Info headers */ osip_list_t accept_languages; /**< Accept-Language head
osip_list_t allows; /**< Allows headers ers */
*/ osip_list_t alert_infos; /**< Alert-Info headers *
osip_list_t authentication_infos; /
/** osip_list_t allows; /**< Allows headers */
< authentication_info headers */ osip_list_t authentication_infos; /**< authentication_info
headers */
#endif #endif
osip_list_t authorizations; /**< Authorizations headers osip_list_t authorizations; /**< Authorizations heade
*/ rs */
osip_call_id_t *call_id; /**< Call-ID header */ osip_call_id_t *call_id; /**< Call-ID header */
#ifndef MINISIZE #ifndef MINISIZE
osip_list_t call_infos; /**< Call-Infos header */ osip_list_t call_infos; /**< Call-Infos header */
#endif #endif
osip_list_t contacts; /**< Contacts headers */ osip_list_t contacts; /**< Contacts headers */
#ifndef MINISIZE #ifndef MINISIZE
osip_list_t content_encodings; osip_list_t content_encodings; /**< Content-Encodings he
/** aders */
< Content-Encodings headers */
#endif #endif
osip_content_length_t *content_length; osip_content_length_t *content_length; /**< Content-Length heade
r */
/**< Content-Length header */ osip_content_type_t *content_type; /**< Content-Type header
osip_content_type_t *content_type; /**< Content-Type h */
eader */ osip_cseq_t *cseq; /**< CSeq header */
osip_cseq_t *cseq; /**< CSeq header *
/
#ifndef MINISIZE #ifndef MINISIZE
osip_list_t error_infos; /**< Error-Info headers */ osip_list_t error_infos; /**< Error-Info headers * /
#endif #endif
osip_from_t *from; /**< From header * osip_from_t *from; /**< From header */
/ osip_mime_version_t *mime_version; /**< Mime-Version header
osip_mime_version_t *mime_version; */
/* osip_list_t proxy_authenticates; /**< Proxy-Authenticate h
*< Mime-Version header */ eaders */
osip_list_t proxy_authenticates;
/**
< Proxy-Authenticate headers */
#ifndef MINISIZE #ifndef MINISIZE
osip_list_t proxy_authentication_infos; osip_list_t proxy_authentication_infos; /**< P-Authentication-Inf
o headers */
/**< P-Authentication-Info headers */
#endif #endif
osip_list_t proxy_authorizations; osip_list_t proxy_authorizations; /**< Proxy-authorization
/** headers */
< Proxy-authorization headers */ osip_list_t record_routes; /**< Record-Route headers
osip_list_t record_routes; /**< Record-Route headers * */
/ osip_list_t routes; /**< Route headers */
osip_list_t routes; /**< Route headers osip_to_t *to; /**< To header */
*/ osip_list_t vias; /**< Vias headers */
osip_to_t *to; /**< To header */ osip_list_t www_authenticates; /**< WWW-Authenticate hea
osip_list_t vias; /**< Vias headers * ders */
/
osip_list_t www_authenticates; osip_list_t headers; /**< Other headers */
/**
< WWW-Authenticate headers */ osip_list_t bodies; /**< List of attachements
*/
osip_list_t headers; /**< Other headers */
/*
osip_list_t bodies; /**< List of attach 1: structure and buffer "message" are identical.
ements */ 2: buffer "message" is not up to date with the structure info (call
osip_message_to_str to update it).
/* */
1: structure and buffer "message" are identical. int message_property; /**< internal value */
2: buffer "message" is not up to date with the structure char *message; /**< internal value */
info (call osip_message_to_str to update it). size_t message_length; /**< internal value */
*/
int message_property; /**@internal */
char *message; /**@internal */
size_t message_length; /**@internal */
void *application_data; /**can be used by upper la void *application_data; /**< can be used by upper
yer*/ layer*/
}; };
#ifndef SIP_MESSAGE_MAX_LENGTH #ifndef SIP_MESSAGE_MAX_LENGTH
/** /**
* You can re-define your own maximum length for SIP message. * You can re-define your own maximum length for SIP message.
*/ */
#define SIP_MESSAGE_MAX_LENGTH 4000 #define SIP_MESSAGE_MAX_LENGTH 4000
#endif #endif
#ifndef BODY_MESSAGE_MAX_SIZE #ifndef BODY_MESSAGE_MAX_SIZE
/** /**
* You can define the maximum length for a body inside a SIP message. * You can define the maximum length for a body inside a SIP message.
*/ */
#define BODY_MESSAGE_MAX_SIZE 4000 #define BODY_MESSAGE_MAX_SIZE 4000
#endif #endif
/** /**
* Allocate a osip_message_t element. * Allocate a osip_message_t element.
* @param sip The element to allocate. * @param sip The element to allocate.
*/ */
int osip_message_init(osip_message_t ** sip); int osip_message_init (osip_message_t ** sip);
/** /**
* Free all resource in a osip_message_t element. * Free all resource in a osip_message_t element.
* @param sip The element to free. * @param sip The element to free.
*/ */
void osip_message_free(osip_message_t * sip); void osip_message_free (osip_message_t * sip);
/** /**
* Parse a osip_message_t element. * Parse a osip_message_t element.
* @param sip The resulting element. * @param sip The resulting element.
* @param buf The buffer to parse. * @param buf The buffer to parse.
* @param length The length of the buffer to parse. * @param length The length of the buffer to parse.
*/ */
int osip_message_parse(osip_message_t * sip, const char *buf, size_t length); int osip_message_parse (osip_message_t * sip, const char *buf, size_t len gth);
/** /**
* Parse a message/sipfrag part and store it in an osip_message_t element. * Parse a message/sipfrag part and store it in an osip_message_t element.
* @param sip The resulting element. * @param sip The resulting element.
* @param buf The buffer to parse. * @param buf The buffer to parse.
* @param length The length of the buffer to parse. * @param length The length of the buffer to parse.
*/ */
int osip_message_parse_sipfrag(osip_message_t * sip, const char *buf int osip_message_parse_sipfrag (osip_message_t * sip, const char *buf, si
, ze_t length);
size_t le
ngth);
/** /**
* Get a string representation of a osip_message_t element. * Get a string representation of a osip_message_t element.
* @param sip The element to work on. * @param sip The element to work on.
* @param dest new allocated buffer returned. * @param dest new allocated buffer returned.
* @param message_length The length of the returned buffer. * @param message_length The length of the returned buffer.
*/ */
int osip_message_to_str(osip_message_t * sip, char **dest, int osip_message_to_str (osip_message_t * sip, char **dest, size_t * mess
size_t * message_len age_length);
gth);
/** /**
* Get a string representation of a message/sipfrag part * Get a string representation of a message/sipfrag part
* stored in an osip_message_t element. * stored in an osip_message_t element.
* @param sip The element to work on. * @param sip The element to work on.
* @param dest new allocated buffer returned. * @param dest new allocated buffer returned.
* @param message_length The length of the returned buffer. * @param message_length The length of the returned buffer.
*/ */
int osip_message_to_str_sipfrag(osip_message_t * sip, char **dest, int osip_message_to_str_sipfrag (osip_message_t * sip, char **dest, size_
size t * message_length);
_t * message_length);
/** /**
* Clone a osip_message_t element. * Clone a osip_message_t element.
* @param sip The element to clone. * @param sip The element to clone.
* @param dest The new allocated element cloned. * @param dest The new allocated element cloned.
*/ */
int osip_message_clone(const osip_message_t * sip, osip_message_t ** dest); int osip_message_clone (const osip_message_t * sip, osip_message_t ** des t);
/** /**
* Set the reason phrase. This is entirely free in SIP. * Set the reason phrase. This is entirely free in SIP.
* @param sip The element to work on. * @param sip The element to work on.
* @param reason The reason phrase. * @param reason The reason phrase.
*/ */
void osip_message_set_reason_phrase(osip_message_t * sip, char *reas on); void osip_message_set_reason_phrase (osip_message_t * sip, char *reason);
/** /**
* Get the reason phrase. This is entirely free in SIP. * Get the reason phrase. This is entirely free in SIP.
* @param sip The element to work on. * @param sip The element to work on.
*/ */
char *osip_message_get_reason_phrase(const osip_message_t * sip); char *osip_message_get_reason_phrase (const osip_message_t * sip);
/** /**
* Set the status code. This is entirely free in SIP. * Set the status code. This is entirely free in SIP.
* @param sip The element to work on. * @param sip The element to work on.
* @param statuscode The status code. * @param statuscode The status code.
*/ */
void osip_message_set_status_code(osip_message_t * sip, int statusco de); void osip_message_set_status_code (osip_message_t * sip, int statuscode);
/** /**
* Get the status code. * Get the status code.
* @param sip The element to work on. * @param sip The element to work on.
*/ */
int osip_message_get_status_code(const osip_message_t * sip); int osip_message_get_status_code (const osip_message_t * sip);
/** /**
* Set the method. You can set any string here. * Set the method. You can set any string here.
* @param sip The element to work on. * @param sip The element to work on.
* @param method The method name. * @param method The method name.
*/ */
void osip_message_set_method(osip_message_t * sip, char *method); void osip_message_set_method (osip_message_t * sip, char *method);
/** /**
* Get the method name. * Get the method name.
* @param sip The element to work on. * @param sip The element to work on.
*/ */
char *osip_message_get_method(const osip_message_t * sip); char *osip_message_get_method (const osip_message_t * sip);
/** /**
* Set the SIP version used. (default is "SIP/2.0") * Set the SIP version used. (default is "SIP/2.0")
* @param sip The element to work on. * @param sip The element to work on.
* @param version The version of SIP. * @param version The version of SIP.
*/ */
void osip_message_set_version(osip_message_t * sip, char *version); void osip_message_set_version (osip_message_t * sip, char *version);
/** /**
* Get the SIP version. * Get the SIP version.
* @param sip The element to work on. * @param sip The element to work on.
*/ */
char *osip_message_get_version(const osip_message_t * sip); char *osip_message_get_version (const osip_message_t * sip);
/** /**
* Set the Request-URI. * Set the Request-URI.
* @param sip The element to work on. * @param sip The element to work on.
* @param uri The uri to set. * @param uri The uri to set.
*/ */
void osip_message_set_uri(osip_message_t * sip, osip_uri_t * uri); void osip_message_set_uri (osip_message_t * sip, osip_uri_t * uri);
/** /**
* Get the Request-URI. * Get the Request-URI.
* @param sip The element to work on. * @param sip The element to work on.
*/ */
osip_uri_t *osip_message_get_uri(const osip_message_t * sip); osip_uri_t *osip_message_get_uri (const osip_message_t * sip);
/* /*
* These are helpfull MACROs to test messages type. * These are helpfull MACROs to test messages type.
*/ */
/** /**
* Test if the message is a SIP RESPONSE * Test if the message is a SIP RESPONSE
* @param msg the SIP message. * @param msg the SIP message.
*/ */
#define MSG_IS_RESPONSE(msg) ((msg)->status_code!=0) #define MSG_IS_RESPONSE(msg) ((msg)->status_code!=0)
/** /**
skipping to change at line 443 skipping to change at line 432
* @param NAME The name of the parameter element to find. * @param NAME The name of the parameter element to find.
* @param DEST A pointer on the element found. * @param DEST A pointer on the element found.
*/ */
#define osip_generic_param_get_byname(LIST,NAME,DEST) osip_uri_param_get_by name(LIST,NAME,DEST) #define osip_generic_param_get_byname(LIST,NAME,DEST) osip_uri_param_get_by name(LIST,NAME,DEST)
/** /**
* Set the name of a generic parameter element. * Set the name of a generic parameter element.
* @param generic_param The element to work on. * @param generic_param The element to work on.
* @param name the token name to set. * @param name the token name to set.
*/ */
void osip_generic_param_set_name(osip_generic_param_t * generic_para void osip_generic_param_set_name (osip_generic_param_t * generic_param, c
m, har *name);
cha
r *name);
/** /**
* Get the name of a generic parameter element. * Get the name of a generic parameter element.
* @param generic_param The element to work on. * @param generic_param The element to work on.
*/ */
char *osip_generic_param_get_name(const osip_generic_param_t * gener ic_param); char *osip_generic_param_get_name (const osip_generic_param_t * generic_p aram);
/** /**
* Set the value of a generic parameter element. * Set the value of a generic parameter element.
* @param generic_param The element to work on. * @param generic_param The element to work on.
* @param value the token name to set. * @param value the token name to set.
*/ */
void osip_generic_param_set_value(osip_generic_param_t * generic_par void osip_generic_param_set_value (osip_generic_param_t * generic_param,
am, char *value);
ch
ar *value);
/** /**
* Get the value of a generic parameter element. * Get the value of a generic parameter element.
* @param generic_param The element to work on. * @param generic_param The element to work on.
*/ */
char *osip_generic_param_get_value(const osip_generic_param_t * gene ric_param); char *osip_generic_param_get_value (const osip_generic_param_t * generic_ param);
/** /**
* Get the a known header from a list of known header. * Get the a known header from a list of known header.
* @param header_list The element to work on. * @param header_list 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_knownheaderlist(osip_list_t * header_list, int osip_message_get_knownheaderlist (osip_list_t * header_list, int pos,
void **dest);
int pos, void **dest);
/** @} */ /** @} */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 37 change blocks. 
116 lines changed or deleted 97 lines changed or added


 osip_mime_version.h   osip_mime_version.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_mt.h   osip_mt.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
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_MT_H_ #ifndef _OSIP_MT_H_
#define _OSIP_MT_H_ #define _OSIP_MT_H_
#ifdef OSIP_MT #ifndef OSIP_MONOTHREAD
#ifdef ENABLE_MPATROL
#include <mpatrol.h>
#endif
#include <stdio.h> #include <stdio.h>
#ifndef _WIN32_WCE
#include <errno.h>
#endif
/** /**
* @file osip_mt.h * @file osip_mt.h
* @brief oSIP Thread, Mutex and Semaphore definitions * @brief oSIP Thread, Mutex and Semaphore definitions
* *
* Those methods are only available if the library is compile * Those methods are only available if the library is compile
* in multi threaded mode. This is the default for oSIP. * in multi threaded mode. This is the default for oSIP.
*/ */
/** /**
skipping to change at line 56 skipping to change at line 49
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Structure for referencing a thread * Structure for referencing a thread
* @struct osip_thread * @struct osip_thread
*/ */
struct osip_thread; struct osip_thread;
/** /**
* Allocate (or initialise if a thread address is given) * Allocate (or initialise if a thread address is given)
* @param stacksize The stack size of the thread. (20000 is a good value) * @param stacksize The stack size of the thread. (20000 is a good value)
* @param func The method where the thread start. * @param func The method where the thread start.
* @param arg A pointer on the argument given to the method 'func'. * @param arg A pointer on the argument given to the method 'func'.
*/ */
struct osip_thread *osip_thread_create(int stacksize, struct osip_thread *osip_thread_create (int stacksize, void *(*func) (voi
d *), void *arg);
void *(*func) (void *), void *arg);
/** /**
* Join a thread. * Join a thread.
* @param thread The thread to join. * @param thread The thread to join.
*/ */
int osip_thread_join(struct osip_thread *thread); int osip_thread_join (struct osip_thread *thread);
/** /**
* Set the priority of a thread. (NOT IMPLEMENTED ON ALL SYSTEMS) * Set the priority of a thread. (NOT IMPLEMENTED ON ALL SYSTEMS)
* @param thread The thread to work on. * @param thread The thread to work on.
* @param priority The priority value to set. * @param priority The priority value to set.
*/ */
int osip_thread_set_priority(struct osip_thread *thread, int priorit y); int osip_thread_set_priority (struct osip_thread *thread, int priority);
/** /**
* Exit from a thread. * Exit from a thread.
*/ */
void osip_thread_exit(void); void osip_thread_exit (void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/** @} *//** /** @}
* @defgroup oSIP_SEMA oSIP semaphore definitions * @defgroup oSIP_SEMA oSIP semaphore definitions
* @ingroup osip2_port * @ingroup osip2_port
* @{ * @{
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Structure for referencing a semaphore element. * Structure for referencing a semaphore element.
* @struct osip_sem * @struct osip_sem
*/ */
struct osip_sem; struct osip_sem;
/** /**
* Allocate and Initialise a semaphore. * Allocate and Initialise a semaphore.
* @param value The initial value for the semaphore. * @param value The initial value for the semaphore.
*/ */
struct osip_sem *osip_sem_init(unsigned int value); struct osip_sem *osip_sem_init (unsigned int value);
/** /**
* Destroy a semaphore. * Destroy a semaphore.
* @param sem The semaphore to destroy. * @param sem The semaphore to destroy.
*/ */
int osip_sem_destroy(struct osip_sem *sem); int osip_sem_destroy (struct osip_sem *sem);
/** /**
* Post operation on a semaphore. * Post operation on a semaphore.
* @param sem The semaphore to destroy. * @param sem The semaphore to destroy.
*/ */
int osip_sem_post(struct osip_sem *sem); int osip_sem_post (struct osip_sem *sem);
/** /**
* Wait operation on a semaphore. * Wait operation on a semaphore.
* NOTE: this call will block if the semaphore is at 0. * NOTE: this call will block if the semaphore is at 0.
* @param sem The semaphore to destroy. * @param sem The semaphore to destroy.
*/ */
int osip_sem_wait(struct osip_sem *sem); int osip_sem_wait (struct osip_sem *sem);
/** /**
* Wait operation on a semaphore. * Wait operation on a semaphore.
* NOTE: if the semaphore is at 0, this call won't block. * NOTE: if the semaphore is at 0, this call won't block.
* @param sem The semaphore to destroy. * @param sem The semaphore to destroy.
*/ */
int osip_sem_trywait(struct osip_sem *sem); int osip_sem_trywait (struct osip_sem *sem);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/** @} *//** /** @}
* @defgroup oSIP_MUTEX oSIP mutex definitions * @defgroup oSIP_MUTEX oSIP mutex definitions
* @ingroup osip2_port * @ingroup osip2_port
* @{ * @{
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Structure for referencing a mutex element. * Structure for referencing a mutex element.
* @struct osip_mutex * @struct osip_mutex
*/ */
struct osip_mutex; struct osip_mutex;
/** /**
* Allocate and Initialise a mutex. * Allocate and Initialise a mutex.
*/ */
struct osip_mutex *osip_mutex_init(void); struct osip_mutex *osip_mutex_init (void);
/** /**
* Destroy the mutex. * Destroy the mutex.
* @param mut The mutex to destroy. * @param mut The mutex to destroy.
*/ */
void osip_mutex_destroy(struct osip_mutex *mut); void osip_mutex_destroy (struct osip_mutex *mut);
/** /**
* Lock the mutex. * Lock the mutex.
* @param mut The mutex to lock. * @param mut The mutex to lock.
*/ */
int osip_mutex_lock(struct osip_mutex *mut); int osip_mutex_lock (struct osip_mutex *mut);
/** /**
* Unlock the mutex. * Unlock the mutex.
* @param mut The mutex to unlock. * @param mut The mutex to unlock.
*/ */
int osip_mutex_unlock(struct osip_mutex *mut); int osip_mutex_unlock (struct osip_mutex *mut);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/** @} */ /** @} */
#endif /* OSIP_MT */ #endif /* OSIP_MONOTHREAD */
#endif /* end of _THREAD_H_ #endif /* end of _THREAD_H_ */
*/
 End of changes. 22 change blocks. 
29 lines changed or deleted 21 lines changed or added


 osip_parser.h   osip_parser.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
skipping to change at line 44 skipping to change at line 44
* @{ * @{
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Initialise the oSIP parser. * Initialise the oSIP parser.
*/ */
int parser_init(void); int parser_init (void);
/** /**
* Fix the via header for INCOMING requests only. * Fix the via header for INCOMING requests only.
* a copy of ip_addr is done. * a copy of ip_addr is done.
*/ */
int osip_message_fix_last_via_header(osip_message_t * request, int osip_message_fix_last_via_header (osip_message_t * request, const cha
r *ip_addr, int port);
const char *ip_addr, int port);
/** /**
* define this macro to avoid building several times * define this macro to avoid building several times
* the message on retransmissions. If you have changed * the message on retransmissions. If you have changed
* the osip_message_t element since last call of osip_message_to_str() you * the osip_message_t element since last call of osip_message_to_str() you
* can call osip_message_force_update() to force a rebuild. * can call osip_message_force_update() to force a rebuild.
*/ */
/** /**
* Check if the element is already built. (so osip_message_to_str won't bui ld it again) * Check if the element is already built. (so osip_message_to_str won't bui ld it again)
* @param sip The element to check. * @param sip The element to check.
*/ */
int osip_message_get__property(const osip_message_t * sip); int osip_message_get__property (const osip_message_t * sip);
/** /**
* Force a osip_message_t element to be rebuild on next osip_message_to_str () call. * Force a osip_message_t element to be rebuild on next osip_message_to_str () call.
* @param sip The element to work on. * @param sip The element to work on.
*/ */
int osip_message_force_update(osip_message_t * sip); int osip_message_force_update (osip_message_t * sip);
/** /**
* Get the usual reason phrase as defined in SIP for a specific status code . * Get the usual reason phrase as defined in SIP for a specific status code .
* @param status_code A status code. * @param status_code A status code.
*/ */
const char *osip_message_get_reason(int status_code); const char *osip_message_get_reason (int status_code);
/** /**
* Set the Accept header. * Set the Accept header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_set_accept(osip_message_t * sip, const char *hvalue ); int osip_message_set_accept (osip_message_t * sip, const char *hvalue);
#else #else
#define osip_message_set_accept(sip,value) osip_message_set_head er((osip_message_t *)sip,(const char *)"Accept",value) #define osip_message_set_accept(sip,value) osip_message_set_head er((osip_message_t *)sip,(const char *)"Accept",value)
#endif #endif
/** /**
* Get one Accept header. * Get one Accept header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_accept(const osip_message_t * sip, int pos, int osip_message_get_accept (const osip_message_t * sip, int pos, osip_ac
osip_accept_ cept_t ** dest);
t ** dest);
#else #else
#define osip_message_get_accept(sip,pos,dest) osip_message_header_ get_byname(( osip_message_t *)sip,(const char *)"accept",pos,(osip_header_t **)dest) #define osip_message_get_accept(sip,pos,dest) osip_message_header_ get_byname(( osip_message_t *)sip,(const char *)"accept",pos,(osip_header_t **)dest)
#endif #endif
/** /**
* Set the Accept-encoding header. * Set the Accept-encoding header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_set_accept_encoding(osip_message_t * sip, const cha r *hvalue); int osip_message_set_accept_encoding (osip_message_t * sip, const char *h value);
#else #else
#define osip_message_set_accept_encoding(sip,value) osip_message _set_header((osip_message_t *)sip,(const char *)"Accept-Encoding",value) #define osip_message_set_accept_encoding(sip,value) osip_message _set_header((osip_message_t *)sip,(const char *)"Accept-Encoding",value)
#endif #endif
/** /**
* Get one Accept-encoding header. * Get one Accept-encoding header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_accept_encoding(const osip_message_t * sip, int int osip_message_get_accept_encoding (const osip_message_t * sip, int pos
pos, , osip_accept_encoding_t ** dest);
osip_accept_encoding_t ** dest);
#else #else
#define osip_message_get_accept_encoding(sip,pos,dest) osip_messag e_header_get_byname(( osip_message_t *)sip,(const char *)"accept-encoding", pos,(osip_header_t **)dest) #define osip_message_get_accept_encoding(sip,pos,dest) osip_messag e_header_get_byname(( osip_message_t *)sip,(const char *)"accept-encoding", pos,(osip_header_t **)dest)
#endif #endif
/** /**
* Set the Accept-language header. * Set the Accept-language header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_set_accept_language(osip_message_t * sip, const cha r *hvalue); int osip_message_set_accept_language (osip_message_t * sip, const char *h value);
#else #else
#define osip_message_set_accept_language(sip,value) osip_message _set_header((osip_message_t *)sip,(const char *)"Accept-Language",value) #define osip_message_set_accept_language(sip,value) osip_message _set_header((osip_message_t *)sip,(const char *)"Accept-Language",value)
#endif #endif
/** /**
* Get one Accept-Language header. * Get one Accept-Language header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_accept_language(const osip_message_t * sip, int int osip_message_get_accept_language (const osip_message_t * sip, int pos
pos, , osip_accept_language_t ** dest);
osip_accept_language_t ** dest);
#else #else
#define osip_message_get_accept_language(sip,pos,dest) osip_messag e_header_get_byname(( osip_message_t *)sip,(const char *)"accept-language", pos,(osip_header_t **)dest) #define osip_message_get_accept_language(sip,pos,dest) osip_messag e_header_get_byname(( osip_message_t *)sip,(const char *)"accept-language", pos,(osip_header_t **)dest)
#endif #endif
/** /**
* Set the Alert-info header. * Set the Alert-info header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_set_alert_info(osip_message_t * sip, const char *hv alue); int osip_message_set_alert_info (osip_message_t * sip, const char *hvalue );
#else #else
#define osip_message_set_alert_info(sip,value) osip_message_set_ header((osip_message_t *)sip,(const char *)"Alert-Info",value) #define osip_message_set_alert_info(sip,value) osip_message_set_ header((osip_message_t *)sip,(const char *)"Alert-Info",value)
#endif #endif
/** /**
* Get one Alert-info header. * Get one Alert-info header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_alert_info(const osip_message_t * sip, int pos, int osip_message_get_alert_info (const osip_message_t * sip, int pos, osi
osip p_alert_info_t ** dest);
_alert_info_t ** dest);
#else #else
#define osip_message_get_alert_info(sip,pos,dest) osip_message_hea der_get_byname(( osip_message_t *)sip,(const char *)"alert-info",pos,(osip_ header_t **)dest) #define osip_message_get_alert_info(sip,pos,dest) osip_message_hea der_get_byname(( osip_message_t *)sip,(const char *)"alert-info",pos,(osip_ header_t **)dest)
#endif #endif
/** /**
* Set the Allow header. * Set the Allow header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_set_allow(osip_message_t * sip, const char *hvalue) ; int osip_message_set_allow (osip_message_t * sip, const char *hvalue);
#else #else
#define osip_message_set_allow(sip,value) osip_message_set_heade r((osip_message_t *)sip,(const char *)"Allow",value) #define osip_message_set_allow(sip,value) osip_message_set_heade r((osip_message_t *)sip,(const char *)"Allow",value)
#endif #endif
/** /**
* Get one Allow header. * Get one Allow header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_allow(const osip_message_t * sip, int pos, int osip_message_get_allow (const osip_message_t * sip, int pos, osip_all
osip_allow_t ** d ow_t ** dest);
est);
#else #else
#define osip_message_get_allow(sip,pos,dest) osip_message_header_g et_byname(( osip_message_t *)sip,(const char *)"allow",pos,(osip_header_t * *)dest) #define osip_message_get_allow(sip,pos,dest) osip_message_header_g et_byname(( osip_message_t *)sip,(const char *)"allow",pos,(osip_header_t * *)dest)
#endif #endif
/** /**
* Set the Authentication-info header. * Set the Authentication-info header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_set_authentication_info(osip_message_t * sip, int osip_message_set_authentication_info (osip_message_t * sip, const cha
r *hvalue);
const char *hvalue);
#else #else
#define osip_message_set_authentication_info(sip,value) osip_mes sage_set_header((osip_message_t *)sip,(const char *)"Authentication-Info",v alue) #define osip_message_set_authentication_info(sip,value) osip_mes sage_set_header((osip_message_t *)sip,(const char *)"Authentication-Info",v alue)
#endif #endif
/** /**
* Get one Authentication-info header. * Get one Authentication-info header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_authentication_info(const osip_message_t * sip, int osip_message_get_authentication_info (const osip_message_t * sip, int
pos, osip_authentication_info_t ** dest);
int pos,
osip_authentication_info_t ** dest);
#else #else
#define osip_message_get_authentication_info(sip,pos,dest) osip_me ssage_header_get_byname(( osip_message_t *)sip,(const char *)"authenticatio n-info",pos,(osip_header_t **)dest) #define osip_message_get_authentication_info(sip,pos,dest) osip_me ssage_header_get_byname(( osip_message_t *)sip,(const char *)"authenticatio n-info",pos,(osip_header_t **)dest)
#endif #endif
/** /**
* Set the Authorization header. * Set the Authorization header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_authorization(osip_message_t * sip, const char *hvalue); int osip_message_set_authorization (osip_message_t * sip, const char *hva 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.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_authorization(const osip_message_t * sip, int p int osip_message_get_authorization (const osip_message_t * sip, int pos,
os, osip_authorization_t ** dest);
o
sip_authorization_t ** dest);
#else #else
#define osip_message_get_authorization(sip, pos, dest) osip_message_get_kno wnheaderlist((&(sip)->authorizations), pos, (void **)(dest)) #define osip_message_get_authorization(sip, pos, dest) osip_message_get_kno wnheaderlist((&(sip)->authorizations), pos, (void **)(dest))
#endif #endif
/** /**
* Set the Call-id header. * Set the Call-id header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_call_id(osip_message_t * sip, const char *hvalu e); 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.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
osip_call_id_t *osip_message_get_call_id(const osip_message_t * sip) ; osip_call_id_t *osip_message_get_call_id (const osip_message_t * sip);
#else #else
#define osip_message_get_call_id(sip) ((sip)->call_id) #define osip_message_get_call_id(sip) ((sip)->call_id)
#endif #endif
/** /**
* Set the Call-info header. * Set the Call-info header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_set_call_info(osip_message_t * sip, const char *hva lue); int osip_message_set_call_info (osip_message_t * sip, const char *hvalue) ;
#else #else
#define osip_message_set_call_info(sip,value) osip_message_set_h eader((osip_message_t *)sip,(const char *)"Call-Info",value) #define osip_message_set_call_info(sip,value) osip_message_set_h eader((osip_message_t *)sip,(const char *)"Call-Info",value)
#endif #endif
/** /**
* Get one Call-info header. * Get one Call-info header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_call_info(const osip_message_t * sip, int pos, int osip_message_get_call_info (const osip_message_t * sip, int pos, osip
osip_call _call_info_t ** dest);
_info_t ** dest);
#else #else
#define osip_message_get_call_info(sip,pos,dest) osip_message_head er_get_byname(( osip_message_t *)sip,(const char *)"call-info",pos,(osip_he ader_t **)dest) #define osip_message_get_call_info(sip,pos,dest) osip_message_head er_get_byname(( osip_message_t *)sip,(const char *)"call-info",pos,(osip_he ader_t **)dest)
#endif #endif
/** /**
* Set the Contact header. * Set the Contact header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_contact(osip_message_t * sip, const char *hvalu e); 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.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_contact(const osip_message_t * sip, int pos, int osip_message_get_contact (const osip_message_t * sip, int pos, osip_c
osip_contac ontact_t ** dest);
t_t ** dest);
#else #else
#define osip_message_get_contact(sip, pos, dest) osip_message_get_knownhead erlist((&(sip)->contacts), pos, (void **)(dest)) #define osip_message_get_contact(sip, pos, dest) osip_message_get_knownhead erlist((&(sip)->contacts), pos, (void **)(dest))
#endif #endif
/** /**
* Set the Content-encoding header. * Set the Content-encoding header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_set_content_encoding(osip_message_t * sip, int osip_message_set_content_encoding (osip_message_t * sip, const char *
hvalue);
const char *hvalue);
#else #else
#define osip_message_set_content_encoding(sip,value) osip_messag e_set_header((osip_message_t *)sip,(const char *)"Content-Encoding",value) #define osip_message_set_content_encoding(sip,value) osip_messag e_set_header((osip_message_t *)sip,(const char *)"Content-Encoding",value)
#endif #endif
/** /**
* Get one Content-encoding header. * Get one Content-encoding header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_content_encoding(const osip_message_t * sip, in int osip_message_get_content_encoding (const osip_message_t * sip, int po
t pos, s, osip_content_encoding_t ** dest);
osip_content_encoding_t ** dest);
#else #else
#define osip_message_get_content_encoding(sip,pos,dest) osip_messa ge_header_get_byname(( osip_message_t *)sip,(const char *)"content-encoding ",pos,(osip_header_t **)dest) #define osip_message_get_content_encoding(sip,pos,dest) osip_messa ge_header_get_byname(( osip_message_t *)sip,(const char *)"content-encoding ",pos,(osip_header_t **)dest)
#endif #endif
/** /**
* Set the Content-length header. * Set the Content-length header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_content_length(osip_message_t * sip, const char *hvalue); int osip_message_set_content_length (osip_message_t * sip, const char *hv 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.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
osip_content_length_t *osip_message_get_content_length(const osip_me osip_content_length_t *osip_message_get_content_length (const osip_messag
ssage_t e_t * sip);
* sip);
#else #else
#define osip_message_get_content_length(sip) ((sip)->content_length) #define osip_message_get_content_length(sip) ((sip)->content_length)
#endif #endif
/** /**
* Set the Content-type header. * Set the Content-type header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_content_type(osip_message_t * sip, const char * hvalue); int osip_message_set_content_type (osip_message_t * sip, const char *hval 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.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
osip_content_type_t *osip_message_get_content_type(const osip_messag e_t * sip); osip_content_type_t *osip_message_get_content_type (const osip_message_t * sip);
#else #else
#define osip_message_get_content_type(sip) ((sip)->content_type) #define osip_message_get_content_type(sip) ((sip)->content_type)
#endif #endif
/** /**
* Set the Cseq header. * Set the Cseq header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_cseq(osip_message_t * sip, const char *hvalue); int osip_message_set_cseq (osip_message_t * sip, const char *hvalue);
/** /**
* Get one Cseq header. * Get one Cseq header.
* @param sip The element to work on. * @param sip The element to work on.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
osip_cseq_t *osip_message_get_cseq(const osip_message_t * sip); osip_cseq_t *osip_message_get_cseq (const osip_message_t * sip);
#else #else
#define osip_message_get_cseq(sip) ((sip)->cseq) #define osip_message_get_cseq(sip) ((sip)->cseq)
#endif #endif
/** /**
* Set the Error-info header. * Set the Error-info header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_set_error_info(osip_message_t * sip, const char *hv alue); int osip_message_set_error_info (osip_message_t * sip, const char *hvalue );
#else #else
#define osip_message_set_error_info(sip,value) osip_message_set_ header((osip_message_t *)sip,(const char *)"Error-Info",value) #define osip_message_set_error_info(sip,value) osip_message_set_ header((osip_message_t *)sip,(const char *)"Error-Info",value)
#endif #endif
/** /**
* Get one Error-info header. * Get one Error-info header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_error_info(const osip_message_t * sip, int pos, int osip_message_get_error_info (const osip_message_t * sip, int pos, osi
osip p_error_info_t ** dest);
_error_info_t ** dest);
#else #else
#define osip_message_get_error_info(sip,pos,dest) osip_message_hea der_get_byname(( osip_message_t *)sip,(const char *)"error-info",pos,(osip_ header_t **)dest) #define osip_message_get_error_info(sip,pos,dest) osip_message_hea der_get_byname(( osip_message_t *)sip,(const char *)"error-info",pos,(osip_ header_t **)dest)
#endif #endif
/** /**
* Set the From header. * Set the From header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_from(osip_message_t * sip, const char *hvalue); int osip_message_set_from (osip_message_t * sip, const char *hvalue);
/** /**
* Get the From header. * Get the From header.
* @param sip The element to work on. * @param sip The element to work on.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
osip_from_t *osip_message_get_from(const osip_message_t * sip); osip_from_t *osip_message_get_from (const osip_message_t * sip);
#else #else
#define osip_message_get_from(sip) ((sip)->from) #define osip_message_get_from(sip) ((sip)->from)
#endif #endif
/** /**
* Set the mime-version header. * Set the mime-version header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_mime_version(osip_message_t * sip, const char * hvalue); int osip_message_set_mime_version (osip_message_t * sip, const char *hval 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.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
osip_mime_version_t *osip_message_get_mime_version(const osip_messag e_t * sip); osip_mime_version_t *osip_message_get_mime_version (const osip_message_t * sip);
#else #else
#define osip_message_get_mime_version(sip) ((sip)->mime_version) #define osip_message_get_mime_version(sip) ((sip)->mime_version)
#endif #endif
/** /**
* Set the Proxy-authenticate header. * Set the Proxy-authenticate header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_proxy_authenticate(osip_message_t * sip, int osip_message_set_proxy_authenticate (osip_message_t * sip, const char
*hvalue);
const char *hvalue);
/** /**
* Get the Proxy-authenticate header. * Get the Proxy-authenticate header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_proxy_authenticate(const osip_message_t * sip, int osip_message_get_proxy_authenticate (const osip_message_t * sip, int
pos, osip_proxy_authenticate_t ** dest);
int pos,
osip_proxy_authenticate_t ** dest);
#else #else
#define osip_message_get_proxy_authenticate(sip, pos, dest) osip_message_ge t_knownheaderlist((&(sip)->proxy_authenticates), pos, (void **)(dest)) #define osip_message_get_proxy_authenticate(sip, pos, dest) osip_message_ge t_knownheaderlist((&(sip)->proxy_authenticates), pos, (void **)(dest))
#endif #endif
/** /**
* Set the Proxy-authorization header. * Set the Proxy-authorization header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_proxy_authorization(osip_message_t * sip, int osip_message_set_proxy_authorization (osip_message_t * sip, const cha
r *hvalue);
const char *hvalue);
/** /**
* Get one Proxy-authorization header. * Get one Proxy-authorization header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_proxy_authorization(const osip_message_t * sip, int osip_message_get_proxy_authorization (const osip_message_t * sip, int
pos, osip_proxy_authorization_t ** dest);
int pos,
osip_proxy_authorization_t ** dest);
#else #else
#define osip_message_get_proxy_authorization(sip, pos, dest) osip_message_g et_knownheaderlist((&(sip)->proxy_authorizations), pos, (void **)(dest)) #define osip_message_get_proxy_authorization(sip, pos, dest) osip_message_g et_knownheaderlist((&(sip)->proxy_authorizations), pos, (void **)(dest))
#endif #endif
/** /**
* Set the Proxy-authentication-info header. * Set the Proxy-authentication-info header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_set_proxy_authentication_info(osip_message_t * sip, int osip_message_set_proxy_authentication_info (osip_message_t * sip, con
st char *hvalue);
const char *hvalue);
#else #else
#define osip_message_set_proxy_authentication_info(sip,value) os ip_message_set_header((osip_message_t *)sip,(const char *)"Proxy-Authentica tion-Info",value) #define osip_message_set_proxy_authentication_info(sip,value) os ip_message_set_header((osip_message_t *)sip,(const char *)"Proxy-Authentica tion-Info",value)
#endif #endif
/** /**
* Get the Proxy-authentication-info header. * Get the Proxy-authentication-info header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_proxy_authentication_info(const osip_message_t int osip_message_get_proxy_authentication_info (const osip_message_t * si
* sip, p, int pos, osip_proxy_authentication_info_t ** dest);
int pos,
osip_proxy_authentication_info_t
** dest);
#else #else
#define osip_message_get_proxy_authentication_info(sip,pos,dest) o sip_message_header_get_byname(( osip_message_t *)sip,(const char *)"proxy-a uthentication-info",pos,(osip_header_t **)dest) #define osip_message_get_proxy_authentication_info(sip,pos,dest) o sip_message_header_get_byname(( osip_message_t *)sip,(const char *)"proxy-a uthentication-info",pos,(osip_header_t **)dest)
#endif #endif
/** /**
* Set the Record-Route header. * Set the Record-Route header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_record_route(osip_message_t * sip, const char * hvalue); int osip_message_set_record_route (osip_message_t * sip, const char *hval 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.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_record_route(const osip_message_t * sip, int po int osip_message_get_record_route (const osip_message_t * sip, int pos, o
s, sip_record_route_t ** dest);
os
ip_record_route_t ** dest);
#else #else
#define osip_message_get_record_route(sip, pos, dest) osip_message_get_know nheaderlist((&(sip)->record_routes), pos, (void **)(dest)) #define osip_message_get_record_route(sip, pos, dest) osip_message_get_know nheaderlist((&(sip)->record_routes), pos, (void **)(dest))
#endif #endif
/** /**
* Set the Route header. * Set the Route header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_route(osip_message_t * sip, const char *hvalue) ; int osip_message_set_route (osip_message_t * sip, const char *hvalue);
/** /**
* Get one Route header. * Get one Route header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_route(const osip_message_t * sip, int pos, int osip_message_get_route (const osip_message_t * sip, int pos, osip_rou
osip_route_t ** d te_t ** dest);
est);
#else #else
#define osip_message_get_route(sip, pos, dest) osip_message_get_knownheader list((&(sip)->routes), pos, (void **)(dest)) #define osip_message_get_route(sip, pos, dest) osip_message_get_knownheader list((&(sip)->routes), pos, (void **)(dest))
#endif #endif
/** /**
* Set the To header. * Set the To header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_to(osip_message_t * sip, const char *hvalue); int osip_message_set_to (osip_message_t * sip, const char *hvalue);
/** /**
* Get the To header. * Get the To header.
* @param sip The element to work on. * @param sip The element to work on.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
osip_to_t *osip_message_get_to(const osip_message_t * sip); osip_to_t *osip_message_get_to (const osip_message_t * sip);
#else #else
#define osip_message_get_to(sip) ((sip)->to) #define osip_message_get_to(sip) ((sip)->to)
#endif #endif
/** /**
* Set the Via header. * Set the Via header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_via(osip_message_t * sip, const char *hvalue); int osip_message_set_via (osip_message_t * sip, const char *hvalue);
/** /**
* Append a Via header. * Append a Via header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_append_via(osip_message_t * sip, const char *hvalue ); int osip_message_append_via (osip_message_t * sip, const char *hvalue);
/** /**
* Get one Via header. * Get one Via header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_via(const osip_message_t * sip, int pos, int osip_message_get_via (const osip_message_t * sip, int pos, osip_via_t
osip_via_t ** dest) ** dest);
;
#else #else
#define osip_message_get_via(sip, pos, dest) osip_message_get_knownheaderli st((&(sip)->vias), pos, (void **)(dest)) #define osip_message_get_via(sip, pos, dest) osip_message_get_knownheaderli st((&(sip)->vias), pos, (void **)(dest))
#endif #endif
/** /**
* Set the Www-authenticate header. * Set the Www-authenticate header.
* @param sip The element to work on. * @param sip The element to work on.
* @param hvalue The string describing the element. * @param hvalue The string describing the element.
*/ */
int osip_message_set_www_authenticate(osip_message_t * sip, int osip_message_set_www_authenticate (osip_message_t * sip, const char *
hvalue);
const char *hvalue);
/** /**
* Get one Www-authenticate header. * Get one Www-authenticate header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_www_authenticate(const osip_message_t * sip, in int osip_message_get_www_authenticate (const osip_message_t * sip, int po
t pos, s, osip_www_authenticate_t ** dest);
osip_www_authenticate_t ** dest);
#else #else
#define osip_message_get_www_authenticate(sip, pos, dest) osip_message_get_ knownheaderlist((&(sip)->www_authenticates), pos, (void **)(dest)) #define osip_message_get_www_authenticate(sip, pos, dest) osip_message_get_ knownheaderlist((&(sip)->www_authenticates), pos, (void **)(dest))
#endif #endif
#ifndef DOXYGEN #ifndef DOXYGEN
/** /**
* Allocate and Add multiple header (not defined in oSIP). * Allocate and Add multiple header (not defined in oSIP).
* @param sip The element to work on. * @param sip The element to work on.
* @param hname The token name. NAME MUST BE DYNAMICLY ALLOCATED * @param hname The token name. NAME MUST BE DYNAMICLY ALLOCATED
* @param hvalue The token value. VALUE MUST BE DYNAMICLY ALLOCATED * @param hvalue The token value. VALUE MUST BE DYNAMICLY ALLOCATED
*/ */
int osip_message_set_multiple_header(osip_message_t * sip, char *hna int osip_message_set_multiple_header (osip_message_t * sip, char *hname,
me, 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, con
const char * st char *hvalue);
hvalue);
/** /**
* Allocate and Add/Replace an "unknown" header (not defined in oSIP). * Allocate and Add/Replace an "unknown" header (not defined in oSIP).
* @param sip The element to work on. * @param sip The element to work on.
* @param hname The token name. * @param hname The token name.
* @param hvalue The token value. * @param hvalue The token value.
*/ */
int osip_message_replace_header(osip_message_t * sip, const char *hn int osip_message_replace_header (osip_message_t * sip, const char *hname,
ame, const char *hvalue);
cons
t char *hvalue);
#ifndef MINISIZE #ifndef MINISIZE
/** /**
* Allocate and Add an "unknown" header (not defined in oSIP). * Allocate and Add an "unknown" header (not defined in oSIP).
* The element is add on the top of the unknown header list. * The element is add on the top of the unknown header list.
* @param sip The element to work on. * @param sip The element to work on.
* @param hname The token name. * @param hname The token name.
* @param hvalue The token value. * @param hvalue The token value.
*/ */
int osip_message_set_topheader(osip_message_t * sip, const char *hna int osip_message_set_topheader (osip_message_t * sip, const char *hname,
me, const char *hvalue);
const cha
r *hvalue);
#endif #endif
/** /**
* Find an "unknown" header. (not defined in oSIP) * Find an "unknown" header. (not defined in oSIP)
* @param sip The element to work on. * @param sip The element to work on.
* @param hname The name of the header to find. * @param hname The name of the header to find.
* @param pos The index where to start searching for the header. * @param pos The index where to start searching for the header.
* @param dest A pointer to the header found. * @param dest A pointer to the header found.
*/ */
int osip_message_header_get_byname(const osip_message_t * sip, int osip_message_header_get_byname (const osip_message_t * sip, const cha
c r *hname, int pos, osip_header_t ** dest);
onst char *hname, int pos,
o
sip_header_t ** dest);
/** /**
* Get one "unknown" header. * Get one "unknown" header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the header found. * @param dest A pointer on the header found.
*/ */
#ifndef MINISZE #ifndef MINISZE
int osip_message_get_header(const osip_message_t * sip, int pos, int osip_message_get_header (const osip_message_t * sip, int pos, osip_he
osip_header_ ader_t ** dest);
t ** dest);
#else #else
#define osip_message_get_header(sip, pos, dest) osip_message_get_knownheade rlist((&(sip)->headers), pos, (void **)(dest)) #define osip_message_get_header(sip, pos, dest) osip_message_get_knownheade rlist((&(sip)->headers), pos, (void **)(dest))
#endif #endif
/** /**
* Set the Body of the SIP message. * Set the Body of the SIP message.
* @param sip The element to work on. * @param sip The element to work on.
* @param buf The buffer containing the body. * @param buf The buffer containing the body.
* @param length The length of the buffer. * @param length The length of the buffer.
*/ */
int osip_message_set_body(osip_message_t * sip, const char *buf, int osip_message_set_body (osip_message_t * sip, const char *buf, size_t
size_t length); length);
/** /**
* Set the Body of the SIP message. (please report bugs) * Set the Body of the SIP message. (please report bugs)
* @param sip The element to work on. * @param sip The element to work on.
* @param buf the buffer containing the body. * @param buf the buffer containing the body.
* @param length The length of the buffer. * @param length The length of the buffer.
*/ */
int osip_message_set_body_mime(osip_message_t * sip, const char *buf int osip_message_set_body_mime (osip_message_t * sip, const char *buf, si
, ze_t length);
size_t le
ngth);
/** /**
* Get one body header. * Get one body header.
* @param sip The element to work on. * @param sip The element to work on.
* @param pos The index of the element to get. * @param pos The index of the element to get.
* @param dest A pointer on the body found. * @param dest A pointer on the body found.
*/ */
#ifndef MINISIZE #ifndef MINISIZE
int osip_message_get_body(const osip_message_t * sip, int pos, int osip_message_get_body (const osip_message_t * sip, int pos, osip_body
osip_body_t ** des _t ** dest);
t);
#else #else
#define osip_message_get_body(sip, pos, dest) osip_message_get_knownheaderl ist((&(sip)->bodies), pos, (void **)(dest)) #define osip_message_get_body(sip, pos, dest) osip_message_get_knownheaderl ist((&(sip)->bodies), pos, (void **)(dest))
#endif #endif
/* trace facilities */ /* trace facilities */
#ifndef DOXYGEN /* avoid DOXYGEN war ning */ #ifndef DOXYGEN /* avoid DOXYGEN warning */
#ifdef ENABLE_TRACE #ifdef ENABLE_TRACE
void msg_logrequest(osip_message_t * sip, char *fmt); void msg_logrequest (osip_message_t * sip, char *fmt);
void msg_logresponse(osip_message_t * sip, char *fmt); void msg_logresponse (osip_message_t * sip, char *fmt);
#else #else
#define msg_logrequest(P,Q) ; #define msg_logrequest(P,Q) ;
#define msg_logresponse(P,Q) ; #define msg_logresponse(P,Q) ;
#endif #endif
#endif #endif
/** /**
* Allocate and Add a new Date header. * Allocate and Add a new Date header.
* @param sip The element to work on. * @param sip The element to work on.
* @param value the value of the new header. * @param value the value of the new header.
 End of changes. 68 change blocks. 
162 lines changed or deleted 104 lines changed or added


 osip_port.h   osip_port.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
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_PORT_H_ #ifndef _OSIP_PORT_H_
#define _OSIP_PORT_H_ #define _OSIP_PORT_H_
/* Include necessary headers for osip */
#include <stdio.h> #include <stdio.h>
#if defined(__arc__) /* on android, va_list is only defined if stdarg.h is included before */
#include "includes_api.h" /* on other platform, it doesn't harm to have it */
#include "os_cfg_pub.h" #if defined(HAVE_STDARG_H)
#include <posix_time_pub.h>
#endif
#if defined(__PALMOS__) && (__PALMOS__ >= 0x06000000)
# define STDC_HEADERS 1
# define HAVE_CTYPE_H 1
# define HAVE_STRING_H 1
# define HAVE_SYS_TYPES_H 1
# define HAVE_TIME_H 1
# define HAVE_STDARG_H 1
#elif defined _WIN32_WCE
#define STDC_HEADERS 1
#define HAVE_CTYPE_H 1
#define HAVE_STRING_H 1
#define HAVE_TIME_H 1
#define HAVE_STDARG_H 1
#define snprintf _snprintf
#define EBUSY 16
#elif defined(WIN32)
#define STDC_HEADERS 1
#define HAVE_CTYPE_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_TIME_H 1
#define HAVE_STDARG_H 1
#define snprintf _snprintf
/* use win32 crypto routines for random number generation */
/* only use for vs .net (compiler v. 1300) or greater */
#if _MSC_VER >= 1300
#define WIN32_USE_CRYPTO 1
#endif
#endif
#if defined(__VXWORKS_OS__) || defined(__rtems__)
#include <string.h>
#include <time.h>
#include <sys/times.h>
#include <stdarg.h> #include <stdarg.h>
#include <sys/types.h>
#include <stdlib.h>
#define VA_START(a, f) va_start(a, f)
#if defined(__VXWORKS_OS__)
/* VxWorks lacks support for snprintf */
int osip_vsnprintf(char *buf, int max, const char *fmt, va_list ap);
int osip_snprintf(char *buf, int max, const char *fmt, ...);
#define snprintf osip_snprintf
#define vsnprintf osip_vsnprintf
#endif
#else /* end of __VXWORKS_
OS__ */
#if defined (HAVE_CONFIG_H)
#include <config.h>
# if defined (HAVE_STRING_H)
# include <string.h>
# else
# include <strings.h>
# endif /* HAVE_STRING_H */
#else #else
# include <string.h> #if defined(HAVE_VARARGS_H)
#endif /* !HAVE_CONFIG_H */ #include <varargs.h>
#if defined (HAVE_SYS_TYPES_H)
# include <sys/types.h>
#endif
#ifdef STDC_HEADERS
# include <stdlib.h>
#endif /* !STDC_HEADERS */
#if defined(HAVE_STDARG_H) || defined(WIN32)
# include <stdarg.h>
# define VA_START(a, f) va_start(a, f)
#else #else
# if defined(HAVE_VARARGS_H) #include <stdarg.h>
# include <varargs.h>
# define VA_START(a, f) va_start(a)
# else
# include <stdarg.h>
# define VA_START(a, f) va_start(a, f)
# endif
#endif
#ifdef HAVE_TIME_H
# include <time.h>
#endif
#if defined (HAVE_SYS_TIME_H)
# include <sys/time.h>
#endif #endif
#endif /* end of !__VXWORKS
_OS__ */
#ifdef _WIN32_WCE
#define VA_START(a, f) va_start(a, f)
#endif #endif
#ifdef WIN32 #if defined(__VXWORKS_OS__)
#define VA_START(a, f) va_start(a, f) /* VxWorks lacks support for snprintf */
#endif int osip_vsnprintf (char *buf, int max, const char *fmt, va_list ap);
int osip_snprintf (char *buf, int max, const char *fmt, ...);
#ifdef __PSOS__
#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 #define snprintf osip_snprintf
#ifndef INT_MAX #define vsnprintf osip_vsnprintf
#define INT_MAX 0x7FFFFFFF
#endif
#endif
#if __STDC__
# ifndef NOPROTOS
# define PARAMS(args) args
# endif
#endif
#ifndef PARAMS
# define PARAMS(args) ()
#endif #endif
#include <osipparser2/osip_const.h> #include <osipparser2/osip_const.h>
#include <osipparser2/osip_list.h> #include <osipparser2/osip_list.h>
#define SIP_SYNTAX_ERROR (-1) #define SIP_SYNTAX_ERROR (-1)
#define SIP_NETWORK_ERROR (-2) #define SIP_NETWORK_ERROR (-2)
#define SIP_ECONNREFUSED (-3) #define SIP_ECONNREFUSED (-3)
#define SIP_RESSOURCE_ERROR (-4) #define SIP_RESSOURCE_ERROR (-4)
skipping to change at line 187 skipping to change at line 67
extern "C" { extern "C" {
#endif #endif
/**************************/ /**************************/
/* MALLOC redirections */ /* MALLOC redirections */
/**************************/ /**************************/
#if !defined(WIN32) && !defined(_WIN32_WCE) #if !defined(WIN32) && !defined(_WIN32_WCE)
#ifndef MINISIZE #ifndef MINISIZE
typedef void *osip_malloc_func_t(size_t size); typedef void *osip_malloc_func_t (size_t size);
typedef void osip_free_func_t(void *ptr); typedef void osip_free_func_t (void *ptr);
typedef void *osip_realloc_func_t(void *ptr, size_t size); typedef void *osip_realloc_func_t (void *ptr, size_t size);
extern osip_malloc_func_t *osip_malloc_func; extern osip_malloc_func_t *osip_malloc_func;
extern osip_realloc_func_t *osip_realloc_func; extern osip_realloc_func_t *osip_realloc_func;
extern osip_free_func_t *osip_free_func; extern osip_free_func_t *osip_free_func;
void osip_set_allocators(osip_malloc_func_t * malloc_func, void osip_set_allocators (osip_malloc_func_t * malloc_func, osip_realloc_
osip_realloc_func_t func_t * realloc_func, osip_free_func_t * free_func);
* realloc_func,
osip_free_func_t *
free_func);
#endif #endif
#ifdef DEBUG_MEM #ifdef DEBUG_MEM
void *_osip_malloc(size_t size, char *file, unsigned short line); void *_osip_malloc (size_t size, char *file, unsigned short line);
void _osip_free(void *ptr); void _osip_free (void *ptr);
void *_osip_realloc(void *ptr, size_t size, char *file, unsigned sho void *_osip_realloc (void *ptr, size_t size, char *file, unsigned short l
rt line); ine);
#ifndef osip_malloc #ifndef osip_malloc
#define osip_malloc(S) _osip_malloc(S,__FILE__,__LINE__) #define osip_malloc(S) _osip_malloc(S,__FILE__,__LINE__)
#endif #endif
#ifndef osip_realloc #ifndef osip_realloc
#define osip_realloc(P,S) _osip_realloc(P,S,__FILE__,__LINE__) #define osip_realloc(P,S) _osip_realloc(P,S,__FILE__,__LINE__)
#endif #endif
#ifndef osip_free #ifndef osip_free
#define osip_free(P) { if (P!=NULL) { _osip_free(P); } } #define osip_free(P) { if (P!=NULL) { _osip_free(P); } }
#endif #endif
skipping to change at line 230 skipping to change at line 108
#define osip_malloc(S) (osip_malloc_func?osip_malloc_func(S):malloc(S)) #define osip_malloc(S) (osip_malloc_func?osip_malloc_func(S):malloc(S))
#endif #endif
#ifndef osip_realloc #ifndef osip_realloc
#define osip_realloc(P,S) (osip_realloc_func?osip_realloc_func(P,S):realloc (P,S)) #define osip_realloc(P,S) (osip_realloc_func?osip_realloc_func(P,S):realloc (P,S))
#endif #endif
#ifndef osip_free #ifndef osip_free
#define osip_free(P) { if (P!=NULL) { if (osip_free_func) osip_free_func(P) ; else free(P);} } #define osip_free(P) { if (P!=NULL) { if (osip_free_func) osip_free_func(P) ; else free(P);} }
#endif #endif
#else #else
/* MINISIZE code */ /* MINISIZE code */
#ifndef osip_malloc #ifndef osip_malloc
#define osip_malloc(S) malloc(S) #define osip_malloc(S) malloc(S)
#endif #endif
#ifndef osip_realloc #ifndef osip_realloc
#define osip_realloc(P,S) realloc(P,S) #define osip_realloc(P,S) realloc(P,S)
#endif #endif
#ifndef osip_free #ifndef osip_free
#define osip_free(P) { if (P!=NULL) { free(P);} } #define osip_free(P) { if (P!=NULL) { free(P);} }
#endif #endif
#endif #endif
#endif #endif
#else #else
void *osip_malloc(size_t size); #if 0 /* for windows test purpose */
void *osip_realloc(void *, size_t size); #ifndef osip_malloc
void osip_free(void *); #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
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);
#else
void *osip_malloc (size_t size);
void *osip_realloc (void *, size_t size);
void osip_free (void *);
#endif
#endif #endif
#ifdef WIN32 #ifdef WIN32
#define alloca _alloca #define alloca _alloca
#endif #endif
/**************************/ /**************************/
/* RANDOM number support */ /* RANDOM number support */
/**************************/ /**************************/
unsigned int osip_build_random_number(void); unsigned int osip_build_random_number (void);
/**************************/ /**************************/
/* TIMER support */ /* TIMER support */
/**************************/ /**************************/
#define SP " \0" #define SP " \0"
void osip_usleep(int useconds); void osip_usleep (int useconds);
#ifndef MINISIZE #ifndef MINISIZE
int osip_atoi(const char *number); int osip_atoi (const char *number);
int osip_strcasecmp(const char *s1, const char *s2); int osip_strcasecmp (const char *s1, const char *s2);
int osip_strncasecmp(const char *s1, const char *s2, size_t len); int osip_strncasecmp (const char *s1, const char *s2, size_t len);
char *osip_strcasestr(const char *haystack, const char *needle); char *osip_strcasestr (const char *haystack, const char *needle);
#else #else
#define osip_atoi atoi #define osip_atoi atoi
#define osip_strcasecmp strcasecmp #define osip_strcasecmp strcasecmp
#define osip_strncasecmp strncasecmp #define osip_strncasecmp strncasecmp
#define osip_strcasestr strcasestr #define osip_strcasestr strcasestr
#endif #endif
/**************************/ /**************************/
/* STRING support */ /* STRING support */
/**************************/ /**************************/
char *osip_strncpy(char *dest, const char *src, size_t length); char *osip_strncpy (char *dest, const char *src, size_t length);
char *osip_strdup(const char *ch); char *osip_strdup (const char *ch);
char *osip_strdup_without_quote(const char *ch); char *osip_strdup_without_quote (const char *ch);
int osip_tolower(char *word); int osip_tolower (char *word);
int osip_clrspace(char *word); int osip_clrspace (char *word);
char *__osip_sdp_append_string(char *string, size_t size, char *__osip_sdp_append_string (char *string, size_t size, char *cur, cha
char *cur r *string_osip_to_append);
, char *string_osip_to_append); int __osip_set_next_token (char **dest, char *buf, int end_separator, cha
int __osip_set_next_token(char **dest, char *buf, int end_separator, r **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);
unsigned long osip_hash (const char *str);
unsigned long osip_hash(const char *str); char *osip_str_append (char *dst, const char *src);
char *osip_str_append(char *dst, const char *src); char *osip_strn_append (char *dst, const char *src, size_t len);
char *osip_strn_append(char *dst, const char *src, size_t len); char *osip_clrncpy (char *dst, const char *src, size_t len);
char *osip_clrncpy(char *dst, const char *src, size_t len);
/**************************/ /**************************/
/* LOG&DEBUG support */ /* LOG&DEBUG support */
/**************************/ /**************************/
#define LOG_TRUE 1 #define LOG_TRUE 1
#define LOG_FALSE 0 #define LOG_FALSE 0
/* levels */ /* levels */
typedef enum _trace_level { typedef enum _trace_level {
TRACE_LEVEL0 = 0, TRACE_LEVEL0 = 0,
#define OSIP_FATAL TRACE_LEVEL0 #define OSIP_FATAL TRACE_LEVEL0
TRACE_LEVEL1 = 1, TRACE_LEVEL1 = 1,
#define OSIP_BUG TRACE_LEVEL1 #define OSIP_BUG TRACE_LEVEL1
TRACE_LEVEL2 = 2, TRACE_LEVEL2 = 2,
#define OSIP_ERROR TRACE_LEVEL2 #define OSIP_ERROR TRACE_LEVEL2
TRACE_LEVEL3 = 3, TRACE_LEVEL3 = 3,
#define OSIP_WARNING TRACE_LEVEL3 #define OSIP_WARNING TRACE_LEVEL3
TRACE_LEVEL4 = 4, TRACE_LEVEL4 = 4,
#define OSIP_INFO1 TRACE_LEVEL4 #define OSIP_INFO1 TRACE_LEVEL4
TRACE_LEVEL5 = 5, TRACE_LEVEL5 = 5,
#define OSIP_INFO2 TRACE_LEVEL5 #define OSIP_INFO2 TRACE_LEVEL5
TRACE_LEVEL6 = 6, TRACE_LEVEL6 = 6,
#define OSIP_INFO3 TRACE_LEVEL6 #define OSIP_INFO3 TRACE_LEVEL6
TRACE_LEVEL7 = 7, TRACE_LEVEL7 = 7,
#define OSIP_INFO4 TRACE_LEVEL7 #define OSIP_INFO4 TRACE_LEVEL7
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 typedef void osip_trace_func_t (char *fi, int li, osip_trace_level_t leve
level, l, char *chfr, va_list ap);
char *chf
r, va_list ap);
/* these are defined in all cases, but are empty when oSIP is compiled /* these are defined in all cases, but are empty when oSIP is compiled
without trace */ without trace */
void osip_trace_initialize_func(osip_trace_level_t level, void osip_trace_initialize_func (osip_trace_level_t level, osip_trace_fun
osip c_t * func);
_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 *id ;
ent); 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)
#define TRACE_ENABLE_LEVEL(level) do { } while (0) #define TRACE_ENABLE_LEVEL(level) do { } while (0)
#define TRACE_DISABLE_LEVEL(level) do { } while (0) #define TRACE_DISABLE_LEVEL(level) do { } while (0)
#define IS_TRACE_LEVEL_ACTIVATE(level) (-1) #define IS_TRACE_LEVEL_ACTIVATE(level) (-1)
#else #else
skipping to change at line 369 skipping to change at line 259
#define TRACE_DISABLE_LEVEL(level) osip_trace_disable_level ( level ) #define TRACE_DISABLE_LEVEL(level) osip_trace_disable_level ( level )
#define IS_TRACE_LEVEL_ACTIVATE(level) osip_is_trace_level_activate( level ) #define IS_TRACE_LEVEL_ACTIVATE(level) osip_is_trace_level_activate( level )
#endif #endif
/* log facility. */ /* log facility. */
/* if f is NULL, current default log file is used. */ /* if f is NULL, current default log file is used. */
/* INPUT: level | level of the trace */ /* INPUT: level | level of the trace */
/* INPUT: f | use f instead of default log file */ /* INPUT: f | use f instead of default log file */
/* INPUT: chfr | format string for next args */ /* INPUT: chfr | format string for next args */
int osip_trace(char *fi, int li, osip_trace_level_t level, FILE * f, int osip_trace (char *fi, int li, osip_trace_level_t level, FILE * f, cha
char *chfr, ...); r *chfr, ...);
#ifdef ENABLE_TRACE #ifdef ENABLE_TRACE
#define OSIP_TRACE(P) P #define OSIP_TRACE(P) P
#else #else
#define OSIP_TRACE(P) do {} while (0) #define OSIP_TRACE(P) do {} while (0)
#endif #endif
#define REMOVE_ELEMENT(first_element, element) \ #define REMOVE_ELEMENT(first_element, element) \
if (element->parent==NULL) \ if (element->parent==NULL) \
{ first_element = element->next; \ { first_element = element->next; \
skipping to change at line 419 skipping to change at line 308
element->parent = NULL; /* useless */ } \ element->parent = NULL; /* useless */ } \
else \ else \
{ type_of_element_t *f; \ { type_of_element_t *f; \
for (f=first_element; f->next!=NULL; f=f->next) \ for (f=first_element; f->next!=NULL; f=f->next) \
{ } \ { } \
f->next = element; \ f->next = element; \
element->parent = f; \ element->parent = f; \
element->next = NULL; \ element->next = NULL; \
} }
const char *osip_strerror(int err); const char *osip_strerror (int err);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#define OSIP_SUCCESS 0 #define OSIP_SUCCESS 0
#define OSIP_UNDEFINED_ERROR -1 #define OSIP_UNDEFINED_ERROR -1
#define OSIP_BADPARAMETER -2 #define OSIP_BADPARAMETER -2
#define OSIP_WRONG_STATE -3 #define OSIP_WRONG_STATE -3
#define OSIP_NOMEM -4 #define OSIP_NOMEM -4
#define OSIP_SYNTAXERROR -5 #define OSIP_SYNTAXERROR -5
skipping to change at line 442 skipping to change at line 331
#define OSIP_NO_NETWORK -10 #define OSIP_NO_NETWORK -10
#define OSIP_PORT_BUSY -11 #define OSIP_PORT_BUSY -11
#define OSIP_UNKNOWN_HOST -12 #define OSIP_UNKNOWN_HOST -12
#define OSIP_DISK_FULL -30 #define OSIP_DISK_FULL -30
#define OSIP_NO_RIGHTS -31 #define OSIP_NO_RIGHTS -31
#define OSIP_FILE_NOT_EXIST -32 #define OSIP_FILE_NOT_EXIST -32
#define OSIP_TIMEOUT -50 #define OSIP_TIMEOUT -50
#define OSIP_TOOMUCHCALL -51 #define OSIP_TOOMUCHCALL -51
#define OSIP_WRONG_FORMAT -52 #define OSIP_WRONG_FORMAT -52
#define OSIP_NOCOMMONCODEC -53 #define OSIP_NOCOMMONCODEC -53
#endif /* _PORT_H_ */ #endif /* _PORT_H_ */
 End of changes. 32 change blocks. 
209 lines changed or deleted 96 lines changed or added


 osip_proxy_authenticate.h   osip_proxy_authenticate.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_proxy_authentication_info.h   osip_proxy_authentication_info.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or(at your option) any later version. version 2.1 of the License, or(at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_proxy_authorization.h   osip_proxy_authorization.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_record_route.h   osip_record_route.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_route.h   osip_route.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_time.h   osip_time.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
skipping to change at line 30 skipping to change at line 30
#ifndef _OSIP_TIME_H_ #ifndef _OSIP_TIME_H_
#define _OSIP_TIME_H_ #define _OSIP_TIME_H_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Common time-related functions and data types */ /* Common time-related functions and data types */
#if defined(_WIN32_WCE) #if defined(_WIN32_WCE)
struct _timeb { struct _timeb {
time_t time; time_t time;
unsigned short millitm; unsigned short millitm;
short timezone; short timezone;
short dstflag; short dstflag;
}; };
#endif #endif
/* struct timeval, as defined in <sys/time.h>, <winsock.h> or <winsock2.h> */ /* struct timeval, as defined in <sys/time.h>, <winsock.h> or <winsock2.h> */
struct timeval; struct timeval;
/* Time manipulation functions */ /* Time manipulation functions */
void add_gettimeofday(struct timeval *atv, int ms); void add_gettimeofday (struct timeval *atv, int ms);
void min_timercmp(struct timeval *tv1, struct timeval *tv2); void min_timercmp (struct timeval *tv1, struct timeval *tv2);
/* OS-dependent */ /* OS-dependent */
#if defined(WIN32) || defined(_WIN32_WCE) || defined (__VXWORKS_OS__) || de fined(__arc__) #if defined(WIN32) || defined(_WIN32_WCE) || defined (__VXWORKS_OS__) || de fined(__arc__)
/* Operations on struct timeval */ /* Operations on struct timeval */
#define osip_timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) #define osip_timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
# define osip_timercmp(a, b, CMP) \ #define osip_timercmp(a, b, CMP) \
(((a)->tv_sec == (b)->tv_sec) ? \ (((a)->tv_sec == (b)->tv_sec) ? \
((a)->tv_usec CMP (b)->tv_usec) : \ ((a)->tv_usec CMP (b)->tv_usec) : \
((a)->tv_sec CMP (b)->tv_sec)) ((a)->tv_sec CMP (b)->tv_sec))
#define osip_timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 #define osip_timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
/* osip_gettimeofday() for Windows */
#if defined(__arc__)
#define osip_gettimeofday gettimeofday
#else
int osip_gettimeofday(struct timeval *tp, void *tz);
#endif
#else #else
/* Operations on struct timeval */ /* Operations on struct timeval */
#define osip_timerisset(tvp) timerisset(tvp) #define osip_timerisset(tvp) timerisset(tvp)
#define osip_timercmp(tvp, uvp, cmp) timercmp(tvp,uvp,cmp) #define osip_timercmp(tvp, uvp, cmp) timercmp(tvp,uvp,cmp)
#define osip_timerclear(tvp) timerclear(tvp) #define osip_timerclear(tvp) timerclear(tvp)
/* osip_gettimeofday() == gettimeofday() */
#define osip_gettimeofday gettimeofday
#endif #endif
int osip_gettimeofday (struct timeval *tp, void *tz);
time_t osip_getsystemtime (time_t * t);
void osip_compensatetime (void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 8 change blocks. 
21 lines changed or deleted 15 lines changed or added


 osip_to.h   osip_to.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 osip_uri.h   osip_uri.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
skipping to change at line 49 skipping to change at line 49
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Structure for referencing url parameters. * Structure for referencing url parameters.
* @var osip_uri_param_t * @var osip_uri_param_t
*/ */
typedef struct osip_uri_param osip_uri_param_t; typedef struct osip_uri_param osip_uri_param_t;
/** /**
* Structure for referencing url parameters. * Structure for referencing url parameters.
* @struct osip_uri_param * @struct osip_uri_param
*/ */
struct osip_uri_param { struct osip_uri_param {
char *gname;/**< uri parameter name */ char *gname; /**< uri parameter name */
char *gvalue; char *gvalue;
/**< uri parameter value */ /**< uri parameter value */
}; };
/** /**
* Structure for referencing url headers. * Structure for referencing url headers.
* @var osip_uri_header_t * @var osip_uri_header_t
*/ */
typedef osip_uri_param_t osip_uri_header_t; typedef osip_uri_param_t osip_uri_header_t;
/** /**
* Allocate a url parameter element. * Allocate a url parameter element.
* @param url_param The element to work on. * @param url_param The element to work on.
*/ */
int osip_uri_param_init(osip_uri_param_t ** url_param); int osip_uri_param_init (osip_uri_param_t ** url_param);
/** /**
* Free a url parameter element. * Free a url parameter element.
* @param url_param The element to work on. * @param url_param The element to work on.
*/ */
void osip_uri_param_free(osip_uri_param_t * url_param); void osip_uri_param_free (osip_uri_param_t * url_param);
/** /**
* Set values of a url parameter element. * Set values of a url parameter element.
* @param url_param The element to work on. * @param url_param The element to work on.
* @param name The token name. * @param name The token name.
* @param value The token value. * @param value The token value.
*/ */
int osip_uri_param_set(osip_uri_param_t * url_param, char *name, cha r *value); int osip_uri_param_set (osip_uri_param_t * url_param, char *name, char *v alue);
/** /**
* Clone a url parameter element. * Clone a url parameter element.
* @param url_param The element to work on. * @param url_param The element to work on.
* @param dest The resulting new allocated element. * @param dest The resulting new allocated element.
*/ */
int osip_uri_param_clone(const osip_uri_param_t * url_param, int osip_uri_param_clone (const osip_uri_param_t * url_param, osip_uri_pa
osip_uri_param_t ** ram_t ** dest);
dest);
#ifndef DOXYGEN #ifndef DOXYGEN
/* /*
* Free a list of a url parameter element. * Free a list of a url parameter element.
* @param url_params The list of url parameter element to free. * @param url_params The list of url parameter element to free.
*/ */
void osip_uri_param_freelist(osip_list_t * url_params); void osip_uri_param_freelist (osip_list_t * url_params);
#endif #endif
/** /**
* Allocate and add a url parameter element in a list. * Allocate and add a url parameter element in a list.
* @param url_params The list of url parameter element to work on. * @param url_params The list of url parameter element to work on.
* @param name The token name. * @param name The token name.
* @param value The token value. * @param value The token value.
*/ */
int osip_uri_param_add(osip_list_t * url_params, char *name, char *v alue); int osip_uri_param_add (osip_list_t * url_params, char *name, char *value );
/** /**
* Find in a url parameter element in a list. * Find in a url parameter element in a list.
* @param url_params The list of url parameter element to work on. * @param url_params The list of url parameter element to work on.
* @param name The name of the parameter element to find. * @param name The name of the parameter element to find.
* @param dest A pointer on the element found. * @param dest A pointer on the element found.
*/ */
int osip_uri_param_get_byname(osip_list_t * url_params, char *name, int osip_uri_param_get_byname (osip_list_t * url_params, char *name, osip
osip_uri_p _uri_param_t ** dest);
aram_t ** dest);
/** /**
* Allocate a generic parameter element. * Allocate a generic parameter element.
* @param url_header The element to work on. * @param url_header The element to work on.
*/ */
#define osip_uri_header_init(url_header) osip_uri_param_init(url_header) #define osip_uri_header_init(url_header) osip_uri_param_init(url_header)
/** /**
* Free a generic parameter element. * Free a generic parameter element.
* @param url_header The element to work on. * @param url_header The element to work on.
*/ */
skipping to change at line 163 skipping to change at line 161
* @param url_headers The list of generic parameter element to work on. * @param url_headers The list of generic parameter element to work on.
* @param name The name of the parameter element to find. * @param name The name of the parameter element to find.
* @param dest A pointer on the element found. * @param dest A pointer on the element found.
*/ */
#define osip_uri_header_get_byname(url_headers,name,dest) osip_uri_param_ge t_byname(url_headers,name,dest) #define osip_uri_header_get_byname(url_headers,name,dest) osip_uri_param_ge t_byname(url_headers,name,dest)
/** /**
* Structure for referencing SIP urls. * Structure for referencing SIP urls.
* @var osip_uri_t * @var osip_uri_t
*/ */
typedef struct osip_uri osip_uri_t; typedef struct osip_uri osip_uri_t;
/** /**
* Structure for referencing SIP urls. * Structure for referencing SIP urls.
* @struct osip_uri * @struct osip_uri
*/ */
struct osip_uri { struct osip_uri {
char *scheme; /**< Uri Scheme (sip or sips) */ char *scheme; /**< Uri Scheme (sip or sips) */
char *username; /**< Username */ char *username; /**< Username */
char *password; /**< Password */ char *password; /**< Password */
char *host; /**< Domain */ char *host; /**< Domain */
char *port; /**< Port number */ char *port; /**< Port number */
osip_list_t url_params;/**< Uri parameters */ osip_list_t url_params; /**< Uri parameters */
osip_list_t url_headers; osip_list_t url_headers;
/**< Uri headers /**< Uri headers
*/ */
char *string; char *string;
/**< Space for other url schemes. (http, /**< Space for other url schemes. (http,
mailto...) */ mailto...) */
}; };
/** /**
* Allocate a url element. * Allocate a url element.
* @param url The element to work on. * @param url The element to work on.
*/ */
int osip_uri_init(osip_uri_t ** url); int osip_uri_init (osip_uri_t ** url);
/** /**
* Free a url element. * Free a url element.
* @param url The element to work on. * @param url The element to work on.
*/ */
void osip_uri_free(osip_uri_t * url); void osip_uri_free (osip_uri_t * url);
/** /**
* Parse a url. * Parse a url.
* @param url The element to work on. * @param url The element to work on.
* @param buf The buffer to parse. * @param buf The buffer to parse.
*/ */
int osip_uri_parse(osip_uri_t * url, const char *buf); int osip_uri_parse (osip_uri_t * url, const char *buf);
#ifndef DOXYGEN #ifndef DOXYGEN
/** /**
* Parse the header part of a url. * Parse the header part of a url.
* @param url The element to work on. * @param url The element to work on.
* @param buf The buffer to parse. * @param buf The buffer to parse.
*/ */
int osip_uri_parse_headers(osip_uri_t * url, const char *buf); int osip_uri_parse_headers (osip_uri_t * url, const char *buf);
/** /**
* Parse the parameter part of a url. * Parse the parameter part of a url.
* @param url The element to work on. * @param url The element to work on.
* @param buf The buffer to parse. * @param buf The buffer to parse.
*/ */
int osip_uri_parse_params(osip_uri_t * url, const char *buf); int osip_uri_parse_params (osip_uri_t * url, const char *buf);
#endif #endif
/** /**
* Get a string representation of a url element. * Get a string representation of a url element.
* @param url The element to work on. * @param url The element to work on.
* @param dest The resulting new allocated buffer. * @param dest The resulting new allocated buffer.
*/ */
int osip_uri_to_str(const osip_uri_t * url, char **dest); int osip_uri_to_str (const osip_uri_t * url, char **dest);
/** /**
* Clone a url element. * Clone a url element.
* @param url The element to work on. * @param url The element to work on.
* @param dest The resulting new allocated element. * @param dest The resulting new allocated element.
*/ */
int osip_uri_clone(const osip_uri_t * url, osip_uri_t ** dest); int osip_uri_clone (const osip_uri_t * url, osip_uri_t ** dest);
/** /**
* Get a canonical string representation of a url element. * Get a canonical string representation of a url element.
* as defined in 10.3-5 * as defined in 10.3-5
* @param url The element to work on. * @param url The element to work on.
* @param dest The resulting new allocated buffer. * @param dest The resulting new allocated buffer.
*/ */
int osip_uri_to_str_canonical(const osip_uri_t * url, char **dest); int osip_uri_to_str_canonical (const osip_uri_t * url, char **dest);
/** /**
* Set the scheme of a url element. * Set the scheme of a url element.
* @param url The element to work on. * @param url The element to work on.
* @param value The token value. * @param value The token value.
*/ */
void osip_uri_set_scheme(osip_uri_t * url, char *value); void osip_uri_set_scheme (osip_uri_t * url, char *value);
/** /**
* Get the scheme of a url element. * Get the scheme of a url element.
* @param url The element to work on. * @param url The element to work on.
*/ */
char *osip_uri_get_scheme(osip_uri_t * url); char *osip_uri_get_scheme (osip_uri_t * url);
/** /**
* Set the host of a url element. * Set the host of a url element.
* @param url The element to work on. * @param url The element to work on.
* @param value The token value. * @param value The token value.
*/ */
void osip_uri_set_host(osip_uri_t * url, char *value); void osip_uri_set_host (osip_uri_t * url, char *value);
/** /**
* Get the host of a url element. * Get the host of a url element.
* @param url The element to work on. * @param url The element to work on.
*/ */
char *osip_uri_get_host(osip_uri_t * url); char *osip_uri_get_host (osip_uri_t * url);
/** /**
* Set the username of a url element. * Set the username of a url element.
* @param url The element to work on. * @param url The element to work on.
* @param value The token value. * @param value The token value.
*/ */
void osip_uri_set_username(osip_uri_t * url, char *value); void osip_uri_set_username (osip_uri_t * url, char *value);
/** /**
* Get the username of a url element. * Get the username of a url element.
* @param url The element to work on. * @param url The element to work on.
*/ */
char *osip_uri_get_username(osip_uri_t * url); char *osip_uri_get_username (osip_uri_t * url);
/** /**
* Set the password of a url element. * Set the password of a url element.
* @param url The element to work on. * @param url The element to work on.
* @param value The token value. * @param value The token value.
*/ */
void osip_uri_set_password(osip_uri_t * url, char *value); void osip_uri_set_password (osip_uri_t * url, char *value);
/** /**
* Get the password of a url element. * Get the password of a url element.
* @param url The element to work on. * @param url The element to work on.
*/ */
char *osip_uri_get_password(osip_uri_t * url); char *osip_uri_get_password (osip_uri_t * url);
/** /**
* Set the port of a url element. * Set the port of a url element.
* @param url The element to work on. * @param url The element to work on.
* @param value The token value. * @param value The token value.
*/ */
void osip_uri_set_port(osip_uri_t * url, char *value); void osip_uri_set_port (osip_uri_t * url, char *value);
/** /**
* Get the port of a url element. * Get the port of a url element.
* @param url The element to work on. * @param url The element to work on.
*/ */
char *osip_uri_get_port(osip_uri_t * url); char *osip_uri_get_port (osip_uri_t * url);
/** /**
* Set the transport parameter to UDP in a url element. * Set the transport parameter to UDP in a url element.
* @param url The element to work on. * @param url The element to work on.
*/ */
#define osip_uri_set_transport_udp(url) osip_uri_param_add((&(url)->url_p arams), osip_strdup("transport"), osip_strdup("udp")) #define osip_uri_set_transport_udp(url) osip_uri_param_add((&(url)->url_p arams), osip_strdup("transport"), osip_strdup("udp"))
/** /**
* Set the transport parameter to TCP in a url element. * Set the transport parameter to TCP in a url element.
* @param url The element to work on. * @param url The element to work on.
*/ */
skipping to change at line 407 skipping to change at line 405
/** /**
* Find in a url header element in a url element. * Find in a url header element in a url element.
* @param url The element to work on. * @param url The element to work on.
* @param name The name of the url header element to find. * @param name The name of the url header element to find.
* @param dest A pointer on the element found. * @param dest A pointer on the element found.
*/ */
#define osip_uri_uheader_get_byname(url,name,dest) osip_uri_header_get_byna me((&(url)->url_headers),name,dest) #define osip_uri_uheader_get_byname(url,name,dest) osip_uri_header_get_byna me((&(url)->url_headers),name,dest)
#ifndef DOXYGEN #ifndef DOXYGEN
/* internal method */ /* internal method */
char *next_separator(const char *ch, int separator_osip_to_find, char *next_separator (const char *ch, int separator_osip_to_find, int bef
int before_separator); ore_separator);
char *__osip_uri_escape_nonascii_and_nondef(const char *string, char *__osip_uri_escape_nonascii_and_nondef (const char *string, const ch
ar *def);
const char *def); char *__osip_uri_escape_userinfo (const char *string);
char *__osip_uri_escape_userinfo(const char *string); char *__osip_uri_escape_password (const char *string);
char *__osip_uri_escape_password(const char *string); char *__osip_uri_escape_uri_param (char *string);
char *__osip_uri_escape_uri_param(char *string); char *__osip_uri_escape_header_param (char *string);
char *__osip_uri_escape_header_param(char *string); void __osip_uri_unescape (char *string);
void __osip_uri_unescape(char *string);
#endif #endif
/** @} */ /** @} */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _URLS_H_ */ #endif /* _URLS_H_ */
 End of changes. 34 change blocks. 
63 lines changed or deleted 60 lines changed or added


 osip_via.h   osip_via.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
skipping to change at line 94 skipping to change at line 94
* Clone a Via element. * Clone a Via element.
* @param header The element to work on. * @param header The element to work on.
* @param dest A pointer on the copy of the element. * @param dest A pointer on the copy of the element.
*/ */
int osip_via_clone (const osip_via_t * header, osip_via_t ** dest); int osip_via_clone (const osip_via_t * header, osip_via_t ** dest);
/** /**
* Set the SIP version in the Via element. * Set the SIP version in the Via element.
* @param header The element to work on. * @param header The element to work on.
* @param value The value of the element. * @param value The value of the element.
*/ */
#define osip_via_set_version via_set_version
void via_set_version (osip_via_t * header, char *value); void via_set_version (osip_via_t * header, char *value);
#define osip_via_set_version via_set_version
/** /**
* Get the SIP version from a Via header. * Get the SIP version from a Via header.
* @param header The element to work on. * @param header The element to work on.
*/ */
#define osip_via_get_version via_get_version
char *via_get_version (osip_via_t * header); char *via_get_version (osip_via_t * header);
#define osip_via_get_version via_get_version
/** /**
* Set the protocol in the Via element. * Set the protocol in the Via element.
* @param header The element to work on. * @param header The element to work on.
* @param value The value of the element. * @param value The value of the element.
*/ */
#define osip_via_set_protocol via_set_protocol
void via_set_protocol (osip_via_t * header, char *value); void via_set_protocol (osip_via_t * header, char *value);
#define osip_via_set_protocol via_set_protocol
/** /**
* Get the protocol from a Via header. * Get the protocol from a Via header.
* @param header The element to work on. * @param header The element to work on.
*/ */
#define osip_via_get_protocol via_get_protocol
char *via_get_protocol (osip_via_t * header); char *via_get_protocol (osip_via_t * header);
#define osip_via_get_protocol via_get_protocol
/** /**
* Set the host in the Via element. * Set the host in the Via element.
* @param header The element to work on. * @param header The element to work on.
* @param value The value of the element. * @param value The value of the element.
*/ */
#define osip_via_set_host via_set_host
void via_set_host (osip_via_t * header, char *value); void via_set_host (osip_via_t * header, char *value);
#define osip_via_set_host via_set_host
/** /**
* Get the host from a Via header. * Get the host from a Via header.
* @param header The element to work on. * @param header The element to work on.
*/ */
#define osip_via_get_host via_get_host
char *via_get_host (osip_via_t * header); char *via_get_host (osip_via_t * header);
#define osip_via_get_host via_get_host
/** /**
* Set the port in the Via element. * Set the port in the Via element.
* @param header The element to work on. * @param header The element to work on.
* @param value The value of the element. * @param value The value of the element.
*/ */
#define osip_via_set_port via_set_port
void via_set_port (osip_via_t * header, char *value); void via_set_port (osip_via_t * header, char *value);
#define osip_via_set_port via_set_port
/** /**
* Get the port from a Via header. * Get the port from a Via header.
* @param header The element to work on. * @param header The element to work on.
*/ */
#define osip_via_get_port via_get_port
char *via_get_port (osip_via_t * header); char *via_get_port (osip_via_t * header);
#define osip_via_get_port via_get_port
/** /**
* Set the comment in the Via element. * Set the comment in the Via element.
* @param header The element to work on. * @param header The element to work on.
* @param value The value of the element. * @param value The value of the element.
*/ */
#define osip_via_set_comment via_set_comment
void via_set_comment (osip_via_t * header, char *value); void via_set_comment (osip_via_t * header, char *value);
#define osip_via_set_comment via_set_comment
/** /**
* Get the comment from a Via header. * Get the comment from a Via header.
* @param header The element to work on. * @param header The element to work on.
*/ */
#define osip_via_get_comment via_get_comment
char *via_get_comment (osip_via_t * header); char *via_get_comment (osip_via_t * header);
#define osip_via_get_comment via_get_comment
/** /**
* Allocate and add a hidden parameter element in a list. * Allocate and add a hidden parameter element in a list.
* @param header The element to work on. * @param header The element to work on.
*/ */
#define osip_via_set_hidden(header) osip_generic_param_add((&(header)->v ia_params),osip_strdup("hidden"),NULL) #define osip_via_set_hidden(header) osip_generic_param_add((&(header)->v ia_params),osip_strdup("hidden"),NULL)
/** /**
* Allocate and add a ttl parameter element in a list. * Allocate and add a ttl parameter element in a list.
* @param header The element to work on. * @param header The element to work on.
* @param value The token value. * @param value The token value.
 End of changes. 21 change blocks. 
11 lines changed or deleted 11 lines changed or added


 osip_www_authenticate.h   osip_www_authenticate.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 sdp_message.h   sdp_message.h 
/* /*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -) The oSIP library implements the Session Initiation Protocol (SIP -rfc3261 -)
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@ato sc.org Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
skipping to change at line 50 skipping to change at line 50
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Structure for referencing bandwidth header. * Structure for referencing bandwidth header.
* @var sdp_bandwidth_t * @var sdp_bandwidth_t
*/ */
typedef struct sdp_bandwidth sdp_bandwidth_t; typedef struct sdp_bandwidth sdp_bandwidth_t;
/** /**
* SDP bandwidth definition. * SDP bandwidth definition.
* @struct sdp_bandwidth * @struct sdp_bandwidth
*/ */
struct sdp_bandwidth { struct sdp_bandwidth {
char *b_bwtype; /**< bandwidth type */ char *b_bwtype; /**< bandwidth type */
char *b_bandwidth; /**< bandwidth value */ char *b_bandwidth; /**< bandwidth value */
}; };
/** /**
* Allocate a bandwidth element. * Allocate a bandwidth element.
* @param elem The element to work on. * @param elem The element to work on.
*/ */
int sdp_bandwidth_init(sdp_bandwidth_t ** elem); int sdp_bandwidth_init (sdp_bandwidth_t ** elem);
/** /**
* Free a bandwidth element. * Free a bandwidth element.
* @param elem The element to work on. * @param elem The element to work on.
*/ */
void sdp_bandwidth_free(sdp_bandwidth_t * elem); void sdp_bandwidth_free (sdp_bandwidth_t * elem);
/** /**
* Structure for referencing time description header. * Structure for referencing time description header.
* @var sdp_time_descr_t * @var sdp_time_descr_t
*/ */
typedef struct sdp_time_descr sdp_time_descr_t; typedef struct sdp_time_descr sdp_time_descr_t;
/** /**
* SDP Time description definition. * SDP Time description definition.
* @struct sdp_time_descr * @struct sdp_time_descr
*/ */
struct sdp_time_descr { struct sdp_time_descr {
char *t_start_time; /**< start time */ char *t_start_time; /**< start time */
char *t_stop_time; /**< stop time */ char *t_stop_time; /**< stop time */
osip_list_t r_repeats; /**< repeat headers */ osip_list_t r_repeats; /**< repeat headers */
}; };
/** /**
* Allocate a time description element. * Allocate a time description element.
* @param elem The element to work on. * @param elem The element to work on.
*/ */
int sdp_time_descr_init(sdp_time_descr_t ** elem); int sdp_time_descr_init (sdp_time_descr_t ** elem);
/** /**
* Free a time description element. * Free a time description element.
* @param elem The element to work on. * @param elem The element to work on.
*/ */
void sdp_time_descr_free(sdp_time_descr_t * elem); void sdp_time_descr_free (sdp_time_descr_t * elem);
/** /**
* Structure for referencing key header. * Structure for referencing key header.
* @var sdp_key_t * @var sdp_key_t
*/ */
typedef struct sdp_key sdp_key_t; typedef struct sdp_key sdp_key_t;
/** /**
* SDP key definition. * SDP key definition.
* @struct sdp_key * @struct sdp_key
*/ */
struct sdp_key { struct sdp_key {
char *k_keytype;/**< Key Type (prompt, clear, base64, uri) * char *k_keytype; /**< Key Type (prompt, clear, base64, uri)
/ */
char *k_keydata;/**< key data */ char *k_keydata; /**< key data */
}; };
/** /**
* Allocate a key element. * Allocate a key element.
* @param elem The element to work on. * @param elem The element to work on.
*/ */
int sdp_key_init(sdp_key_t ** elem); int sdp_key_init (sdp_key_t ** elem);
/** /**
* Free a key element. * Free a key element.
* @param elem The element to work on. * @param elem The element to work on.
*/ */
void sdp_key_free(sdp_key_t * elem); void sdp_key_free (sdp_key_t * elem);
/** /**
* Structure for referencing an attribute header. * Structure for referencing an attribute header.
* @var sdp_attribute_t * @var sdp_attribute_t
*/ */
typedef struct sdp_attribute sdp_attribute_t; typedef struct sdp_attribute sdp_attribute_t;
/** /**
* SDP attribute definition. * SDP attribute definition.
* @struct sdp_attribute * @struct sdp_attribute
*/ */
struct sdp_attribute { struct sdp_attribute {
char *a_att_field; /**< attribute field */ char *a_att_field; /**< attribute field */
char *a_att_value; /**< attribute value (option char *a_att_value; /**< attribute value (optio
al) */ nal) */
}; };
/** /**
* Allocate an attribute element. * Allocate an attribute element.
* @param elem The element to work on. * @param elem The element to work on.
*/ */
int sdp_attribute_init(sdp_attribute_t ** elem); int sdp_attribute_init (sdp_attribute_t ** elem);
/** /**
* Free a attribute element. * Free a attribute element.
* @param elem The element to work on. * @param elem The element to work on.
*/ */
void sdp_attribute_free(sdp_attribute_t * elem); void sdp_attribute_free (sdp_attribute_t * elem);
/** /**
* Structure for referencing a connection header. * Structure for referencing a connection header.
* @var sdp_connection_t * @var sdp_connection_t
*/ */
typedef struct sdp_connection sdp_connection_t; typedef struct sdp_connection sdp_connection_t;
/** /**
* SDP connection definition. * SDP connection definition.
* @struct sdp_connection * @struct sdp_connection
*/ */
struct sdp_connection { struct sdp_connection {
char *c_nettype; /**< Network Type */ char *c_nettype; /**< Network Type */
char *c_addrtype; /**< Network Address Type * char *c_addrtype; /**< Network Address Type
/ */
char *c_addr; /**< Address */ char *c_addr; /**< Address */
char *c_addr_multicast_ttl; char *c_addr_multicast_ttl;
/**< TTL va /**< TTL v
lue for multicast address */ alue for multicast address */
char *c_addr_multicast_int; char *c_addr_multicast_int;
/**< Number /**< Numbe
of multicast address */ r of multicast address */
}; };
/** /**
* Allocate a connection element. * Allocate a connection element.
* @param elem The element to work on. * @param elem The element to work on.
*/ */
int sdp_connection_init(sdp_connection_t ** elem); int sdp_connection_init (sdp_connection_t ** elem);
/** /**
* Free a connection element. * Free a connection element.
* @param elem The element to work on. * @param elem The element to work on.
*/ */
void sdp_connection_free(sdp_connection_t * elem); void sdp_connection_free (sdp_connection_t * elem);
/** /**
* Structure for referencing a media header. * Structure for referencing a media header.
* @var sdp_media_t * @var sdp_media_t
*/ */
typedef struct sdp_media sdp_media_t; typedef struct sdp_media sdp_media_t;
/** /**
* SDP media definition. * SDP media definition.
* @struct sdp_media * @struct sdp_media
*/ */
struct sdp_media { struct sdp_media {
char *m_media; /**< media type */ char *m_media; /**< media type */
char *m_port; /**< port number */ char *m_port; /**< port number */
char *m_number_of_port; /**< number of port */ char *m_number_of_port; /**< number of port */
char *m_proto; /**< protocol to be used */ char *m_proto; /**< protocol to be used */
osip_list_t m_payloads;/**< list of payloads (as strings) */ osip_list_t m_payloads; /**< list of payloads (as strings) *
/
char *i_info; /**< information header */
osip_list_t c_connections; char *i_info; /**< information header */
/**< list of sdp_ osip_list_t c_connections;
connection_t * */ /**< list of sdp
osip_list_t b_bandwidths; _connection_t * */
/**< list of sdp_ osip_list_t b_bandwidths;
bandwidth_t * */ /**< list of sdp
osip_list_t a_attributes; _bandwidth_t * */
/**< list of sdp_ osip_list_t a_attributes;
attribute_t * */ /**< list of sdp
sdp_key_t *k_key; /**< key informations */ _attribute_t * */
}; sdp_key_t *k_key; /**< key informations */
};
/** /**
* Allocate a media element. * Allocate a media element.
* @param elem The element to work on. * @param elem The element to work on.
*/ */
int sdp_media_init(sdp_media_t ** elem); int sdp_media_init (sdp_media_t ** elem);
/** /**
* Free a media element. * Free a media element.
* @param elem The element to work on. * @param elem The element to work on.
*/ */
void sdp_media_free(sdp_media_t * elem); void sdp_media_free (sdp_media_t * elem);
/** /**
* Structure for referencing a SDP packet. * Structure for referencing a SDP packet.
* @var sdp_message_t * @var sdp_message_t
*/ */
typedef struct sdp_message sdp_message_t; typedef struct sdp_message sdp_message_t;
/** /**
* SDP message definition. * SDP message definition.
* @struct sdp_message * @struct sdp_message
*/ */
struct sdp_message { struct sdp_message {
char *v_version; /**< version header */ char *v_version; /**< version header */
char *o_username; /**< Username */ char *o_username; /**< Username */
char *o_sess_id; /**< Identifier for session char *o_sess_id; /**< Identifier for session
*/ */
char *o_sess_version; /**< Version of session */ char *o_sess_version; /**< Version of session */
char *o_nettype; /**< Network type */ char *o_nettype; /**< Network type */
char *o_addrtype; /**< Address type */ char *o_addrtype; /**< Address type */
char *o_addr; /**< Address */ char *o_addr; /**< Address */
char *s_name; /**< Subject header */ char *s_name; /**< Subject header */
char *i_info; /**< Information header */ char *i_info; /**< Information header */
char *u_uri; /**< Uri header */ char *u_uri; /**< Uri header */
osip_list_t e_emails; /**< list of mail address */ osip_list_t e_emails; /**< list of mail address */
osip_list_t p_phones; /**< list of phone numbers * */ osip_list_t p_phones; /**< list of phone numbers * */
sdp_connection_t *c_connection; sdp_connection_t *c_connection;
/* /
*< Connection information */ **< Connection information */
osip_list_t b_bandwidths; osip_list_t b_bandwidths;
/**< list of band /**< list of ban
width info (sdp_bandwidth_t) */ dwidth info (sdp_bandwidth_t) */
osip_list_t t_descrs; /**< list of time description (sdp_ti osip_list_t t_descrs; /**< list of time description (sdp_t
me_descr_t) */ ime_descr_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; osip_list_t a_attributes;
/**< list of glob /**< list of glo
al attributes (sdp_attribute_t) */ bal attributes (sdp_attribute_t) */
osip_list_t m_medias; /**< list of supported media (sdp_med osip_list_t m_medias; /**< list of supported media (sdp_me
ia_t) */ dia_t) */
}; };
/** /**
* Allocate a SDP packet. * Allocate a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
*/ */
int sdp_message_init(sdp_message_t ** sdp); int sdp_message_init (sdp_message_t ** sdp);
/** /**
* Parse a SDP packet. * Parse a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param buf The buffer to parse. * @param buf The buffer to parse.
*/ */
int sdp_message_parse(sdp_message_t * sdp, const char *buf); int sdp_message_parse (sdp_message_t * sdp, const char *buf);
/** /**
* Get a string representation of a SDP packet. * Get a string representation of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param dest The resulting new allocated buffer. * @param dest The resulting new allocated buffer.
*/ */
int sdp_message_to_str(sdp_message_t * sdp, char **dest); int sdp_message_to_str (sdp_message_t * sdp, char **dest);
/** /**
* Free a SDP packet. * Free a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
*/ */
void sdp_message_free(sdp_message_t * sdp); void sdp_message_free (sdp_message_t * sdp);
/** /**
* Clone a SDP packet. * Clone a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param dest The cloned element. * @param dest The cloned element.
*/ */
int sdp_message_clone(sdp_message_t * sdp, sdp_message_t ** dest); int sdp_message_clone (sdp_message_t * sdp, sdp_message_t ** dest);
/** /**
* Set the version in a SDP packet. * Set the version in a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param value The token value. * @param value The token value.
*/ */
int sdp_message_v_version_set(sdp_message_t * sdp, char *value); int sdp_message_v_version_set (sdp_message_t * sdp, char *value);
/** /**
* Get the version ('v' field) of a SDP packet. * Get the version ('v' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
*/ */
char *sdp_message_v_version_get(sdp_message_t * sdp); char *sdp_message_v_version_get (sdp_message_t * sdp);
/** /**
* Set the origin field in a SDP packet. * Set the origin field in a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param username The token value. * @param username The token value.
* @param sess_id The token value. * @param sess_id The token value.
* @param sess_version The token value. * @param sess_version The token value.
* @param nettype The token value. * @param nettype The token value.
* @param addrtype The token value. * @param addrtype The token value.
* @param addr The token value. * @param addr The token value.
*/ */
int sdp_message_o_origin_set(sdp_message_t * sdp, char *username, int sdp_message_o_origin_set (sdp_message_t * sdp, char *username, char *
char *sess_ sess_id, char *sess_version, char *nettype, char *addrtype, char *addr);
id, char *sess_version,
char *netty
pe, char *addrtype, char *addr);
/** /**
* Get the username ('o' field) of a SDP packet. * Get the username ('o' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
*/ */
char *sdp_message_o_username_get(sdp_message_t * sdp); char *sdp_message_o_username_get (sdp_message_t * sdp);
/** /**
* Get the session id ('o' field) of a SDP packet. * Get the session id ('o' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
*/ */
char *sdp_message_o_sess_id_get(sdp_message_t * sdp); char *sdp_message_o_sess_id_get (sdp_message_t * sdp);
/** /**
* Get the session version ('o' field) of a SDP packet. * Get the session version ('o' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
*/ */
char *sdp_message_o_sess_version_get(sdp_message_t * sdp); char *sdp_message_o_sess_version_get (sdp_message_t * sdp);
/** /**
* Get the nettype ('o' field) of a SDP packet. * Get the nettype ('o' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
*/ */
char *sdp_message_o_nettype_get(sdp_message_t * sdp); char *sdp_message_o_nettype_get (sdp_message_t * sdp);
/** /**
* Get the addrtype ('o' field) of a SDP packet. * Get the addrtype ('o' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
*/ */
char *sdp_message_o_addrtype_get(sdp_message_t * sdp); char *sdp_message_o_addrtype_get (sdp_message_t * sdp);
/** /**
* Get the addr ('o' field) of a SDP packet. * Get the addr ('o' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
*/ */
char *sdp_message_o_addr_get(sdp_message_t * sdp); char *sdp_message_o_addr_get (sdp_message_t * sdp);
/** /**
* Set the session name in a SDP packet. * Set the session name in a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param value The token value. * @param value The token value.
*/ */
int sdp_message_s_name_set(sdp_message_t * sdp, char *value); int sdp_message_s_name_set (sdp_message_t * sdp, char *value);
/** /**
* Get the session name ('s' field) of a SDP packet. * Get the session name ('s' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
*/ */
char *sdp_message_s_name_get(sdp_message_t * sdp); char *sdp_message_s_name_get (sdp_message_t * sdp);
/** /**
* Set the version in a SDP packet. * Set the version in a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The media line number. * @param pos_media The media line number.
* @param value The token value. * @param value The token value.
*/ */
int sdp_message_i_info_set(sdp_message_t * sdp, int pos_media, char *value); int sdp_message_i_info_set (sdp_message_t * sdp, int pos_media, char *val 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.
*/ */
int sdp_message_u_uri_set(sdp_message_t * sdp, char *value); int sdp_message_u_uri_set (sdp_message_t * sdp, char *value);
/** /**
* Get the uri ('u' field) of a SDP packet. * Get the uri ('u' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
*/ */
char *sdp_message_u_uri_get(sdp_message_t * sdp); char *sdp_message_u_uri_get (sdp_message_t * sdp);
/** /**
* Set the version in a SDP packet. * Set the version in a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param value The token value. * @param value The token value.
*/ */
int sdp_message_e_email_add(sdp_message_t * sdp, char *value); int sdp_message_e_email_add (sdp_message_t * sdp, char *value);
/** /**
* OBSOLETE: see sdp_message_e_email_get * OBSOLETE: see sdp_message_e_email_get
* @def sdp_e_email_get * @def sdp_e_email_get
*/ */
#define sdp_e_email_get sdp_message_e_email_get #define sdp_e_email_get sdp_message_e_email_get
/** /**
* Get one of the email ('e' field) of a SDP packet. * Get one of the email ('e' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos the index of the email line. * @param pos the index of the email line.
*/ */
char *sdp_message_e_email_get(sdp_message_t * sdp, int pos); char *sdp_message_e_email_get (sdp_message_t * sdp, int pos);
/** /**
* Set the version in a SDP packet. * Set the version in a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param value The token value. * @param value The token value.
*/ */
int sdp_message_p_phone_add(sdp_message_t * sdp, char *value); int sdp_message_p_phone_add (sdp_message_t * sdp, char *value);
/** /**
* Get one of the phone ('p' field) of a SDP packet. * Get one of the phone ('p' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos the index of the phone line. * @param pos the index of the phone line.
*/ */
char *sdp_message_p_phone_get(sdp_message_t * sdp, int pos); char *sdp_message_p_phone_get (sdp_message_t * sdp, int pos);
/** /**
* Set the version in a SDP packet. * Set the version in a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The media line number. * @param pos_media The media line number.
* @param nettype The token value. * @param nettype The token value.
* @param addrtype The token value. * @param addrtype The token value.
* @param addr The token value. * @param addr The token value.
* @param addr_multicast_ttl The token value. * @param addr_multicast_ttl The token value.
* @param addr_multicast_int The token value. * @param addr_multicast_int The token value.
*/ */
int sdp_message_c_connection_add(sdp_message_t * sdp, int pos_media, int sdp_message_c_connection_add (sdp_message_t * sdp, int pos_media, cha
cha r *nettype, char *addrtype, char *addr, char *addr_multicast_ttl, char *add
r *nettype, char *addrtype, r_multicast_int);
cha
r *addr, char *addr_multicast_ttl,
cha
r *addr_multicast_int);
#ifndef DOXYGEN #ifndef DOXYGEN
/* this method should be internal only... */ /* this method should be internal only... */
sdp_connection_t *sdp_message_connection_get(sdp_message_t * sdp, sdp_connection_t *sdp_message_connection_get (sdp_message_t * sdp, int po
s_media, int pos);
int pos_media, int pos);
#endif #endif
/** /**
* Get the network type ('c' field) of a SDP packet. * Get the network type ('c' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The media line number. * @param pos_media The media line number.
* @param pos The index in the connection element list.. * @param pos The index in the connection element list..
*/ */
char *sdp_message_c_nettype_get(sdp_message_t * sdp, int pos_media, int pos); char *sdp_message_c_nettype_get (sdp_message_t * sdp, int pos_media, int pos);
/** /**
* Get the address type ('c' field) of a SDP packet. * Get the address type ('c' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The media line number. * @param pos_media The media line number.
* @param pos The index in the connection element list.. * @param pos The index in the connection element list..
*/ */
char *sdp_message_c_addrtype_get(sdp_message_t * sdp, int pos_media, int pos); char *sdp_message_c_addrtype_get (sdp_message_t * sdp, int pos_media, int pos);
/** /**
* Get the address ('c' field) of a SDP packet. * Get the address ('c' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The media line number. * @param pos_media The media line number.
* @param pos The index in the connection element list.. * @param pos The index in the connection element list..
*/ */
char *sdp_message_c_addr_get(sdp_message_t * sdp, int pos_media, int pos); char *sdp_message_c_addr_get (sdp_message_t * sdp, int pos_media, int pos );
/** /**
* Get the multicast ttl ('c' field) of a SDP packet. * Get the multicast ttl ('c' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The media line number. * @param pos_media The media line number.
* @param pos The index in the connection element list.. * @param pos The index in the connection element list..
*/ */
char *sdp_message_c_addr_multicast_ttl_get(sdp_message_t * sdp, char *sdp_message_c_addr_multicast_ttl_get (sdp_message_t * sdp, int pos_
media, int pos);
int pos_media, int pos);
/** /**
* Get the multicast int info ('c' field) of a SDP packet. * Get the multicast int info ('c' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The media line number. * @param pos_media The media line number.
* @param pos The index in the connection element list.. * @param pos The index in the connection element list..
*/ */
char *sdp_message_c_addr_multicast_int_get(sdp_message_t * sdp, char *sdp_message_c_addr_multicast_int_get (sdp_message_t * sdp, int pos_
media, int pos);
int pos_media, int pos);
/** /**
* Set the version in a SDP packet. * Set the version in a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The media line number. * @param pos_media The media line number.
* @param bwtype The token value. * @param bwtype The token value.
* @param bandwidth The token value. * @param bandwidth The token value.
*/ */
int sdp_message_b_bandwidth_add(sdp_message_t * sdp, int pos_media, int sdp_message_b_bandwidth_add (sdp_message_t * sdp, int pos_media, char
char *bwtype, char *bandwidth);
*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, i nt pos); char *sdp_message_b_bwtype_get (sdp_message_t * sdp, int pos_media, int p 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 , int pos); char *sdp_message_b_bandwidth_get (sdp_message_t * sdp, int pos_media, in 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, c har *stop); int sdp_message_t_time_descr_add (sdp_message_t * sdp, char *start, char *stop);
/** /**
* Get the start time value ('t' field) of a SDP packet. * Get the start time value ('t' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_td The time description line number. * @param pos_td The time description line number.
*/ */
char *sdp_message_t_start_time_get(sdp_message_t * sdp, int pos_td); char *sdp_message_t_start_time_get (sdp_message_t * sdp, int pos_td);
/** /**
* Get the stop time value ('t' field) of a SDP packet. * Get the stop time value ('t' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_td The time description line number. * @param pos_td The time description line number.
*/ */
char *sdp_message_t_stop_time_get(sdp_message_t * sdp, int pos_td); char *sdp_message_t_stop_time_get (sdp_message_t * sdp, int pos_td);
/** /**
* Set the repeat information ('r' field) in a SDP packet. * Set the repeat information ('r' field) in a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_time_descr index of t field. * @param pos_time_descr index of t field.
* @param value The token value. * @param value The token value.
*/ */
int sdp_message_r_repeat_add(sdp_message_t * sdp, int pos_time_descr int sdp_message_r_repeat_add (sdp_message_t * sdp, int pos_time_descr, ch
, ar *value);
char *value
);
/** /**
* Get the repeat information ('r' field) in a SDP packet. * Get the repeat information ('r' field) in a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_time_descr index of t field. * @param pos_time_descr index of t field.
* @param pos_repeat index of element in the 'r' field. * @param pos_repeat index of element in the 'r' field.
*/ */
char *sdp_message_r_repeat_get(sdp_message_t * sdp, int pos_time_des char *sdp_message_r_repeat_get (sdp_message_t * sdp, int pos_time_descr,
cr, int pos_repeat);
int pos_r
epeat);
/** /**
* Set the adjustments ('z' field) of a SDP packet. * Set the adjustments ('z' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param value The token value. * @param value The token value.
*/ */
int sdp_message_z_adjustments_set(sdp_message_t * sdp, char *value); int sdp_message_z_adjustments_set (sdp_message_t * sdp, char *value);
/** /**
* Get the adjustments ('z' field) of a SDP packet. * Get the adjustments ('z' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
*/ */
char *sdp_message_z_adjustments_get(sdp_message_t * sdp); char *sdp_message_z_adjustments_get (sdp_message_t * sdp);
/** /**
* Add a key in a SDP packet. * Add a key in a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media index of m field. * @param pos_media index of m field.
* @param keytype The token value. * @param keytype The token value.
* @param keydata The token value. * @param keydata The token value.
*/ */
int sdp_message_k_key_set(sdp_message_t * sdp, int pos_media, int sdp_message_k_key_set (sdp_message_t * sdp, int pos_media, char *keyt
char *keytype, cha ype, char *keydata);
r *keydata);
/** /**
* Get the key type ('k' field) of a SDP packet. * Get the key type ('k' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The media line number. * @param pos_media The media line number.
*/ */
char *sdp_message_k_keytype_get(sdp_message_t * sdp, int pos_media); char *sdp_message_k_keytype_get (sdp_message_t * sdp, int pos_media);
/** /**
* Get the key value ('k' field) of a SDP packet. * Get the key value ('k' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The media line number. * @param pos_media The media line number.
*/ */
char *sdp_message_k_keydata_get(sdp_message_t * sdp, int pos_media); char *sdp_message_k_keydata_get (sdp_message_t * sdp, int pos_media);
/** /**
* Set the version in a SDP packet. * Set the version in a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The line number. * @param pos_media The line number.
* @param att_field The token value. * @param att_field The token value.
* @param att_value The token value. * @param att_value The token value.
*/ */
int sdp_message_a_attribute_add(sdp_message_t * sdp, int pos_media, int sdp_message_a_attribute_add (sdp_message_t * sdp, int pos_media, char
char *att_field, char *att_value);
*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
char *att_field);
*att_field);
/** /**
* delete one specific attribute fields specified by att_field. * delete one specific attribute fields specified by att_field.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The line number. * @param pos_media The line number.
* @param att_field The value to remove. * @param att_field The value to remove.
* @param pos_attr The index of attribute to remove. * @param pos_attr The index of attribute to remove.
*/ */
int sdp_message_a_attribute_del_at_index(sdp_message_t * sdp, int sdp_message_a_attribute_del_at_index (sdp_message_t * sdp, int pos_me
dia, char *att_field, int pos_attr);
int pos_media, char *att_field,
int pos_attr);
/** /**
* Get one of the attribute ('a' field) of a SDP packet. * Get one of the attribute ('a' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The media line number. * @param pos_media The media line number.
* @param pos The attribute line number. * @param pos The attribute line number.
*/ */
sdp_attribute_t *sdp_message_attribute_get(sdp_message_t * sdp, sdp_attribute_t *sdp_message_attribute_get (sdp_message_t * sdp, int pos_
media, int pos);
int pos_media, int pos);
/** /**
* Get the attribute name ('a' field) of a SDP packet. * Get the attribute name ('a' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The media line number. * @param pos_media The media line number.
* @param pos The attribute line number. * @param pos The attribute line number.
*/ */
char *sdp_message_a_att_field_get(sdp_message_t * sdp, int pos_media , int pos); char *sdp_message_a_att_field_get (sdp_message_t * sdp, int pos_media, in 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 , int pos); char *sdp_message_a_att_value_get (sdp_message_t * sdp, int pos_media, in 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 *port, , char *number_of_port, char *proto);
char *number_of_port, char *proto);
/** /**
* Get the media type ('m' field) of a SDP packet. * Get the media type ('m' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The line number. * @param pos_media The line number.
*/ */
char *sdp_message_m_media_get(sdp_message_t * sdp, int pos_media); char *sdp_message_m_media_get (sdp_message_t * sdp, int pos_media);
/** /**
* Get the port number ('m' field) of a SDP packet. * Get the port number ('m' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The line number. * @param pos_media The line number.
*/ */
char *sdp_message_m_port_get(sdp_message_t * sdp, int pos_media); char *sdp_message_m_port_get (sdp_message_t * sdp, int pos_media);
/** /**
* Set the port number ('m' field) of a SDP packet. * Set the port number ('m' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The line number. * @param pos_media The line number.
* @param port The new port to set (must be allocated with osip_malloc) * @param port The new port to set (must be allocated with osip_malloc)
*/ */
int sdp_message_m_port_set(sdp_message_t * sdp, int pos_media, char *port); int sdp_message_m_port_set (sdp_message_t * sdp, int pos_media, char *por t);
/** /**
* Get the number of port ('m' field) of a SDP packet. * Get the number of port ('m' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The line number. * @param pos_media The line number.
*/ */
char *sdp_message_m_number_of_port_get(sdp_message_t * sdp, int pos_ media); char *sdp_message_m_number_of_port_get (sdp_message_t * sdp, int pos_medi a);
/** /**
* Get the protocol ('m' field) of a SDP packet. * Get the protocol ('m' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The line number. * @param pos_media The line number.
*/ */
char *sdp_message_m_proto_get(sdp_message_t * sdp, int pos_media); char *sdp_message_m_proto_get (sdp_message_t * sdp, int pos_media);
/** /**
* Set the payload in a SDP packet. * Set the payload in a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The line number. * @param pos_media The line number.
* @param payload The token value. * @param payload The token value.
*/ */
int sdp_message_m_payload_add(sdp_message_t * sdp, int pos_media, int sdp_message_m_payload_add (sdp_message_t * sdp, int pos_media, char *
char *payl payload);
oad);
/** /**
* Get one of the payload number ('m' field) of a SDP packet. * Get one of the payload number ('m' field) of a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The line number. * @param pos_media The line number.
* @param pos The i th payload element. * @param pos The i th payload element.
*/ */
char *sdp_message_m_payload_get(sdp_message_t * sdp, int pos_media, int pos); char *sdp_message_m_payload_get (sdp_message_t * sdp, int pos_media, int pos);
/** /**
* Remove a payload in a SDP packet. * Remove a payload in a SDP packet.
* @param sdp The element to work on. * @param sdp The element to work on.
* @param pos_media The line number. * @param pos_media The line number.
* @param pos The position of the payload in the media line. * @param pos The position of the payload in the media line.
*/ */
int sdp_message_m_payload_del(sdp_message_t * sdp, int pos_media, in t pos); int sdp_message_m_payload_del (sdp_message_t * sdp, int pos_media, int po s);
/** @} */ /** @} */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 88 change blocks. 
204 lines changed or deleted 180 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/