osip_dialog.h

Go to the documentation of this file.
00001 /*
00002   The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
00003   Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@atosc.org
00004   
00005   This library is free software; you can redistribute it and/or
00006   modify it under the terms of the GNU Lesser General Public
00007   License as published by the Free Software Foundation; either
00008   version 2.1 of the License, or (at your option) any later version.
00009   
00010   This library is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013   Lesser General Public License for more details.
00014   
00015   You should have received a copy of the GNU Lesser General Public
00016   License along with this library; if not, write to the Free Software
00017   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 #ifndef _DIALOG_H_
00021 #define _DIALOG_H_
00022 
00023 #include <osip2/osip.h>
00024 
00036 #ifdef __cplusplus
00037 extern "C"
00038 {
00039 #endif
00040 
00041 
00042 #ifndef DOXYGEN
00043   typedef enum _osip_dialog_type_t
00044   {
00045     CALLER,
00046     CALLEE
00047   }
00048   osip_dialog_type_t;
00049 #endif
00050 
00051 
00056   typedef struct osip_dialog osip_dialog_t;
00057 
00058 
00063   struct osip_dialog
00064   {
00065     char *call_id;                       
00066     char *local_tag;                     
00067     char *remote_tag;                    
00068     osip_list_t route_set;              
00069     int local_cseq;                      
00070     int remote_cseq;                     
00071     osip_to_t *remote_uri;               
00072     osip_from_t *local_uri;              
00073     osip_contact_t *remote_contact_uri;  
00074     int secure;                          
00076     osip_dialog_type_t type;             
00077     state_t state;                       
00078     void *your_instance;                 
00079   };
00080 
00086 #define osip_dialog_set_instance(dialog,instance) (dialog)->your_instance = (void*)(instance)
00087 
00093 #define osip_dialog_get_instance(dialog)          (dialog)->your_instance
00094 
00106   int osip_dialog_init_as_uac (osip_dialog_t ** dialog, osip_message_t * response);
00115   int osip_dialog_init_as_uac_with_remote_request (osip_dialog_t ** dialog,
00116                                                    osip_message_t *
00117                                                    next_request, int local_cseq);
00118 
00127   int osip_dialog_init_as_uas (osip_dialog_t ** dialog,
00128                                osip_message_t * invite, osip_message_t * response);
00133   void osip_dialog_free (osip_dialog_t * dialog);
00140   void osip_dialog_set_state (osip_dialog_t * dialog, state_t type);
00151   int osip_dialog_update_route_set_as_uas (osip_dialog_t * dialog,
00152                                            osip_message_t * invite);
00159   int osip_dialog_update_osip_cseq_as_uas (osip_dialog_t * dialog,
00160                                            osip_message_t * request);
00161 
00167   int osip_dialog_match_as_uac (osip_dialog_t * dialog, osip_message_t * response);
00174   int osip_dialog_update_tag_as_uac (osip_dialog_t * dialog,
00175                                      osip_message_t * response);
00186   int osip_dialog_update_route_set_as_uac (osip_dialog_t * dialog,
00187                                            osip_message_t * response);
00188 
00194   int osip_dialog_match_as_uas (osip_dialog_t * dialog, osip_message_t * request);
00195 
00201   int osip_dialog_is_originator (osip_dialog_t * dialog);
00207   int osip_dialog_is_callee (osip_dialog_t * dialog);
00208 
00209 
00210 #ifdef __cplusplus
00211 }
00212 #endif
00213 
00217 #endif

Generated on Wed Feb 13 01:03:29 2008 for libosip by  doxygen 1.5.4