From 07acfe8db5674fd9a379edc20d9c5750e97858fc Mon Sep 17 00:00:00 2001 From: pintar Date: Mon, 14 Oct 2013 10:19:19 +0000 Subject: [PATCH] Changes done due to validation weeks 40 and 41 for STF 467 -IMS rel10 validation --- ttcn/LibIms_Steps.ttcn | 331 +++++++++++++++++++++++++++++-------- ttcn/LibIms_Templates.ttcn | 57 ++++++- 2 files changed, 314 insertions(+), 74 deletions(-) diff --git a/ttcn/LibIms_Steps.ttcn b/ttcn/LibIms_Steps.ttcn index d8d777f..46d88db 100644 --- a/ttcn/LibIms_Steps.ttcn +++ b/ttcn/LibIms_Steps.ttcn @@ -24,9 +24,70 @@ module LibIms_Steps import from LibIms_SIPTypesAndValues all; group externalfunctions { - } + }//end group externalfunctions group parameterOperations { - } + + /** + * + * @desc functions add new via parameter + * @param p_message (request) SIP message to be used to prepair via header + * @param p_userprofile user profile + */ + function f_addNewViaParameter(in Request p_message, in integer p_userprofile) runs on ImsComponent + { + var integer v_intVia; + var integer i := 0; + if (ispresent(p_message.msgHeader.via)) { + + v_intVia := sizeof(p_message.msgHeader.via.viaBody); + while (i < v_intVia) { + p_message.msgHeader.via.viaBody[v_intVia] := p_message.msgHeader.via.viaBody[v_intVia-1]; + v_intVia := v_intVia - 1; + } + vc_branch := c_branchCookie & f_getRndTag(); + p_message.msgHeader.via.viaBody[0] := valueof(m_ViaBody_currIpaddr(vc_branch, vc_userprofile)); + vc_via := p_message.msgHeader.via; + } + } + + /** + * + * @desc functions add new via parameter + * @param p_message (request) SIP message to be used to prepair via header + * @param p_userprofile user profile + */ + function f_addNewRecordRouteAndRemoveRoutParameter(in Request p_message) runs on ImsComponent + { + var integer v_intRoute,v_intRecordRoute; + var integer i := 1; + var integer j := 0; + var RouteBody v_route1; + var Route v_newRoute; + v_newRoute.fieldName := ROUTE_E; + if (ispresent(p_message.msgHeader.route)) { + + v_intRoute := sizeof(p_message.msgHeader.route.routeBody); + v_route1 := p_message.msgHeader.route.routeBody[0]; + while (i < v_intRoute) { + v_newRoute.routeBody[i-1] := p_message.msgHeader.route.routeBody[i]; + i := i + 1; + } + vc_route := v_newRoute; + } + + if (ispresent(p_message.msgHeader.recordRoute)) { + + v_intRecordRoute := sizeof(p_message.msgHeader.recordRoute.routeBody); + while (j < v_intRecordRoute) { + p_message.msgHeader.recordRoute.routeBody[v_intRecordRoute] := p_message.msgHeader.recordRoute.routeBody[v_intRecordRoute-1]; + v_intRecordRoute := v_intRecordRoute - 1; + } + p_message.msgHeader.recordRoute.routeBody[0] := v_route1; + vc_recordRoute := p_message.msgHeader.recordRoute; + } + } + }//end group parameterOperations + group fieldOperations { /* @@ -67,21 +128,30 @@ module LibIms_Steps LibSip_Steps.f_setHeadersCANCEL(p_cSeq_s); }// end f_setHeadersCANCEL - /** * * @desc sets headers for forward request from AS in case if AS acts as Proxy + * @param p_proxyMode true = proxyMode, false = B2BMode */ - function f_setHeadersForwardRequestFromAS (inout CSeq p_cSeq_s) runs on ImsComponent + function f_setHeadersForwardRequestFromAS (inout CSeq p_cSeq_s, boolean p_proxyMode) runs on ImsComponent { var Request v_request; v_request := vc_request; - vc_via := v_request.msgHeader.via; // TODO via header need to be adapted due to standards - - vc_route := v_request.msgHeader.route; // TODO route header need to be adapted due to standards - + if (p_proxyMode) + { + vc_requestUri2 := v_request.requestLine.requestUri; + vc_to := v_request.msgHeader.toField; + vc_contact := v_request.msgHeader.contact; + f_addNewViaParameter(v_request, c_userProfile_AS1); + f_addNewRecordRouteAndRemoveRoutParameter(v_request); + } + else + { //B2Bmode + vc_contact := valueof(m_Contact(m_SipUrl_contactIpaddr(vc_userprofile))); + vc_callId := { fieldName:=CALL_ID_E, callid:=f_getRndCallId(p_cSeq_s) & c_AT & vc_userprofile.currIpaddr }; + } }// end function f_setHeadersForwardRequest /** @@ -111,18 +181,18 @@ module LibIms_Steps function f_setHeadersINVITE(inout CSeq p_cSeq_s, in integer p_to_user) runs on ImsComponent { vc_to := f_initToHeader(p_to_user); // init of vc_to using userProfile identifier - + vc_from := f_initFromHeader(vc_userprofile.id, f_getRndTag()); // init of vc_from using userProfile identifier vc_requestUri := f_initSipUrl(p_to_user); // Request URI of Invite is identical with To header - + if (vc_boo_route) { vc_route := valueof(m_route_interface(vc_interfaceprofile))}; if (vc_boo_recordRoute) { vc_recordRoute := valueof(m_recordRoute_currIpAddr(vc_userprofile))}; - + LibSip_Steps.f_setHeadersINVITE(p_cSeq_s); - + }// end f_setHeadersINVITE /* @@ -266,12 +336,16 @@ module LibIms_Steps * @param p_cSeq_s current cSeq * @param p_orginatingSide true in case of Re-INVITE is send from the orgination endpoint otherwise false. */ - function f_setHeadersReINVITE (inout CSeq p_cSeq_s, in boolean p_orginatingSide) runs on ImsComponent + function f_setHeadersReINVITE (inout CSeq p_cSeq_s, in boolean p_orginatingSide, in integer p_to_user) runs on ImsComponent { + var integer v_tmp; + f_setHeadersGeneral(p_cSeq_s, "INVITE"); // cseq, contact, branch, via - vc_reqHostPort := vc_requestUri.components.sip.hostPort; - + vc_reqHostPort := vc_requestUri.components.sip.hostPort; + + vc_requestUri := f_initSipUrl(p_to_user); + if(p_orginatingSide) { vc_to := vc_caller_To; vc_from := vc_caller_From; @@ -279,7 +353,12 @@ module LibIms_Steps else { vc_to := vc_callee_To; vc_from := vc_callee_From; - } + } + + v_tmp := str2int(vc_sdp_local.origin.session_id); + vc_sdp_local.origin.session_id := int2str(v_tmp + 1); + v_tmp := str2int(vc_sdp_local.origin.session_version); + vc_sdp_local.origin.session_version := int2str(v_tmp + 1); }// end function f_setHeadersReINVITE @@ -693,11 +772,20 @@ module LibIms_Steps vc_userprofile.registrarDomain := PX_IMS_SUT_UE4_REGISTRAR; // Authorization } - case (c_userProfile_AS1) { //variant c_userProfile_AS1 - vc_userprofile.currPort := PX_IMS_TS_AS1_PORT; // via, route(Isc interface of TS) - vc_userprofile.currIpaddr := PX_IMS_TS_AS1_IPADDR; // via, route - vc_userprofile.homeDomain := PX_IMS_TS_AS1_HOME_DOMAIN; // via, route - } + case (c_userProfile_AS1) { //variant c_userProfile_AS1 + vc_userprofile.currPort := PX_IMS_TS_AS1_PORT; // via, route(Isc interface of TS) + vc_userprofile.currIpaddr := PX_IMS_TS_AS1_IPADDR; // via, route + vc_userprofile.contactPort := PX_IMS_TS_AS1_PORT; // contact (simulated UE) + vc_userprofile.contactIpaddr := PX_IMS_TS_AS1_IPADDR; // contact + vc_userprofile.bearerIpaddr := PX_IMS_SUT_UE1_BEARER_IPADDR; + vc_userprofile.homeDomain := PX_IMS_TS_AS1_HOME_DOMAIN; // via, routevc_userprofile.publUsername := PX_IMS_SUT_UE4_PUBLIC_USER; // From, To (register) + vc_userprofile.publUsername := "as1"; + vc_userprofile.qop := ""; // Authorization + vc_userprofile.privUsername := ""; // Authorization + vc_userprofile.passwd := ""; // Authorization + vc_userprofile.registrarDomain := ""; // Authorization + + } case (c_userProfile_AS2) { //variant c_userProfile_AS2 vc_userprofile.currPort := PX_IMS_TS_AS2_PORT; // via, route(Isc interface of TS) @@ -753,96 +841,104 @@ module LibIms_Steps function f_initSipUrl(in integer p_user) runs on ImsComponent return SipUrl { - var SipUrl p_sipUrl := { + var SipUrl v_sipUrl := { scheme := c_sipScheme, // contains "sip" components := { sip:= { - userInfo := omit, - hostPort := {omit,omit}}}, + userInfo := omit, + hostPort := {omit,omit}}}, + urlParameters := omit, + headers := omit}; + + var SipUrl v_urnUrl := { + scheme := c_urnScheme, // contains "urn" + components := { urn:= { + namespaceId := "service", + namespaceSpecificString := "sos"}}, urlParameters := omit, headers := omit}; select(p_user){ case (c_userProfile_UE1atSUThome) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_UE1_PUBLIC_USER, password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_UE1_HOME_DOMAIN, portField :=omit} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_UE1_PUBLIC_USER, password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_UE1_HOME_DOMAIN, portField :=omit} } case (c_userProfile_UE2atSUThome) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_UE2_PUBLIC_USER, password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_UE2_HOME_DOMAIN, portField :=omit} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_UE2_PUBLIC_USER, password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_UE2_HOME_DOMAIN, portField :=omit} } case (c_userProfile_UE3atSUThome) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_UE3_PUBLIC_USER, password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_UE3_HOME_DOMAIN, portField :=omit} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_UE3_PUBLIC_USER, password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_UE3_HOME_DOMAIN, portField :=omit} } case (c_userProfile_UE4atSUThome) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_UE4_PUBLIC_USER, password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_UE4_HOME_DOMAIN, portField :=omit} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_UE4_PUBLIC_USER, password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_UE4_HOME_DOMAIN, portField :=omit} } case (c_userProfile_IBCFwithHomeUE) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_TS_IMS1UE_PUBLIC_USER, password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_IMS1UE_HOME_DOMAIN, portField :=omit} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_TS_IMS1UE_PUBLIC_USER, password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_IMS1UE_HOME_DOMAIN, portField :=omit} } case (c_userProfile_ICSCFwithHomeUE) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_TS_IMS1UE_PUBLIC_USER, password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_IMS1UE_HOME_DOMAIN, portField :=omit} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_TS_IMS1UE_PUBLIC_USER, password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_IMS1UE_HOME_DOMAIN, portField :=omit} } case (c_userProfile_PCSCFwithHomeUE) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_TS_IMS1UE_PUBLIC_USER, password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_PCSCF_IPADDR, portField :=omit} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_TS_IMS1UE_PUBLIC_USER, password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_PCSCF_IPADDR, portField :=omit} } case (c_userProfile_SCSCFwithHomeUE) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_UE4_PUBLIC_USER, password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_SCSCF_HOME_DOMAIN, portField :=PX_IMS_TS_SCSCF_PORT} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_UE4_PUBLIC_USER, password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_SCSCF_HOME_DOMAIN, portField :=PX_IMS_TS_SCSCF_PORT} } case (c_userProfile_SCSCFwithHomeUE_domain) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_UE4_PUBLIC_USER, password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_SCSCF_HOME_DOMAIN, portField :=omit} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_UE4_PUBLIC_USER, password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_SCSCF_HOME_DOMAIN, portField :=omit} } case (c_userProfile_AS1) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_TS_IMS1UE_PUBLIC_USER, password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_AS1_IPADDR, portField :=omit} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_TS_IMS1UE_PUBLIC_USER, password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_AS1_IPADDR, portField :=omit} } case (c_userProfile_ECSCFwithHomeUE) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_TS_IMS1UE_PUBLIC_USER, password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_ECSCF_IPADDR, portField :=omit} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_TS_IMS1UE_PUBLIC_USER, password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_ECSCF_IPADDR, portField :=omit} } case (c_userProfile_ISUP) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_TS_ISUP_PUBLIC_USER, password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_ISUP_HOME_DOMAIN, portField :=omit} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_TS_ISUP_PUBLIC_USER, password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_TS_ISUP_HOME_DOMAIN, portField :=omit} } case (c_serviceProfile_EMERGENCY) { - p_sipUrl.scheme := c_urnScheme; - p_sipUrl.components.urn.namespaceId := PX_IMS_SUT_EMERGENCY_SERVICE_namespaceId; - p_sipUrl.components.urn.namespaceId := PX_IMS_SUT_EMERGENCY_SERVICE_namespaceSpecificString; - //p_sipUrl.hostPort := {host := PX_IMS_SUT_EMERGENCY_HOME_DOMAIN, portField :=omit} + v_urnUrl.components.urn.namespaceId := PX_IMS_SUT_EMERGENCY_SERVICE_namespaceId; + v_urnUrl.components.urn.namespaceSpecificString := PX_IMS_SUT_EMERGENCY_SERVICE_namespaceSpecificString; } case (c_serviceProfile_EMERGENCY_INVALID) { - p_sipUrl.scheme := c_urnScheme; - p_sipUrl.components.urn.namespaceId := PX_IMS_SUT_EMERGENCY_SERVICE_INVALID_namespaceId; - p_sipUrl.components.urn.namespaceId := PX_IMS_SUT_EMERGENCY_SERVICE_INVALID_namespaceSpecificString; + v_urnUrl.components.urn.namespaceId := PX_IMS_SUT_EMERGENCY_SERVICE_INVALID_namespaceId; + v_urnUrl.components.urn.namespaceSpecificString := PX_IMS_SUT_EMERGENCY_SERVICE_INVALID_namespaceSpecificString; } // following setting is used for the assignment of the Path header field case (c_interfaceProfile_IMS_SUT_PCSCF1) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:="", password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_PCSCF1_HOME_DOMAIN, portField :=PX_IMS_SUT_PCSCF1_PORT} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:="", password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_PCSCF1_HOME_DOMAIN, portField :=PX_IMS_SUT_PCSCF1_PORT} } // following setting is used in relation to the route headers list elements case (c_interfaceSIPURL_IMS_SUT_PCSCF1_domain) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:="", password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_PCSCF1_HOME_DOMAIN, portField :=PX_IMS_SUT_PCSCF1_PORT} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:="", password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_PCSCF1_HOME_DOMAIN, portField :=PX_IMS_SUT_PCSCF1_PORT} } case (c_interfaceSIPURL_IMS_SUT_PCSCF1_ip) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:="", password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_PCSCF1_IPADDR, portField :=PX_IMS_SUT_PCSCF1_PORT} + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:="", password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_PCSCF1_IPADDR, portField :=PX_IMS_SUT_PCSCF1_PORT} } case (c_conferenceProfile_factoryURI) { - p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_CONF_FACTORY_NAME, password:=omit}; - p_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_CONF_HOME_DOMAIN, portField := omit} - } + v_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_CONF_FACTORY_NAME, password:=omit}; + v_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_CONF_HOME_DOMAIN, portField := omit} + } }; - return(p_sipUrl) + if(p_user == c_serviceProfile_EMERGENCY or p_user == c_serviceProfile_EMERGENCY_INVALID) + {return(v_urnUrl)} + else + {return(v_sipUrl)} } @@ -901,7 +997,18 @@ module LibIms_Steps vc_interfaceprofile.SUTHomeDomain := PX_IMS_SUT_AS_HOME_DOMAIN; } } - } + } + + /* + * + * @desc retrieves user DomainPort value of the interface profile + * @param p_interface identifies the selected interface + * @return DomainPort template + */ + function f_get_userDomainPort (in SipUserProfile p_userProfile) runs on ImsComponent return /*template*/ HostPort + { + return {p_userProfile.homeDomain, p_userProfile.currPort} + } /* * @@ -1151,9 +1258,10 @@ module LibIms_Steps * @param p_cSeq_s cseq parameter * @param p_register register template */ - function f_IMS_preamble_withRegistration (in integer p_userprofile, inout CSeq p_cSeq_s, template REGISTER_Request p_register) runs on ImsComponent + function f_IMS_preamble_withRegistration (in integer p_userprofile, in integer p_interface, inout CSeq p_cSeq_s, template REGISTER_Request p_register) runs on ImsComponent { - + + f_init_interfaceprofile(p_interface); //Variables & defaults initialization f_IMS_preamble_woRegistration(p_userprofile, p_cSeq_s); @@ -1175,9 +1283,9 @@ module LibIms_Steps * @param p_userprofile user profile of call * @param p_cSeq_s cseq parameter */ - function f_IMS_preamble_withRegistrationBasic (in integer p_userprofile, inout CSeq p_cSeq_s) runs on ImsComponent + function f_IMS_preamble_withRegistrationBasic (in integer p_userprofile,in integer p_interface, inout CSeq p_cSeq_s) runs on ImsComponent { - + f_init_interfaceprofile(p_interface); //Variables & defaults initialization f_IMS_preamble_woRegistration(p_userprofile, p_cSeq_s); @@ -1185,7 +1293,33 @@ module LibIms_Steps f_Registration_IMS(p_cSeq_s, PX_SIP_REGISTER_AUTHENTICATION_ENABLED); f_setHeaders_SUBSCRIBE(p_cSeq_s); f_Subscription(p_cSeq_s, m_SUBSCRIBE_Request_UE(vc_requestUri, vc_callId, p_cSeq_s, vc_from, vc_to, vc_via, vc_contact, vc_route_REG)); - } + } + + /* + * + * @desc Sets variables and default initialization for user profile and handle registration and authentication with MD5 + * (basic registration template) + * @param p_userprofile user profile of call + * @param p_cSeq_s cseq parameter + */ + function f_IMS_preamble_AS (in integer p_userprofile, in integer p_interface, inout CSeq p_cSeq_s) runs on ImsComponent + { + // avoid deregistration in default behavior + vc_DeregDone := true; + vc_boo_route := true; + vc_boo_recordRoute := true; + vc_cSeq := p_cSeq_s; + + //Defaults + vc_def_catchSyncStop := activate(a_Sip_catchSyncStop()); + vc_default := activate (a_altstep_AS()); + + //Preamble + f_init_interfaceprofile(p_interface); + f_init_userprofile(p_userprofile); // assignment of PIXIT values to component variable + vc_sdp_local := valueof(m_SDP_bandwidth(valueof(m_media_dynPT(PX_SIP_SDP_dyn, PX_SIP_SDP_encoding)), vc_userprofile)); + vc_contact := valueof(m_Contact(m_SipUrl_contactIpaddr(vc_userprofile))); + } } // end group preambles @@ -1201,6 +1335,18 @@ module LibIms_Steps f_terminate_component(); } + + /* + * + * @desc Sets variables and default initialization for user profile and handle deregistration on AS as TS + * @param p_cSeq_s cseq parameter + */ + function f_IMS_postamble_AS_withDeRegistration (boolean p_deRegistration) runs on ImsComponent { + + if(p_deRegistration == true) + {f_awaitingREGISTER_sendReply(mw_REGISTER_Request_Base,true);} + f_terminate_component(); + } function f_SIP_postamble_IMS1_withoutRegistration () runs on ImsComponent {f_terminate_component()}; @@ -1556,5 +1702,48 @@ module LibIms_Steps f_componentStop(); } } + + /** + * + * @desc main default altstep to handle unexpected messages and timeout + * @verdict fail for all unexpected branches + */ + altstep a_altstep_AS() runs on SipComponent + { + var Response v_response; + var Request v_request; + + [] any timer.timeout + { + setverdict(fail); + all timer.stop; + } + + // allow repeated INVITEs + [vc_ignore_invite] SIPP.receive(mw_INVITE_Request_Base) + { + repeat + } + //handle REGISTER requests + [] SIPP.receive(mw_REGISTER_Request_Base)-> value v_request sender vc_sent_label + { + f_setHeadersOnReceiptOfREGISTER(v_request); + //vc_contact := vc_request.msgHeader.contact; + f_sendResponse(m_Response_Contact(c_statusLine200,vc_callId, vc_cSeq,vc_caller_From, vc_caller_To, vc_via, vc_contact)); + repeat; + } + + // according to SIP chap.8.1.3.2 + [] SIPP.receive(mw_Response_Base(c_statusLine183,vc_callId, vc_cSeq)) + { + repeat; + } + // any + [] SIPP.receive + { + setverdict(fail); + all timer.stop; + } + } } } // module LibIms_Steps \ No newline at end of file diff --git a/ttcn/LibIms_Templates.ttcn b/ttcn/LibIms_Templates.ttcn index da7049c..6fbeacf 100644 --- a/ttcn/LibIms_Templates.ttcn +++ b/ttcn/LibIms_Templates.ttcn @@ -245,6 +245,14 @@ group HeaderFieldTemplates{ {id:=c_orig_ioi, paramValue := p_homeDomain}} }; + template PChargingVector m_pChargingVector_accessNetwInfo(charstring p_homeDomain) := + { + fieldName := P_CHARGING_VECTOR_E, + chargeParams := {{id:=c_icid, paramValue :=c_icid_value}, + {id:=c_term_ioi, paramValue := p_homeDomain}, + {id:=c_access_network_charging_info, paramValue := "192.1.1.10"}} + }; + template PChargingVector mw_pChargingVector(template charstring p_id, template charstring p_paramValue) := { fieldName := P_CHARGING_VECTOR_E, @@ -453,8 +461,8 @@ group HeaderFieldTemplates{ template SemicolonParam_List mw_challenge := superset(mw_ck,mw_ik); // template SemicolonParam_List mw_challenge := {mw_ck,mw_ik}; - template GenericParam mw_ck := {"ck",*}; - template GenericParam mw_ik := {"ik",*} + template GenericParam mw_ck := {"ck"}; + template GenericParam mw_ik := {"ik"} /* @@ -1310,7 +1318,16 @@ group MessageTemplates { group modified_templates { group request_send { - + + template ACK_Request m_ACK_Request_AS (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, + From p_from, To p_to, Via p_via, template Route p_route, template RecordRoute p_recordRoute ) modifies m_ACK_Request_Base := + { + msgHeader := + { + route := p_route, + recordRoute := p_recordRoute + } + } template ACK_Request m_ACK_Request_IMS (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, From p_from, To p_to, Via p_via, template Route p_route) modifies m_ACK_Request_Base := @@ -1321,6 +1338,20 @@ group request_send { } } + template ACK_Request m_ACK_Request_sdp_IMS (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, + From p_from, To p_to, Via p_via,template MessageBody p_mb, template Route p_route) + modifies m_ACK_Request_Base + := + { + msgHeader := + { + contentLength := {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))}, + contentType := {fieldName := CONTENT_TYPE_E, mediaType := c_sdpAplication}, + route := p_route + }, + messageBody := p_mb + } + template BYE_Request m_BYE_Request_IMS ( SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, From p_from, To p_to, Via p_via, template Route p_route) @@ -2823,6 +2854,16 @@ group response_send rSeq := {fieldName:=RSEQ_E, responseNum:= 9999}//Ref: ES 283 003 V2.5.1 ch:A.2.1.4.7 }, messageBody := p_mb + } + + template Response m_Response_18XonINVITE_AS (StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq, + From p_from, To p_to, Via p_via, Contact p_contact, template RecordRoute p_recordRoute ) modifies m_Response_Base:= + { + msgHeader := + { + contact := p_contact, + recordRoute := p_recordRoute + } } template Response m_Response_18XonINVITE_UE (StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq, @@ -3539,6 +3580,16 @@ group response_receive } } + template Response mw_Response_PchargingFunctionAddr(template StatusLine p_statusLine, template CallId p_callId, + template CSeq p_cSeq, template PChargingFunctionAddresses p_chargingFunctionAddresses) modifies mw_Response_Base:= + { + statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?}, + msgHeader := + { + pChargingFunctionAddresses := p_chargingFunctionAddresses + } + } + } // end response_receive }//end modified_templates -- GitLab