Commit 051778a1cd43211d72e9dfa48d657ab8f34e98c7
1 parent
13f6323037
Exists in
master
config.do_not_forward_rc68_direct_response_rc68
Showing 1 changed file with 7 additions and 1 deletions Side-by-side Diff
index.js
... | ... | @@ -57,8 +57,9 @@ function onIncomingMessage(params) { |
57 | 57 | if (params.do_not_forward_to_core) return; |
58 | 58 | if (params.is_outgoing) return; |
59 | 59 | |
60 | + let data; | |
60 | 61 | try { |
61 | - var data = JSON.parse(body); | |
62 | + data = JSON.parse(body); | |
62 | 63 | } |
63 | 64 | catch(e) { |
64 | 65 | if (DEBUG_ON_NON_JSON_DIRECT_RESPONSE) { |
... | ... | @@ -74,7 +75,12 @@ function onIncomingMessage(params) { |
74 | 75 | } |
75 | 76 | |
76 | 77 | //logger.verbose('DEBUG', {msg: data.message, err: data.error}); |
78 | + if (!data) return; | |
77 | 79 | const responseMessage = data.message || data.error; |
80 | + if ( | |
81 | + data && data.rc === '68' | |
82 | + && config && config.do_not_forward_direct_response_rc68 | |
83 | + ) return; | |
78 | 84 | sendToPartner(params.partner, responseMessage); |
79 | 85 | }) |
80 | 86 | } |