/*
 Compile with:
    jsc /reference:NetClientCall.dll /lib:C:\Telephony\EEs /target:library /debug HelloWorld.js 
*/

import System;
import IVRForBeginners;

public class HelloWorld extends NetClientCall
{

 public function Answer() : void
 {
  var  syn   : Synthesizer;
  var  temp : String;

  playMessage("helloworld");
  waitIfPlaying();

  syn = getSynthesizer();

  syn.speak("Please press a key on your telephone's key pad.");
  inputWait(1, '#', 10000);

  temp = "You pressed ";

  if (  inputAvailable() > 0 )
   temp = temp + getChar();

  else
   temp = temp + "nothing";

  syn.speak(temp);

  syn.speak("That was easy, wasn't it?");
  syn.wait();
 }

}