diff options
Diffstat (limited to 'res/ari/resource_events.c')
-rw-r--r-- | res/ari/resource_events.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/res/ari/resource_events.c b/res/ari/resource_events.c index 597f4dfeb..ed936f732 100644 --- a/res/ari/resource_events.c +++ b/res/ari/resource_events.c @@ -27,6 +27,7 @@ #include "resource_events.h" #include "asterisk/astobj2.h" +#include "asterisk/http_websocket.h" #include "asterisk/stasis_app.h" #include "asterisk/vector.h" @@ -108,6 +109,15 @@ static void stasis_app_message_handler( msg_type, msg_application); } else { + if (stasis_app_get_debug_by_name(app_name)) { + char *str = ast_json_dump_string_format(message, ast_ari_json_format()); + + ast_verbose("<--- Sending ARI event to %s --->\n%s\n", + ast_sockaddr_stringify(ast_ari_websocket_session_get_remote_addr(session->ws_session)), + str); + ast_json_free(str); + } + /* We are ready to publish the message */ ast_ari_websocket_session_write(session->ws_session, message); } |