2 The oSIP library implements the Session Initiation Protocol (SIP -rfc2543-)
3 Copyright (C) 2001 Aymeric MOIZARD jack@atosc.org
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <osipparser2/osip_const.h>
25 #include <osipparser2/osip_port.h>
33 void __osip_message_callback (int type, osip_transaction_t *,
35 void __osip_kill_transaction_callback (int type, osip_transaction_t *);
36 void __osip_transport_error_callback (int type, osip_transaction_t *,
40 * Allocate an osip_ict_t element. (for outgoing INVITE transaction)
41 * NOTE: THIS IS AN INTERNAL METHOD ONLY
42 * @param ict The element to allocate.
43 * @param osip The global instance of oSIP.
44 * @param invite The SIP request that initiate the transaction.
46 int __osip_ict_init (osip_ict_t ** ict, osip_t * osip,
47 osip_message_t * invite);
49 * Free all resource in a osip_ict_t element.
50 * NOTE: THIS IS AN INTERNAL METHOD ONLY
51 * @param ict The element to free.
53 int __osip_ict_free (osip_ict_t * ict);
57 * Check if this transaction needs a TIMEOUT_A event
58 * NOTE: THIS IS AN INTERNAL METHOD ONLY
59 * @param ict The element to work on.
60 * @param state The actual state of the transaction.
61 * @param transactionid The transaction id.
63 osip_event_t *__osip_ict_need_timer_a_event (osip_ict_t * ict,
67 * Check if this transaction needs a TIMEOUT_B event
68 * NOTE: THIS IS AN INTERNAL METHOD ONLY
69 * @param ict The element to work on.
70 * @param state The actual state of the transaction.
71 * @param transactionid The transaction id.
73 osip_event_t *__osip_ict_need_timer_b_event (osip_ict_t * ict,
77 * Check if this transaction needs a TIMEOUT_D event
78 * NOTE: THIS IS AN INTERNAL METHOD ONLY
79 * @param ict The element to work on.
80 * @param state The actual state of the transaction.
81 * @param transactionid The transaction id.
83 osip_event_t *__osip_ict_need_timer_d_event (osip_ict_t * ict,
88 * Allocate an osip_nict_t element. (for outgoing NON-INVITE transaction)
89 * NOTE: THIS IS AN INTERNAL METHOD ONLY
90 * @param nict The element to allocate.
91 * @param osip The global instance of oSIP.
92 * @param request The SIP request that initiate the transaction.
94 int __osip_nict_init (osip_nict_t ** nict, osip_t * osip,
95 osip_message_t * request);
97 * Free all resource in an osip_nict_t element.
98 * NOTE: THIS IS AN INTERNAL METHOD ONLY
99 * @param nict The element to free.
101 int __osip_nict_free (osip_nict_t * nict);
105 * Check if this transaction needs a TIMEOUT_E event
106 * NOTE: THIS IS AN INTERNAL METHOD ONLY
107 * @param nict The element to work on.
108 * @param state The actual state of the transaction.
109 * @param transactionid The transaction id.
111 osip_event_t *__osip_nict_need_timer_e_event (osip_nict_t * nict,
115 * Check if this transaction needs a TIMEOUT_F event
116 * NOTE: THIS IS AN INTERNAL METHOD ONLY
117 * @param nict The element to work on.
118 * @param state The actual state of the transaction.
119 * @param transactionid The transaction id.
121 osip_event_t *__osip_nict_need_timer_f_event (osip_nict_t * nict,
125 * Check if this transaction needs a TIMEOUT_K event
126 * NOTE: THIS IS AN INTERNAL METHOD ONLY
127 * @param nict The element to work on.
128 * @param state The actual state of the transaction.
129 * @param transactionid The transaction id.
131 osip_event_t *__osip_nict_need_timer_k_event (osip_nict_t * nict,
136 * Allocate an osip_ist_t element. (for incoming INVITE transaction)
137 * NOTE: THIS IS AN INTERNAL METHOD ONLY
138 * @param ist The element to allocate.
139 * @param osip The global instance of oSIP.
140 * @param invite The SIP invite that initiate the transaction.
142 int __osip_ist_init (osip_ist_t ** ist, osip_t * osip,
143 osip_message_t * invite);
145 * Free all resource in a osip_ist_t element.
146 * NOTE: THIS IS AN INTERNAL METHOD ONLY
147 * @param ist The element to free.
149 int __osip_ist_free (osip_ist_t * ist);
152 * Check if this transaction needs a TIMEOUT_G event
153 * NOTE: THIS IS AN INTERNAL METHOD ONLY
154 * @param ist The element to work on.
155 * @param state The actual state of the transaction.
156 * @param transactionid The transaction id.
158 osip_event_t *__osip_ist_need_timer_g_event (osip_ist_t * ist,
162 * Check if this transaction needs a TIMEOUT_H event
163 * NOTE: THIS IS AN INTERNAL METHOD ONLY
164 * @param ist The element to work on.
165 * @param state The actual state of the transaction.
166 * @param transactionid The transaction id.
168 osip_event_t *__osip_ist_need_timer_h_event (osip_ist_t * ist,
172 * Check if this transaction needs a TIMEOUT_I event
173 * NOTE: THIS IS AN INTERNAL METHOD ONLY
174 * @param ist The element to work on.
175 * @param state The actual state of the transaction.
176 * @param transactionid The transaction id.
178 osip_event_t *__osip_ist_need_timer_i_event (osip_ist_t * ist,
183 * Allocate an osip_nist_t element. (for incoming NON-INVITE transaction)
184 * NOTE: THIS IS AN INTERNAL METHOD ONLY
185 * @param nist The element to allocate.
186 * @param osip The global instance of oSIP.
187 * @param request The SIP request that initiate the transaction.
189 int __osip_nist_init (osip_nist_t ** nist, osip_t * osip,
190 osip_message_t * request);
193 * Free all resource in a osip_nist_t element.
194 * NOTE: THIS IS AN INTERNAL METHOD ONLY
195 * @param nist The element to free.
197 int __osip_nist_free (osip_nist_t * nist);
201 * Check if this transaction needs a TIMEOUT_J event
202 * @param nist The element to work on.
203 * @param state The actual state of the transaction.
204 * @param transactionid The transaction id.
206 osip_event_t *__osip_nist_need_timer_j_event (osip_nist_t * nist,
211 * Check if the response match a server transaction.
212 * NOTE: THIS IS AN INTERNAL METHOD ONLY
213 * @param tr The transaction.
214 * @param resp The SIP response received.
217 __osip_transaction_matching_response_osip_to_xict_17_1_3
218 (osip_transaction_t * tr, osip_message_t * resp);
221 * Check if the request match a client transaction.
222 * NOTE: THIS IS AN INTERNAL METHOD ONLY
223 * @param tr The transaction.
224 * @param request The SIP request received.
227 __osip_transaction_matching_request_osip_to_xist_17_2_3
228 (osip_transaction_t * tr, osip_message_t * request);
233 * Lock access to the list of ict transactions.
234 * NOTE: THIS IS AN INTERNAL METHOD ONLY
235 * @param osip The element to work on.
237 int osip_ict_lock (osip_t * osip);
239 * Unlock access to the list of ict transactions.
240 * NOTE: THIS IS AN INTERNAL METHOD ONLY
241 * @param osip The element to work on.
243 int osip_ict_unlock (osip_t * osip);
245 * Lock access to the list of ist transactions.
246 * NOTE: THIS IS AN INTERNAL METHOD ONLY
247 * @param osip The element to work on.
249 int osip_ist_lock (osip_t * osip);
251 * Unlock access to the list of ist transactions.
252 * NOTE: THIS IS AN INTERNAL METHOD ONLY
253 * @param osip The element to work on.
255 int osip_ist_unlock (osip_t * osip);
257 * Lock access to the list of nict transactions.
258 * NOTE: THIS IS AN INTERNAL METHOD ONLY
259 * @param osip The element to work on.
261 int osip_nict_lock (osip_t * osip);
263 * Unlock access to the list of nict transactions.
264 * NOTE: THIS IS AN INTERNAL METHOD ONLY
265 * @param osip The element to work on.
267 int osip_nict_unlock (osip_t * osip);
269 * Lock access to the list of nist transactions.
270 * NOTE: THIS IS AN INTERNAL METHOD ONLY
271 * @param osip The element to work on.
273 int osip_nist_lock (osip_t * osip);
275 * Unlock access to the list of nist transactions.
276 * NOTE: THIS IS AN INTERNAL METHOD ONLY
277 * @param osip The element to work on.
279 int osip_nist_unlock (osip_t * osip);
282 * Add a ict transaction in the ict list of transaction.
283 * NOTE: THIS IS AN INTERNAL METHOD ONLY
284 * @param osip The element to work on.
285 * @param ict The transaction to add.
287 int __osip_add_ict (osip_t * osip, osip_transaction_t * ict);
289 * Add a ist transaction in the ist list of transaction.
290 * NOTE: THIS IS AN INTERNAL METHOD ONLY
291 * @param osip The element to work on.
292 * @param ist The transaction to add.
294 int __osip_add_ist (osip_t * osip, osip_transaction_t * ist);
296 * Add a nict transaction in the nict list of transaction.
297 * NOTE: THIS IS AN INTERNAL METHOD ONLY
298 * @param osip The element to work on.
299 * @param nict The transaction to add.
301 int __osip_add_nict (osip_t * osip, osip_transaction_t * nict);
303 * Add a nist transaction in the nist list of transaction.
304 * NOTE: THIS IS AN INTERNAL METHOD ONLY
305 * @param osip The element to work on.
306 * @param nist The transaction to add.
308 int __osip_add_nist (osip_t * osip, osip_transaction_t * nist);
311 * Remove a ict transaction from the ict list of transaction.
312 * @param osip The element to work on.
313 * @param ict The transaction to add.
315 int __osip_remove_ict_transaction (osip_t * osip, osip_transaction_t * ict);
317 * Remove a ist transaction from the ist list of transaction.
318 * @param osip The element to work on.
319 * @param ist The transaction to add.
321 int __osip_remove_ist_transaction (osip_t * osip, osip_transaction_t * ist);
323 * Remove a nict transaction from the nict list of transaction.
324 * @param osip The element to work on.
325 * @param nict The transaction to add.
327 int __osip_remove_nict_transaction (osip_t * osip,
328 osip_transaction_t * nict);
330 * Remove a nist transaction from the nist list of transaction.
331 * @param osip The element to work on.
332 * @param nist The transaction to add.
334 int __osip_remove_nist_transaction (osip_t * osip,
335 osip_transaction_t * nist);
338 * Allocate a sipevent.
339 * NOTE: THIS IS AN INTERNAL METHOD ONLY
340 * @param type The type of the event.
341 * @param transactionid The transaction id for this event.
343 osip_event_t *__osip_event_new (type_t type, int transactionid);
347 * Allocate a sipevent (we know this message is an OUTGOING SIP message).
348 * @param sip The SIP message we want to send.
350 osip_event_t *osip_new_outgoing_sipmessage (osip_message_t * sip);