Commit bf525c786b326d1130383353b2a1f5a8419e3639
1 parent
b9fc487108
Exists in
master
jika response ussd error or waiting time up, resp ussd is null
Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff
index.js
... | ... | @@ -154,9 +154,12 @@ function sendUSSD (req, res, next){ |
154 | 154 | console.log(countDown+" second for reqid "+reqid); |
155 | 155 | countDown--; |
156 | 156 | if (respUssd || countDown < 2){ |
157 | + var new_respUssd = null; | |
157 | 158 | //console.log("response USSD; "+respUssd); |
158 | - var new_respUssd = respUssd.replace(/^[^ ]+\+CUSD:/, '\+CUSD:'); | |
159 | + if (respUssd){ | |
160 | + new_respUssd = respUssd.replace(/^[^ ]+\+CUSD:/, '\+CUSD:'); | |
159 | 161 | console.log('n_resp '+new_respUssd); |
162 | + } | |
160 | 163 | count--; |
161 | 164 | res.json({ |
162 | 165 | "response_ussd": new_respUssd, |