presence.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2006 Voice Sistem SRL
00003  *
00004  * This file is part of Kamailio, a free SIP server.
00005  *
00006  * Kamailio is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * Kamailio is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019  *
00020  *
00021  * History:
00022  * ---------
00023  *  2006-10-09  first version (Anca Vamanu)
00024  */
00025 
00033 #ifndef PA_MOD_H
00034 #define PA_MOD_H
00035 
00036 #include "../../parser/msg_parser.h"
00037 #include "../../modules/tm/tm_load.h"
00038 #include "../../modules/sl/sl.h"
00039 #include "../../lib/srdb1/db.h"
00040 #include "../../parser/parse_from.h"
00041 #include "event_list.h"
00042 #include "hash.h"
00043 
00044 /* DB modes */
00045 
00047 #define NO_DB            0
00048 
00049 #define WRITE_THROUGH    1
00050 
00051 #define WRITE_BACK       2
00052 
00053 #define DB_ONLY          3
00054 
00055 #define NO_UPDATE_TYPE  -1
00056 #define UPDATED_TYPE    1
00057 
00059 extern struct tm_binds tmb;
00060 
00061 extern sl_api_t slb;
00062 
00063 /* DB module bind */
00064 extern db_func_t pa_dbf;
00065 extern db1_con_t* pa_db;
00066 extern db_func_t pres_xcap_dbf;
00067 extern db1_con_t* pres_xcap_db;
00068 
00069 /* PRESENCE database */
00070 extern str db_url;
00071 extern str presentity_table;
00072 extern str active_watchers_table;
00073 extern str watchers_table; 
00074 
00075 extern int counter;
00076 extern int pid;
00077 extern int startup_time;
00078 extern char *to_tag_pref;
00079 extern int expires_offset;
00080 extern str server_address;
00081 extern int max_expires;
00082 extern int subs_dbmode;
00083 extern int publ_cache_enabled;
00084 extern int sphere_enable;
00085 extern int timeout_rm_subs;
00086 extern int send_fast_notify;
00087 extern int shtable_size;
00088 extern shtable_t subs_htable;
00089 
00090 extern int pres_fetch_rows;
00091 
00092 extern int pres_waitn_time;
00093 extern int pres_notifier_poll_rate;
00094 extern int pres_notifier_processes;
00095 
00096 extern int phtable_size;
00097 extern phtable_t* pres_htable;
00098 
00099 extern int pres_integrated_xcap_server;
00100 extern str pres_xcap_table;
00101 
00102 int update_watchers_status(str pres_uri, pres_ev_t* ev, str* rules_doc);
00103 int pres_auth_status(struct sip_msg* msg, str watcher_uri, str presentity_uri);
00104 
00105 #endif /* PA_MOD_H */