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

Matt Jordan asteriskteam at digium.com
Wed Jun 29 16:02:00 CDT 2016


Matt Jordan has uploaded a new change for review.

  https://gerrit.asterisk.org/3110

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, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/10/3110/1

diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 65c92c7..6c9db3b 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -3030,11 +3030,13 @@
 
 	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, "No endpoint defined for resource '%s'\n", resource_name);
 		pjsip_endpt_respond_stateless(ast_sip_get_pjsip_endpoint(), rdata, 403, NULL, NULL, NULL);
 		return NULL;
 	}
@@ -3046,6 +3048,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: newchange
Gerrit-Change-Id: I7bffb73cc733b6f80193a23340881db4a102b640
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list