<script xmlns="http://www.nokia.com/ns/cep/script/1.0/"
xmlns:cep="http://www.nokia.com/ns/cep/1.0/">
    <!-- Must have sensor interaction active -->
    <if>
        <equals>
            <contextRef source='Sensor' type='Setting.Active'/>
            <string>Off</string>
        </equals>
        <actions>
        </actions>
    </if>
    <!-- Check if we have incoming call and we receive a double tap event -->
    <elseIf>
        <and>
            <!-- Must have a ringin call and receive new orientation event from sensor -->
            <equals>
                <contextRef source='Call' type='State'/>
                <string>Ringing</string>
            </equals>
	        <and>
                <!-- Check that turning interaction is set -->
                <equals>
                    <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceCalls'/>
                    <string>On</string>
                </equals>
                <and>
                    <!-- New orientation event with value 'DisplayDown' -->
    	            <contextUpdated>
    	                <contextRef source='Sensor' type='Event.Orientation'/>
    	    	    </contextUpdated>
    	        	<equals>
                        <contextRef source='Sensor' type='Event.Orientation'/>
                    	<string>DisplayDownwards</string>
    	            </equals>
                </and>
	        </and>
        </and>
        <actions>
            <!-- Silence ringing tone -->
            <Phone Command='Silence'/>
            <!-- Vibra feedback -->
            <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/>
        </actions>
    </elseIf>
</script>