<?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>
		<RetrieveVoicemailManager id="ASRVmail" firstActivityId="VmailEntryState">

			<!-- Uncaught quota exception -->
			<Transition event="quotaExceeded" action="null" refId="QuotaExceededError"/>
			<Transition event="xsoError" action="null" refId="ErrorMenuQA"/>
	

			<!-- Entry point for ASR vmail  -->
			<Menu id="VmailEntryState" dtmfInputValue="option">
				<Prompt condition="(lastRecoEvent EQ @recoVoiceMail)" type="statement" name="vuiVmailOpeningInbox"/>
				<Transition event="noKey" action="getNewMessages" heavyaction="true" refId="PreLoadMessage"/>
				<Transition event="noNewMessages" action="getSavedMessages" heavyaction="true" refId="PreLoadMessage"/>
				<Transition event="noSavedMessages" action="null" refId="NoMessagesStatement"/>
				<Transition event="xsoError" action="null" refId="FatalErrorStatement"/>
			</Menu>

			<!-- Next vmail -->
			<Menu id="NavigateNextMessage" dtmfInputValue="option">
				<Transition event="noKey" action="getNextMessage" heavyaction="true" refId="PreLoadMessage"/>
				<Transition event="xsoError" action="null" refId="ErrorRetryNext"/>
				<Transition event="noNewMessages" action="null" refId="LastNewMessageState"/>
				<Transition event="noSavedMessages" action="null" refId="LastMessageStatement"/>
			</Menu>

			<!-- Previous vmail -->
			<Menu id="NavigatePreviousMessage" dtmfInputValue="option">
				<Transition event="noKey" action="getPreviousMessage" heavyaction="true" refId="PreLoadMessage"/>
				<Transition event="xsoError" action="null" refId="ErrorRetryPrevious"/>
				<Transition event="noPreviousNewMessages" action="null" refId="StartOfMessagesStatement"/>
				<Transition event="noPreviousSavedMessages" action="null" refId="StartOfMessagesStatement"/>
			</Menu>

			<!-- No messages -->
			<Menu id="NoMessagesStatement" dtmfInputValue="option">
				<Prompt type="statement" name="vuiNoVoiceMessages"/>
				<Prompt condition="IsNull(ocFeature)" type="statement" name="vuiCalReturningToMainMenu"/>
				<Transition event="noKey" action="null" refId="ToMainMenuQA"/>
      </Menu>

      			<!-- End of messages -->
			<Menu id="LastMessageStatement" dtmfInputValue="option">
				<Prompt type="statement" name="vuiThatWasLastMessage"/>
        			<Transition event="noKey" action="null" refId="ToMainMenuQA"/>
			</Menu>

			<!-- End of messages -->
			<Menu id="LastNewMessageState" dtmfInputValue="option">
				<Transition event="noKey" action="getSavedMessages" heavyaction="true" refId="PreLoadMessage"/>
				<Transition event="noSavedMessages" action="null" refId="LastMessageStatement"/>
				<Transition event="xsoError" action="null" heavyaction="true" refId="FatalErrorStatement"/>
			</Menu>

			<!-- Start of messages -->
			<Menu id="StartOfMessagesStatement" dtmfInputValue="option">
				<Prompt type="statement" name="vuiStartOfMessages"/>
				<Transition event="noKey" action="null" refId="AfterMessageQA"/>
			</Menu>

			<!-- Last Action Failed -->
			<Menu id="LastActionFailedStatement" dtmfInputValue="option">
				<Prompt type="statement" name="vuiLastActionFailed"/>
				<Transition event="noKey" action="null" refId="AfterMessageQA"/>
			</Menu>

			<!-- ErrorRetry -->
			<Menu id="ErrorRetryNext" dtmfInputValue="option">
				<Transition event="noKey" action="getNextMessage" heavyaction="true" refId="PreLoadMessage"/>
				<Transition event="xsoError" action="null" refId="ErrorMenuQA"/>
				<Transition event="noNewMessages" action="null" refId="LastMessageStatement"/>
				<Transition event="noSavedMessages" action="null" refId="LastMessageStatement"/>
			</Menu>
			<Menu id="ErrorRetryPrevious" dtmfInputValue="option">
				<Transition event="noKey" action="getPreviousMessage" refId="PreLoadMessage"/>
				<Transition event="xsoError" action="null" refId="ErrorMenuQA"/>
				<Transition event="noPreviousNewMessages" action="null" refId="StartOfMessagesStatement"/>
				<Transition event="noPreviousSavedMessages" action="null" refId="StartOfMessagesStatement"/>
			</Menu>

			<!-- Error Menu -->
			<SpeechMenu id="ErrorMenuQA">
				<Main>
					<Prompt condition="NOT repeat" type="statement" name="tuiItemError"/>
					<Prompt type="statement" name="vuiEmailCmdPreambleShort"/>
					<Prompt type="statement" name="vuiEmailCmdNext"/>
					<Prompt type="statement" name="vuiCalCmdOrMainMenu"/>
				</Main>

				<Grammars>
					<Grammar name="Email.grxml" type = "static" rule = "ErrorCommands"/>
				</Grammars>

				<Transitions>
					<Transition event="recoMainMenu" action="null" refId="ToMainMenuQA"/>
					<Transition event="dtmfFallback" action="null" refId="ToMainMenuDtmf"/>
					<Transition event="recoNext" action="null" refId="NavigateNextMessage"/>
				</Transitions>
			</SpeechMenu>



			<!-- FatalError -->
			<Menu id="FatalErrorStatement" dtmfInputValue="option">
				<Prompt type="statement" name="tuiVmailFatalError"/>
				<Transition event="noKey" action="null" refId="ToMainMenuQA"/>
				<Transition event="xsoError" action="disconnect" refId="FatalErrorStatement"/>
			</Menu>
			<Menu id = "QuotaExceededError" uninterruptible="true">
				<Prompt type = "statement" name = "tuiErrorQuotaExceeded"/>				
				<Transition event="noKey" action="null" refId="AfterMessageQA"/>
			</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="ReadVmailHeaderQA"/>
				<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="anyKey" action="null" refId="ReadVmailHeaderQA"/>
				<Transition event="#" action="more" refId="PauseMessageStatement"/>
			</Menu>
			<Menu id="PauseDisconnectStatement" dtmfInputValue="option">
				<Prompt type="statement" name="tuiPauseDisconnectStatement"/>
				<Transition event="noKey" action="disconnect" refId="PauseDisconnectStatement"/>
			</Menu>


			<!-- Initialize playback of this message before reading the header, so we are ready to go
				as soon as the header menu ends -->
			<MessagePartManager id = "PreLoadMessage" firstActivityId="InitializePlayBack">
				<Menu id = "InitializePlayBack" dtmfInputValue="option">
					<Transition event="noKey" action="firstMessagePart" heavyaction="true" refId="out-ReadVmailHeaderQA"/>
					<Transition event="endOfSection" action="null" refId="out-ReadVmailHeaderQA"/>
					<Transition event="xsoError" action="null" refId="out-ReadVmailHeaderQA"/>
				</Menu>
			</MessagePartManager>

			<!-- Statments about increase/decrease of speed on header -->
			<Menu id="SpeedIncreasedStatement" dtmfInputValue="option">
					<Prompt type="statement" name="tuiPlaybackSpeedIncreasedOnHeader"/>
					<Transition event="noKey" action="resetPlayback" refId="MessageBodyPlayer"/>
				</Menu>
			<Menu id="SpeedDecreasedStatement" dtmfInputValue="option">
				<Prompt type="statement" name="tuiPlaybackSpeedDecreasedOnHeader"/>
				<Prompt type="statement" name="vuiRepeating"/>
				<Transition event="noKey" action="resetPlayback" refId="ReadVmailHeaderQA"/>
			</Menu>
			<Menu id="SpeedMaximumStatement" dtmfInputValue="option">
				<Prompt type="statement" name="tuiPlaybackSpeedMaximum"/>
				<Transition event="noKey" action="resetPlayback" refId="MessageBodyPlayer"/>
			</Menu>
			<Menu id="SpeedMinimumStatement" dtmfInputValue="option">
				<Prompt type="statement" name="tuiPlaybackSpeedMinimum"/>
				<Prompt type="statement" name="vuiRepeating"/>
				<Transition event="noKey" action="resetPlayback" refId="ReadVmailHeaderQA"/>
			</Menu>

			<!-- Read the vmail header -->
			<SpeechMenu id="ReadVmailHeaderQA" inputTimeout="0" interDigitTimeout="0" minDtmfSize="0" maxDtmfSize="2" dtmfInputValue="option">

				<!-- The vmail header  -->
				<PromptGroup name="HeaderGroup">
					<Prompt condition="NOT playedUndelete AND (lastRecoEvent EQ @recoDelete)" type="statement" name="vuiUndeleteInstruction" limitKey="vuiUndeleteHint"/>
					<!-- [Position] -->
					<Condition value="NOT repeat AND (lastRecoEvent NE @recoPlay) AND (lastRecoEvent NE @recoReadTheHeader)">
						<Prompt condition="firstMessage AND NOT read" type="statement" name="tuiFirstNewVoiceMessage"/>
						<Prompt condition="firstMessage AND read" type="statement" name="tuiFirstSavedVoiceMessage"/>
						<Prompt condition="NOT firstMessage AND lastRecoEvent EQ @recoPrevious" type="statement" name="tuiVmailPrevious"/>
						<Prompt condition="NOT (lastRecoEvent EQ @recoPrevious) AND NOT firstMessage" type="statement" name="tuiVmailNext"/>
					</Condition>
					<FsmImport href="AsrVoicemail.fsm" module="VmailHeaderPrompts"/>
					<Prompt type="silence" name="1000ms"/>
				</PromptGroup>

				<Main>
					<Prompt type="group" name="HeaderGroup"/>
				</Main>

				<Mumble1>
					<Prompt condition="NOT repeat" type="statement" name="vuiRepeating"/>
					<Prompt type="group" name="HeaderGroup"/>
				</Mumble1>

				<Grammars>
					<Grammar name="Email.grxml" type = "static" rule ="VmailCommands" />
					<Grammar name="Email.grxml" type = "static" rule ="VmailPlaybackCommands" />
					<Grammar condition="NOT IsNull(namesGrammar)" name="namesGrammar" type="dynamic" rule="ForwardByName" />
					<Grammar condition="NOT IsNull(namesGrammar)" name="namesGrammar" type="dynamic" rule="FindByName" />
				</Grammars>

				<Transitions>
					<Transition event="recoMainMenu" action="null" refId="ToMainMenuQA"/>
					<Transition event="dtmfFallback" action="null" refId="ToMainMenuDtmf"/>
					<Transition event="noKey" action="null" refId="MessageBodyPlayer"/>
					<Transition event="silence1" action="null" refId="MessageBodyPlayer"/>
					<Transition event="mumble2" action="null" refId="AfterMessageQA" refInfo="mumble2"/>
					<Transition event="help" action="null" refId="AfterMessageQA" refInfo="help"/>
					<Transition event="invalidCommand" action="null" refId="AfterMessageQA" refInfo="invalidCommand"/>
					<Transition event="xsoError" action="null" refId="ErrorMenuQA"/>

					<!-- Vmail Commands-->
					<FsmImport href="AsrVoicemail.fsm" module="CommandTransitions"/>
					<Transition event="recoMoreOptions" action="null" refId="AfterMessageQA"/>
					<Transition event="recoEndOfMessage" action="null" refId="EndOfMessageStatement"/>

					<!-- Vmail Playback Commands -->
					<Transition event="recoSpeedUp" action="speedUp" refId="SpeedIncreasedStatement"/>
						<Transition event="6" action="speedUp" refId="SpeedIncreasedStatement"/>
					<Transition event="recoSlowDown" action="slowDown" refId="SpeedDecreasedStatement"/>
						<Transition event="4" action="slowDown" refId="SpeedDecreasedStatement"/>
					<Transition event="recoFastForward" action="null" refId="MessageBodyPlayer"/>
						<Transition event="3" action="null" refId="MessageBodyPlayer"/>
					<Transition event="recoRewind" action="null" refId="ReadVmailHeaderQA"/>
						<Transition event="1" action="null" refId="ReadVmailHeaderQA"/>

					<!-- Navigation Commands -->
					<Transition event="11" action="RetrieveVoicemailManager:Repeat" refId="ReadVmailHeaderQA" />
					<Transition event="33" action="null" refId="EndOfMessageStatement" />

					<!-- Action auto-events -->
					<Transition event="maxProsodyRate" action="null" refId="SpeedMaximumStatement"/>
					<Transition event="minProsodyRate" action="null" refId="SpeedMinimumStatement"/>
				</Transitions>
			</SpeechMenu>

			<!-- Read the message body parts -->
			<MessagePartManager id = "MessageBodyPlayer" firstActivityId="InitializePlayBack">
				<Menu id = "InitializePlayBack" dtmfInputValue="option">
					<Transition event="noKey" action="firstMessagePart" heavyaction="true" refId="ReadMessageBodyQA"/>
					<Transition event="endOfSection" action="null" refId="EndOfMessageStatement"/>
					<Transition event="xsoError" action="null" refId="PlaybackErrorStatement"/>
				</Menu>
				<SpeechMenu id="ReadMessageBodyQA" inputTimeout="0" interDigitTimeout="0" minDtmfSize="0" maxDtmfSize="2" dtmfInputValue="option" stopPromptOnBargeIn="false">
					<Main>
						<Prompt condition="wavePart" type="tempwave" name="waveMessagePart" prosodyRate="user"/>
					</Main>

					<Grammars>
						<Grammar type="static" name="Email.grxml" rule="VmailCommands"/>
						<Grammar type="static" name="Email.grxml" rule="VmailPlaybackCommands"/>
						<Grammar condition="NOT IsNull(namesGrammar)" name="namesGrammar" type="dynamic" rule="ForwardByName" />
						<Grammar condition="NOT IsNull(namesGrammar)" name="namesGrammar" type="dynamic" rule="FindByName" />
					</Grammars>

					<Transitions>
						<Transition event="noKey" action="nextMessagePart" heavyaction="true" refId="ReadMessageBodyQA"/>
						<Transition event="anyKey" action="null" refId="ReadMessageBodyQA" playbackAction="true"/>
						<Transition event="silence1" action="nextMessagePart" heavyaction="true" refId="ReadMessageBodyQA"/>

						<Transition event="mumble1" action="null" refId="ReadMessageBodyQA" playbackAction="true"/>
						<Transition event="help" action="pause" refId="PlaybackInfoMenu" refInfo="help"/>
						<Transition event="invalidCommand" action="null" refId="out-AfterMessageQA" refInfo="invalidCommand"/>
						<Transition event="mumble2" action="null" refId="out-AfterMessageQA"/>

						<Transition event="recoMainMenu" action="null" refId="out-ToMainMenuQA"/>
						<Transition event="dtmfFallback" action="null" refId="out-ToMainMenuDtmf"/>
						<Transition event="endOfSection" action="null" refId="EndOfSectionStatement"/>
						<Transition event="xsoError" action="null" refId="PlaybackErrorStatement"/>

						<!-- Vmail Commands-->
						<FsmImport href="AsrVoicemail.fsm" module="CommandTransitions"/>
						<Transition event="recoMoreOptions" action="null" refId="AfterMessageQA"/>
						<Transition event="recoEndOfMessage" action="null" refId="EndOfMessageStatement"/>

						<!-- Vmail Playback Commands -->
						<Transition event="recoSpeedUp" action="speedUp" refId="ReadMessageBodyQA" playbackAction="false"/>
							<Transition event="6" action="speedUp" refId="ReadMessageBodyQA" playbackAction="false"/>
						<Transition event="recoSlowDown" action="slowDown" refId="ReadMessageBodyQA" playbackAction="false"/>
							<Transition event="4" action="slowDown" refId="ReadMessageBodyQA" playbackAction="false"/>
						<Transition event="recoFastForward" action="fastForward" refId="ReadMessageBodyQA" playbackAction="true"/>
							<Transition event="3" action="fastForward" refId="ReadMessageBodyQA" playbackAction="true"/>
						<Transition event="recoRewind" action="rewind" refId="ReadMessageBodyQA" playbackAction="true"/>
							<Transition event="1" action="rewind" refId="ReadMessageBodyQA" playbackAction="true"/>
	
						<!-- Navigation Commands -->
						<Transition event="11" action="RetrieveVoicemailManager:Repeat" refId="ReadVmailHeaderQA" />
						<Transition event="33" action="null" refId="EndOfMessageStatement" />
	
						<!-- Action auto-events -->
						<Transition event="maxProsodyRate" action="null" refId="SpeedMaximumStatement"/>
						<Transition event="minProsodyRate" action="null" refId="SpeedMinimumStatement"/>
					</Transitions>
				</SpeechMenu>

				<!-- Speech menu with help options, invalid command statements, mumble1 promtps -->
				<SpeechMenu id="PlaybackInfoMenu" inputTimeout="0" interDigitTimeout="0" minDtmfSize="0" maxDtmfSize="2" dtmfInputValue="option">

					<!-- Available commands -->
					<PromptGroup name="CommandGroup">
						<Prompt type="statement" name="vuiEmailCmdPreambleLong"/>
						<FsmImport href="AsrVoicemail.fsm" module="PlaybackCommandPrompts"/>
					</PromptGroup>

					<!-- No main prompts -->			
					<Main/>

					<!-- No mumble1 prompts -->			
					<Mumble1/>

					<Mumble2>
						<Prompt condition="NOT repeat" type="statement" name="vuiDefaultMumble2"/>
						<Prompt type="group" name="CommandGroup"/>
					</Mumble2>

					<Help>
						<Prompt condition="NOT repeat" type="statement" name="vuiHelpPreable"/>
						<Prompt type="group" name="CommandGroup"/>
					</Help>

					<Grammars>
						<Grammar type="static" name="Email.grxml" rule="VmailCommands"/>
						<Grammar type="static" name="Email.grxml" rule="VmailPlaybackCommands"/>
						<Grammar condition="NOT IsNull(namesGrammar)" name="namesGrammar" type="dynamic" rule="ForwardByName" />
						<Grammar condition="NOT IsNull(namesGrammar)" name="namesGrammar" type="dynamic" rule="FindByName" />
					</Grammars>

					<Transitions>
						<Transition event="noKey" action="null" refId="ReadMessageBodyQA"/>
						<Transition event="anyKey" action="null" refId="ReadMessageBodyQA"/>
						<Transition event="silence1" action="null" refId="ReadMessageBodyQA"/>
						
						<Transition event="recoMainMenu" action="null" refId="out-ToMainMenuQA"/>
						<Transition event="dtmfFallback" action="null" refId="out-ToMainMenuDtmf"/>
						<Transition event="mumble2" action="null" refId="out-AfterMessageQA"/>
						<Transition event="invalidCommand" action="null" refId="out-AfterMessageQA" refInfo="invalidCommand"/>

						<!-- Vmail Commands-->
						<FsmImport href="AsrVoicemail.fsm" module="CommandTransitions"/>
						<Transition event="recoMoreOptions" action="null" refId="AfterMessageQA"/>
						<Transition event="recoEndOfMessage" action="null" refId="EndOfMessageStatement"/>

						<!-- Vmail Playback Commands -->
						<Transition event="recoSpeedUp" action="speedUp" refId="ReadMessageBodyQA"/>
							<Transition event="6" action="speedUp" refId="ReadMessageBodyQA"/>
						<Transition event="recoSlowDown" action="slowDown" refId="ReadMessageBodyQA"/>
							<Transition event="4" action="slowDown" refId="ReadMessageBodyQA"/>
						<Transition event="recoFastForward" action="null" refId="ReadMessageBodyQA"/>
							<Transition event="3" action="null" refId="ReadMessageBodyQA"/>
						<Transition event="recoRewind" action="null" refId="ReadMessageBodyQA"/>
							<Transition event="1" action="null" refId="ReadMessageBodyQA"/>
	
						<!-- Navigation Commands -->
						<Transition event="11" action="RetrieveVoicemailManager:Repeat" refId="ReadVmailHeaderQA" />
						<Transition event="33" action="null" refId="EndOfMessageStatement" />

						<!-- Action auto-events -->
						<Transition event="maxProsodyRate" action="null" refId="SpeedMaximumStatement"/>
						<Transition event="minProsodyRate" action="null" refId="SpeedMinimumStatement"/>
					</Transitions>
				</SpeechMenu>

				<!-- 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="ReadMessageBodyQA"/>
					<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="ReadMessageBodyQA"/>
				</Menu>
				<Menu id="PauseDisconnectStatement" dtmfInputValue="option">
					<Prompt type="statement" name="tuiPauseDisconnectStatement"/>
					<Transition event="noKey" action="disconnect" refId="PauseDisconnectStatement"/>
				</Menu>

				<Menu id="EndOfSectionStatement" dtmfInputValue="option">
					<Prompt condition="isEmptyWave" type="statement" name="tuiWaveFileEmpty"/>
					<Transition event="noKey" action="nextMessageSection" refId="ReadMessageBodyQA"/>
					<Transition event="xsoError" action="null" refId="PlaybackErrorStatement"/>
					<Transition event="endOfSection" action="null" refId="EndOfMessageStatement"/>
				</Menu>
				<Menu id="PlaybackErrorStatement" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
					<Prompt type="statement" name="tuiMessagePlaybackMenuError"/>
					<Transition event="noKey" action="nextMessageSection" refId="ReadMessageBodyQA"/>
					<Transition event="xsoError" action="null" refId="out-AfterMessageQA"/>
					<Transition event="endOfSection" action="null" refId="out-AfterMessageQA"/>
				</Menu>

				<!-- Proxy States -->
				<Menu id="NavigateNextMessage" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="out-NavigateNextMessage"/>
				</Menu>
				<Menu id="NavigatePreviousMessage" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="out-NavigatePreviousMessage"/>
				</Menu>
				<Menu id="CueRecordingStatement" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="out-CueRecordingStatement"/>
				</Menu>
				<Menu id="MessageBodyPlayer" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="InitializePlayBack"/>
				</Menu>
				<Menu id="MarkedAsUnreadStatement" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="out-MarkedAsUnreadStatement"/>
				</Menu>
				<Menu id="MarkedAsReadStatement" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="out-MarkedAsReadStatement"/>
				</Menu>
				<Menu id = "MessageDeletedStatement" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="out-MessageDeletedStatement"/>
				</Menu>
				<Menu id = "DeletionUndoneStatement" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="out-DeletionUndoneStatement"/>
				</Menu>
				<Menu id = "DRMForwardNotAllowed" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="out-DRMForwardNotAllowed"/>
				</Menu>
				<Menu id="CallingSenderStatement" dtmfInputValue="option">
					<Transition event="noKey"  action="null" refId="out-CallingSenderStatement"/>
				</Menu>
				<Menu id="FindByNameState" dtmfInputValue="option">
					<Transition event="noKey"  action="null" refId="out-FindByNameState"/>
				</Menu>
				<Menu id="AfterMessageQA" dtmfInputValue="option">
					<Transition event="noKey"  action="null" refId="out-AfterMessageQA"/>
				</Menu>
				<Menu id="ContactEnabledSearch" dtmfInputValue="option">
					<Transition event="noKey"  action="null" refId="out-ContactEnabledSearch"/>
				</Menu>
				<Menu id="ToForwardMessageDtmf" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="out-ToForwardMessageDtmf"/>
				</Menu>
				<Menu id="ReadVmailHeaderQA" dtmfInputValue="option">
					<Transition event="noKey"  action="null" refId="out-ReadVmailHeaderQA"/>
				</Menu>
				<Menu id="EndOfMessageStatement" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="out-EndOfMessageStatement"/>
				</Menu>
				<Menu id="PreEnvelopeInfoStatement" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="out-PreEnvelopeInfoStatement"/>
				</Menu>
                		<Menu id="FlaggedForFollowUpStatement" dtmfInputValue="option">
                   			<Transition event="noKey" action="null" refId="out-FlaggedForFollowUpStatement"/>
               			</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="ReadMessageBodyQA"/>
				</Menu>
				<Menu id="SpeedMinimumStatement" dtmfInputValue="option">
					<Prompt type="statement" name="tuiPlaybackSpeedMinimum"/>
					<Transition event="noKey" action="resetPlayback" refId="ReadMessageBodyQA"/>
				</Menu>
			</MessagePartManager>

			<!-- After message menu -->
			<SpeechMenu id="AfterMessageQA">

				<!-- Available commands  -->
				<PromptGroup name="ShortCommandGroup">
					<Prompt type="statement" name="vuiEmailCmdPreambleShort"/>
					<FsmImport href="AsrVoicemail.fsm" module="VmailShortCommandPrompts"/>
				</PromptGroup>

				<PromptGroup name="LongCommandGroup">
					<Prompt type="statement" name="vuiEmailCmdPreambleLong"/>
					<FsmImport href="AsrVoicemail.fsm" module="VmailCommandPrompts"/>
				</PromptGroup>

				<Main>
					<Prompt condition="NOT repeat AND (lastActivity EQ @EndOfMessageStatement)" type="statement" name="tuiEndOfMessage"/>
					<Prompt condition="NOT more" type="group" name="ShortCommandGroup"/>
					<Prompt condition="more" type="group" name="LongCommandGroup"/>
				</Main>

				<!-- Use default behavior for mumble1, silence1, silence2 -->

				<Mumble2>
					<Prompt condition="NOT repeat" type="statement" name="vuiDefaultMumble1"/>
					<Prompt type="group" name="LongCommandGroup"/>
				</Mumble2>

				<InvalidCommand>
					<Prompt condition="(lastRecoEvent EQ @recoReply)" type="statement" name="tuiCannotReplyUnresolvedSender"/>
					<Prompt condition="(lastRecoEvent EQ @recoCallSender)" type="statement" name="vuiEmailCallSenderNoPhone"/>
					<Prompt condition="(lastRecoEvent EQ @recoUndelete)" type="statement" name="tuiNoUndelete"/>
					<!--Check if a user said a non supported Forward or Find command-->
					<Prompt condition="(lastRecoEvent EQ @recoFindByName) OR (lastRecoEvent EQ @recoFindByNameWithName) OR (lastRecoEvent EQ @recoFindByContact) OR (lastRecoEvent EQ @recoForward) OR (lastRecoEvent EQ @recoForwardWithName) OR (lastRecoEvent EQ @recoForwardToContact)" type="statement" name="vuiDefaultInvalidCommand"/>
					<Prompt type="statement" name="vuiEmailAfterInvalidCommand"/>
					<FsmImport href="AsrVoicemail.fsm" module="VmailShortCommandPrompts"/>
				</InvalidCommand>

				<Grammars>
					<Grammar name="Email.grxml" type = "static" rule ="VmailCommands" />
					<Grammar condition="NOT IsNull(namesGrammar)" name="namesGrammar" type="dynamic" rule="ForwardByName" />
					<Grammar condition="NOT IsNull(namesGrammar)" name="namesGrammar" type="dynamic" rule="FindByName" />
				</Grammars>

				<Transitions>
					<Transition event="recoMainMenu" action="null" refId="ToMainMenuQA"/>
					<Transition event="dtmfFallback" action="null" refId="ToMainMenuDtmf"/>

					<!-- Vmail Commands-->
					<FsmImport href="AsrVoicemail.fsm" module="CommandTransitions"/>
					<Transition event="recoMoreOptions" action="more" refId="AfterMessageQA"/>
				</Transitions>
			</SpeechMenu>

			<!-- The following entries support forwarding using DTMF menu -->
			<FsmImport href="DtmfEmail.fsm" module="ForwardMessageModule"/>
			<Menu id="ToForwardMessageDtmf">
				<Prompt type="statement" name="tuiForwardingMessage"/>
				<Transition event="noKey" action="null" refId="1400"/>
			</Menu>
			<Menu id="ForwardMessageComplete">
				<Transition event="noKey" action="null" refId="SentMessageStatement"/>
			</Menu>
			<Menu id="ForwardMessageCancelled">
				<Transition event="noKey" action="null" refId="CancelMessageStatement"/>
			</Menu>

			<!-- Used by find by name and forward to -->
			<AsrContactsManager id="ContactEnabledSearch" firstActivityId="BeginContactEnabledSearch">
				<Menu id="BeginContactEnabledSearch" dtmfInputValue="option">
					<Transition event="noKey" action="saveRecoEvent" refId="InitializeSearchTarget"/>
				</Menu>
				<Menu id="InitializeSearchTarget" dtmfInputValue="option">
					<Transition condition="GlobalActivityManager:ContactsAccessEnabled AND ((lastRecoEvent EQ @recoForwardToContact) OR (lastRecoEvent EQ @recoFindByContact))" event="noKey" action="setInitialSearchTargetContacts" refId="InitPersonalContacts"/>

					<!-- If recoFindByName, recoFindByNameWithName,recoForward,recoForwardWithName-->
					<Transition condition="(NOT GlobalActivityManager:DirectoryAccessEnabled) AND GlobalActivityManager:ContactsAccessEnabled AND ((lastRecoEvent NE @recoForwardToContact) OR (lastRecoEvent NE @recoFindByContact))" event="noKey" action="setInitialSearchTargetContacts" refId="InitPersonalContacts"/>

					<!--If directory access is enabled we give it preference over contact-->
					<Transition condition="GlobalActivityManager:DirectoryAccessEnabled AND ((lastRecoEvent NE @recoForwardToContact) OR (lastRecoEvent NE @recoFindByContact))" event="noKey" action="setInitialSearchTargetGAL" refId="InitializeGrammars"/>

				</Menu>
				<Menu id="InitializeGrammars" dtmfInputValue="option">
					<Transition event="noKey" action="initializeNamesGrammar" heavyaction="true" refId="SearchEntryState"/>
					<Transition event="noGrammarFile" action="null" refId="NoGrammarFile" />
				</Menu>
				<Menu id="NoGrammarFile" dtmfInputValue="option">
					<Prompt condition="(initialSearchTarget EQ @PersonalContacts)" type="statement" name="vuiNoNames" />
					<Prompt condition="(initialSearchTarget EQ @PersonalContacts)" type="statement" name="tuiVmailContinue" />
					<Transition condition="(initialSearchTarget EQ @PersonalContacts)" event="noKey" action="null" refId="out-AfterMessageQA"/>				
					<Transition condition="(initialSearchTarget EQ @GlobalAddressList)" event="noKey" action="setInitialSearchTargetContacts" refId="InitializeGrammars"/>				
				</Menu>
				<Menu id="NoPersonalContacts" dtmfInputValue="option">
					<Prompt type="statement" name="vuiNoContacts" />
					<Prompt type="statement" name="tuiVmailContinue" />
					<Transition event="noKey" action="null" refId="out-AfterMessageQA"/>
				</Menu>
				<Menu id="SearchEntryState" dtmfInputValue="option">
					<Transition event="noKey" condition="(lastRecoEvent EQ @recoForward)" action="null" refId="AsrSearch" refInfo="forward"/>
					<Transition event="noKey" condition="(lastRecoEvent EQ @recoForwardWithName)" action="null" refId="AsrSearch" refInfo="forwardWithName"/>
					<Transition event="noKey" condition="(lastRecoEvent EQ @recoFindByName)" action="null" refId="AsrSearch" refInfo="findByName"/>
					<Transition event="noKey" condition="(lastRecoEvent EQ @recoFindByNameWithName)" action="null" refId="AsrSearch" refInfo="findByNameWithName"/>
				</Menu>
				<Menu id="ReturnToMainMenu" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="out-ToMainMenuQA"/>
				</Menu>
				<Menu id="DtmfFallback" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="out-ToMainMenuDtmf"/>
				</Menu>
				<Menu id="ErrorFallback" dtmfInputValue="option">
					<Prompt type="statement" name="tuiVmailContinue"/>
					<Transition event="noKey" action="null" refId="out-AfterMessageQA"/>
				</Menu>
				<Menu id="RecipientNotFound" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
					<Prompt type="statement" name="vuiContactsDirectoryContactNotFound"/>
					<Transition event="noKey" action="null" refId="out-AfterMessageQA"/>
				</Menu>
				<Menu id="OperatorFallback" dtmfInputValue="option">
					<Transition event="noKey" action="disconnect" refId="OperatorFallback"/>
				</Menu>
				<Menu id="TransferToOperator" dtmfInputValue="option">
					<Transition event="noKey" action="disconnect" refId="TransferToOperator"/>
				</Menu>
				<Menu id="GotoPersonalContacts" dtmfInputValue="option">
					<Transition event="noKey" action="null" refId="InitPersonalContacts"/>
				</Menu>
				<Menu id="InitPersonalContacts" dtmfInputValue="option">
					<Transition condition="(savedRecoEvent EQ @recoForward) OR (savedRecoEvent EQ @recoForwardWithName) OR (savedRecoEvent EQ @recoForwardToContact)" event="noKey" action="initializeNamesGrammar" heavyaction="true" refId="AsrSearch" refInfo="forward"/>
					<Transition condition="(savedRecoEvent NE @recoForward) AND (savedRecoEvent NE @recoForwardWithName) AND (savedRecoEvent NE @recoForwardToContact)" event="noKey" action="initializeNamesGrammar" heavyaction="true" refId="AsrSearch" refInfo="findByName"/>
					<Transition event="noGrammarFile" action="null" refId="NoPersonalContacts" />
				</Menu>
				<Menu id="ProcessResult" dtmfInputValue="option">
					<Prompt condition="(savedRecoEvent EQ @recoForward) AND (initialSearchTarget NE @PersonalContacts)" type="statement" name="vuiEmailForwardHint"/>
					<Prompt condition="(savedRecoEvent EQ @recoFindByName)  AND (initialSearchTarget NE @PersonalContacts)" type="statement" name="vuiEmailFindHint"/>
					<Transition condition="(savedRecoEvent EQ @recoForward) OR (savedRecoEvent EQ @recoForwardWithName) OR (savedRecoEvent EQ @recoForwardToContact)" event="noKey" action="processResult" refId="out-ProcessForwardResult"/>
					<Transition condition="(savedRecoEvent NE @recoForward) AND (savedRecoEvent NE @recoForwardWithName) AND (savedRecoEvent NE @recoForwardToContact)" event="noKey" action="processResult" refId="out-FindByNameState"/>
				</Menu>
				<FsmImport href = "AsrSearch.fsm" module="asrSearch"/>
			</AsrContactsManager>
			
			<!-- Process the search result for a forwarded message -->
			<Menu id="ProcessForwardResult" dtmfInputValue="option">
				<Transition event="noKey" action="addRecipientBySearch" refId="CueRecordingStatement"/>
				<Transition event="unknownRecipient" action="null" refId="UnknownEmailAddress"/>
			</Menu>
			<Menu id="UnknownEmailAddress" dtmfInputValue="option">
				<Prompt type="statement" name="vuiEmailForwardBadAddress"/>
				<Transition event="noKey" action="null" refId="AfterMessageQA"/>
			</Menu>

			<!-- Message Action Statements -->
			<Menu id = "MarkedAsUnreadStatement" dtmfInputValue="option">
				<Prompt type="statement" name="tuiMessageMarkedNew"/>
				<Transition event="noKey" action="null" refId="NavigateNextMessage"/>
			</Menu>
			<Menu id = "MarkedAsReadStatement" dtmfInputValue="option">
				<Prompt type="statement" name="tuiMessageSaved"/>
				<Transition event="noKey" action="null" refId="NavigateNextMessage"/>
			</Menu>
			<Menu id = "MessageDeletedStatement" dtmfInputValue="option">
				<Prompt type="statement" name="vuiMessageDeleted"/>
				<Transition event="noKey" action="null" refId="NavigateNextMessage"/>
			</Menu>			
			<Menu id = "DeletionUndoneStatement" dtmfInputValue="option">
				<Prompt type="statement" name="vuiMessageDeleteUndone"/>
				<Transition event="noKey" action="null" refId="AfterMessageQA"/>
			</Menu>
			<Menu id = "DRMForwardNotAllowed" dtmfInputValue="option">
				<Prompt type="statement" name="tuiDRMDoesntAllowForward"/>
				<Transition event="noKey" action="null" refId="AfterMessageQA"/>
			</Menu>
            <!-- Flagged for follow-up -->
            <Menu id = "FlaggedForFollowUpStatement" dtmfInputValue="option">
                <Prompt type="statement" name="tuiMessageFlagged"/>
                <Transition event="noKey" action="null" refId="NavigateNextMessage"/>
            </Menu>

            <!-- Find by Name -->
			<Menu id = "FindByNameState" dtmfInputValue="option">
				<Transition event="noKey" action="findByName" heavyaction="true" refId="FindByNameResultsStatement"/>
			</Menu>			
			<Menu id = "FindByNameResultsStatement" dtmfInputValue="option">
				<Prompt type="multiStatement" name="vuiEmailFindByNameResult">
					<Prompt type="cardinal" name="numMessagesFromName" suffix="singularPlural"/>
					<Prompt type="name" name="findByName"/>
				</Prompt>
				<Transition event="noKey" condition="numMessagesFromName LT 1" action="null" refId="AfterMessageQA"/>
				<Transition event="noKey" condition="numMessagesFromName GT 0" action="null" refId="NavigateNextMessage"/>
			</Menu>			

			<!-- Call Sender States -->
			<Menu id="CallingSenderStatement" dtmfInputValue="option">
				<Prompt type="statement" name="vuilCallingSender"/>
				<Transition event="noKey"  action="null" refId="CallTransferState"/>
			</Menu>

			<CallTransfer id="CallTransferState" type="blindTransferToPhone" numberType="variable" number="targetPhoneNumber">
				<Transition event="transferFailed" action="null" refId="TransferFailedStatement"/>
			</CallTransfer>

			<Menu id="TransferFailedStatement" dtmfInputValue="option">
				<Prompt type="statement" name="vuiCallSenderFailed"/>
				<Prompt type="statement" name="tuiVmailContinue"/>				
				<Transition event="noKey"  action="null" refId="AfterMessageQA"/>
			</Menu>

			<!-- End of message -->
			<Menu id="EndOfMessageStatement" dtmfInputValue="option">
				<Transition event="noKey" action="saveVoiceMail" heavyaction="true" refId="AfterMessageQA"/>
			</Menu>

			<!-- State entered just before recording a message -->
			<Menu id="CueRecordingStatement" dtmfInputValue="option">
				<Condition value="(lastRecoEvent EQ @recoRestart)">
					<Prompt type="statement" name="vuiOk"/>
					<Prompt condition="forwardIntro" type="statement" name="vuiEmailForwardCue"/>
					<Prompt condition="replyIntro OR replyAllIntro" type="statement" name="vuiEmailReplyCue"/>
					<Prompt condition="declineIntro" type="statement" name="vuiStartRecordingCue"/>
				</Condition>
				<Condition value="NOT (lastRecoEvent EQ @recoRestart)">
					<Prompt condition="lastRecoEvent EQ @recoReply OR lastActivity EQ @AskDeclineRecordedMessageQA" type="statement" name="vuiSure"/>
					<Prompt condition="replyIntro" type="statement" name="vuiEmailReplyCue"/>
					<Prompt condition="forwardIntro" type="statement" name="vuiEmailForwardCue"/>
				</Condition>
				<Prompt type="statement" name="vuiFinishRecordingInstructions"/>
				<Transition event="noKey" action="null" refId="RecordMessageState"/>
			</Menu>

			<!-- continue message state -->
			<Menu id="ContinueMessageStatement" dtmfInputValue="option">
				<Prompt type="statement" name="vuiContinueRecordingCue"/>
				<Prompt type="statement" name="vuiFinishRecordingInstructions"/>
				<Transition event="noKey" action="null" refId="RecordMessageState"/>
			</Menu>

			<!-- Recording related states -->
			<Record id="RecordMessageState" dtmfStopTones="#*1234567890" type="message">
				<Transition event = "anyKey" action = "null" refId = "RecordedMessageSelectionQA" />
				<Transition event = "silence" condition="NOT IsNull(recording)" action = "null" refId = "RecordedMessageSelectionQA" />
				<Transition event = "silence" condition="IsNull(recording)" action = "null" refId = "RecordSilenceStatement" />
				<Transition event = "timeout" action = "null" refId = "RecordedMessageSelectionQA" />
				<Transition event = "recordFailure" action = "clearRecording" refId = "RecordFailureStatement" />
				<Transition event = "userHangup" action = "sendMessage" heavyaction="false" refId = "DisconnectState" />
			</Record>
			<Menu id="RecordSilenceStatement" dtmfInputValue="option">
				<Prompt condition="recordingFailureCount LT 2" type="statement" name="vuiRecordFailure1"/>
				<Prompt condition="recordingFailureCount GT 1" type="statement" name="vuiRecordFailure2"/>
				<Prompt condition="recordingFailureCount GT 1" type="statement" name="vuiFinishRecordingInstructions"/>
				<Transition event="noKey" action="null" refId="RecordMessageState"/>
			</Menu>
			<Menu id="RecordFailureStatement" dtmfInputValue="option">
				<Prompt type="statement" name="vuiDefaultSpeechError"/>
				<Transition event="noKey" action="null" heavyaction="true" refId="ToMainMenuQA"/>
			</Menu>
			<Menu id="DisconnectState" dtmfInputValue="option">
				<Transition event="noKey" action="disconnect" refId="DisconnectState"/>
			</Menu>
			
			<!-- State entered after recording -->
			<SpeechMenu id="RecordedMessageSelectionQA">
				<Main>
					<Condition value="recordingTimedOut">
						<Prompt type="statement" name="vuiRecordingSelectionTimeOut"/>
					</Condition>
					<Condition value="NOT recordingTimedOut">
						<Prompt condition="lastRecoEvent NE @recoPlayItBack" type="statement" name="vuiRecordingSelection"/>
						<Prompt condition="NOT repeat AND (lastRecoEvent EQ @recoPlayItBack)" type="statement" name="vuiOk"/>
						<Prompt condition="lastRecoEvent EQ @recoPlayItBack" type="statement" name="vuiRecordingSelectionAfterPlayback">
							<Prompt type="tempwave" name="recording"/>
						</Prompt>
					</Condition>
				</Main>

				<Mumble1>
					<Prompt type="statement" name="vuiPleaseRepeatThat"/>
				</Mumble1>

				<Mumble2>
					<Prompt condition="NOT repeat" type="statement" name="vuiDefaultMumble2"/>
					<Prompt type="statement" name="vuiRecordedMessageSelectionHelp"/>
				</Mumble2>

				<Silence1>
					<Prompt condition="NOT repeat" type="statement" name="vuiDefaultSilence1"/>
					<Prompt type="statement" name="vuiRecordedMessageSelectionHelpShort"/>
				</Silence1>

				<Silence2>
					<Prompt condition="NOT repeat" type="statement" name="vuiDefaultSilence2"/>
					<Prompt type="statement" name="vuiRecordedMessageSelectionHelp"/>
				</Silence2>

				<Help>
					<Prompt condition="NOT repeat" type="statement" name="vuiHelpPreable"/>
					<Prompt type="statement" name="vuiRecordedMessageSelectionHelp"/>
				</Help>

				<Grammars>
					<Grammar name="Common.grxml" type = "static" rule = "RecordedMessageSelection"/>
				</Grammars>

				<Transitions>
					<Transition event="recoMainMenu" action="null" heavyaction="true" refId="ToMainMenuQA"/>
					<Transition event="dtmfFallback" action="null" heavyaction="true" refId="ToMainMenuDtmf"/>
					<Transition event="xsoError" action="null" refId="LastActionFailedStatement"/>
					<Transition event="recoPlayItBack" action="null" refId="RecordedMessageSelectionQA"/>
					<Transition event="recoCancel" action="clearRecording" refId="CancelMessageStatement"/>
					<Transition event="recoSend" action="sendMessage" heavyaction="true" refId="SentMessageStatement"/>
					<Transition event="recoSendUrgent" action="sendMessageUrgent" heavyaction="true" refId="SentMessageStatement"/>
					<Transition condition="DrmIsEnabled" event="recoSendPrivate" action="SendMessagePrivate" heavyaction="true" refId="SentMessageStatement"/>
					<Transition condition="NOT DrmIsEnabled" event="recoSendPrivate" action="null" refId="DRMNotEnabled"/>
					<Transition condition="DrmIsEnabled" event="recoSendPrivateAndUrgent" action="SendMessagePrivateAndUrgent" heavyaction="true" refId="SentMessageStatement"/>
					<Transition condition="NOT DrmIsEnabled" event="recoSendPrivateAndUrgent" action="ToggleImportance" refId="DRMNotEnabled"/>
					<Transition event="recoRestart" action="clearRecording" heavyaction="true" refId="CueRecordingStatement"/>
					<Transition event="recoContinue" action="appendRecording" heavyaction="false" refId="ContinueMessageStatement"/>
					<Transition event ="userHangup" action = "sendMessage" heavyaction="false" refId = "DisconnectState" />
				</Transitions>
			</SpeechMenu>

			<!-- States entered after canceling or sending a message -->
			<Menu id="CancelMessageStatement" dtmfInputValue="option">
				<Prompt type="statement" name="vuiMessageCancelled"/>
				<Transition event="noKey" action="null" refId="AfterMessageQA"/>
			</Menu>

			<Menu id="SentMessageStatement" dtmfInputValue="option">
				<Prompt type = "statement" name = "tuiMessageSent" />
				<Transition event = "noKey" action = "null" refId = "AfterMessageQA" />
			</Menu>

			<Menu id="DRMNotEnabled" dtmfInputValue="option">
				<Prompt type = "statement" name = "tuiDRMNotEnabled" />
				<Transition event = "noKey" action = "sendMessage" heavyaction="true" refId = "SentMessageStatement" />
			</Menu>

			<!-- Envelope Info -->
			<Menu id="PreEnvelopeInfoStatement" dtmfInputValue="option">
				<Transition event="noKey" action="getEnvelopInfo" refId="EnvelopeInfoStatement"/>
			</Menu>
			<Menu id="EnvelopeInfoStatement" dtmfInputValue="option">
				<Prompt type="statement" name="tuiVoiceMessageEnvelope" condition="NOT IsNull(senderInfo)">
					<Prompt type="time" name="messageReceivedTime"/>
					<Prompt type="text" name="senderInfo"/>
				</Prompt>
				<Prompt type="statement" name="tuiMessageReceived" condition="IsNull(senderInfo)">
					<Prompt type="time" name="messageReceivedTime"/>
				</Prompt>
				<Condition value = "isProtected">
					<Prompt condition="isHighPriority" type="statement" name="tuiSentProtectedAndImportant"/>
					<Prompt condition="NOT isHighPriority" type="statement" name="tuiSentProtected"/>
				</Condition>
				<Condition value = "NOT isProtected">
					<Prompt condition="isHighPriority" type="statement" name="tuiSentImportant"/>
				</Condition>
				<Prompt type="multiStatement" name="tuiVoiceMessageDuration">
					<Prompt type="cardinal" name="durationMinutes" suffix="singularPlural"/>
					<Prompt type="cardinal" name="durationSeconds" suffix="singularPlural"/>
				</Prompt>
				<Transition event="noKey" action="null" refId="AfterMessageQA"/>
			</Menu>

			<!-- Miscellaneus navigation states out to the main menu -->
			<Menu id="ToMainMenuQA" dtmfInputValue="option">
				<Transition event="noKey" condition="IsNull(ocFeature)" action="null" refId="out-MainMenuQA"/>
				<Transition event="noKey" condition="NOT IsNull(ocFeature)" action="disconnect" refId="ToMainMenuQA"/>
			</Menu>
			<Menu id="ToMainMenuDtmf" dtmfInputValue="option">
				<Transition event="noKey" condition="IsNull(ocFeature)" action="null" refId="out-106"/>
				<Transition event="noKey" condition="NOT IsNull(ocFeature)" action="disconnect" refId="ToMainMenuDtmf"/>
			</Menu>
		</RetrieveVoicemailManager>
	</FsmModule>

	<FsmModule id="VmailHeaderPrompts">
		<Condition value="IsNull(emailSender)">
			<Condition value="isReply">
				<Condition value = "protected">
					<Prompt condition="urgent" type="statement" name="tuiVmailReplyProtectedAndImportantUnknown"/>
					<Prompt condition="NOT urgent" type="statement" name="tuiVmailReplyProtectedUnknown"/>
				</Condition>
				<Condition value = "NOT protected">
					<Prompt condition="NOT urgent" type="statement" name="tuiVmailReplyUnknown"/>
					<Prompt condition="urgent" type="statement" name="tuiVmailReplyImportantUnknown"/>
				</Condition>
			</Condition>
			<Condition value="isForward">
				<Condition value = "protected">
					<Prompt condition="urgent" type="statement" name="tuiVmailForwardProtectedAndImportantUnknown"/>
					<Prompt condition="NOT urgent" type="statement" name="tuiVmailForwardProtectedUnknown"/>
				</Condition>
				<Condition value = "NOT protected">
					<Prompt condition="NOT urgent" type="statement" name="tuiVmailForwardUnknown"/>
					<Prompt condition="urgent" type="statement" name="tuiVmailForwardImportantUnknown"/>
				</Condition>
			</Condition>
			<Condition value="NOT isReply AND NOT isForward">
				<Condition value = "protected">
					<Prompt condition="urgent" type="statement" name="tuiVmailImportantAndProtectedUnknown"/>
					<Prompt condition="NOT urgent" type="statement" name="tuiVmailProtectedUnknown"/>
				</Condition>
				<Condition value = "NOT protected">
					<Prompt condition="urgent" type="statement" name="tuiVmailImportantUnknown"/>
				</Condition>
			</Condition>
		</Condition>
		<Condition value="NOT IsNull(emailSender)">
			<Condition value="isReply">
				<Condition value = "protected">
					<Prompt condition="NOT urgent" type="statement" name="tuiVmailReplyProtected">
						<Prompt name="emailSender" type="name"/>
					</Prompt>
					<Prompt condition="urgent" type="statement" name="tuiVmailReplyProtectedAndImportant">
						<Prompt name="emailSender" type="name"/>
					</Prompt>
				</Condition>
				<Condition value = "NOT protected">
					<Prompt condition="urgent" type="statement" name="tuiVmailReplyImportant">
						<Prompt name="emailSender" type="name"/>
					</Prompt>
					<Prompt condition="NOT urgent" type="statement" name="tuiVmailReply">
						<Prompt name="emailSender" type="name"/>
					</Prompt>
				</Condition>
			</Condition>
			<Condition value="isForward">
				<Condition value = "protected">
					<Prompt condition="NOT urgent" type="statement" name="tuiVmailForwardProtected">
						<Prompt name="emailSender" type="name"/>
					</Prompt>
					<Prompt condition="urgent" type="statement" name="tuiVmailForwardProtectedAndImportant">
						<Prompt name="emailSender" type="name"/>
					</Prompt>
				</Condition>
				<Condition value = "NOT protected">
					<Prompt condition="urgent" type="statement" name="tuiVmailForwardImportant">
						<Prompt name="emailSender" type="name"/>
					</Prompt>
					<Prompt condition="NOT urgent" type="statement" name="tuiVmailForward">
						<Prompt name="emailSender" type="name"/>
					</Prompt>
				</Condition>
			</Condition>
			<Condition value="NOT isReply AND NOT isForward">
				<Condition value = "protected">
					<Prompt condition="urgent" type="statement" name="tuiVmailProtectedAndImportant">
						<Prompt name="emailSender" type="name"/>
					</Prompt>
					<Prompt condition="NOT urgent" type="statement" name="tuiVmailProtected">
						<Prompt name="emailSender" type="name"/>
					</Prompt>
				</Condition>
				<Condition value = "NOT protected">
					<Prompt condition="urgent" type="statement" name="tuiVmailImportant">
						<Prompt name="emailSender" type="name"/>
					</Prompt>
					<Prompt condition="NOT urgent" type="statement" name="tuiVmailMessage">
						<Prompt name="emailSender" type="name"/>
					</Prompt>
				</Condition>
			</Condition>
		</Condition>
		
		<!-- [Message Position] -->
		<Prompt condition="receivedOffset LT 0 OR receivedOffset GT 7" type="statement" name="tuiEmailArrivedDate">
			<Prompt type="date" name="messageReceivedTime"/>
			<Prompt type="simpleTime" name="messageReceivedTime"/>
		</Prompt>
		<Prompt condition="receivedOffset EQ 0" type="statement" name="tuiEmailArrivedToday"><Prompt type="simpleTime" name="messageReceivedTime"/></Prompt>
		<Prompt condition="receivedOffset EQ 1" type="statement" name="tuiEmailArrivedYesterday"><Prompt type="simpleTime" name="messageReceivedTime"/></Prompt>
		<Condition value="receivedOffset GT 1 AND receivedOffset LT 8">
			<Prompt condition="receivedDayOfWeek EQ 0" type="statement" name="tuiEmailArrivedSunday"><Prompt type="simpleTime" name="messageReceivedTime"/></Prompt>
			<Prompt condition="receivedDayOfWeek EQ 1" type="statement" name="tuiEmailArrivedMonday"><Prompt type="simpleTime" name="messageReceivedTime"/></Prompt>
			<Prompt condition="receivedDayOfWeek EQ 2" type="statement" name="tuiEmailArrivedTuesday"><Prompt type="simpleTime" name="messageReceivedTime"/></Prompt>
			<Prompt condition="receivedDayOfWeek EQ 3" type="statement" name="tuiEmailArrivedWednesday"><Prompt type="simpleTime" name="messageReceivedTime"/></Prompt>
			<Prompt condition="receivedDayOfWeek EQ 4" type="statement" name="tuiEmailArrivedThursday"><Prompt type="simpleTime" name="messageReceivedTime"/></Prompt>
			<Prompt condition="receivedDayOfWeek EQ 5" type="statement" name="tuiEmailArrivedFriday"><Prompt type="simpleTime" name="messageReceivedTime"/></Prompt>
			<Prompt condition="receivedDayOfWeek EQ 6" type="statement" name="tuiEmailArrivedSaturday"><Prompt type="simpleTime" name="messageReceivedTime"/></Prompt>
		</Condition>
	</FsmModule>

	<FsmModule id="VmailShortCommandPrompts">
		<Prompt type="statement" name="vuiBodyCmdPlay"/>
		<Prompt type="statement" name="vuiEmailCmdNext"/>
		<Prompt type="statement" name="vuiEmailCmdDelete"/>
		<Prompt condition="NOT IsNull(targetPhoneNumber)" type="statement" name="vuiEmailCmdCallSender"/>
		<Prompt condition="knowVoicemailSender" type="statement" name="vuiEmailCmdReply"/>
		<Prompt type="statement" name="vuiGlobalMainMenu"/>
		<Prompt type="statement" name="vuiCalCmdOrMoreOptions"/>
	</FsmModule>

	<FsmModule id="VmailCommandPrompts">
		<Prompt type="statement" name="vuiEmailCmdPrevious"/>
		<Prompt type="statement" name="vuiEmailCmdReadHeader"/>
		<Prompt type="statement" condition="(NOT protected) AND RetrieveVoicemailManager:IsForwardEnabled" name="vuiEmailCmdForward"/>
		<Prompt type="statement" name="vuiEmailCmdFlagForFollowUp"/>
		<Prompt type="statement" name="vuiEmailCmdMarkAsNew"/>
		<Prompt type="statement" condition="RetrieveVoicemailManager:IsFindEnabled AND GlobalActivityManager:SpeechAccessToDirectoryEnabled" name="vuiEmailCmdFindByName"/>
		<Prompt type="statement" name="vuiVmailCmdEnvelopeInfo"/>
		<Prompt type="statement" name="vuiCalCmdOrMoreOptions"/>
	</FsmModule>

	<FsmModule id="PlaybackCommandPrompts">
		<Prompt type="statement" name="vuiEmailCmdNext"/>
		<Prompt type="statement" name="vuiEmailCmdPrevious"/>
		<Prompt type="statement" name="vuiBodyCmdFastForward"/>
		<Prompt type="statement" name="vuiBodyCmdRewind"/>
		<Prompt type="statement" name="vuiBodyCmdSpeedUp"/>
		<Prompt type="statement" name="vuiBodyCmdSlowDown"/>
		<Prompt type="statement" name="vuiBodyCmdPause"/>
		<Prompt type="statement" name="vuiEmailCmdReadHeader"/>
		<Prompt type="statement" name="vuiEmailCmdEnd"/>
		<Prompt type="statement" name="vuiCalCmdOrMoreOptions"/>
	</FsmModule>

		<FsmModule id="CommandTransitions">
		<Transition event="recoNext" action="saveVoiceMail" refId="NavigateNextMessage"/>
		<Transition event="recoPrevious" action="null" refId="NavigatePreviousMessage"/>
		<Transition event="recoReply" condition="knowVoicemailSender" action="replyVoiceMail" refId="CueRecordingStatement"/>
		<Transition event="recoPlay" action="null" refId="MessageBodyPlayer"/>
		<Transition event="recoMarkAsUnread" action="markUnreadVoiceMail" heavyaction="true" refId="MarkedAsUnreadStatement"/>
		<Transition event="recoReadTheHeader" action="null" refId="ReadVmailHeaderQA"/>
		<Transition event="recoCallSender" condition="NOT IsNull(targetPhoneNumber)" action="null" refId="CallingSenderStatement"/>
		<Transition event="recoPause" action="pause" refId="PauseMessageStatement"/>
		<Transition event="recoDelete" action="deleteVoiceMail" refId="MessageDeletedStatement"/>
		<Transition event="recoUndelete" condition="canUndelete" action="undeleteVoiceMail" refId="DeletionUndoneStatement"/>

		<Transition event="recoFindByName" condition="RetrieveVoicemailManager:IsFindEnabled AND GlobalActivityManager:SpeechAccessToDirectoryEnabled" action="null" refId="ContactEnabledSearch"/>
		<Transition event="recoFindByNameWithName" condition="RetrieveVoicemailManager:IsFindEnabled AND GlobalActivityManager:SpeechAccessToDirectoryEnabled" action="null" refId="ContactEnabledSearch" />
		<Transition event="recoFindByContact" condition="RetrieveVoicemailManager:IsFindByContactEnabled" action="null" refId="ContactEnabledSearch" />
		
		<Transition event="recoForward" condition="(NOT protected) AND RetrieveVoicemailManager:IsForwardEnabled AND GlobalActivityManager:SpeechAccessToDirectoryEnabled" action="forwardVoiceMail" refId="ContactEnabledSearch" />
		<Transition event="recoForward" condition="(NOT protected) AND RetrieveVoicemailManager:IsForwardEnabled AND (NOT GlobalActivityManager:SpeechAccessToDirectoryEnabled)" action="forwardVoiceMail" refId="ToForwardMessageDtmf" />
		<Transition event="recoForward" condition="protected AND RetrieveVoicemailManager:IsForwardEnabled" action="null" refId="DRMForwardNotAllowed" />
		<Transition event="recoForwardWithName" condition="(NOT protected) AND RetrieveVoicemailManager:IsForwardEnabled AND GlobalActivityManager:SpeechAccessToDirectoryEnabled" action="forwardVoiceMail" refId="ContactEnabledSearch" />
		<Transition event="recoForwardWithName" condition="protected AND RetrieveVoicemailManager:IsForwardEnabled" action="null" refId="DRMForwardNotAllowed" />
		<Transition event="recoForwardToContact" condition="(NOT protected) AND RetrieveVoicemailManager:IsForwardToContactEnabled" action="forwardVoiceMail" refId="ContactEnabledSearch" />
		<Transition event="recoForwardToContact" condition="protected AND RetrieveVoicemailManager:IsForwardToContactEnabled" action="null" refId="DRMForwardNotAllowed" />
		<Transition event="recoEnvelopeInfo" action="getEnvelopInfo" refId="PreEnvelopeInfoStatement" />
		<Transition event="recoFlagForFollowup" action="flagVoiceMail" heavyaction="true" refId="FlaggedForFollowUpStatement"/>
		</FsmModule>
</FiniteStateMachine>


