Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00035 #ifndef _PRES_BIND_H_
00036 #define _PRES_BIND_H_
00037
00038 #include "event_list.h"
00039 #include "hash.h"
00040 #include "presentity.h"
00041 #include "../../sr_module.h"
00042
00043 typedef int (*update_watchers_t)(str pres_uri, pres_ev_t* ev, str* rules_doc);
00044 typedef str* (*pres_get_presentity_t)(str pres_uri, pres_ev_t *ev, str *etag, str *contact);
00045 typedef void (*pres_free_presentity_t)(str *presentity, pres_ev_t *ev);
00046 typedef int (*pres_auth_status_t)(struct sip_msg* msg, str watcher_uri, str presentity_uri);
00047 typedef int (*pres_handle_publish_t)(struct sip_msg* msg, char *str1, char* str2);
00048 typedef int (*pres_handle_subscribe0_t)(struct sip_msg* msg);
00049 typedef int (*pres_handle_subscribe_t)(struct sip_msg* msg, str watcher_user, str watcher_domain);
00050
00051 typedef struct presence_api {
00052 add_event_t add_event;
00053 contains_event_t contains_event;
00054 search_event_t search_event;
00055 get_event_list_t get_event_list;
00056 update_watchers_t update_watchers_status;
00057
00058 new_shtable_t new_shtable;
00059 destroy_shtable_t destroy_shtable;
00060 insert_shtable_t insert_shtable;
00061 search_shtable_t search_shtable;
00062 delete_shtable_t delete_shtable;
00063 update_shtable_t update_shtable;
00064 mem_copy_subs_t mem_copy_subs;
00065 update_db_subs_t update_db_subs_timer;
00066 extract_sdialog_info_t extract_sdialog_info;
00067 pres_get_sphere_t get_sphere;
00068 pres_get_presentity_t get_presentity;
00069 pres_free_presentity_t free_presentity;
00070 pres_auth_status_t pres_auth_status;
00071 pres_handle_publish_t handle_publish;
00072 pres_handle_subscribe0_t handle_subscribe0;
00073 pres_handle_subscribe_t handle_subscribe;
00074 } presence_api_t;
00075
00076 int bind_presence(presence_api_t* api);
00077
00078 typedef int (*bind_presence_t)(presence_api_t* api);
00079
00080 inline static int presence_load_api(presence_api_t *api)
00081 {
00082 bind_presence_t bind_presence_exports;
00083 if (!(bind_presence_exports = (bind_presence_t)find_export("bind_presence", 1, 0)))
00084 {
00085 LM_ERR("Failed to import bind_presence\n");
00086 return -1;
00087 }
00088 return bind_presence_exports(api);
00089 }
00090
00091 #endif
00092