]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res/res_pjsip_pubsub: Add additional debug statements 10/3110/4
authorMatt Jordan <mjordan@digium.com>
Mon, 19 Oct 2015 23:55:58 +0000 (18:55 -0500)
committerMatt Jordan <mjordan@digium.com>
Wed, 6 Jul 2016 12:22:47 +0000 (07:22 -0500)
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

res/res_pjsip_pubsub.c

index 65c92c72f89c12bfbd43fb0ed8c41a7a372c94f0..f0e921cb89f18dafbc33fdcf8804fadcb1f69ef0 100644 (file)
@@ -3030,11 +3030,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;
        }
@@ -3046,6 +3049,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;
        }