/* The oSIP library implements the Session Initiation Protocol (SIP -rfc2543-) Copyright (C) 2001 Aymeric MOIZARD jack@atosc.org This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either 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, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _DIALOG_H_ #define _DIALOG_H_ #include /** * @file osip_dialog.h * @brief oSIP dialog Routines * * Dialog management is a powerful facility given by oSIP. This feature is * needed by SIP end point who has the capability to answer calls. (i.e. * answering 200 OK to an INVITE). *
* A Dialog is a context for a call establishment in oSIP. It's not useless * to say that ONE invite request can lead to several call establishment. * This can happen if your call has been forked by a proxy and several * user agent was contacted and replied at the same time. It is true that * this case won't probably happen several times a month... *
* There is two ways of creating a dialog. In one case, you are the CALLER * and in the other case, you will be the CALLEE. * *

The dialog management is compliant with the latest SIP draft * (rfc2543bis-09). It should handle successfully most cases where * a remote UA is not compliant (no tag in the To of a final response!) * But for example, if you receive 2 answers from 2 uncompliant * UA, they will be detected as being related to the same dialog... * Do not change any code in oSIP or in your application... instead, you * should boycott such implementation. :- */ /** * @defgroup oSIP_DIALOG oSIP dialog Handling * @ingroup oSIP * @{ */ #ifdef __cplusplus extern "C" { #endif #ifndef DOXYGEN typedef enum _osip_dialog_type_t { CALLER, CALLEE } osip_dialog_type_t; #endif /** * Structure for referencing a dialog. * @var osip_dialog_t */ typedef struct osip_dialog osip_dialog_t; /** * Structure for referencing a dialog. */ struct osip_dialog { /* char *dialog_id; ***implied*** *//* call-id:local_tag:remote-tag */ char *call_id; char *local_tag; char *remote_tag; osip_list_t *route_set; int local_cseq; int remote_cseq; osip_to_t *remote_uri; osip_from_t *local_uri; osip_contact_t *remote_contact_uri; int secure; /* type of dialog (CALLEE or CALLER) */ osip_dialog_type_t type; state_t state; /* DIALOG_EARLY || DIALOG_CONFIRMED || DIALOG_CLOSED */ }; /** * Allocate a osip_dialog_t element as a UAC. *

* @param dialog The element to allocate. * @param response The response containing the informations. */ int osip_dialog_init_as_uac (osip_dialog_t ** dialog, osip_message_t * response); /** * Allocate a osip_dialog_t element as a UAC. *