[sr-dev] git:master: presence_xml: basic framework for handling xcap-diff event

Daniel-Constantin Mierla miconda at gmail.com
Wed Sep 4 09:58:11 CEST 2013


Module: sip-router
Branch: master
Commit: 0c15125767f8a9001e9c892fee18df3dbad56d2f
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0c15125767f8a9001e9c892fee18df3dbad56d2f

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue Sep  3 23:15:55 2013 +0200

presence_xml: basic framework for handling xcap-diff event

= can be diabled via modparam disable_xcapdiff

---

 modules/presence_xml/add_events.c   |   20 ++++++++++++++++++++
 modules/presence_xml/presence_xml.c |    2 ++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/modules/presence_xml/add_events.c b/modules/presence_xml/add_events.c
index f2c8547..dc3ab61 100644
--- a/modules/presence_xml/add_events.c
+++ b/modules/presence_xml/add_events.c
@@ -44,6 +44,7 @@
 extern int disable_presence;
 extern int disable_winfo;
 extern int disable_bla;
+extern int disable_xcapdiff;
 
 static str pu_415_rpl  = str_init("Unsupported media type");
 
@@ -119,6 +120,25 @@ int xml_add_events(void)
 		LM_DBG("added 'dialog;sla' event to presence module\n");
 	}
 	
+	if (!disable_xcapdiff) {
+		/* constructing xcap-diff event */
+		memset(&event, 0, sizeof(pres_ev_t));
+		event.name.s= "xcap-diff";
+		event.name.len= 9;
+
+		event.content_type.s= "application/xcap-diff+xml";
+		event.content_type.len= 25;
+
+		event.type= PUBL_TYPE;
+		event.default_expires= 3600;
+		if(pres_add_event(&event)< 0)
+		{
+			LM_ERR("while adding event xcap-diff\n");
+			return -1;
+		}
+		LM_DBG("added 'xcap-diff' event to presence module\n");
+	}
+
 	return 0;
 }
 /*
diff --git a/modules/presence_xml/presence_xml.c b/modules/presence_xml/presence_xml.c
index 45fcbd5..3ffff5c 100644
--- a/modules/presence_xml/presence_xml.c
+++ b/modules/presence_xml/presence_xml.c
@@ -94,6 +94,7 @@ int disable_presence = 0;
 int disable_winfo    = 0;
 int disable_bla      = 1;
 int passive_mode     = 0;
+int disable_xcapdiff = 0;
 str xcapauth_userdel_reason = str_init("probation");
 
 /** SL API structure */
@@ -126,6 +127,7 @@ static param_export_t params[]={
 	{ "disable_presence",	INT_PARAM, &disable_presence },
 	{ "disable_winfo",		INT_PARAM, &disable_winfo },
 	{ "disable_bla",		INT_PARAM, &disable_bla },
+	{ "disable_xcapdiff",	INT_PARAM, &disable_xcapdiff },
 	{ "passive_mode",		INT_PARAM, &passive_mode },
 	{ "xcapauth_userdel_reason", STR_PARAM, &xcapauth_userdel_reason.s},
 	{ 0, 0, 0}




More information about the sr-dev mailing list