<?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>
		<!-- Check whether we should wait for source party information or not -->
		<Menu id="callDiscriminator">
			<Transition condition="waitForSourcePartyInfo" event="noKey" refId="getSourcePartyInfoMenu" action="null"/>
			<Transition condition="NOT waitForSourcePartyInfo" event="noKey" refId="100" action="null"/>
		</Menu>
		
		<!-- Check whether the valid diversion received from gateway ================================-->
		<Menu id="100" minDtmfSize="0" maxDtmfSize="0" dtmfInputValue="option">
			<!-- resolve diversion -->
			<Transition event="noKey" refId="infoGreetingMenu" action="getExtension"/>
			<!-- diversion found, and it was a call to UM enabled number. Transition to leave voicemail menu -->
			<Transition event="extensionFound" refId="700" action="null" refInfo="callAnswering"/>
			<!-- diversion found, and it was a call to DTMF AA, transition to AA menu -->
			<Transition event="validDtmfAutoAttendant" refId="900" action="null"/>
			<!-- diversion found, and it was a call to Speech Enabled AA, transition to Speech AA -->
			<Transition event="validSpeechAutoAttendant" refId="2000" action="null"/>
			<!-- A WebService call was detected, run the WebService manager -->
			<Transition event="webServiceCall" refId="5000" action="null"/>
			<!-- play-on-phone outbound call, run the transition to PlayOnPhone-->
			<Transition event="playOnPhone" refId="5100" action="null"/>
			<!-- A UMDiagnostic Call was detected, run the UmDiagnostic Manager -->
			<Transition event="umdiagnosticCall" refId="6000" action="null"/>
		</Menu>

		<!-- 
			Wait up to 4 seconds for source party information. Any dtmf input received
			during this state will be queued by MSS. E.g.: this allows entering a pin
			while we are waiting for source party and diversion data.
		-->
		<Menu id="getSourcePartyInfoMenu" uninterruptible="true">
			<Prompt type="silence" name="4s"/>
			<Transition event="noKey" refId="100" action="null"/>
		</Menu>
	</FsmModule>
</FiniteStateMachine>
