import(mod_conference)
import(mod_monitoring)

initial state lobby 
  enter { 
	playFile(wav/welcome.wav) 
	monitoring.log(username, @user)
	monitoring.log(position, lobby)
  };

state room;

transition "lobby to room" lobby - eventTest(#action==take) /  {   
   flushPlaylist()
   conference.setPlayoutType(adaptive)
   playFile(wav/taken.wav) 
   conference.join(#roomname)
   connectMedia()
   monitoring.log(position, #roomname)
} -> room;

transition "room change" room - eventTest(#action==take) /  {   
   flushPlaylist()
   playFile(wav/change.wav) 
   conference.join(#roomname)
   connectMedia()
   monitoring.log(position, #roomname)
} -> room;

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

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

state end;
