/*
an example of capturing dtmf is done similar to how it's done in
the file playing code if you return false you will cancel the speech.
*/
function my_dtmf_callback(type, dtmf_str, arg)
{
console_log("debug", "you dialed " + dtmf_str + "\n");
return true;
}
session.speak("cepstral", "david", 'Hello this is a test of the break tag', my_dtmf_callback);
/*
the playback works in a similar way only there are many more commands
you can return from the callback to infulence the behaviour.
There is another example here
http://www.freeswitch.org/eg/js/playfile_test_js.txt
if you put a pure numeric string for the callback arg
then it will just return the accumulated digits once it has that many
*/
input = session.speak("cepstral", "david", 'Hello this is a test of the break tag', "5");
/*
that will return the entire 5 digit string once you have dialed 5 digits.
*/