
initial state START;

transition "sess start" START - sessionStart / {
	  playPrompt(hello);
	  setTimer(1, 5);
	  setTimer(2, 20);
	  recordFile(/tmp/test_rec.wav);
} -> sess_started;

state sess_started;
state ADDKEY;
state FIN;

transition "start pin entry" sess_started - / { set($pin = ""); } -> ADDKEY;

transition "play from timer" ADDKEY - timerTest(#id == 1) /  {
	   playPrompt(hello); 
	   stopRecord();
	   flushPlaylist();
	   playFile("/tmp/test_rec.wav");
	   } -> ADDKEY;

transition "add a key" ADDKEY - keyTest(#key < 10) / 
	   { 
	     append($pin, #key);
	     playPrompt(#key);
	   } -> ADDKEY;

transition "timeout stop it" ADDKEY - timerTest(#id == 2) / stop(true) -> FIN;

transition finished ADDKEY - keyTest(#key > 9) / playPrompt(entering) -> FIN;
