pua_db.h

00001 /*
00002  * $Id$
00003  *
00004  * pua_db headers - presence user agent db headers
00005  *
00006  * Copyright (C) 2011 Crocodile RCS Ltd
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 
00025 #ifndef PUA_DB_H
00026 #define PUA_DB_H
00027 
00028 #include "../../lib/srdb1/db.h"
00029 #include "../rls/list.h"
00030 
00031 #define PUA_PRES_URI (1<<0) 
00032 #define PUA_PRES_ID (1<<1)
00033 #define PUA_EVENT (1<<2)
00034 #define PUA_EXPIRES (1<<3)
00035 #define PUA_DESIRED_EXPIRES (1<<4)
00036 #define PUA_FLAG (1<<5)
00037 #define PUA_ETAG (1<<6)
00038 #define PUA_TUPLE_ID (1<<7)
00039 #define PUA_WATCHER_URI (1<<8)
00040 #define PUA_CALL_ID (1<<9)
00041 #define PUA_TO_TAG (1<<10)
00042 #define PUA_FROM_TAG (1<<11)
00043 #define PUA_CSEQ  (1<<12)
00044 #define PUA_RECORD_ROUTE (1<<13)
00045 #define PUA_CONTACT (1<<14)
00046 #define PUA_REMOTE_CONTACT (1<<15)
00047 #define PUA_VERSION (1<<16)
00048 #define PUA_EXTRA_HEADERS (1<<17)
00049 
00050 void free_results_puadb( db1_res_t *res );
00051 int is_dialog_puadb(ua_pres_t *pres);
00052 int get_record_id_puadb(ua_pres_t *pres, str **rec_id );
00053 
00054 int convert_temporary_dialog_puadb(ua_pres_t *pres);
00055 int insert_dialog_puadb(ua_pres_t* pres);
00056 ua_pres_t *get_dialog_puadb(str pres_id, str *pres_uri, ua_pres_t *result, db1_res_t **res);
00057 int delete_dialog_puadb(ua_pres_t *pres);
00058 int update_dialog_puadb(ua_pres_t *pres, int expires, str *contact);
00059 list_entry_t *get_subs_list_puadb(str *did);
00060 
00061 int insert_record_puadb(ua_pres_t* pres);
00062 ua_pres_t *get_record_puadb(str pres_id, str *etag, ua_pres_t *result, db1_res_t **res);
00063 int delete_record_puadb(ua_pres_t *pres);
00064 int update_record_puadb(ua_pres_t *pres, int expires, str *contact);
00065 int update_version_puadb(ua_pres_t *pres);
00066 int update_contact_puadb(ua_pres_t *pres, str *contact);
00067 
00068 #endif