[sr-dev] git:4.2:25ec4076: presence: do aux_body_processing() if exists after get_p_notify_body()

Luis Azedo luis at 2600hz.com
Wed Jan 28 18:40:59 CET 2015


Module: kamailio
Branch: 4.2
Commit: 25ec407671a88d6a993239958642dff114ca70d8
URL: https://github.com/kamailio/kamailio/commit/25ec407671a88d6a993239958642dff114ca70d8

Author: lazedo <luis.azedo at factorlusitano.com>
Committer: Luis Azedo <luis at 2600hz.com>
Date: 2015-01-28T17:40:26Z

presence: do aux_body_processing() if exists after get_p_notify_body()

- fix for send_notify_request()

(cherry picked from commit cfef15ef1ca52abf4d6df129a5768baa0aaf5a07)

---

Modified: modules/presence/notify.c

---

Diff:  https://github.com/kamailio/kamailio/commit/25ec407671a88d6a993239958642dff114ca70d8.diff
Patch: https://github.com/kamailio/kamailio/commit/25ec407671a88d6a993239958642dff114ca70d8.patch

---

diff --git a/modules/presence/notify.c b/modules/presence/notify.c
index 24c0a9d..1511587 100644
--- a/modules/presence/notify.c
+++ b/modules/presence/notify.c
@@ -1526,21 +1526,30 @@ int send_notify_request(subs_t* subs, subs_t * watcher_subs,
 				{
 					LM_DBG("Could not get the notify_body\n");
 				}
-				else		/* apply authorization rules if exists */
-				if(subs->event->req_auth)
+				else
 				{
-					if(subs->auth_rules_doc && subs->event->apply_auth_nbody
-							&& subs->event->apply_auth_nbody(notify_body,
-								subs,&final_body)<0)
+					/* call aux_body_processing if exists */
+					if(subs->event->aux_body_processing)
 					{
-						LM_ERR("in function apply_auth\n");
-						goto error;
+						subs->event->aux_body_processing(subs, notify_body);
 					}
-					if(final_body)
+
+					/* apply authorization rules if exists */
+					if(subs->event->req_auth)
 					{
-						xmlFree(notify_body->s);
-						pkg_free(notify_body);
-						notify_body= final_body;
+						if(subs->auth_rules_doc && subs->event->apply_auth_nbody
+								&& subs->event->apply_auth_nbody(notify_body,
+									subs,&final_body)<0)
+						{
+							LM_ERR("in function apply_auth\n");
+							goto error;
+						}
+						if(final_body)
+						{
+							xmlFree(notify_body->s);
+							pkg_free(notify_body);
+							notify_body= final_body;
+						}
 					}
 				}
 			}




More information about the sr-dev mailing list