blob: e07ba79a80c3f0f8e8463958610257a8967be327 [file] [log] [blame]
Benny Prijono268ca612006-02-07 12:34:11 +00001/* $Id$ */
2/*
3 * Copyright (C) 2003-2006 Benny Prijono <benny@prijono.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program 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
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __SIP_INVITE_SESSION_H__
20#define __SIP_INVITE_SESSION_H__
21
Benny Prijono312aff92006-06-17 04:08:30 +000022/**
23 * @file sip_inv.h
24 * @brief INVITE sessions
25 */
26
27
Benny Prijono268ca612006-02-07 12:34:11 +000028#include <pjsip/sip_dialog.h>
29#include <pjmedia/sdp_neg.h>
30
Benny Prijonof3195072006-02-14 21:15:30 +000031
Benny Prijono312aff92006-06-17 04:08:30 +000032/**
33 * @defgroup PJSIP_HIGH_UA User Agent Library
34 * @ingroup PJSIP
35 * @brief Mid-level User Agent Library.
36 *
37 * This is the high level user agent library, which consists of:
38 * - @ref PJSIP_INV, to encapsulate INVITE sessions and SDP
39 * negotiation in the session,
40 * - @ref PJSUA_REGC, high level client registration API, and
41 * - @ref PJSUA_XFER.
42 *
43 * More detailed information is explained in
44 * <A HREF="/docs.htm">PJSIP Developer's Guide</A>
45 * PDF document, and readers are encouraged to read the document to
46 * get the concept behind dialog, dialog usages, and INVITE sessions.
47 *
48 * The User Agent Library is implemented in <b>pjsip-ua</b> static
49 * library.
50 */
51
52/**
53 * @defgroup PJSIP_INV INVITE Session
54 * @ingroup PJSIP_HIGH_UA
55 * @brief Provides INVITE session management.
56 * @{
57 *
58 * The INVITE session uses the @ref PJSIP_DIALOG framework to manage
59 * the underlying dialog, and is one type of usages that can use
60 * a particular dialog instance (other usages are event subscription,
61 * discussed in @ref PJSIP_EVENT_NOT). The INVITE session manages
62 * the life-time of the session, and also manages the SDP negotiation.
63 *
64 * Application must link with <b>pjsip-ua</b> static library to use this API.
65 *
66 * More detailed information is explained in
67 * <A HREF="/docs.htm">PJSIP Developer's Guide</A>
68 * PDF document, and readers are encouraged to read the document to
69 * get the concept behind dialog, dialog usages, and INVITE sessions.
70 *
71 * The INVITE session does NOT manage media. If application wants to
72 * use API that encapsulates both signaling and media in a very easy
73 * to use API, it can use @ref PJSUA_LIB for this purpose.
74 */
75
Benny Prijonof3195072006-02-14 21:15:30 +000076PJ_BEGIN_DECL
77
78
Benny Prijono312aff92006-06-17 04:08:30 +000079/**
80 * @see pjsip_inv_session
81 */
Benny Prijono268ca612006-02-07 12:34:11 +000082typedef struct pjsip_inv_session pjsip_inv_session;
Benny Prijono312aff92006-06-17 04:08:30 +000083
Benny Prijono268ca612006-02-07 12:34:11 +000084
85/**
86 * This enumeration describes invite session state.
87 */
Benny Prijono312aff92006-06-17 04:08:30 +000088typedef enum pjsip_inv_state
Benny Prijono268ca612006-02-07 12:34:11 +000089{
90 PJSIP_INV_STATE_NULL, /**< Before INVITE is sent or received */
91 PJSIP_INV_STATE_CALLING, /**< After INVITE is sent */
92 PJSIP_INV_STATE_INCOMING, /**< After INVITE is received. */
93 PJSIP_INV_STATE_EARLY, /**< After response with To tag. */
94 PJSIP_INV_STATE_CONNECTING, /**< After 2xx is sent/received. */
95 PJSIP_INV_STATE_CONFIRMED, /**< After ACK is sent/received. */
96 PJSIP_INV_STATE_DISCONNECTED, /**< Session is terminated. */
Benny Prijono312aff92006-06-17 04:08:30 +000097} pjsip_inv_state;
Benny Prijono268ca612006-02-07 12:34:11 +000098
99/**
100 * This structure contains callbacks to be registered by application to
101 * receieve notifications from the framework about various events in
102 * the invite session.
103 */
Benny Prijono312aff92006-06-17 04:08:30 +0000104typedef struct pjsip_inv_callback
Benny Prijono268ca612006-02-07 12:34:11 +0000105{
106 /**
107 * This callback is called when the invite sesion state has changed.
108 * Application should inspect the session state (inv_sess->state) to get
109 * the current state of the session.
110 *
111 * This callback is mandatory.
112 *
113 * @param inv The invite session.
114 * @param e The event which has caused the invite session's
115 * state to change.
116 */
117 void (*on_state_changed)(pjsip_inv_session *inv, pjsip_event *e);
118
119
120 /**
121 * This callback is called when the invite usage module has created
122 * a new dialog and invite because of forked outgoing request.
123 *
124 * This callback is mandatory.
125 *
126 * @param inv The new invite session.
127 * @param e The event which has caused the dialog to fork.
128 * The type of this event can be either
129 * PJSIP_EVENT_RX_MSG or PJSIP_EVENT_RX_200_MSG.
130 */
131 void (*on_new_session)(pjsip_inv_session *inv, pjsip_event *e);
132
133 /**
134 * This callback is called whenever any transactions within the session
135 * has changed their state. Application MAY implement this callback,
136 * e.g. to monitor the progress of an outgoing request.
137 *
138 * This callback is optional.
139 *
140 * @param inv The invite session.
141 * @param tsx The transaction, which state has changed.
142 * @param e The event which has caused the transation state's
143 * to change.
144 */
145 void (*on_tsx_state_changed)(pjsip_inv_session *inv,
146 pjsip_transaction *tsx,
147 pjsip_event *e);
148
149 /**
150 * This callback is called when the invite session has received
151 * new offer from peer. Application can inspect the remote offer
Benny Prijono26ff9062006-02-21 23:47:00 +0000152 * in "offer".
Benny Prijono268ca612006-02-07 12:34:11 +0000153 *
154 * @param inv The invite session.
Benny Prijono26ff9062006-02-21 23:47:00 +0000155 * @param offer Remote offer.
Benny Prijono268ca612006-02-07 12:34:11 +0000156 */
Benny Prijono26ff9062006-02-21 23:47:00 +0000157 void (*on_rx_offer)(pjsip_inv_session *inv,
158 const pjmedia_sdp_session *offer);
Benny Prijono268ca612006-02-07 12:34:11 +0000159
160 /**
161 * This callback is called after SDP offer/answer session has completed.
162 * The status argument specifies the status of the offer/answer,
163 * as returned by pjmedia_sdp_neg_negotiate().
164 *
165 * This callback is optional (from the point of view of the framework),
166 * but all useful applications normally need to implement this callback.
167 *
168 * @param inv The invite session.
169 * @param status The negotiation status.
170 */
171 void (*on_media_update)(pjsip_inv_session *inv_ses,
172 pj_status_t status);
Benny Prijono312aff92006-06-17 04:08:30 +0000173
174} pjsip_inv_callback;
175
Benny Prijono268ca612006-02-07 12:34:11 +0000176
177
178/**
179 * This enumeration shows various options that can be applied to a session.
180 * The bitmask combination of these options need to be specified when
181 * creating a session. After the dialog is established (including early),
182 * the options member of #pjsip_inv_session shows which capabilities are
183 * common in both endpoints.
184 */
185enum pjsip_inv_option
186{
187 /**
188 * Indicate support for reliable provisional response extension
189 */
190 PJSIP_INV_SUPPORT_100REL = 1,
191
192 /**
193 * Indicate support for session timer extension.
194 */
195 PJSIP_INV_SUPPORT_TIMER = 2,
196
197 /**
198 * Indicate support for UPDATE method. This is automatically implied
199 * when creating outgoing dialog. After the dialog is established,
200 * the options member of #pjsip_inv_session shows whether peer supports
201 * this method as well.
202 */
203 PJSIP_INV_SUPPORT_UPDATE = 4,
204
205 /**
206 * Require reliable provisional response extension.
207 */
208 PJSIP_INV_REQUIRE_100REL = 32,
209
210 /**
211 * Require session timer extension.
212 */
213 PJSIP_INV_REQUIRE_TIMER = 64,
214
215};
216
217
218/**
219 * This structure describes the invite session.
220 */
221struct pjsip_inv_session
222{
Benny Prijono0b6340c2006-06-13 22:21:23 +0000223 char obj_name[PJ_MAX_OBJ_NAME]; /**< Log identification */
Benny Prijonoe4f2abb2006-02-10 14:04:05 +0000224 pj_pool_t *pool; /**< Dialog's pool. */
225 pjsip_inv_state state; /**< Invite sess state. */
Benny Prijonod4e0abd2006-03-05 11:53:36 +0000226 pjsip_status_code cause; /**< Disconnect cause. */
Benny Prijono0b6340c2006-06-13 22:21:23 +0000227 pj_str_t cause_text; /**< Cause text. */
Benny Prijonod4e0abd2006-03-05 11:53:36 +0000228 pj_bool_t notify; /**< Internal. */
Benny Prijonoe4f2abb2006-02-10 14:04:05 +0000229 pjsip_dialog *dlg; /**< Underlying dialog. */
230 pjsip_role_e role; /**< Invite role. */
231 unsigned options; /**< Options in use. */
232 pjmedia_sdp_neg *neg; /**< Negotiator. */
233 pjsip_transaction *invite_tsx; /**< 1st invite tsx. */
234 void *mod_data[PJSIP_MAX_MODULE];/**< Modules data. */
Benny Prijono268ca612006-02-07 12:34:11 +0000235};
236
237
238/**
239 * Initialize the invite usage module and register it to the endpoint.
240 * The callback argument contains pointer to functions to be called on
241 * occurences of events in invite sessions.
242 *
243 * @param endpt The endpoint instance.
Benny Prijono312aff92006-06-17 04:08:30 +0000244 * @param cb Callback structure.
Benny Prijono268ca612006-02-07 12:34:11 +0000245 *
246 * @return PJ_SUCCESS on success, or the appropriate error code.
247 */
248PJ_DECL(pj_status_t) pjsip_inv_usage_init(pjsip_endpoint *endpt,
Benny Prijono268ca612006-02-07 12:34:11 +0000249 const pjsip_inv_callback *cb);
250
251/**
252 * Get the INVITE usage module instance.
253 *
254 * @return PJ_SUCCESS on success, or the appropriate error code.
255 */
256PJ_DECL(pjsip_module*) pjsip_inv_usage_instance(void);
257
258
Benny Prijono632ce712006-02-09 14:01:40 +0000259/**
260 * Dump user agent contents (e.g. all dialogs).
261 */
262PJ_DECL(void) pjsip_inv_usage_dump(void);
263
Benny Prijono268ca612006-02-07 12:34:11 +0000264
265/**
266 * Create UAC invite session for the specified dialog in dlg.
267 *
268 * @param dlg The dialog which will be used by this invite session.
269 * @param local_sdp If application has determined its media capability,
270 * it can specify the SDP here. Otherwise it can leave
271 * this to NULL, to let remote UAS specifies an offer.
272 * @param options The options argument is bitmask combination of SIP
273 * features in pjsip_inv_options enumeration.
274 * @param p_inv On successful return, the invite session will be put
275 * in this argument.
276 *
277 * @return The function will return PJ_SUCCESS if it can create
278 * the session. Otherwise the appropriate error status
279 * will be returned on failure.
280 */
281PJ_DECL(pj_status_t) pjsip_inv_create_uac(pjsip_dialog *dlg,
282 const pjmedia_sdp_session *local_sdp,
283 unsigned options,
284 pjsip_inv_session **p_inv);
285
286
287/**
288 * Application SHOULD call this function upon receiving the initial INVITE
289 * request in rdata before creating the invite session (or even dialog),
290 * to verify that the invite session can handle the INVITE request.
291 * This function verifies that local endpoint is capable to handle required
292 * SIP extensions in the request (i.e. Require header) and also the media,
293 * if media description is present in the request.
294 *
295 * @param rdata The incoming INVITE request.
296 *
297 * @param options Upon calling this function, the options argument
298 * MUST contain the desired SIP extensions to be
299 * applied to the session. Upon return, this argument
300 * will contain the SIP extension that will be applied
301 * to the session, after considering the Supported,
302 * Require, and Allow headers in the request.
303 *
304 * @param sdp If local media capability has been determined,
305 * and if application wishes to verify that it can
306 * handle the media offer in the incoming INVITE
307 * request, it SHOULD specify its local media capability
308 * in this argument.
309 * If it is not specified, media verification will not
310 * be performed by this function.
311 *
312 * @param dlg If tdata is not NULL, application needs to specify
313 * how to create the response. Either dlg or endpt
314 * argument MUST be specified, with dlg argument takes
315 * precedence when both are specified.
316 *
317 * If a dialog has been created prior to calling this
318 * function, then it MUST be specified in dlg argument.
319 * Otherwise application MUST specify the endpt argument
320 * (this is useful e.g. when application wants to send
321 * the response statelessly).
322 *
323 * @param endpt If tdata is not NULL, application needs to specify
324 * how to create the response. Either dlg or endpt
325 * argument MUST be specified, with dlg argument takes
326 * precedence when both are specified.
327 *
328 * @param tdata If this argument is not NULL, this function will
329 * create the appropriate non-2xx final response message
330 * when the verification fails.
331 *
332 * @return If everything has been negotiated successfully,
333 * the function will return PJ_SUCCESS. Otherwise it
334 * will return the reason of the failure as the return
335 * code.
336 *
337 * This function is capable to create the appropriate
338 * response message when the verification has failed.
339 * If tdata is specified, then a non-2xx final response
340 * will be created and put in this argument upon return,
341 * when the verification has failed.
342 *
343 * If a dialog has been created prior to calling this
344 * function, then it MUST be specified in dlg argument.
345 * Otherwise application MUST specify the endpt argument
346 * (this is useful e.g. when application wants to send
347 * the response statelessly).
348 */
349PJ_DECL(pj_status_t) pjsip_inv_verify_request( pjsip_rx_data *rdata,
350 unsigned *options,
351 const pjmedia_sdp_session *sdp,
352 pjsip_dialog *dlg,
353 pjsip_endpoint *endpt,
354 pjsip_tx_data **tdata);
355
356
357/**
358 * Create UAS invite session for the specified dialog in dlg. Application
359 * SHOULD call the verification function before calling this function,
360 * to ensure that it can create the session successfully.
361 *
362 * @param dlg The dialog to be used.
363 * @param rdata Application MUST specify the received INVITE request
364 * in rdata. The invite session needs to inspect the
365 * received request to see if the request contains
366 * features that it supports.
Benny Prijono312aff92006-06-17 04:08:30 +0000367 * @param local_sdp If application has determined its media capability,
Benny Prijono268ca612006-02-07 12:34:11 +0000368 * it can specify this capability in this argument.
369 * If SDP is received in the initial INVITE, the UAS
370 * capability specified in this argument doesn't have to
371 * match the received offer; the SDP negotiator is able
372 * to rearrange the media lines in the answer so that it
373 * matches the offer.
374 * @param options The options argument is bitmask combination of SIP
375 * features in pjsip_inv_options enumeration.
376 * @param p_inv Pointer to receive the newly created invite session.
377 *
378 * @return On successful, the invite session will be put in
379 * p_inv argument and the function will return PJ_SUCCESS.
380 * Otherwise the appropriate error status will be returned
381 * on failure.
382 */
383PJ_DECL(pj_status_t) pjsip_inv_create_uas(pjsip_dialog *dlg,
384 pjsip_rx_data *rdata,
385 const pjmedia_sdp_session *local_sdp,
386 unsigned options,
387 pjsip_inv_session **p_inv);
388
389
390/**
Benny Prijonod4e0abd2006-03-05 11:53:36 +0000391 * Forcefully terminate and destroy INVITE session, regardless of
392 * the state of the session. Note that this function should only be used
393 * when there is failure in the INVITE session creation. After the
394 * invite session has been created and initialized, normally application
395 * SHOULD use #pjsip_inv_end_session() to end the INVITE session instead.
396 *
397 * Note also that this function may terminate the underlying dialog, if
398 * there are no other sessions in the dialog.
399 *
400 * @param inv The invite session.
401 * @param st_code Status code for the reason of the termination.
402 * @param notify If set to non-zero, then on_state_changed()
403 * callback will be called.
404 *
405 * @return PJ_SUCCESS if the INVITE session has been
406 * terminated.
407 */
408PJ_DECL(pj_status_t) pjsip_inv_terminate( pjsip_inv_session *inv,
409 int st_code,
410 pj_bool_t notify );
411
412
413/**
Benny Prijono268ca612006-02-07 12:34:11 +0000414 * Create the initial INVITE request for this session. This function can only
415 * be called for UAC session. If local media capability is specified when
416 * the invite session was created, then this function will put an SDP offer
417 * in the outgoing INVITE request. Otherwise the outgoing request will not
418 * contain SDP body.
419 *
420 * @param inv The UAC invite session.
421 * @param p_tdata The initial INVITE request will be put in this
422 * argument if it can be created successfully.
423 *
424 * @return PJ_SUCCESS if the INVITE request can be created.
425 */
426PJ_DECL(pj_status_t) pjsip_inv_invite( pjsip_inv_session *inv,
427 pjsip_tx_data **p_tdata );
428
429
430/**
Benny Prijono64f851e2006-02-23 13:49:28 +0000431 * Create the initial response message for the incoming INVITE request in
432 * rdata with status code st_code and optional status text st_text. Use
433 * #pjsip_answer() to create subsequent response message.
434 */
435PJ_DECL(pj_status_t) pjsip_inv_initial_answer( pjsip_inv_session *inv,
436 pjsip_rx_data *rdata,
437 int st_code,
438 const pj_str_t *st_text,
439 const pjmedia_sdp_session *sdp,
440 pjsip_tx_data **p_tdata);
441
442/**
Benny Prijono268ca612006-02-07 12:34:11 +0000443 * Create a response message to the initial INVITE request. This function
444 * can only be called for the initial INVITE request, as subsequent
445 * re-INVITE request will be answered automatically.
446 *
447 * @param inv The UAS invite session.
448 * @param st_code The st_code contains the status code to be sent,
449 * which may be a provisional or final response.
450 * @param st_text If custom status text is desired, application can
451 * specify the text in st_text; otherwise if this
452 * argument is NULL, default status text will be used.
453 * @param local_sdp If application has specified its media capability
454 * during creation of UAS invite session, the local_sdp
455 * argument MUST be NULL. This is because application
456 * can not perform more than one SDP offer/answer session
457 * in a single INVITE transaction.
458 * If application has not specified its media capability
459 * during creation of UAS invite session, it MAY or MUST
460 * specify its capability in local_sdp argument,
461 * depending whether st_code indicates a 2xx final
462 * response.
463 * @param p_tdata Pointer to receive the response message created by
464 * this function.
465 *
466 * @return PJ_SUCCESS if response message was created
467 * successfully.
468 */
469PJ_DECL(pj_status_t) pjsip_inv_answer( pjsip_inv_session *inv,
470 int st_code,
471 const pj_str_t *st_text,
472 const pjmedia_sdp_session *local_sdp,
473 pjsip_tx_data **p_tdata );
474
475
Benny Prijonoa66c7152006-02-09 01:26:14 +0000476/**
Benny Prijono26ff9062006-02-21 23:47:00 +0000477 * Set local answer to respond to remote SDP offer, to be carried by
478 * subsequent response (or request).
Benny Prijonoa66c7152006-02-09 01:26:14 +0000479 *
480 * @param inv The invite session.
481 * @param sdp The SDP description which will be set as answer
482 * to remote.
Benny Prijono26ff9062006-02-21 23:47:00 +0000483 *
484 * @return PJ_SUCCESS if local answer can be accepted by
485 * SDP negotiator.
Benny Prijonoa66c7152006-02-09 01:26:14 +0000486 */
Benny Prijono26ff9062006-02-21 23:47:00 +0000487PJ_DECL(pj_status_t) pjsip_inv_set_sdp_answer(pjsip_inv_session *inv,
488 const pjmedia_sdp_session *sdp );
489
Benny Prijonoa66c7152006-02-09 01:26:14 +0000490
Benny Prijono268ca612006-02-07 12:34:11 +0000491/**
492 * Create a SIP message to initiate invite session termination. Depending on
493 * the state of the session, this function may return CANCEL request,
494 * a non-2xx final response, or a BYE request. If the session has not answered
495 * the incoming INVITE, this function creates the non-2xx final response with
496 * the specified status code in st_code and optional status text in st_text.
497 *
498 * @param inv The invite session.
499 * @param st_code Status code to be used for terminating the session.
500 * @param st_text Optional status text.
501 * @param p_tdata Pointer to receive the message to be created.
502 *
503 * @return PJ_SUCCESS if termination message can be created.
504 */
505PJ_DECL(pj_status_t) pjsip_inv_end_session( pjsip_inv_session *inv,
506 int st_code,
507 const pj_str_t *st_text,
508 pjsip_tx_data **p_tdata );
509
510
511
512/**
513 * Create a re-INVITE request.
514 *
515 * @param inv The invite session.
516 * @param new_contact If application wants to update its local contact and
517 * inform peer to perform target refresh with a new
518 * contact, it can specify the new contact in this
519 * argument; otherwise this argument must be NULL.
520 * @param new_offer Application MAY initiate a new SDP offer/answer
521 * session in the request when there is no pending
522 * answer to be sent or received. It can detect this
523 * condition by observing the state of the SDP
524 * negotiator of the invite session. If new offer
525 * should be sent to remote, the offer must be specified
526 * in this argument, otherwise it must be NULL.
527 * @param p_tdata Pointer to receive the re-INVITE request message to
528 * be created.
529 *
530 * @return PJ_SUCCESS if a re-INVITE request with the specified
531 * characteristics (e.g. to contain new offer) can be
532 * created.
533 */
534PJ_DECL(pj_status_t) pjsip_inv_reinvite(pjsip_inv_session *inv,
535 const pj_str_t *new_contact,
536 const pjmedia_sdp_session *new_offer,
537 pjsip_tx_data **p_tdata );
538
539
540
541/**
542 * Create an UPDATE request.
543 *
544 * @param inv The invite session.
545 * @param new_contact If application wants to update its local contact
546 * and inform peer to perform target refresh with a new
547 * contact, it can specify the new contact in this
548 * argument; otherwise this argument must be NULL.
549 * @param new_offer Application MAY initiate a new SDP offer/answer
550 * session in the request when there is no pending answer
551 * to be sent or received. It can detect this condition
552 * by observing the state of the SDP negotiator of the
553 * invite session. If new offer should be sent to remote,
554 * the offer must be specified in this argument; otherwise
555 * this argument must be NULL.
556 * @param p_tdata Pointer to receive the UPDATE request message to
557 * be created.
558 *
559 * @return PJ_SUCCESS if a UPDATE request with the specified
560 * characteristics (e.g. to contain new offer) can be
561 * created.
562 */
563PJ_DECL(pj_status_t) pjsip_inv_update ( pjsip_inv_session *inv,
564 const pj_str_t *new_contact,
565 const pjmedia_sdp_session *new_offer,
566 pjsip_tx_data **p_tdata );
567
568
569/**
570 * Send request or response message in tdata.
571 *
572 * @param inv The invite session.
573 * @param tdata The message to be sent.
Benny Prijono268ca612006-02-07 12:34:11 +0000574 *
575 * @return PJ_SUCCESS if transaction can be initiated
576 * successfully to send this message. Note that the
577 * actual final state of the transaction itself will
578 * be reported later, in on_tsx_state_changed()
579 * callback.
580 */
581PJ_DECL(pj_status_t) pjsip_inv_send_msg(pjsip_inv_session *inv,
Benny Prijonoe8b0d3b2006-03-17 17:57:52 +0000582 pjsip_tx_data *tdata);
Benny Prijono268ca612006-02-07 12:34:11 +0000583
584
585
586/**
587 * Get the invite session for the dialog, if any.
588 *
589 * @param dlg The dialog which invite session is being queried.
590 *
591 * @return The invite session instance which has been
592 * associated with this dialog, or NULL.
593 */
594PJ_DECL(pjsip_inv_session*) pjsip_dlg_get_inv_session(pjsip_dialog *dlg);
595
596/**
597 * Get the invite session instance associated with transaction tsx, if any.
598 *
599 * @param tsx The transaction, which invite session is being
600 * queried.
601 *
602 * @return The invite session instance which has been
603 * associated with this transaction, or NULL.
604 */
605PJ_DECL(pjsip_inv_session*) pjsip_tsx_get_inv_session(pjsip_transaction *tsx);
606
607
Benny Prijonoe8b0d3b2006-03-17 17:57:52 +0000608/**
609 * Get state names for INVITE session state.
610 *
611 * @param state The invite state.
612 *
613 * @return String describing the state.
614 */
615PJ_DECL(const char *) pjsip_inv_state_name(pjsip_inv_state state);
616
Benny Prijono268ca612006-02-07 12:34:11 +0000617
Benny Prijonof3195072006-02-14 21:15:30 +0000618PJ_END_DECL
619
Benny Prijono312aff92006-06-17 04:08:30 +0000620/**
621 * @}
622 */
Benny Prijono268ca612006-02-07 12:34:11 +0000623
624
625#endif /* __SIP_INVITE_SESSION_H__ */