diff --git a/docs/JavaScript.txt b/docs/JavaScript.txt index ac5a3e4085..a46eeb1327 100644 --- a/docs/JavaScript.txt +++ b/docs/JavaScript.txt @@ -39,8 +39,7 @@ function on_dtmf(digits) session.answer(); -while(session.state == "CS_EXECUTE") { - allDigits = ""; +while(session.ready()) { return_value = session.streamFile("/tmp/demo.wav", "", "on_dtmf"); if (return_value == "hangup") { session.hangup(); // or break;