<?xml version="1.0" encoding="utf-8"?>
<!--
//  Copyright (C) 2006 Microsoft Corporation.  All rights reserved.
//  The xml file that describes the finite state machine.
-->
<FiniteStateMachine>
	<FsmModule>

		<PlayOnPhone id="5100" firstActivityId="5101">

			<!-- Get the play on phone type (greeting/voicemail) -->
			<Menu id="5101" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
				<!-- Get the type of play on phone call -->
				<Transition event="noKey" refId="5110" action="getPlayOnPhoneType"/>
				<!-- Play the selected voice message -->
				<Transition event="playOnPhoneVoicemail" refId="802" action="null"/>
				<!-- Play the oof greeting -->
				<Transition event="playOnPhoneGreeting" refId="602" action="null"/>
			</Menu>

			<!--- PlayOnPhoneVoicemail: Play the selected voicemail message in OWA/Outlook =======================-->
			<MessagePlayer id = "802" firstActivityId="100">
				<Menu id = "100" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
					<Transition event="noKey" action="firstMessagePart" heavyaction="true" refId="101"/>
					<Transition event="endOfSection" action="null" refId="103"/>
					<Transition event="xsoError" action="null" refId="104"/>
				</Menu>
				<PlayBackMenu id="101" minDtmfSize="0" maxDtmfSize="2" dtmfInputValue="option" interDigitTimeout="2" stopPromptOnBargeIn="false">
					<Prompt condition="playMixedContentIntro" type="statement" name="tuiMixedAudioTextContent"/>
					<Prompt condition="playAudioContentIntro" type="statement" name="tuiPlayingAudioSection"/>
					<Prompt condition="playTextContentIntro" type="statement" name="tuiPlayingTextSection"/>
					<Prompt condition="wavePart" type="tempwave" name="messagePart" prosodyRate="user"/>
					<Prompt condition="textPart" type="email" name="messagePart" prosodyRate="user"/>
					<!-- Rewind	   --><Transition event="1"  action="rewind"  refId="101" playbackAction="true"/>
					<!-- Pause	   --><Transition event="2"  action="pause" refId="PauseMessageStatement"/>
					<!-- FForward  --><Transition event="3"  action="fastForward" refId="101" playbackAction="true"/>
					<!-- Slower	   --><Transition event="4"  action="slowDown" refId="101"/>
					<!-- Faster	   --><Transition event="6"  action="speedUp" refId="101" playbackAction="true"/>
					<!-- Beginning --><Transition event="11" action="firstMessagePart" heavyaction="true" refId="101"/>
					<!-- End	     --><Transition event="33" action="null" refId="103"/>
					<!-- Commands  --><Transition event="0"  action="null" refId="106"/>
					<Transition event="noKey" action="nextMessagePart" heavyaction="true" refId="101"/>
					<Transition event="anyKey" action="null" refId="101" playbackAction="true"/>
					<Transition event="endOfSection" condition ="IsNull(ocFeature)" action="null" refId="103"/>
					<Transition event="endOfSection" condition ="NOT IsNull(ocFeature)" action="disconnect" refId="101"/>
					<Transition event="xsoError" action="null" refId="104"/>
				</PlayBackMenu>
				<Menu id="103" minDtmfSize="1" maxDtmfSize="1" dtmfInputValue="option">
					<Prompt type="statement" name="tuiPoPMessageMenu"/>
					<!-- Replay   --><Transition event="1" action="firstMessagePart" heavyaction="true" refId="101"/>
					<!-- Commands --><Transition event="2" action="null" refId="105"/>
					<!-- LogOn	--><Transition event="3" action="null" refId="out-5110"/>
					<!-- Exit	 --><Transition event="*" action="disconnect" refId="101"/>
					<Transition event="xsoError" action="null" refId="104"/>
				</Menu>
				<Menu id="104" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
					<Prompt type="statement" name="tuiMessagePlaybackMenuError"/>
					<Transition event="noKey" condition ="IsNull(ocFeature)" action="null" refId="103"/>
					<Transition event="noKey" condition ="NOT IsNull(ocFeature)" action="disconnect" refId="104"/>
				</Menu>
				<Menu id="105" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
					<Prompt type="statement" name="tuiPopMessageDuringCommandsHeader"/>
					<Transition event="noKey" action="null" refId="106"/>
				</Menu>
				<Menu id="106" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
					<Prompt type="statement" name="tuiPopMessageDuringCommands"/>
					<Transition event="noKey" action="firstMessagePart" heavyaction="true" refId="101"/>
					<Transition event="xsoError" action="null" refId="104"/>
				</Menu>

				<!-- Paused State -->	
				<Menu id="PauseMessageStatement" minDtmfSize="0" maxDtmfSize="1" dtmfInputValue="option">
					<Prompt condition="NOT (lastActivity EQ @PauseContinueStatement)" type="statement" name="tuiPauseInitialStatement"/>
					<Prompt type="silence" name="10s"/>
					<Transition event="anyKey" action="null" refId="101"/>
					<Transition event="noKey" action="null" refId="PauseContinueStatement"/>
				</Menu>
				<Menu id="PauseContinueStatement" minDtmfSize="0" maxDtmfSize="1" dtmfInputValue="option">
					<Prompt type="statement" name="tuiPauseContinueVmailStatement"/>
					<Prompt type="silence" name="5s"/>
					<Transition event="noKey" action="null" refId="PauseDisconnectStatement"/>
					<Transition event="#" action="more" refId="PauseMessageStatement"/>
					<Transition event="anyKey" action="null" refId="101"/>
				</Menu>
				<Menu id="PauseDisconnectStatement" dtmfInputValue="option">
					<Prompt type="statement" name="tuiPauseDisconnectStatement"/>
					<Transition event="noKey" action="disconnect" refId="PauseDisconnectStatement"/>
				</Menu>

				<!-- Statments about increase/decrease of speed on header -->
				<Menu id="SpeedMaximumStatement" dtmfInputValue="option">
					<Prompt type="statement" name="tuiPlaybackSpeedMaximum"/>
					<Transition event="noKey" action="resetPlayback" refId="101"/>
				</Menu>
				<Menu id="SpeedMinimumStatement" dtmfInputValue="option">
					<Prompt type="statement" name="tuiPlaybackSpeedMinimum"/>
					<Transition event="noKey" action="resetPlayback" refId="101"/>
				</Menu>
			</MessagePlayer>

			<!--- PlayOnPhoneGreeting: Play the selected greeting message in OWA/Outlook =======================-->
			<Menu id="602" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
				<Transition event="noKey" condition="greetingType EQ NormalCustom" action="null"  refId="609" />
				<Transition event="noKey" condition="greetingType EQ OofCustom" action="null"  refId="709" />
			</Menu>

			<!-- PlayOnPhone Greeting Main Menu -->
			<Menu id = "603" minDtmfSize = "1" maxDtmfSize = "1" dtmfInputValue = "option">
				<Prompt type = "statement" name = "tuiPopGreetingMainMenu"/>
				<!-- Normal --><Transition event = "1" action = "getExternal" heavyaction="true" refId = "609"/>
				<!-- Oof	  --><Transition event = "2" action = "getOof" heavyaction="true" refId = "709"/>
				<!-- LogOn  --><Transition event = "3" action = "null" refId="5110"/>
				<!-- Exit	  --><Transition event = "*" action = "disconnect" refId="603"/>
				<Transition event = "noKey" action = "null" refId = "603"/>
			</Menu>

			<!-- NormalCustom Greeting -->
			<Menu id="609" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
				<Transition event="noKey" condition="IsNull(greeting)" action="null"  refId="611" />
				<Transition event="noKey" condition="NOT IsNull(greeting)" action="null"  refId="610" />
			</Menu>
			<Menu id = "610" minDtmfSize = "0" maxDtmfSize = "1" dtmfInputValue = "option">
				<Prompt type = "statement" name = "tuiPersonalGreetingCurrent">
					<Prompt type = "tempwave" name = "greeting"/>
				</Prompt>
				<Transition event = "1" action="null" refId="612"/>
				<Transition event = "*" action="null" refId="603"/>
				<Transition event = "noKey" action = "null" refId = "614"/>
			</Menu>
			<Menu id="611" minDtmfSize="1" maxDtmfSize="1" dtmfInputValue="option">
				<Prompt type="statement" name="tuiPopNoNormalGreeting"/>
				<Transition event = "1" action="null" refId="612"/>
				<Transition event = "*" action="null" refId="603"/>
			</Menu>
			<Menu id="612" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
				<Transition event="noKey" action="null" refId="613"/>
				<Prompt type="statement" name="tuiRecordGreetingCue"/>
			</Menu>
			<Record id = "613" dtmfStopTones="#"  type="greeting">
				<Transition event = "anyKey" action = "null" refId = "615" />
				<Transition event = "silence" action = "null" refId = "615" />
				<Transition event = "timeout" action = "null" refId = "616" />
			</Record>
			<Menu id="614" minDtmfSize="1" maxDtmfSize="1" dtmfInputValue="option">
				<Prompt condition = "IsNull(greeting)" type="statement" name="tuiAfterGreetingNoGreeting"/>
				<Prompt condition = "NOT IsNull(greeting)" type="statement" name="tuiAfterGreeting"/>

				<Transition event="1" action="saveExternal" heavyaction="true" refId="650"/>
				<Transition event="2" action="clearRecording" refId="612"/>
				<Transition event="3" condition = "NOT IsNull(greeting)" action="deleteExternal" heavyaction="true" refId="651"/>
				<Transition event="*" action="null" refId="603"/>
				<Transition event="0" action="null" refId="614"/>
			</Menu>
			<Menu id="615" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
				<Prompt condition = "NOT IsNull(recording)" type = "tempwave" name = "recording"/>
				<Transition event="noKey" action="null" refId="614"/>
			</Menu>
			<Menu id = "616" minDtmfSize = "0" maxDtmfSize = "0" dtmfInputValue = "option">
				<Prompt type="statement" name="tuiGreetingRecordingTooLong"/>
				<Transition event = "noKey" action = "null" refId = "615"/>
			</Menu>

			<!-- OofCustom Greeting -->
			<Menu id="709" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
				<Transition event="noKey" condition="IsNull(greeting)" action="null"  refId="711" />
				<Transition event="noKey" condition="NOT IsNull(greeting)" action="null"  refId="710" />
			</Menu>
			<Menu id = "710" minDtmfSize = "0" maxDtmfSize = "1" dtmfInputValue = "option">
				<Prompt type = "statement" name = "tuiOofGreetingCurrent">
					<Prompt type = "tempwave" name = "greeting"/>
				</Prompt>
				<Transition event = "1" action="null" refId="712"/>
				<Transition event = "*" action="null" refId="603"/>
				<Transition event = "noKey" action = "null" refId = "714"/>
			</Menu>
			<Menu id="711" minDtmfSize="1" maxDtmfSize="1" dtmfInputValue="option">
				<Prompt type="statement" name="tuiPopNoOofGreeting"/>
				<Transition event = "1" action="null" refId="712"/>
				<Transition event = "*" action="null" refId="603"/>
			</Menu>
			<Menu id="712" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
				<Transition event="noKey" action="null" refId="713"/>
				<Prompt type="statement" name="tuiRecordGreetingCue"/>
			</Menu>
			<Record id = "713" dtmfStopTones="#"  type="greeting">
				<Transition event = "anyKey" action = "null" refId = "715" />
				<Transition event = "silence" action = "null" refId = "715" />
				<Transition event = "timeout" action = "null" refId = "716" />
			</Record>
			<Menu id="714" minDtmfSize="1" maxDtmfSize="1" dtmfInputValue="option">
				<Prompt condition = "IsNull(greeting)" type="statement" name="tuiAfterGreetingNoGreeting"/>
				<Prompt condition = "NOT IsNull(greeting)" type="statement" name="tuiAfterGreeting"/>

				<Transition event="1" action="saveOof" heavyaction="true" refId="650"/>
				<Transition event="2" action="clearRecording" refId="712"/>
				<Transition event="3" condition = "NOT IsNull(greeting)" action="deleteOof" heavyaction="true" refId="651"/>
				<Transition event="*" action="null" refId="603"/>
				<Transition event="0" action="null" refId="714"/>
			</Menu>
			<Menu id="715" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
				<Prompt condition = "NOT IsNull(recording)" type = "tempwave" name = "recording"/>
				<Transition event="noKey" action="null" refId="714"/>
			</Menu>
			<Menu id = "716" minDtmfSize = "0" maxDtmfSize = "0" dtmfInputValue = "option">
				<Prompt type="statement" name="tuiGreetingRecordingTooLong"/>
				<Transition event = "noKey" action = "null" refId = "715"/>
			</Menu>


			<!-- Recording Accepted -->
			<Menu id="650" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
				<Transition event="noKey" action="null" refId="603"/>
				<Prompt type="statement" name="tuiRecordingAccepted"/>
			</Menu>

			<!-- Recording Deleted -->
			<Menu id="651" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
				<Transition event="noKey" action="null" refId="603"/>
				<Prompt type="statement" name="tuiRecordingDeleted"/>
			</Menu>
			

			<!-- Helper state to exit to the main menu -->
			<Menu id="5110" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
				<Transition event="noKey" action="resetCallType" refId="out-101"/>
			</Menu>
		</PlayOnPhone>
	</FsmModule>
</FiniteStateMachine>

