2008-01-12 14:25:35 -05:00
|
|
|
function onPlayFile(s, type, obj, arg)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
if (type == "dtmf") {
|
|
|
|
console_log("info", "DTMF digit: " + s.name + " [" + obj.digit + "] len [" + obj.duration + "]\n\n");
|
2008-04-02 03:33:50 -04:00
|
|
|
session.execute("phrase", "spell," + obj.digit);
|
2008-01-12 14:25:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
console_log("err", e + "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
session.answer();
|
|
|
|
|
|
|
|
while(session.ready()) {
|
|
|
|
session.streamFile(argv[0], onPlayFile);
|
|
|
|
}
|