Sfoglia il codice sorgente

modules_k/presence: added handle_publish() and handle_subscribe() to exported API for use in app_lua

pd 14 anni fa
parent
commit
a870c32263

+ 4 - 0
modules_k/presence/bind_presence.c

@@ -41,6 +41,8 @@
 #include "presence.h"
 #include "presence.h"
 #include "bind_presence.h"
 #include "bind_presence.h"
 #include "notify.h"
 #include "notify.h"
+#include "publish.h"
+#include "subscribe.h"
 
 
 int bind_presence(presence_api_t* api)
 int bind_presence(presence_api_t* api)
 {
 {
@@ -67,6 +69,8 @@ int bind_presence(presence_api_t* api)
 	api->get_presentity= get_p_notify_body;
 	api->get_presentity= get_p_notify_body;
 	api->free_presentity= free_notify_body;
 	api->free_presentity= free_notify_body;
 	api->pres_auth_status= pres_auth_status;
 	api->pres_auth_status= pres_auth_status;
+	api->handle_publish= handle_publish;
+	api->handle_subscribe= handle_subscribe;
 	return 0;
 	return 0;
 }
 }
 
 

+ 4 - 0
modules_k/presence/bind_presence.h

@@ -44,6 +44,8 @@ typedef int (*update_watchers_t)(str pres_uri, pres_ev_t* ev, str* rules_doc);
 typedef str* (*pres_get_presentity_t)(str pres_uri, pres_ev_t *ev, str *etag, str *contact);
 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);
 typedef void (*pres_free_presentity_t)(str *presentity, pres_ev_t *ev);
 typedef int (*pres_auth_status_t)(struct sip_msg* msg, str watcher_uri, str presentity_uri);
 typedef int (*pres_auth_status_t)(struct sip_msg* msg, str watcher_uri, str presentity_uri);
+typedef int (*pres_handle_publish_t)(struct sip_msg* msg, char *str1, char* str2);
+typedef int (*pres_handle_subscribe_t)(struct sip_msg* msg, char *str1, char *str2);
 
 
 typedef struct presence_api {
 typedef struct presence_api {
 	add_event_t add_event;
 	add_event_t add_event;
@@ -65,6 +67,8 @@ typedef struct presence_api {
 	pres_get_presentity_t get_presentity;
 	pres_get_presentity_t get_presentity;
 	pres_free_presentity_t free_presentity;
 	pres_free_presentity_t free_presentity;
 	pres_auth_status_t pres_auth_status;
 	pres_auth_status_t pres_auth_status;
+	pres_handle_publish_t handle_publish;
+	pres_handle_subscribe_t handle_subscribe;
 } presence_api_t;
 } presence_api_t;
 
 
 int bind_presence(presence_api_t* api);
 int bind_presence(presence_api_t* api);