modules/presence/bind_presence.h
f42f79bf
 /*
  * $Id: bind_presence.h 1979 2007-04-06 13:24:12Z anca_vamanu $
  *
  * presence module - presence server implementation
  *
  * Copyright (C) 2007 Voice Sistem S.R.L.
  *
27642a08
  * This file is part of Kamailio, a free SIP server.
f42f79bf
  *
27642a08
  * Kamailio is free software; you can redistribute it and/or modify
f42f79bf
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version
  *
27642a08
  * Kamailio is distributed in the hope that it will be useful,
f42f79bf
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License 
  * along with this program; if not, write to the Free Software 
9e1ff448
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
f42f79bf
  *
  * History:
  * --------
ae86ca36
  *  2007-04-17  initial version (Anca Vamanu)
f42f79bf
  */
e01b2508
 /*! \file
08422176
  * \brief SIP-Router Presence :: Kamailio generic presence module
  *
  * \ingroup presence
e01b2508
  */
 
 
f42f79bf
 #ifndef _PRES_BIND_H_
 #define _PRES_BIND_H_
 
 #include "event_list.h"
2254abe7
 #include "hash.h"
ea35fb5f
 #include "presentity.h"
abc175ad
 #include "../../sr_module.h"
f42f79bf
 
7532087a
 typedef int (*update_watchers_t)(str pres_uri, pres_ev_t* ev, str* rules_doc);
bd598ce9
 typedef str* (*pres_get_presentity_t)(str pres_uri, pres_ev_t *ev, str *etag, str *contact);
 typedef void (*pres_free_presentity_t)(str *presentity, pres_ev_t *ev);
abc175ad
 typedef int (*pres_auth_status_t)(struct sip_msg* msg, str watcher_uri, str presentity_uri);
a870c322
 typedef int (*pres_handle_publish_t)(struct sip_msg* msg, char *str1, char* str2);
63ab6b48
 typedef int (*pres_handle_subscribe0_t)(struct sip_msg* msg);
 typedef int (*pres_handle_subscribe_t)(struct sip_msg* msg, str watcher_user, str watcher_domain);
7532087a
 
 typedef struct presence_api {
f42f79bf
 	add_event_t add_event;
2e733157
 	contains_event_t contains_event;
739e0edd
 	search_event_t search_event;
50329914
 	get_event_list_t get_event_list;
7532087a
 	update_watchers_t update_watchers_status;
2254abe7
 	/* subs hash table functions */
 	new_shtable_t new_shtable;
 	destroy_shtable_t destroy_shtable;
 	insert_shtable_t insert_shtable;
 	search_shtable_t search_shtable;
 	delete_shtable_t delete_shtable;
 	update_shtable_t update_shtable;
739e0edd
 	mem_copy_subs_t  mem_copy_subs;
ae86ca36
 	update_db_subs_t update_db_subs_timer;
739e0edd
 	extract_sdialog_info_t extract_sdialog_info;
ea35fb5f
 	pres_get_sphere_t get_sphere;
bd598ce9
 	pres_get_presentity_t get_presentity;
 	pres_free_presentity_t free_presentity;
abc175ad
 	pres_auth_status_t pres_auth_status;
a870c322
 	pres_handle_publish_t handle_publish;
63ab6b48
 	pres_handle_subscribe0_t handle_subscribe0;
a870c322
 	pres_handle_subscribe_t handle_subscribe;
7532087a
 } presence_api_t;
f42f79bf
 
7532087a
 int bind_presence(presence_api_t* api);
f42f79bf
 
7532087a
 typedef int (*bind_presence_t)(presence_api_t* api);
f42f79bf
 
abc175ad
 inline static int presence_load_api(presence_api_t *api)
 {
 	bind_presence_t bind_presence_exports;
 	if (!(bind_presence_exports = (bind_presence_t)find_export("bind_presence", 1, 0)))
 	{
 		LM_ERR("Failed to import bind_presence\n");
 		return -1;
 	}
 	return bind_presence_exports(api);
 }
 
f42f79bf
 #endif