SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
osip_dialog.h
Go to the documentation of this file.
1 /*
2  The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
3  Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
4 
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.
9 
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.
14 
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
18 */
19 
20 #ifndef _DIALOG_H_
21 #define _DIALOG_H_
22 
23 #include <osip2/osip.h>
24 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 
41 #ifndef DOXYGEN
42  typedef enum _osip_dialog_type_t {
46 #endif
47 
48 
53  typedef struct osip_dialog osip_dialog_t;
54 
55 
60  struct osip_dialog {
61  char *call_id;
62  char *local_tag;
63  char *remote_tag;
64  char *line_param;
66  int local_cseq;
72  int secure;
76  void *your_instance;
77  };
78 
84 #define osip_dialog_set_instance(dialog,instance) (dialog)->your_instance = (void*)(instance)
85 
91 #define osip_dialog_get_instance(dialog) (dialog)->your_instance
92 
104  int osip_dialog_init_as_uac (osip_dialog_t ** dialog, osip_message_t * response);
113  int osip_dialog_init_as_uac_with_remote_request (osip_dialog_t ** dialog, osip_message_t * next_request, int local_cseq);
114 
123  int osip_dialog_init_as_uas (osip_dialog_t ** dialog, osip_message_t * invite, osip_message_t * response);
128  void osip_dialog_free (osip_dialog_t * dialog);
135  void osip_dialog_set_state (osip_dialog_t * dialog, state_t type);
154 
160  int osip_dialog_match_as_uac (osip_dialog_t * dialog, osip_message_t * response);
179 
185  int osip_dialog_match_as_uas (osip_dialog_t * dialog, osip_message_t * request);
186 
196  int osip_dialog_is_callee (osip_dialog_t * dialog);
197 
198 
199 #ifdef __cplusplus
200 }
201 #endif
202 
203 #endif
Structure for referencing a list of elements.
Definition: osip_list.h:82
Structure for SIP Message (REQUEST and RESPONSE).
Definition: osip_message.h:55
oSIP fsm Routines
int osip_dialog_init_as_uas(osip_dialog_t **dialog, osip_message_t *invite, osip_message_t *response)
Allocate a osip_dialog_t element as a UAS.
char * remote_tag
remote tag
Definition: osip_dialog.h:63
enum _state_t state_t
Enumeration for transaction state.
void * your_instance
for application data reference
Definition: osip_dialog.h:76
int osip_dialog_init_as_uac(osip_dialog_t **dialog, osip_message_t *response)
Allocate a osip_dialog_t element as a UAC.
int osip_dialog_match_as_uac(osip_dialog_t *dialog, osip_message_t *response)
Match a response received with a dialog.
void osip_dialog_free(osip_dialog_t *dialog)
Free all resource in a osip_dialog_t element.
enum _osip_dialog_type_t osip_dialog_type_t
osip_from_t * local_uri
local_uri
Definition: osip_dialog.h:69
char * call_id
Call-ID.
Definition: osip_dialog.h:61
char * local_tag
local tag
Definition: osip_dialog.h:62
osip_list_t route_set
route set
Definition: osip_dialog.h:65
int osip_dialog_update_route_set_as_uas(osip_dialog_t *dialog, osip_message_t *invite)
Update the Route-Set as UAS of a dialog.
_osip_dialog_type_t
Definition: osip_dialog.h:42
int osip_dialog_update_osip_cseq_as_uas(osip_dialog_t *dialog, osip_message_t *request)
Update the CSeq (remote cseq) during a UAS transaction of a dialog.
state_t state
DIALOG_EARLY || DIALOG_CONFIRMED || DIALOG_CLOSED.
Definition: osip_dialog.h:75
Definition of the From header.
Definition: osip_from.h:48
void osip_dialog_set_state(osip_dialog_t *dialog, state_t type)
Set the state of the dialog.
int osip_dialog_match_as_uas(osip_dialog_t *dialog, osip_message_t *request)
Match a request (response sent?) received with a dialog.
int osip_dialog_is_callee(osip_dialog_t *dialog)
Is dialog initiated by as CALLEE.
osip_contact_t * remote_contact_uri
remote contact_uri
Definition: osip_dialog.h:70
osip_to_t * remote_uri
remote_uri
Definition: osip_dialog.h:68
Structure for referencing a dialog.
Definition: osip_dialog.h:60
int secure
use secure transport layer
Definition: osip_dialog.h:72
osip_dialog_type_t type
type of dialog (CALLEE or CALLER)
Definition: osip_dialog.h:74
int osip_dialog_update_route_set_as_uac(osip_dialog_t *dialog, osip_message_t *response)
Update the Route-Set as UAC of a dialog.
char * line_param
line param from request uri for incoming calls
Definition: osip_dialog.h:64
int osip_dialog_is_originator(osip_dialog_t *dialog)
Is dialog initiated by as CALLER.
int osip_dialog_update_tag_as_uac(osip_dialog_t *dialog, osip_message_t *response)
Update the tag as UAC of a dialog?.
int local_cseq
last local cseq
Definition: osip_dialog.h:66
int remote_cseq
last remote cseq
Definition: osip_dialog.h:67
int osip_dialog_init_as_uac_with_remote_request(osip_dialog_t **dialog, osip_message_t *next_request, int local_cseq)
Allocate a osip_dialog_t element as a UAC.