1 /*
2 *
3 * presence module - presence server implementation
4 *
5 * Copyright (C) 2006 Voice Sistem S.R.L.
6 *
7 * This file is part of Kamailio, a free SIP server.
8 *
9 * Kamailio is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version
13 *
14 * Kamailio is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 *
23 */
24
25 /*! \file
26 * \brief Kamailio Presence :: Kamailio generic presence module
27 *
28 * This is the core presence module, used in combination with other modules.
29 *
30 * \ingroup presence
31 */
32
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include "../../core/dprint.h"
36 #include "../../core/sr_module.h"
37 #include "presence.h"
38 #include "bind_presence.h"
39 #include "notify.h"
40 #include "publish.h"
41 #include "subscribe.h"
42
bind_presence(presence_api_t * api)43 int bind_presence(presence_api_t *api)
44 {
45 if(!api) {
46 LM_ERR("Invalid parameter value\n");
47 return -1;
48 }
49
50 api->add_event = add_event;
51 api->contains_event = contains_event;
52 api->search_event = search_event;
53 api->get_event_list = get_event_list;
54 api->update_watchers_status = update_watchers_status;
55 api->new_shtable = new_shtable;
56 api->destroy_shtable = destroy_shtable;
57 api->insert_shtable = insert_shtable;
58 api->search_shtable = search_shtable;
59 api->delete_shtable = delete_shtable;
60 api->update_shtable = update_shtable;
61 api->mem_copy_subs = mem_copy_subs;
62 api->update_db_subs_timer = update_db_subs_timer;
63 api->extract_sdialog_info = extract_sdialog_info;
64 api->get_sphere = get_sphere;
65 api->get_presentity = get_p_notify_body;
66 api->free_presentity = free_notify_body;
67 api->pres_auth_status = pres_auth_status;
68 api->handle_publish = w_handle_publish;
69 api->handle_subscribe0 = handle_subscribe0;
70 api->handle_subscribe = handle_subscribe;
71 api->update_presentity = _api_update_presentity;
72 api->pres_refresh_watchers = _api_pres_refresh_watchers;
73 return 0;
74 }
75