summaryrefslogtreecommitdiff
path: root/res/res_pjsip_pubsub.c
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-10-19 18:55:58 -0500
committerMatt Jordan <mjordan@digium.com>2016-07-13 09:11:46 -0500
commitc49833653bdbb10dc82ef32ae8503cd26ae3135c (patch)
tree7714ca6e814cc6d028ba159b46f01eb3ddf4286c /res/res_pjsip_pubsub.c
parent73d8cb587d6515b707c9cafe334e18fbd7c24905 (diff)
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
Diffstat (limited to 'res/res_pjsip_pubsub.c')
-rw-r--r--res/res_pjsip_pubsub.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 4e4180957..207fae04c 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -2965,11 +2965,14 @@ static struct ast_sip_publication *publish_request_initial(struct ast_sip_endpoi
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;
}
@@ -2981,6 +2984,7 @@ static struct ast_sip_publication *publish_request_initial(struct ast_sip_endpoi
}
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;
}