If you place the script in the "[FS root dir]/scripts" you may access them by their basename without any path information; if you place them elsewhere you must include the full path to the script eg:
If located in [FS root dir]/scripts
Full path example:
Let's create a new application called HelloWorld.js and place it in the correct directory.
That wasn't so hard, was it? The first line specifies which Human language we are using. We can switch language anytime during the session thanks to this variable.
The second variable specifies the root directory for the sound files.
We have created our own method called playFile which is used to play the correct language prompt. It also allows us not to care about where the sound files are located, which gives us the advantage of D.R.Y. (don't repeat yourself).
Session.answer() is the most important function in this script, since it answers the telephone call.