Skip to content
AtsSccas_TCFunctions.ttcn 151 KiB
Newer Older
Iztok Juvancic's avatar
Iztok Juvancic committed
																PX_IMS_SUT_SCSCF_IPADDR, // TODO To be refined during validation
																PX_IMS_SUT_SCSCF_PORT, // TODO To be refined during validation
																"600000",
																-,
																m_contentType(c_sdpApplication), // TODO To be refined during validation
																m_MBody_SDP(vc_sdp_local) // TODO To be refined during validation
												), 
												mw_sccas_Response_2xxonREGISTER(vc_callId, vc_cSeq, vc_from, vc_to, vc_via_REG, vc_contact)
												);
				f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict()); // sync

				// Registration
				f_IncCSeq(v_cSeq_s); LibIms_Steps.f_setHeadersINVITE(v_cSeq_s, f_initSipUrl(c_serviceProfile_EMERGENCY), f_initSipUrl(c_userProfile_UE1atSUThome));
				f_sendResponse(
							 m_Response_2xx_Base(
											c_statusLine200,
											vc_callId, 
											p_cSeq_s, 
											vc_from, 
											vc_to, 
											vc_via_REG
											));
				tc_ack.start;
				alt {
					[] SIPP.receive(mw_Response_Base(c_statusLine183)) {
						tc_ack.stop;
						log("*** " & __SCOPE__ & ": PASS: Respoonse 183 was received ***");
						f_selfOrClientSyncAndVerdict(c_tbDone, e_success); // sync
					}
					[] tc_ack.timeout {
						f_selfOrClientSyncAndVerdict(c_tbDone, e_error); // sync 
					}
				}

				// TODO Deregistration?
				f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict()); // sync

			} // End of function f_TC_ISC_SCCAS_CPT_INV_14

			/**
			 *  @desc    Verify that the SCC AS correctly behave procedures when the access transfer is completed.
			 *  @param   p_cSeq_s Random CSeq REGISTER number
			 */
			function f_TC_ISC_SCCAS_TER_BYE_01(in CSeq p_cSeq_s)
			runs on ImsComponent {
				// Local variables
				var CSeq v_cSeq_s := p_cSeq_s;

				// Preambule
				f_init_userprofile(c_userProfile_UE1atSUThome);
				f_initSipUrl(c_serviceProfile_EMERGENCY);
				f_init_interfaceprofile(c_interfaceProfile_IMS_SUT_PCSCF1);
				// Registration
				f_sendRegistrationAndAwait200Ok(
												v_cSeq_s,
												m_sccas_register(
																vc_requestUri, 
																vc_callId, 
																vc_cSeq, 
																vc_from, 
																vc_to, 
																vc_via_REG, 
																vc_contact, 
																m_add_Authorization_digest(
																							vc_authorization, 
																							{c_Integrity_protected_no}
																							), 
																PX_IMS_SUT_SCSCF_IPADDR, // TODO To be refined during validation
																PX_IMS_SUT_SCSCF_PORT, // TODO To be refined during validation
																"600000",
																-,
																m_contentType(c_sdpApplication), // TODO To be refined during validation
																m_MBody_SDP(vc_sdp_local) // TODO To be refined during validation
												), 
												mw_sccas_Response_2xxonREGISTER(vc_callId, vc_cSeq, vc_from, vc_to, vc_via_REG, vc_contact)
												);
				f_selfOrClientSyncAndVerdict(c_prDone, f_getVerdict()); // sync

				// Registration
				f_IncCSeq(v_cSeq_s); LibIms_Steps.f_setHeadersBYE(v_cSeq_s, f_initSipUrl(c_userProfile_UE1atSUThome));
				f_SendBYE(
							 m_BYE_Request_UE(
											vc_requestUri,
											vc_callId, 
											p_cSeq_s, 
											vc_from, vc_to, vc_via_REG
											));
				tc_ack.start;
				alt {
					[] SIPP.receive(mw_Response_Base(c_statusLine200)) {
						tc_ack.stop;
						log("*** " & __SCOPE__ & ": PASS: 200 OK message was received ***");
						f_selfOrClientSyncAndVerdict(c_tbDone, e_success); // sync
					}
					[] tc_ack.timeout {
						f_selfOrClientSyncAndVerdict(c_tbDone, e_error); // sync 
					}
				}

				// TODO Deregistration?
				f_selfOrClientSyncAndVerdict(c_poDone, f_getVerdict()); // sync

			} // End of function f_TC_ISC_SCCAS_TER_BYE_01
    	
Steffen Ludtke's avatar
Steffen Ludtke committed
    } // End of group Group_12_3

    group helpers {

        function f_sendRegistrationAndAwait200Ok(
                                                 in CSeq p_cSeq_s,
                                                 in template (omit) REGISTER_Request p_register, 
                                                 template (present) Response p_response
                                                 ) runs on ImsComponent {
            f_setHeaders_REGISTER(p_cSeq_s);
            f_SendREGISTER(p_register);
            tc_ack.start;
            alt {
                [] SIPP.receive(p_response) {
                    tc_ack.stop;
                }
                [] tc_ack.timeout {
                    f_setVerdict(e_timeout); 
                }
            }

        } // End of function f_sendRegistrationAndAwait200Ok

        /**
         * @desc function send OPTIONS message
         * @param p_request template of the message to be sent
         */
        function f_SendOPTIONS(
            template(value) OPTIONS_Request p_request
        ) runs on SipComponent  {
            SIPP.send(p_request) to vc_sent_label;
        }
Axel Rennoch's avatar
Axel Rennoch committed
			/**
			 * @desc setting of general and basic OPTIONS header fields in additon to the addresses (To, From, ReqUri)
			 * @param p_cSeq_s
			 */
			function f_setHeadersOPTIONS(
				inout CSeq p_cSeq_s
			) runs on SipComponent  {
				f_setHeadersGeneral(p_cSeq_s, "OPTIONS"); // cseq, contact, branch, via
				vc_callId := {
					fieldName := CALL_ID_E,
					callid := f_getRndCallId() & c_AT & vc_userprofile.currIpaddr
				};

				vc_cancel_To := vc_to;
				vc_caller_To := vc_to;

				vc_caller_From := vc_from;

				if (ischosen(vc_requestUri.components.sip)) {
					// sip/sips call
					vc_reqHostPort := vc_requestUri.components.sip.hostPort;
				}
				else if (ischosen(vc_requestUri.components.urn)) {
					// Emergency call
					vc_reqUrnUri := vc_requestUri.components.urn;
				}
				else {
					log("*** " & __SCOPE__ &": INFO:f_setHeadersOPTIONS: unsupported field: ", vc_requestUri," ***");
					setverdict(fail);
				}
			}

Steffen Ludtke's avatar
Steffen Ludtke committed
    } // End of group helpers

} // End of module AtsSccas_TCFunctions