import(mod_conference)

initial state START;

state lobby;

transition "start to lobby" START - sessionStart / { 
	   playFile(wav/default_en.wav); 
} -> lobby;

state room;

transition "lobby to room" lobby - noAudioTest /  {
   conference.setPlayoutType(adaptive)
   conference.join(myroom) 
} -> room;


transition "key 1 pressed" room - keyPress(1); test($is_spkonly == "") / {
 set($is_spkonly=1);  
 flushPlaylist(false);
 conference.join(myroom, speakonly); 
} -> room;

transition "key 1 pressed" room - keyPress(1); test($is_spkonly == "1") / {
 set($is_spkonly=""); 
 flushPlaylist(false); 
 conference.join(myroom); 
} -> room;

transition "key 2 pressed" room - keyPress(2); test($is_listenonly == "") / {
 set($is_listenonly=1);
 flushPlaylist(false);  
 conference.join(myroom, listenonly); 
} -> room;

transition "key 2 pressed" room - keyPress(2); test($is_listenonly == "1") / {
 set($is_listenonly="");  
 flushPlaylist(false);
 conference.join(myroom); 
} -> room;

transition "x event" room - eventTest(#action==kick) / stop(true) -> end;

transition "bye recvd" (lobby, room) - hangup / stop(false) -> end;

state end;
