2 * Copyright (C) 2006 Voice Sistem SRL
4 * This file is part of Kamailio, a free SIP server.
6 * Kamailio is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * Kamailio is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 * \brief Kamailio presence module :: Core
32 #include "../../core/parser/msg_parser.h"
33 #include "../../modules/tm/tm_load.h"
34 #include "../../modules/sl/sl.h"
35 #include "../../lib/srdb1/db.h"
36 #include "../../core/parser/parse_from.h"
37 #include "../../core/utils/sruid.h"
38 #include "event_list.h"
43 /** subscriptions are stored only in memory */
45 /** subscriptions are written in memory and in DB synchronously and read only from memory */
46 #define WRITE_THROUGH 1
47 /** subscriptions are stored in memory and periodically updated in DB */
49 /** subscriptions are stored only in database */
52 #define NO_UPDATE_TYPE -1
53 #define UPDATED_TYPE 1
56 extern struct tm_binds tmb;
61 extern db_func_t pa_dbf;
62 extern db1_con_t *pa_db;
64 /* PRESENCE database */
65 extern str pres_db_url;
66 extern str presentity_table;
67 extern str active_watchers_table;
68 extern str watchers_table;
70 extern int pres_counter;
72 extern int pres_startup_time;
73 extern int pres_expires_offset;
74 extern int pres_cseq_offset;
75 extern str pres_server_address;
76 extern uint32_t pres_min_expires;
77 extern int pres_min_expires_action;
78 extern uint32_t pres_max_expires;
79 extern int pres_subs_dbmode;
80 extern int publ_cache_enabled;
81 extern int pres_sphere_enable;
82 extern int pres_timeout_rm_subs;
83 extern int pres_send_fast_notify;
84 extern int shtable_size;
85 extern shtable_t subs_htable;
87 extern int pres_fetch_rows;
89 extern int pres_waitn_time;
90 extern int pres_notifier_poll_rate;
91 extern int pres_notifier_processes;
92 extern int pres_force_delete;
93 extern int pres_startup_mode;
94 extern str pres_xavp_cfg;
95 extern int pres_retrieve_order;
96 extern str pres_retrieve_order_by;
97 extern int pres_enable_dmq;
99 extern int phtable_size;
100 extern phtable_t *pres_htable;
102 extern sruid_t pres_sruid;
104 extern db_locking_t pres_db_table_lock;
106 int update_watchers_status(str pres_uri, pres_ev_t *ev, str *rules_doc);
107 int pres_auth_status(struct sip_msg *msg, str watcher_uri, str presentity_uri);
108 int _api_pres_refresh_watchers(str *pres, str *event, int type);
110 typedef int (*sip_uri_match_f)(str *s1, str *s2);
111 extern sip_uri_match_f presence_sip_uri_match;
113 int pv_get_subscription(
114 struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
115 int pv_parse_subscription_name(pv_spec_p sp, str *in);
117 #endif /* PA_MOD_H */