Index: modules/presence_xml/presence_xml.c
===================================================================
--- modules/presence_xml/presence_xml.c	(revision 8946)
+++ modules/presence_xml/presence_xml.c	(working copy)
@@ -74,6 +74,7 @@
 xcap_serv_t* xs_list= NULL;
 str pres_rules_auid = {0, 0};
 str pres_rules_filename = {0, 0};
+int generate_offline_body = 1;
 
 /* SIGNALING bind */
 struct sig_binds xml_sigb;
@@ -95,6 +96,7 @@
 	{ "xcap_server",     STR_PARAM|USE_FUNC_PARAM,(void*)pxml_add_xcap_server},
 	{ "pres_rules_auid",        STR_PARAM,                 &pres_rules_auid.s},
 	{ "pres_rules_filename",    STR_PARAM,             &pres_rules_filename.s},
+	{ "generate_offline_body",  INT_PARAM,             &generate_offline_body},
 	{  0,                       0,                                          0}
 };
 
Index: modules/presence_xml/notify_body.c
===================================================================
--- modules/presence_xml/notify_body.c	(revision 8946)
+++ modules/presence_xml/notify_body.c	(working copy)
@@ -42,6 +42,7 @@
 
 enum {
 	OFFB_STATUS_OK = 0,
+	OFFB_STATUS_DISABLED,
 	OFFB_STATUS_NO_DIALOG,
 	OFFB_STATUS_ERROR,
 };
@@ -120,6 +121,11 @@
 	char *err_msg;
 	int rc = OFFB_STATUS_ERROR;
 
+        if (!generate_offline_body) {
+	    rc = OFFB_STATUS_DISABLED;
+	    goto done;
+        }
+
 	doc= xmlParseMemory(body->s, body->len);
 	if(doc==  NULL)
 	{
@@ -437,7 +443,7 @@
 	{
 		body= body_array[off_index];
 		status = offline_body_fct(body, &n_body);
-		if (status != OFFB_STATUS_OK && status != OFFB_STATUS_NO_DIALOG)
+		if (status != OFFB_STATUS_OK && status != OFFB_STATUS_DISABLED && status != OFFB_STATUS_NO_DIALOG)
 		{
 			LM_ERR("constructing offline body failed\n"); 
 			return NULL;
@@ -448,7 +454,7 @@
 	LM_DBG("[user]=%.*s  [domain]= %.*s\n",
 			pres_user->len, pres_user->s, pres_domain->len, pres_domain->s);
 	n_body= agregate_xmls(pres_user, pres_domain, body_array, n, root_name, elem_name);
-	if(n_body== NULL && n!= 0)
+	if(n_body== NULL && n!= 0 && generate_offline_body != 0)
 	{
 		LM_ERR("while aggregating body\n");
 	}
Index: modules/presence_xml/presence_xml.h
===================================================================
--- modules/presence_xml/presence_xml.h	(revision 8946)
+++ modules/presence_xml/presence_xml.h	(working copy)
@@ -56,5 +56,6 @@
 extern struct sig_binds xml_sigb;
 extern str pres_rules_auid;
 extern str pres_rules_filename;
+extern int generate_offline_body;
 
 #endif
Index: modules/presence/notify.c
===================================================================
--- modules/presence/notify.c	(revision 8946)
+++ modules/presence/notify.c	(working copy)
@@ -1260,7 +1260,6 @@
 		notify_body = event->agg_nbody(&uri.user, &uri.host, body_array, body_cnt, build_off_n);
 		if(notify_body == NULL)
 		{
-			LM_ERR("Failed to aggregate notify body\n");
 			goto error;
 		}
 	}
