libosip  4.1.0
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 {
43  CALLER,
44  CALLEE
45  } 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;
74  osip_dialog_type_t type;
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