<?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 id="logonModule">
		<!-- Enter password -->
		<Menu id="104" minDtmfSize="1" maxDtmfSize="password" dtmfInputValue="password" dtmfStopTones="*#" interDigitTimeout="5" inputTimeout="20">
			<Prompt type="statement" name="tuiEnterPassword">
				<Prompt type="name" name="userName"/>
			</Prompt>
			
			<Transition event="*" action="clearCaller" refId="102"/>
			<Transition event = "faxtone" refId = "1300" action = "createCallee"></Transition>
			<Transition event = "umdiagnosticCall" refId = "6000" action = "null"></Transition>
			<!-- Handle # in case we have it in the buffer from the previous menu -->
			<Transition event="#" action="null" refId="104"/>
			<Transition event="anyKey" action="doLogon" heavyaction="true" refId="140"/>
			<FsmImport href="Logon.fsm" module="doLogonTransitions"/>
		</Menu>

		<Menu id="handleSkipPinLogon">
			<Transition event="noKey" action="doLogon" heavyaction="true" refId="140"/>
			<FsmImport href="Logon.fsm" module="doLogonTransitions"/>
		</Menu>

		<Menu id="handleLogonOk">
			<!-- No OC feature specified (default UM behaviour) -->
			<Transition condition="IsNull(ocFeature) AND (useAsr)" event="noKey" action="getSummaryInfo" heavyaction="true" refId="MainMenuQA"/>
			<Transition condition="IsNull(ocFeature) AND (NOT useAsr)" event="noKey" action="null" heavyaction="true" refId="170"/>
			<!-- OC feature = Greeting, Voicemail, SingleVoicemail -->
			<Transition condition="NOT IsNull(ocFeature) AND (ocFeature EQ @Greeting)" event="noKey" action="null" refId="5100"/>
			<Transition condition="NOT IsNull(ocFeature) AND (ocFeature EQ @Voicemail) AND (useAsr)" event="noKey" action="null" refId="ASRVmail"/>
			<Transition condition="NOT IsNull(ocFeature) AND (ocFeature EQ @Voicemail) AND (NOT useAsr)" event="noKey" action="null" refId="800"/>
			<Transition condition="NOT IsNull(ocFeature) AND (ocFeature EQ @SingleVoicemail)" event="noKey" action="null" refId="5100"/>
			<Transition event="xsoError" action="null" refId="105"/>
		</Menu>

		<!-- Bad password -->
		<Menu id="140" minDtmfSize="1" maxDtmfSize="password" dtmfInputValue="password" dtmfStopTones="*#" interDigitTimeout="5" inputTimeout="20">
			<Prompt type="statement" name="tuiIncorrectPassword"/>
			<Transition event="*" action="clearCaller" refId="102"/>
			<Transition event="anyKey" action="doLogon" heavyaction="true" refId="140"/>
			<FsmImport href="Logon.fsm" module="doLogonTransitions"/>
		</Menu>
		<!-- Disconnect -->
		<Menu id="141" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
			<Prompt type="statement" name="tuiPasswordDisconnect"/>
			<Transition event="noKey" action="disconnect" refId="141"/>
		</Menu>
		<!-- Lockout -->
		<Menu id="142" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
			<Prompt type="statement" name="tuiPasswordLockout"/>
			<Transition event="noKey" action="disconnect" refId="142"/>
		</Menu>
		<!-- Auto-new password generated -->
		<Menu id="PasswordResetStatement" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
			<Prompt type="statement" name="tuiPasswordAutoReset"/>
			<Transition event="noKey" action="disconnect" refId="PasswordResetStatement"/>
		</Menu>
		<!-- Stale checksum, call back soon -->
		<Menu id="PasswordChangeInProgress" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
			<Prompt type="statement" name="tuiPasswordChangeInProgress"/>
			<Transition event="noKey" action="disconnect" refId="PasswordChangeInProgress"/>
		</Menu>
	</FsmModule>
	<!-- Transitions for the doLogon action -->
	<FsmModule id="doLogonTransitions">
		<Transition event="logonOk" action="null" refId="handleLogonOk"/>
		<Transition event="logonAsr" action="null" refId="handleLogonOk"/>
		<Transition event="logonPP" action="null" refId="PromptProvisioning"/>
		<Transition event="firstTimeUserTask" action="null" refId="600"/>
		<Transition event="changePasswordTask" action="null" refId="600"/>
		<Transition event="badPasswordDisconnect" action="null" refId="141"/>
		<Transition event="badPasswordLockout" action="null" refId="142"/>
		<Transition event="badPasswordReset" action="null" refId="PasswordResetStatement"/>
		<Transition event="staleChecksum" action="null" refId="PasswordChangeInProgress"/>
		<Transition event="xsoError" refId="119" action="null"/>
	</FsmModule>
</FiniteStateMachine>
