[removed presence_xcapdiff module and the patch (both are commited to opensips trunk and 1.4 branch) Denis Bilenko **20080902095913] { hunk ./openser/presence_xcapdiff/Makefile 1 -# WARNING: do not run this directly, it should be run by the master Makefile - -include ../../Makefile.defs -auto_gen= -NAME=presence_xcapdiff.so -LIBS= - -DEFS+=-I$(LOCALBASE)/include -LIBS+=-L$(SYSBASE)/include/lib -L$(LOCALBASE)/lib - -include ../../Makefile.modules rmfile ./openser/presence_xcapdiff/Makefile hunk ./openser/presence_xcapdiff/README 1 -Presence_XCAPDiff Module - -Denis Bilenko - - - -Edited by - -Denis Bilenko - - - - Copyright © 2008 AG Projects - Revision History - Revision $Revision$ $Date$ - __________________________________________________________ - - Table of Contents - - 1. Admin Guide - - 1.1. Overview - 1.2. Dependencies - - 1.2.1. OpenSIPS Modules - 1.2.2. External Libraries or Applications - - 1.3. Exported parameters - - 1.3.1. enable_presence (int) - 1.3.2. enable_pua (int) - - List of Examples - - 1.1. Disabling presence - 1.2. Disabling pua - -Chapter 1. Admin Guide - -1.1. Overview - - Presence_XCAPDiff is an OpenSIPS module that adds support for - "xcap-diff" event to presence and pua. At the moment, the - module just registers the event but doesn't do any - event-specific processing. Registering event with pua allows - XCAP server to publish xcap-event when modification of a - document happens. Registering event with presence allow clients - to subscribe for the event. The module is intended to be used - with OpenXCAP (www.openxcap.org) server, although it doesn't - contain any OpenXCAP-specific code and potentially could be - used with any XCAP server. - -1.2. Dependencies - -1.2.1. OpenSIPS Modules - - The following modules must be loaded before this module: - * presence module - if enable_presence is non-zero (see below - the description of enable_presence). - * pua module - if enable_pua is non-zero (see below the - description of enable_pua). - * pua_mi module - if enable_pua is non-zero and you intent to - use this module with OpenXCAP. - -1.2.2. External Libraries or Applications - - The following libraries or applications must be installed - before running OpenSIPS with this module loaded: - * None. - -1.3. Exported parameters - -1.3.1. enable_presence (int) - - Boolean flag that specifies if "xcap-diff" event should be - registered with presence. - - Default value is "1". - - Example 1.1. Disabling presence -... -modparam("presence_xcapdiff", "enable_presence", 0) -... - -1.3.2. enable_pua (int) - - Boolean flag that specifies if "xcap-diff" event should be - registered with pua. - - Default value is "1". - - Example 1.2. Disabling pua -... -modparam("presence_xcapdiff", "enable_pua", 0) -... rmfile ./openser/presence_xcapdiff/README hunk ./openser/presence_xcapdiff/doc/presence_xcapdiff.xml 1 - - - - - - -%docentities; - -]> - - - - Presence_XCAPDiff Module - - - Denis - Bilenko - denis@ag-projects.com - - - Denis - Bilenko - denis@ag-projects.com - - - - 2008 - AG Projects - - - - $Revision$ - $Date$ - - - - - - &admin; - &faq; - - rmfile ./openser/presence_xcapdiff/doc/presence_xcapdiff.xml hunk ./openser/presence_xcapdiff/doc/presence_xcapdiff_admin.xml 1 - - - - - &adminguide; - -
- Overview - - Presence_XCAPDiff is an &osips; module that adds support for - "xcap-diff" event to presence and pua. At the moment, the module - just registers the event but doesn't do any event-specific processing. - - Registering event with pua allows XCAP server to publish xcap-event - when modification of a document happens. - Registering event with presence allow clients to subscribe for the event. - - The module is intended to be used with OpenXCAP (www.openxcap.org) server, - although it doesn't contain any OpenXCAP-specific code and potentially could - be used with any XCAP server. - -
- -
- Dependencies -
- &osips; Modules - - The following modules must be loaded before this module: - - - - presence module - if enable_presence is non-zero - (see below the description of enable_presence). - - - - - pua module - if enable_pua is non-zero - (see below the description of enable_pua). - - - - - pua_mi module - if enable_pua is non-zero and - you intent to use this module with OpenXCAP. - - - - -
- -
- External Libraries or Applications - - The following libraries or applications must be installed before - running &osips; with this module loaded: - - - - None. - - - - -
-
- -
- Exported parameters -
- <varname>enable_presence</varname> (int) - - Boolean flag that specifies if "xcap-diff" event should be registered with presence. - - - - - Default value is 1. - - - - - Disabling presence - -... -modparam("presence_xcapdiff", "enable_presence", 0) -... - - -
- -
- <varname>enable_pua</varname> (int) - - Boolean flag that specifies if "xcap-diff" event should be registered with pua. - - - - - Default value is 1. - - - - - Disabling pua - -... -modparam("presence_xcapdiff", "enable_pua", 0) -... - - -
- - -
- -
- rmfile ./openser/presence_xcapdiff/doc/presence_xcapdiff_admin.xml rmdir ./openser/presence_xcapdiff/doc hunk ./openser/presence_xcapdiff/presence_xcapdiff.c 1 -#include "../presence/bind_presence.h" -#include "../pua/pua_bind.h" - -MODULE_VERSION - -str s_event_name = str_init("xcap-diff"); -str s_content_type = str_init("application/xcap-diff+xml"); - -static int mod_init(void); -static int child_init(int); -static void destroy(void); - -static cmd_export_t cmds[] = -{ - {0, 0, 0, 0, 0, 0} -}; - -int enable_presence = 1; -int enable_pua = 1; - -static param_export_t params[] = { - { "enable_presence", INT_PARAM, &enable_presence }, - { "enable_pua", INT_PARAM, &enable_pua }, - {0, 0, 0} -}; - -struct module_exports exports= { - "presence_xcapdiff", /* module name */ - DEFAULT_DLFLAGS, /* dlopen flags */ - cmds, /* exported functions */ - params, /* exported parameters */ - 0, /* exported statistics */ - 0, /* exported MI functions */ - 0, /* exported pseudo-variables */ - 0, /* extra processes */ - mod_init, /* module initialization function */ - (response_function) 0, /* response handling function */ - destroy, /* destroy function */ - child_init /* per-child init function */ //perhaps should be NULL? -}; - -int xcapdiff_process_body(publ_info_t* publ, str** fin_body, int ver, str** tuple) -{ - *fin_body= publ->body; - return 0; -} - -static int mod_init(void) -{ - LM_INFO("initializing...\n"); - - if (enable_presence) - { - bind_presence_t bind_presence; - presence_api_t pres; - - bind_presence= (bind_presence_t)find_export("bind_presence", 1,0); - if (!bind_presence) { - LM_ERR("find_export(\"bind_presence\") failed\n"); - return -1; - } - - if (bind_presence(&pres) < 0) { - LM_ERR("bind_presence failed\n"); - return -1; - } - - pres_ev_t event; - - memset(&event, 0, sizeof(pres_ev_t)); - event.name = s_event_name; - event.content_type = s_content_type; - event.default_expires= 3600; - event.type = PUBL_TYPE; - event.req_auth = 0; - - if (pres.add_event(&event) < 0) { - LM_ERR("pres.add_event(\"xcap-diff\")\n"); - return -1; - } - } - - if (enable_pua) - { - bind_pua_t bind_pua = (bind_pua_t)find_export("bind_pua", 1,0); - if (!bind_pua) - { - LM_ERR("find_export(\"bind_pua\", 1,0) failed\n"); - return -1; - } - - pua_api_t pua; - if (bind_pua(&pua) < 0) - { - LM_ERR("bind_pua() failed\n"); - return -1; - } - - if(pua.add_event(XCAPDIFF_EVENT, s_event_name.s, s_content_type.s, xcapdiff_process_body)< 0) - { - LM_ERR("pua.add_event(XCAPDIFF_EVENT) failed\n"); - return -1; - } - } - - return 0; -} - -static int child_init(int rank) -{ - LM_DBG("[%d] pid [%d]\n", rank, getpid()); - - return 0; -} - -static void destroy(void) -{ - LM_DBG("destroying module ...\n"); - - return; -} rmfile ./openser/presence_xcapdiff/presence_xcapdiff.c rmdir ./openser/presence_xcapdiff hunk ./openser/pua_hash_h_patch.diff 1 -Index: modules/pua/hash.h -=================================================================== ---- modules/pua/hash.h (revision 4523) -+++ modules/pua/hash.h (working copy) -@@ -39,6 +39,7 @@ - #define BLA_EVENT 1<<2 - #define MSGSUM_EVENT 1<<3 - #define CONFERENCE_EVENT 1<<4 -+#define XCAPDIFF_EVENT 1<<5 - - #define UL_PUBLISH 1<<0 - #define BLA_PUBLISH 1<<1 -@@ -136,6 +137,10 @@ - if (strncmp(event->s, "presence", 8) == 0) - return PRESENCE_EVENT; - break; -+ case 9: -+ if (strncmp(event->s, "xcap-diff", 9) == 0) -+ return XCAPDIFF_EVENT; -+ break; - case 10: - if (strncmp(event->s, "dialog;sla", 10) == 0) - return BLA_EVENT; rmfile ./openser/pua_hash_h_patch.diff }