[asterisk-commits] res/res pjsip pubsub: Add additional debug statements (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 13 18:53:02 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: res/res_pjsip_pubsub: Add additional debug statements
......................................................................


res/res_pjsip_pubsub: Add additional debug statements

When something very sad and wrong occurs, it's challenging sometimes to
figure out why. This patch adds some additional debug statements on
off-nominal paths to try and make debugging easier.

Change-Id: I7bffb73cc733b6f80193a23340881db4a102b640
---
M res/res_pjsip_pubsub.c
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, approved
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve; Verified



diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 65c92c7..f0e921c 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -3030,11 +3030,14 @@
 
 	resource = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "inbound-publication", resource_name);
 	if (!resource) {
+		ast_debug(1, "No 'inbound-publication' defined for resource '%s'\n", resource_name);
 		pjsip_endpt_respond_stateless(ast_sip_get_pjsip_endpoint(), rdata, 404, NULL, NULL, NULL);
 		return NULL;
 	}
 
 	if (!ast_strlen_zero(resource->endpoint) && strcmp(resource->endpoint, ast_sorcery_object_get_id(endpoint))) {
+		ast_debug(1, "Resource %s has a defined endpoint '%s', but does not match endpoint '%s' that received the request\n",
+			resource_name, resource->endpoint, ast_sorcery_object_get_id(endpoint));
 		pjsip_endpt_respond_stateless(ast_sip_get_pjsip_endpoint(), rdata, 403, NULL, NULL, NULL);
 		return NULL;
 	}
@@ -3046,6 +3049,7 @@
 	}
 
 	if (!event_configuration_name) {
+		ast_debug(1, "Event '%s' is not configured for '%s'\n", handler->event_name, resource_name);
 		pjsip_endpt_respond_stateless(ast_sip_get_pjsip_endpoint(), rdata, 404, NULL, NULL, NULL);
 		return NULL;
 	}

-- 
To view, visit https://gerrit.asterisk.org/3110
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7bffb73cc733b6f80193a23340881db4a102b640
Gerrit-PatchSet: 4
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Scott Griepentrog <sgriepentrog at digium.com>



More information about the asterisk-commits mailing list