AtsImsIot_TP_behavior_GM.ttcn 184 KB
Newer Older
Bostjan Pintar's avatar
Bostjan Pintar committed
/**
 *  @author     STF 574
 *  @version    $Id$
 *  @desc       This module provides the TP behaviour functions at GM interface
 */

module AtsImsIot_TP_behavior_GM {

	// LibIms
	import from LibIms_Templates all;
	import from LibIms_UpperTester all;
	// LibIot
	import from LibIot_TypesAndValues all;
	import from LibIot_Functions all;
	import from LibIot_TestInterface all;
	import from LibIot_PIXITS all;
	// LibSip
	import from LibSip_SIPTypesAndValues all;
	import from LibSip_Templates all;
	import from LibSip_Common all;
	import from LibSip_SDPTypes all;
	// LibMsrp
	import from LibMsrp_TypesAndValues all;
	import from LibMsrp_Functions all;
	import from LibMsrp_Templates all;
	// AtsImsIot
	import from AtsImsIot_TestSystem all;
	import from AtsImsIot_Templates all;
	import from AtsImsIot_Templates_GM all;
	import from AtsImsIot_TypesAndValues all;
	import from AtsImsIot_Functions all;
	group imsMessages {
		/**
		 * @desc Verify that the P-CSCF successfully processes a SIP messages greater than 1300 bytes
		 * Initial conditions with {
		 *     the UE_A entity isAttachedTo the EPC_A and
		 *     the UE_A entity isNotRegisteredTo the IMS_A
		 * }
		 * 
		 * Expected behaviour
		 *     ensure that {
		 *         when {
		 *             the UE_A entity isRequestedToSend a MESSAGE containing
		 *                 From indicating value PX_UE_A_SIP_URI,
		 *                 To indicating value PX_UE_A_SIP_URI,
		 *                 CallId indicating value PX_UE_A_CALLID,
		 *                 Via indicating value PX_UE_A_VIA,
		 *                 ContentLength indicating value greater than 1300 bytes
		 *                 ;
		 *             to the IMS_P_CSCF_A entity
		 *         }
		 *         then {
		 *             the IMS_P_CSCF_A entity receives the MESSAGE containing
		 *                 From indicating value PX_UE_A_SIP_URI,
		 *                 To indicating value PX_UE_A_SIP_URI,
		 *                 CallId indicating value PX_UE_A_CALLID,
		 *                 Via indicating value PX_UE_A_VIA,
		 *                 ContentLength indicating value greater than 1300 bytes
		 *                 ;
		 *             from the UE_A entity
		 *             and the IMS_P_CSCF_A entity sends a 200_Ok containing
		 *                 From indicating value PX_UE_A_SIP_URI,
		 *                 To indicating value PX_UE_A_SIP_URI,
		 *                 CallId indicating value PX_UE_A_CALLID,
		 *                 Via indicating value PX_UE_A_VIA,
		 *                 PChargingVector containing
		 *                     orig_ioi indicating value PX_OPERATOR_ID_A,
		 *                     term_ioi indicating value PX_OPERATOR_ID_B,
		 *                 not PAccessNetworkInfo
		 *             ;;
		 *             to the UE_A entity
		 *         }
		 *     }
		 */
		function f_mtc_check_TP_GM_PCSCF_MESSAGE_01(
													SipInterfaceMonitor p_monitorCompRef,
													in boolean p_checkMessage := true
													) runs on ImsTestCoordinator {
			if (isvalue(p_monitorCompRef)) {
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{
															mw_SipRequest(mdw_MESSAGE_1500c)
														}, // FIXME CallId and more can be checked
														{ mw_SipRequest(mw_MESSAGE_Request_Base) },
														{0, omit},
														"TP_GM_PCSCF_MESSAGE_01 - Request",
														false,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{
															mw_SipResponse(mw_200OK_Base)
														}, // FIXME CallId and more can be checked
														{ },
														{0, omit},
														"TP_GM_PCSCF_MESSAGE_01 - Response",
														false,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
			}
		} // End of function f_mtc_check_TP_GM_PCSCF_MESSAGE_01
	} // End of group imsMessages
	// 5.2  IMS Registration
	group imsRegistration {
		/**
		 * @desc Verify that the P-CSCF successfully processes a first registration (Successful)
		 * Initial conditions with {
		 *     the UE_A entity isAttachedTo the EPC_A and
		 *     the UE_A entity isNotRegisteredTo the IMS_A and
		 *     the UE_B entity isNotRegisteredTo the IMS_B
		 * }
		 * 
		 * Expected behaviour
		 *     ensure that {
		 *         when {
		 *             the UE_A entity isTriggeredToStart
		 *         }
		 *         then {
		 *             the UE_A entity sends a REGISTER containing
		 *                 From indicating value PX_UE_A_SIP_URI,
		 *                 To indicating value PX_UE_A_SIP_URI,
		 *                 CallId indicating value PX_UE_A_CALLID,
		 *                 Via indicating value PX_UE_A_VIA,
		 *                 Authorization containing
		 *                     Authentication_Schema indicating value PX_TO_BE_DEFINED,
		 *                     Authentication_URI indicating value PX_TO_BE_DEFINED,
		 *                     Username indicating value PX_UE_A_USERNAME,
		 *                     Realm indicating value PX_UE_A_REALM,
		 *                     Algorithm indicating value PX_UE_A_AUTH_ALG,
		 *                     Nonce indicating value "",
		 *                     not term_ioi,
		 *                 not SecurityClient
		 *                 ;;
		 *             to the IMS_P_CSCF_A entity
		 *             and the UE_A entity receives an 401_Unauthorized containing
		 *                 From indicating value PX_UE_A_SIP_URI,
		 *                 To indicating value PX_UE_A_SIP_URI,
		 *                 CallId indicating value PX_UE_A_CALLID,
		 *                 Via indicating value PX_UE_A_VIA,
		 *                 Path,
		 *                 Warning,
		 *                 PAccessNetworkInfo,
		 *                 WwwAuthenticate containing
		 *                     Digest,
		 *                     Realm indicating value PX_UE_A_REALM,
		 *                     Algorithm indicating value PX_UE_A_AUTH_ALG,
		 *                     Nonce indicating value "not empty",
		 *                     qop indicating value "auth"
		 *                 ;;
		 *             from the IMS_P_CSCF_A entity
		 *         }
		 *     }
		 */
		function f_mtc_check_TP_GM_PCSCF_REGISTER_01(
													 in SipInterfaceMonitor p_monitorCompRef,
													 in boolean p_checkMessage := false
													 ) runs on ImsTestCoordinator {
			if (isvalue(p_monitorCompRef)) {
				var ImsUserInfo v_userInfoA := f_getSipUserId(PX_EUT_A);
				var SipMessage v_sip;
				// Check the first REGISTER
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														 { 
															mw_SipRequest(
																		  mw_TP_GM_PCSCF_REGISTER_01( // FIXME Add CallId...
																									 mw_From_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																									 mw_To_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																									 mw_Authorization_other
																									 )
																		  )
														},
														{ 
															mw_SipRequest(mw_REGISTER_Request_Base)
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_01 - First request",
														true,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
				// Retrieve messge
				f_getSipMsgFromMonitor(p_monitorCompRef, v_sip);
				if (not(isbound(v_sip))) {
					return;
				}
				// Check REGISTER 401 Unauthorized response
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{ 
															mw_SipResponse(mw_401Unauthorized(v_sip.request.msgHeader.cSeq, mw_WwwAuthenticate))
														},
														{
															mw_SipResponse(mw_401Unauthorized_Base),
															mw_SipResponse(mw_Response_4xx_Base(
																								v_sip.request.msgHeader.callId,
																								v_sip.request.msgHeader.cSeq
																								)) 
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_01 - 401 Unauthorized",
														false,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
			}
		} // End of function f_mtc_check_TP_GM_PCSCF_REGISTER_01
		/**
		 * @desc Verify that the P-CSCF successfully processes a first registration (Successful)
		 * Initial conditions with {
		 *     the UE_A entity isAttachedTo the EPC_A and
		 *     the UE_A entity not isRegisteredTo the IMS_A
		 * }
		 * 
		 * Expected behaviour
		 *     ensure that {
		 *         when {
		 *             the IMS_P_CSCF_A entity receives a REGISTER containing
		 *                 From indicating value PX_UE_A_SIP_URI,
		 *                 To indicating value PX_UE_A_SIP_URI,
		 *                 CallId indicating value PX_UE_A_CALLID,
		 *                 Via indicating value PX_UE_A_VIA,
		 *                 Path,
		 *                 Warning,
		 *                 WwwAuthenticate containing
		 *                     Digest,,
		 *                     Realm indicating value PX_UE_A_REALM,
		 *                     Algorithm indicating value PX_UE_A_AUTH_ALG,
		 *                     Nonce indicating value "",
		 *                     not term_ioi,
		 *                 not SecurityClient,
		 *                 Contact indicating value "sos";;
		 *             from the UE_A entity
		 *         }
		 *         then {
		 *             the IMS_P_CSCF_A entity sends a 401_Unauthorized containing
		 *                 From indicating value PX_UE_A_SIP_URI,
		 *                 To indicating value PX_UE_A_SIP_URI,
		 *                 CallId indicating value PX_UE_A_CALLID,
		 *                 Via indicating value PX_UE_A_VIA,
		 *                 Path,
		 *                 Warning,
		 *                 PAccessNetworkInfo,
		 *                 WwwAuthenticate containing
		 *                     Digest,
		 *                     Realm indicating value PX_UE_A_REALM,
		 *                     Algorithm indicating value PX_UE_A_AUTH_ALG,
		 *                     Nonce indicating value "not empty",
		 *                     qop indicating value "auth";;
		 *                 ;
		 *             from the UE_A entity
		 *         }
		 *     }
		 */
		function f_mtc_check_TP_GM_PCSCF_ECO_REGISTER_01(
														 in SipInterfaceMonitor p_monitorCompRef,
														 in boolean p_checkMessage := false
														 ) runs on ImsTestCoordinator {
			if (isvalue(p_monitorCompRef)) {
				var ImsUserInfo v_userInfoA := f_getSipUserId(PX_EUT_A_EMERGENCY);
				var SipMessage v_sip;
				// Check the first REGISTER
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														 { 
															mw_SipRequest(
																		  mw_TP_GM_PCSCF_ECO_REGISTER_01( // FIXME Add CallId...
																										 mw_From_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																										 mw_To_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																										 mw_Authorization_other,
																										 -, -,
																										 mw_contact(mw_ContactAddress)
																										 )
																		  )
														},
														{ 
															mw_SipRequest(mw_REGISTER_Request_Base)
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_01 - First request",
														true,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
				// Retrieve messge
				f_getSipMsgFromMonitor(p_monitorCompRef, v_sip);
				if (not(isbound(v_sip))) {
					return;
				}
				// Check REGISTER 401 Unauthorized response
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{ 
															mw_SipResponse(mw_401Unauthorized(v_sip.request.msgHeader.cSeq, mw_WwwAuthenticate))
														},
														{
															mw_SipResponse(mw_401Unauthorized_Base),
															mw_SipResponse(mw_Response_4xx_Base(
																								v_sip.request.msgHeader.callId,
																								v_sip.request.msgHeader.cSeq
																								)) 
														},
														{0, omit},
														"TP_GM_PCSCF_ECO_REGISTER_01 - 401 Unauthorized",
														false,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
			}
		} // End of function f_mtc_check_TP_GM_PCSCF_ECO_REGISTER_01
		/**
		 * @desc Verify that the P-CSCF successfully processes a first registration (Successful)
		 * Initial conditions with {
		 *     the UE_A entity isAttachedTo the EPC_A and
		 *     the UE_A entity isNotRegisteredTo the IMS_A and
		 *     the UE_B entity isNotRegisteredTo the IMS_B
		 * }
		 * 
		 * Expected behaviour
		 * ensure that {
		 *     when {
		 *         the IMS_P_CSCF_A entity receives a REGISTER containing
		 *             From indicating value PX_UE_A_SIP_URI,
		 *             To indicating value PX_UE_A_SIP_URI,
		 *             CallId indicating value PX_UE_A_CALLID,
		 *             Via indicating value PX_UE_A_VIA,
		 *             Authorization containing
		 *                 Authentication_Schema indicating value PX_TO_BE_DEFINED,
		 *                 Authentication_URI indicating value PX_TO_BE_DEFINED,
		 *                 Username indicating value PX_UE_A_USERNAME,
		 *                 Realm indicating value PX_UE_A_REALM,
		 *                 Algorithm indicating value PX_UE_A_AUTH_ALG,
		 *                 Nonce indicating value "not empty",
		 *                 qop indicating value "auth",
		 *             not SecurityClient
		 *             ;;
		 *         from the UE_A entity
		 *     }
		 *     then {
		 *         the IMS_P_CSCF_A entity sends an 200_Ok containing
		 *             From indicating value PX_UE_A_SIP_URI,
		 *             To indicating value PX_UE_A_SIP_URI,
		 *             CallId indicating value PX_UE_A_CALLID,
		 *             Via indicating value PX_UE_A_VIA,
		 *             AuthenticationInfo,
		 *             PAccessNetworkInfo,
		 *             PAssociatedURI indicating value PX_UE_A_SIP_URI,
		 *             PChargingVector,
		 *                orig_ioi_parameter 
		 *                    indicating value "Operator Identifier Of ImsA" ,
		 *                term_ioi_parameter 
		 *                    indicating value "Operator Identifier Of ImsB"
		 *             Path,
		 *             ServiceRoute
		 *             ;
		 *         to the UE_A entity
		 *         }
		 *     }
		 */
		function f_mtc_check_TP_GM_PCSCF_REGISTER_02(
													 in SipInterfaceMonitor p_monitorCompRef,
													 in boolean p_checkMessage := false
													 ) runs on ImsTestCoordinator {
			if (isvalue(p_monitorCompRef)){
				var ImsUserInfo v_userInfoA := f_getSipUserId(PX_EUT_A);
				var SipMessage v_sip;
				// Check the first REGISTER
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{
															mw_SipRequest(
																		  mw_TP_GM_PCSCF_REGISTER_02(
																									 mw_From_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																									 mw_To_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																									 mw_Authorization_other
																									 )
																		  )
														},
														{ 
															mw_SipRequest(mw_REGISTER_Request_Base)
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_02 - Second request",
														true,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
				// Retrieve messge
				f_getSipMsgFromMonitor(p_monitorCompRef, v_sip);
				if (not(isbound(v_sip))) {
					return;
				}
				// Check REGISTER 200 OK response
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{
															mw_SipResponse(mw_200OK(
																					v_sip.request.msgHeader.cSeq,
																					v_sip.request.msgHeader.callId,
																					v_sip.request.msgHeader.fromField,
																					v_sip.request.msgHeader.toField
																					))
														},
														{
															mw_SipResponse(mw_Response_2xx_Base)
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_02 - 200 OK",
														false,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
			}
		} // End of function f_mtc_check_TP_GM_PCSCF_REGISTER_02
		/**
		 * @desc Verify that the P-CSCF successfully processes a full emergency registration (Successful).
		 * Initial conditions with {
		 *     the UE_A entity isAttachedTo the EPC_A and
		 *     the UE_A entity isNotRegisteredTo the IMS_A and
		 *     the UE_A entity hasAchievedFirstRegistration
		 * }
		 * 
		 * Expected behaviour
		 * ensure that {
		 *     when {
		 *         the IMS_P_CSCF_A entity receives a REGISTER containing
		 *             From indicating value PX_UE_A_SIP_URI,
		 *             To indicating value PX_UE_A_SIP_URI,
		 *             CallId indicating value PX_UE_A_CALLID,
		 *             Via indicating value PX_UE_A_VIA,
		 *             Authorization containing
		 *                 Authentication_Schema indicating value PX_TO_BE_DEFINED,
		 *                 Authentication_URI indicating value PX_TO_BE_DEFINED,
		 *                 Username indicating value PX_UE_A_USERNAME,
		 *                 Realm indicating value PX_UE_A_REALM,
		 *                 Algorithm indicating value PX_UE_A_AUTH_ALG,
		 *                 Nonce indicating value "not empty",
		 *                 qop indicating value "auth",
		 *             not SecurityClient,
		 *             Contact indicating value "sos";;
		 *         from the UE_A entity
		 *     }
		 *     then {
		 *         the IMS_P_CSCF_A entity sends an 200_Ok containing
		 *             From indicating value PX_UE_A_SIP_URI,
		 *             To indicating value PX_UE_A_SIP_URI,
		 *             CallId indicating value PX_UE_A_CALLID,
		 *             Via indicating value PX_UE_A_VIA,
		 *             AuthenticationInfo,
		 *             PAccessNetworkInfo,
		 *             PAssociatedURI indicating value PX_UE_A_SIP_URI,
		 *             PChargingVector,
		 *                orig_ioi_parameter 
		 *                    indicating value "Operator Identifier Of ImsA" ,
		 *                term_ioi_parameter 
		 *                    indicating value "Operator Identifier Of ImsB"
		 *             Path,
		 *             ServiceRoute;
		 *         to the UE_A entity
		 *         }
		 *     }
		 */
		function f_mtc_check_TP_GM_PCSCF_ECO_REGISTER_02(
														 in SipInterfaceMonitor p_monitorCompRef,
														 in boolean p_checkMessage := false
														 ) runs on ImsTestCoordinator {
			if (isvalue(p_monitorCompRef)){
				var ImsUserInfo v_userInfoA := f_getSipUserId(PX_EUT_A_EMERGENCY);
				var SipMessage v_sip;
				// Check the first REGISTER
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{
															mw_SipRequest(
																		  mw_TP_GM_PCSCF_ECO_REGISTER_02(
																										 mw_From_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																										 mw_To_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																										 mw_Authorization_other,
																										 -, -,
																										 mw_contact(mw_ContactAddress)
																										 )
																		  )
														},
														{ 
															mw_SipRequest(mw_REGISTER_Request_Base)
														},
														{0, omit},
														"TP_GM_PCSCF_ECO_REGISTER_02 - Second request",
														true,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
				// Retrieve messge
				f_getSipMsgFromMonitor(p_monitorCompRef, v_sip);
				if (not(isbound(v_sip))) {
					return;
				}
				// Check REGISTER 200 OK response
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{
															mw_SipResponse(mw_200OK(
																					v_sip.request.msgHeader.cSeq,
																					v_sip.request.msgHeader.callId,
																					v_sip.request.msgHeader.fromField,
																					v_sip.request.msgHeader.toField
																					))
														},
														{
															mw_SipResponse(mw_Response_2xx_Base)
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_02 - 200 OK",
														false,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
			}
		} // End of function f_mtc_check_TP_GM_PCSCF_ECO_REGISTER_02
		/**
		 * @desc Verify that the P-CSCF successfully processes an invalid first registration (Unsuccessful).
		 * Initial conditions with {
		 *     the UE_A entity isAttachedTo the EPC_A and
		 *     the UE_A entity isNotRegisteredTo the IMS_A and
		 *     the UE_B entity isNotRegisteredTo the IMS_B
		 * }
		 * 
		 * Expected behaviour
		 *     ensure that {
		 *         when {
		 *             the UE_A entity isTriggeredToStart
		 *         }
		 *         then {
		 *             the IMS_P_CSCF_A entity receives a REGISTER containing
		 *                 From indicating value PX_UE_A_SIP_URI,
		 *                 To indicating value PX_UE_A_SIP_URI,
		 *                 CallId indicating value PX_UE_A_CALLID,
		 *                 Via indicating value PX_UE_A_VIA,
		 *                 Authorization containing
		 *                     Authentication_Schema indicating value PX_TO_BE_DEFINED,
		 *                     Authentication_URI indicating value PX_TO_BE_DEFINED,
		 *                     Username indicating value PX_UE_A_INVALID_USERNAME,
		 *                     Realm indicating value PX_UE_A_REALM,
		 *                     Algorithm indicating value PX_UE_A_AUTH_ALG,
		 *                     Nonce indicating value ""
		 *                 ;;
		 *             from the UE_A entity
		 *             and the IMS_P_CSCF_A entity sends an 404_NotFound containing
		 *                 From indicating value PX_UE_A_SIP_URI,
		 *                 To indicating value PX_UE_A_SIP_URI,
		 *                 CallId indicating value PX_UE_A_CALLID
		 *                 ;
		 *             to the UE_A entity
		 *         }
		 *     }
		 */
		function f_mtc_check_TP_GM_PCSCF_REGISTER_03(
													 in SipInterfaceMonitor p_monitorCompRef,
													 in boolean p_checkMessage := false
													 ) runs on ImsTestCoordinator {
			if (isvalue(p_monitorCompRef)) {
				var ImsUserInfo v_userInfoA := f_getSipUserId(PX_EUT_A); // User removed from HSS
				var SipMessage v_sip;
				// Check the first REGISTER
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														 { 
															mw_SipRequest(
																		  mw_TP_GM_PCSCF_REGISTER_03(
																									 mw_From_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																									 mw_To_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																									 mw_Authorization_other
																									 )
																		  )
														},
														{ 
															mw_SipRequest(mw_REGISTER_Request_Base)
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_03 - First request",
														true,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
				// Retrieve messge
				f_getSipMsgFromMonitor(p_monitorCompRef, v_sip);
				if (not(isbound(v_sip))) {
					return;
				}
				log("v_sip", v_sip);
				// Check REGISTER 404 Not Found response
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{ 
															mw_SipResponse(mw_404NotFound(v_sip.request.msgHeader.cSeq/*, mw_WwwAuthenticate*/)),
															mw_SipResponse(mw_480TemporaryUnavailable(-, v_sip.request.msgHeader.cSeq/*, mw_WwwAuthenticate*/))
														},
														{
															mw_SipResponse(mw_Response_4xx_Base(
																								v_sip.request.msgHeader.callId,
																								v_sip.request.msgHeader.cSeq
																								)) 
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_03 - 404 Not Found",
														false,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
			}
		} // End of function f_mtc_check_TP_GM_PCSCF_REGISTER_03
		/**
		 * @desc Verify that the emergency registration is rejected with 403 (Forbidden) in case invalid credentials sent from UE. (Unsuccessful emergency registration).
		 * Initial conditions with {
		 *     the UE_A entity isEmergencyAttachedTo the EPC_A and
		 *     the UE_A entity not isRegisteredTo the IMS_A
		 * }
		 * 
		 * Expected behaviour
		 *     ensure that {
		 *         when {
		 *             the UE_A entity isTriggeredToStart
		 *         }
		 *         then {
		 *             the IMS_P_CSCF_A entity receives a REGISTER containing
		 *                 From indicating value PX_UE_A_SIP_URI,
		 *                 To indicating value PX_UE_A_SIP_URI,
		 *                 CallId indicating value PX_UE_A_CALLID,
		 *                 Via indicating value PX_UE_A_VIA,
		 *                 Authorization indicating value "Invalid credentials",
		 *                 Contact indicating value "sos";
		 *             from the UE_A entity
		 *             and the IMS_P_CSCF_A entity sends an 403_Forbiden containing
		 *                 From indicating value PX_UE_A_SIP_URI,
		 *                 To indicating value PX_UE_A_SIP_URI,
		 *                 CallId indicating value PX_UE_A_CALLID,
						   Via indicating value PX_UE_A_VIA;
		 *             to the UE_A entity
		 *         }
		 *     }
		 */
		function f_mtc_check_TP_GM_PCSCF_ECO_REGISTER_03(
														 in SipInterfaceMonitor p_monitorCompRef,
														 in boolean p_checkMessage := false
														 ) runs on ImsTestCoordinator {
			if (isvalue(p_monitorCompRef)) {
				var ImsUserInfo v_userInfoA := f_getSipUserId(PX_EUT_A_EMERGENCY); // User removed from HSS
				var SipMessage v_sip;
				// Check the first REGISTER
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														 { 
															mw_SipRequest(
																		  mw_TP_GM_PCSCF_ECO_REGISTER_03(
																										 mw_From_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																										 mw_To_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																										 mw_Authorization_other, // FIXME indicating value "Invalid credentials"
																										 -, -,
																										 mw_contact(mw_ContactAddress)
																										 )
																		  )
														},
														{ 
															mw_SipRequest(mw_REGISTER_Request_Base)
														},
														{0, omit},
														"TP_GM_PCSCF_ECO_REGISTER_03 - First request",
														true,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
				// Retrieve messge
				f_getSipMsgFromMonitor(p_monitorCompRef, v_sip);
				if (not(isbound(v_sip))) {
					return;
				}
				log("v_sip", v_sip);
				// Check REGISTER 404 Not Found response
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{ 
															mw_SipResponse(mw_403Forbidden(v_sip.request.msgHeader.cSeq/*, mw_WwwAuthenticate*/)),
															mw_SipResponse(mw_480TemporaryUnavailable(-, v_sip.request.msgHeader.cSeq/*, mw_WwwAuthenticate*/))
														},
														{
															mw_SipResponse(mw_Response_4xx_Base(
																								v_sip.request.msgHeader.callId,
																								v_sip.request.msgHeader.cSeq
																								)) 
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_03 - 404 Not Found",
														false,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
			}
		} // End of function f_mtc_check_TP_GM_PCSCF_ECO_REGISTER_03
		function f_mtc_check_TP_GM_PCSCF_REGISTER_04( // FIXME RMI To be reviewed
													 in SipInterfaceMonitor p_monitorCompRef,
													 in boolean p_checkMessage := false
													 ) runs on ImsTestCoordinator {
			if (isvalue(p_monitorCompRef)){
				var ImsUserInfo v_userInfoA := f_getSipUserId(PX_EUT_A);
				var SipMessage v_sip;
				// Check the first REGISTER
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{
															mw_SipRequest(
																		  mw_TP_GM_PCSCF_REGISTER_04(
																									 mw_From_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																									 mw_To_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																									 mw_Authorization_other
																									 )
																		  )
														},
														{ 
															mw_SipRequest(mw_REGISTER_Request_Base)
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_04 - First request",
														true,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
				// Retrieve messge
				f_getSipMsgFromMonitor(p_monitorCompRef, v_sip);
				if (not(isbound(v_sip))) {
					return;
				}
				// Check REGISTER 404 Not Found response
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{ 
															mw_SipResponse(mw_401Unauthorized(v_sip.request.msgHeader.cSeq, mw_WwwAuthenticate)),
															mw_SipResponse(mw_480TemporaryUnavailable(-, v_sip.request.msgHeader.cSeq, mw_WwwAuthenticate))
														},
														{
															mw_SipResponse(mw_401Unauthorized_Base),
															mw_SipResponse(mw_Response_4xx_Base(
																								v_sip.request.msgHeader.callId,
																								v_sip.request.msgHeader.cSeq
																								)) 
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_04 - 401 Unauthorized",
														false,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
			}
		} // End of function f_mtc_check_TP_GM_PCSCF_REGISTER_04
		/**
		 * @desc Verify that the emergency registration is rejected with 403 (Forbidden) in case the UE and P-CSCF does not support GPRS-IMS-Bundled authentication. (Unsuccessful emergency registration).
		 * Initial conditions with {
		 *     the UE_A entity isEmergencyAttachedTo the EPC_B and
		 *     the UE_A entity not isRegisteredTo the IMS_B
		 * }
		 * 
		 * Expected behaviour
		 *     ensure that {
		 *         when {
		 *             the IMS_P_CSCF_B entity receives a REGISTER containing
		 *                 From indicating value PX_UE_A_SIP_URI,
		 *                 To indicating value PX_UE_A_SIP_URI,
		 *                 CallId indicating value PX_UE_A_CALLID,
		 *                 Via indicating value PX_UE_A_VIA,
		 *                 Authorization indicating value GPRS_IMS_Bundled_authentication,
		 *                 Contact indicating value "sos";
		 *             from the UE_A entity
		 *         }
		 *         then {
		 *             the IMS_P_CSCF_B entity sends an 403_Forbiden containing
		 *                 From indicating value PX_UE_A_SIP_URI,
		 *                 To indicating value PX_UE_A_SIP_URI,
		 *                 CallId indicating value PX_UE_A_CALLID,
		 *                     Via indicating value PX_UE_A_VIA,
		 *                 MessageBody containing
		 *                     XML containing
		 *                         ims_3gpp_element indicating value anonymous_emergencycall;;;
		 *             to the UE_A entity
		 *         }
		 *     }
		 */
		function f_mtc_check_TP_GM_PCSCF_ECO_REGISTER_04(
														 in SipInterfaceMonitor p_monitorCompRef,
														 in boolean p_checkMessage := false
														 ) runs on ImsTestCoordinator {
			if (isvalue(p_monitorCompRef)){
				var ImsUserInfo v_userInfoA := f_getSipUserId(PX_EUT_A_EMERGENCY);
				var SipMessage v_sip;
				// Check the first REGISTER
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{
															mw_SipRequest(
																		  mw_TP_GM_PCSCF_ECO_REGISTER_04(
																										 mw_From_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																										 mw_To_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																										 mw_Authorization_other // FIXME not indicating value GPRS_IMS_Bundled_authenticatio
																										 )
																		  )
														},
														{ 
															mw_SipRequest(mw_REGISTER_Request_Base)
														},
														{0, omit},
														"TP_GM_PCSCF_ECO_REGISTER_04 - First request",
														true,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
				// Retrieve messge
				f_getSipMsgFromMonitor(p_monitorCompRef, v_sip);
				if (not(isbound(v_sip))) {
					return;
				}
				// Check REGISTER 404 Not Found response
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{ 
															mw_SipResponse(mw_403Forbidden(v_sip.request.msgHeader.cSeq, mw_WwwAuthenticate)),
															mw_SipResponse(mw_480TemporaryUnavailable(-, v_sip.request.msgHeader.cSeq, mw_WwwAuthenticate))
														},
														{
															mw_SipResponse(mw_401Unauthorized_Base),
															mw_SipResponse(mw_Response_4xx_Base(
																								v_sip.request.msgHeader.callId,
																								v_sip.request.msgHeader.cSeq
																								)) 
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_04 - 401 Unauthorized",
														false,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
			}
		} // End of function f_mtc_check_TP_GM_PCSCF_ECO_REGISTER_04
		function f_mtc_check_TP_GM_PCSCF_REGISTER_05( // FIXME RMI To be reviewed
													 in SipInterfaceMonitor p_monitorCompRef,
													 in boolean p_checkMessage := false
													 ) runs on ImsTestCoordinator {
			if (isvalue(p_monitorCompRef)){
				var ImsUserInfo v_userInfoA := f_getSipUserId(PX_EUT_A);
				var SipMessage v_sip;
				// Check the first REGISTER
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{
															mw_SipRequest(
																		  mw_TP_GM_PCSCF_REGISTER_05(
																									 mw_From_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																									 mw_To_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																									 mw_Authorization_other
																									 )
																		  )
														},
														{ 
															mw_SipRequest(mw_REGISTER_Request_Base)
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_05 - Second request",
														true,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
				// Retrieve messge
				f_getSipMsgFromMonitor(p_monitorCompRef, v_sip);
				if (not(isbound(v_sip))) {
					return;
				}
				// Check REGISTER 200 OK response
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{
															mw_SipResponse(mw_200OK(
																					v_sip.request.msgHeader.cSeq,
																					v_sip.request.msgHeader.callId,
																					v_sip.request.msgHeader.fromField,
																					v_sip.request.msgHeader.toField
																					))
														},
														{
															mw_SipResponse(mw_Response_2xx_Base)
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_05 - 200 OK",
														false,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
			}
		} // End of function f_mtc_check_TP_GM_PCSCF_REGISTER_05
		function f_mtc_check_TP_GM_PCSCF_ECO_REGISTER_05(
														 in SipInterfaceMonitor p_monitorCompRef,
														 in boolean p_checkMessage := false
														 ) runs on ImsTestCoordinator {
			if (isvalue(p_monitorCompRef)){
				var ImsUserInfo v_userInfoA := f_getSipUserId(PX_EUT_A_EMERGENCY);
				var SipMessage v_sip;
				// Check the first REGISTER
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{
															mw_SipRequest(
																		  mw_TP_GM_PCSCF_ECO_REGISTER_05(
																										 mw_From_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																										 mw_To_AddrUnion_SipUrl(omit, v_userInfoA.publicId, v_userInfoA.domain),
																										 mw_Authorization_other
																										 )
																		  )
														},
														{ 
															mw_SipRequest(mw_REGISTER_Request_Base)
														},
														{0, omit},
														"TP_GM_PCSCF_ECO_REGISTER_05 - Second request",
														true,
														p_checkMessage
														)
									   );
				p_monitorCompRef.done;
				// Retrieve messge
				f_getSipMsgFromMonitor(p_monitorCompRef, v_sip);
				if (not(isbound(v_sip))) {
					return;
				}
				// Check REGISTER 200 OK response
				p_monitorCompRef.start(
									   f_Iot_Sip_receive(
														{ 
															mw_SipResponse(mw_420BadExtension(
																							  v_sip.request.msgHeader.cSeq, 
																							  mw_WwwAuthenticate,
																							  mw_MBody_MIME_Ims3gpp(
																													*,
																													? // FIXME XML message body
																													)
																							  )),
															mw_SipResponse(mw_480TemporaryUnavailable(-, v_sip.request.msgHeader.cSeq, mw_WwwAuthenticate))
														},
														{
															mw_SipResponse(mw_Response_2xx_Base)
														},
														{0, omit},
														"TP_GM_PCSCF_REGISTER_05 - 200 OK",
														false,
														p_checkMessage