presentity.h

Go to the documentation of this file.
00001 /*
00002  * $Id: presentity.h 4585 2008-08-06 08:20:30Z klaus_darilion $
00003  *
00004  * presence module - presence server implementation
00005  *
00006  * Copyright (C) 2006 Voice Sistem S.R.L.
00007  *
00008  * This file is part of Kamailio, a free SIP server.
00009  *
00010  * Kamailio is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version
00014  *
00015  * Kamailio is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License 
00021  * along with this program; if not, write to the Free Software 
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  * History:
00025  * --------
00026  *  2006-08-15  initial version (anca)
00027  */
00028 
00029 /*! \file
00030  * \brief Kamailio presence module :: Presentity handling
00031  * \ref presentity.c
00032  * \ingroup presence 
00033  */
00034 
00035 
00036 #ifndef PRESENTITY_H
00037 #define PRESENTITY_H
00038 
00039 #include "../../str.h"
00040 #include "../../parser/msg_parser.h" 
00041 #include "event_list.h"
00042 //#include "presence.h"
00043 
00044 extern char prefix;
00045 
00046 typedef struct presentity
00047 {
00048    int presid;
00049    str user;
00050    str domain;
00051    pres_ev_t* event;
00052    str etag;
00053    str* sender;
00054    time_t expires;
00055    time_t received_time;
00056 } presentity_t;
00057 
00058 /* create new presentity */
00059 presentity_t* new_presentity( str* domain,str* user,int expires, 
00060       pres_ev_t* event, str* etag, str* sender);
00061 
00062 /* update presentity in database */
00063 int update_presentity(struct sip_msg* msg,presentity_t* p,str* body,int t_new,
00064       int* sent_reply, char* sphere);
00065 
00066 /* free memory */
00067 void free_presentity(presentity_t* p);
00068 
00069 char* generate_ETag(int publ_count);
00070 
00071 int pres_htable_restore(void);
00072 
00073 char* extract_sphere(str body);
00074 
00075 char* get_sphere(str* pres_uri);
00076 typedef char* (*pres_get_sphere_t)(str* pres_uri);
00077 
00078 
00079 #endif
00080 

Generated on Thu May 24 08:00:52 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6