diff options
author | David M. Lee <dlee@digium.com> | 2013-07-16 21:44:12 +0000 |
---|---|---|
committer | David M. Lee <dlee@digium.com> | 2013-07-16 21:44:12 +0000 |
commit | e1b75afdb824d1c817e8a3c2a28c215d17ffc6a0 (patch) | |
tree | 27e26b9ccf932bf66233a81eaa8c75b0f794e876 /res | |
parent | 3f9be54d911c0fe49bb827f644ebf60e62ada0eb (diff) |
Debug logging to help with WebSocket connection problems
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/stasis_http/ari_websockets.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/res/stasis_http/ari_websockets.c b/res/stasis_http/ari_websockets.c index 2808e54e7..c67ace5ff 100644 --- a/res/stasis_http/ari_websockets.c +++ b/res/stasis_http/ari_websockets.c @@ -99,6 +99,8 @@ struct ast_json *ari_websocket_session_read( ast_websocket_fd(session->ws_session), -1); if (res <= 0) { + ast_log(LOG_WARNING, "WebSocket poll error: %s\n", + strerror(errno)); return NULL; } @@ -106,14 +108,21 @@ struct ast_json *ari_websocket_session_read( &payload_len, &opcode, &fragmented); if (res != 0) { + ast_log(LOG_WARNING, "WebSocket read error: %s\n", + strerror(errno)); return NULL; } switch (opcode) { case AST_WEBSOCKET_OPCODE_CLOSE: + ast_debug(1, "WebSocket closed by peer\n"); return NULL; case AST_WEBSOCKET_OPCODE_TEXT: message = ast_json_load_buf(payload, payload_len, NULL); + if (message == NULL) { + ast_log(LOG_WARNING, + "WebSocket input failed to parse\n"); + } break; default: /* Ignore all other message types */ |