Commit 01b03bef authored by tepelmann's avatar tepelmann
Browse files

Added template restrictions.

Fixed templates:
- unused parameters are used now
- started to analyze and refactor using "modifies"
- removed an (invalid) UPDATE send template
Fixed usage of sizeof, valueof, ispresent.
Introduced new templates for fields.
parent 8ccbdb6a
Loading
Loading
Loading
Loading
+43 −43
Original line number Diff line number Diff line
@@ -39,13 +39,13 @@ module LibIms_Steps
          var integer i := 0;
          if (ispresent(p_message.msgHeader.via)) {          

            v_intVia := sizeof(p_message.msgHeader.via.viaBody);
            v_intVia := lengthof(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));
            p_message.msgHeader.via.viaBody[0] := m_ViaBody_currIpaddr(vc_branch, vc_userprofile);
            vc_via := p_message.msgHeader.via;
          }
        }
@@ -66,7 +66,7 @@ module LibIms_Steps
         v_newRoute.fieldName := ROUTE_E;
         if (ispresent(p_message.msgHeader.route)) {          

           v_intRoute := sizeof(p_message.msgHeader.route.routeBody);
           v_intRoute := lengthof(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];
@@ -75,15 +75,15 @@ module LibIms_Steps
           vc_route := v_newRoute;
         }
         
         if (ispresent(p_message.msgHeader.recordRoute)) {          
         if (isvalue(p_message.msgHeader.recordRoute)) {          

           v_intRecordRoute := sizeof(p_message.msgHeader.recordRoute.routeBody);
           v_intRecordRoute := lengthof(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;
           vc_recordRoute := valueof(p_message.msgHeader.recordRoute);
         }
       }

@@ -100,13 +100,13 @@ module LibIms_Steps
        var integer i := 1;
        var integer j := 0;

        v_intRecordRoute := sizeof(p_rr.routeBody);
        v_intRecordRoute := lengthof(p_rr.routeBody);
         if (v_intRecordRoute>0){
          while (j < v_intRecordRoute) {
              p_rr.routeBody[v_intRecordRoute] := p_rr.routeBody[v_intRecordRoute-1];
              v_intRecordRoute := v_intRecordRoute - 1;
          }
          p_rr.routeBody[0] := valueof(m_routeBody_currIpAddr(vc_userprofile));
          p_rr.routeBody[0] := m_routeBody_currIpAddr(vc_userprofile);
          vc_recordRoute := p_rr;
          return vc_recordRoute;
         }
@@ -176,7 +176,7 @@ module LibIms_Steps
    		}
    		else
			{	//B2Bmode
    			vc_contact := valueof(m_Contact(m_SipUrl_contactIpaddr(vc_userprofile)));
    			vc_contact := 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
@@ -192,8 +192,8 @@ module LibIms_Steps
			
			vc_via:= v_response.msgHeader.via; // TODO via header need to be adapted due to standards
			
			if (ispresent(v_response.msgHeader.recordRoute)) {
			vc_recordRoute:= v_response.msgHeader.recordRoute; // TODO recordRoute header need to be adapted due to standards
			if (isvalue(v_response.msgHeader.recordRoute)) {
			vc_recordRoute:= valueof(v_response.msgHeader.recordRoute); // TODO recordRoute header need to be adapted due to standards
			}
		}// end function f_setHeadersForwardResponse

@@ -214,9 +214,9 @@ module LibIms_Steps
		  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))};
		  { vc_route := m_route_interface(vc_interfaceprofile)};
		  if (vc_boo_recordRoute)
		  { vc_recordRoute := valueof(m_recordRoute_currIpAddr(vc_userprofile))};
		  { vc_recordRoute := m_recordRoute_currIpAddr(vc_userprofile)};
         
		  LibSip_Steps.f_setHeadersINVITE(p_cSeq_s);
         
@@ -239,9 +239,9 @@ module LibIms_Steps
			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))};
			{ vc_route := m_route_interface(vc_interfaceprofile)};
			if (vc_boo_recordRoute)
			{ vc_recordRoute := valueof(m_recordRoute_currIpAddr(vc_userprofile))};
			{ vc_recordRoute := m_recordRoute_currIpAddr(vc_userprofile)};
	  
			LibSip_Steps.f_setHeadersUPDATE(p_cSeq_s);
		  
@@ -282,7 +282,7 @@ module LibIms_Steps
				vc_branch := c_branchCookie & f_getRndTag();
				vc_via:={
					fieldName := VIA_E,
					viaBody 	 := {valueof(m_ViaBody_virtual_XCSCF(vc_branch, vc_userprofile))}
					viaBody 	 := {m_ViaBody_virtual_XCSCF(vc_branch, vc_userprofile)}
				};
				
				vc_to := f_initToHeader(p_to_user); // init of vc_to using userProfile identifier
@@ -292,7 +292,7 @@ module LibIms_Steps
				vc_requestUri := f_initSipUrl(p_to_user); // Request URI of Invite is identical with To header
				
				//contact header initialization for sending of NOTIFY from CSCF component
				vc_contact := valueof(m_Contact(m_SipUrl_currIpaddr_CSCF(vc_userprofile)));
				vc_contact := m_Contact(m_SipUrl_currIpaddr_CSCF(vc_userprofile));
	  
		}// end f_setHeadersNOTIFY

@@ -311,7 +311,7 @@ module LibIms_Steps
				vc_branch := c_branchCookie & f_getRndTag();
				vc_via:={
					fieldName := VIA_E,
					viaBody 	 := {valueof(m_ViaBody_virtual_XCSCF(vc_branch, vc_userprofile))}
					viaBody 	 := {m_ViaBody_virtual_XCSCF(vc_branch, vc_userprofile)}
				};
		
				vc_to := f_initToHeader(p_to_user); // init of vc_to using userProfile identifier
@@ -321,12 +321,12 @@ module LibIms_Steps
				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))};
				{ vc_route := m_route_interface(vc_interfaceprofile)};
				if (vc_boo_recordRoute)
				{ vc_recordRoute := valueof(m_recordRoute_currIpAddr(vc_userprofile))};
				{ vc_recordRoute := m_recordRoute_currIpAddr(vc_userprofile)};
				
				//contact header initialization for sending of PUBLISH from CSCF component
				vc_contact := valueof(m_Contact(m_SipUrl_currIpaddr_CSCF(vc_userprofile)));
				vc_contact := m_Contact(m_SipUrl_currIpaddr_CSCF(vc_userprofile));
  
			}// end f_setHeadersPUBLISH
		
@@ -385,10 +385,10 @@ module LibIms_Steps
			
			//get route from previous ACK request
			//          Route Management
              if (ispresent(v_request.msgHeader.recordRoute))
              if (isvalue(v_request.msgHeader.recordRoute))
              {
                vc_recordRoute := v_request.msgHeader.recordRoute;
                v_nbroute := sizeof(vc_recordRoute.routeBody);
                vc_recordRoute := valueof(v_request.msgHeader.recordRoute);
                v_nbroute := lengthof(vc_recordRoute.routeBody);
                // copy and reverse the order of the routes in route header
                for (v_i:=0; v_i<=(v_nbroute - 1); v_i:=v_i+1)
                {
@@ -433,15 +433,15 @@ module LibIms_Steps
	  p_cSeq_s.method    := p_method ;
	  vc_cSeq := p_cSeq_s;
      
	  vc_contact := valueof(m_Contact(m_SipUrl_contactIpaddr(vc_userprofile)));
	  vc_contact := m_Contact(m_SipUrl_contactIpaddr(vc_userprofile));

	  vc_branch := c_branchCookie & f_getRndTag();
	  vc_branch_ICSCF := c_branchCookie & f_getRndTag();

	  vc_via:={
		fieldName := VIA_E,
		viaBody 	 := {valueof(m_ViaBody_currIpaddr(vc_branch, vc_userprofile)),
						 valueof(m_ViaBody_virtualUEinPCSCF(vc_branch_ICSCF, vc_userprofile))
		viaBody 	 := {m_ViaBody_currIpaddr(vc_branch, vc_userprofile),
						 m_ViaBody_virtualUEinPCSCF(vc_branch_ICSCF, vc_userprofile)
						 }
	  };
	}// end function f_setHeadersGeneral_ICSCF
@@ -473,7 +473,7 @@ module LibIms_Steps
	  vc_callId := { fieldName:=CALL_ID_E, callid:=f_getRndCallId(p_cSeq_s) & c_AT & vc_userprofile.currIpaddr };
	  vc_callIdReg := vc_callId;
      
	  vc_to := valueof(m_To(m_SipUrl_currDomain(vc_userprofile)));
	  vc_to := m_To(m_SipUrl_currDomain(vc_userprofile));
	  v_params := {{id:=c_tagId, paramValue:=f_getRndTag()}}
	  vc_from := {fieldName := FROM_E,
		addressField :=vc_to.addressField,
@@ -515,9 +515,9 @@ module LibIms_Steps
		  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))};
		  { vc_route := m_route_interface(vc_interfaceprofile)};
		  if (vc_boo_recordRoute)
		  { vc_recordRoute := valueof(m_recordRoute_currIpAddr(vc_userprofile))};
		  { vc_recordRoute := m_recordRoute_currIpAddr(vc_userprofile)};
		  
		  LibSip_Steps.f_setHeadersREFER(p_cSeq_s);
		  
@@ -547,10 +547,10 @@ module LibIms_Steps
		  vc_requestUri := p_uri; // Request URI of Invite is identical with To header
      
		  if (vc_boo_route) { 
		  	vc_route := valueof(m_route_interface(vc_interfaceprofile))
		  	vc_route := m_route_interface(vc_interfaceprofile)
		  };
		  if (vc_boo_recordRoute) { 
		  	vc_recordRoute := valueof(m_recordRoute_currIpAddr(vc_userprofile))
		  	vc_recordRoute := m_recordRoute_currIpAddr(vc_userprofile)
		  };
		  
		  LibSip_Steps.f_setHeadersREFER(p_cSeq_s);
@@ -1328,8 +1328,8 @@ module LibIms_Steps

			//Preamble
			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)));
			vc_sdp_local := m_SDP_bandwidth(m_media_dynPT(PX_SIP_SDP_dyn, PX_SIP_SDP_encoding), vc_userprofile);
			vc_contact := m_Contact(m_SipUrl_contactIpaddr(vc_userprofile));
		}

    //TODO STF471 added
@@ -1351,7 +1351,7 @@ module LibIms_Steps

      //Preamble
      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_sdp_local := m_SDP_bandwidth(m_media_dynPT(PX_SIP_SDP_dyn, PX_SIP_SDP_encoding), vc_userprofile);
    }

		/*
@@ -1442,8 +1442,8 @@ module LibIms_Steps
            //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)));
            vc_sdp_local := m_SDP_bandwidth(m_media_dynPT(PX_SIP_SDP_dyn, PX_SIP_SDP_encoding), vc_userprofile);
            vc_contact := m_Contact(m_SipUrl_contactIpaddr(vc_userprofile));
        }			
		
	} // end group preambles
@@ -1572,11 +1572,11 @@ module LibIms_Steps
		 * @param p_reqHostPort parameter for outgoing BYE
		 */
		function f_terminateCall_IMS(SipUrl p_requestUri, CallId p_CallId, inout CSeq p_cSeq, From p_from,
		  template To p_to) runs on ImsComponent
		  template(value) To p_to) runs on ImsComponent
		{
          LibSip_Steps.f_setHeadersBYE(p_cSeq);
		  // Sending of a BYE request to release the call and expect a final response
		  f_SendBYE(m_BYE_Request_IMS(p_requestUri, p_CallId, p_cSeq, p_from, valueof(p_to), vc_via, vc_route));
		  f_SendBYE(m_BYE_Request_IMS(p_requestUri, p_CallId, p_cSeq, p_from, p_to, vc_via, vc_route));
      
		  tc_resp.start(PX_SIP_TRESP);
		  alt
@@ -1604,11 +1604,11 @@ module LibIms_Steps
		 * @param p_reqHostPort parameter for outgoing BYE
		 */
		function f_terminateCall_UE(SipUrl p_requestUri, CallId p_CallId, inout CSeq p_cSeq, From p_from,
		  template To p_to) runs on ImsComponent
		  template(value) To p_to) runs on ImsComponent
		{
		  LibSip_Steps.f_setHeadersBYE(p_cSeq);
		  // Sending of a BYE request to release the call and expect a final response
		  f_SendBYE(m_BYE_Request_UE(p_requestUri, p_CallId, p_cSeq, p_from, valueof(p_to), vc_via, vc_route));
		  f_SendBYE(m_BYE_Request_UE(p_requestUri, p_CallId, p_cSeq, p_from, p_to, vc_via, vc_route));
      
		  tc_resp.start(PX_SIP_TRESP);
		  alt
@@ -1636,11 +1636,11 @@ module LibIms_Steps
         * @param p_reqHostPort parameter for outgoing BYE
         */
        function f_terminateCall_UE_withDeReg(SipUrl p_requestUri, CallId p_CallId, inout CSeq p_cSeq, From p_from,
          template To p_to) runs on ImsComponent
          template(value) To p_to) runs on ImsComponent
        {
          LibSip_Steps.f_setHeadersBYE(p_cSeq);
          // Sending of a BYE request to release the call and expect a final response
          f_SendBYE(m_BYE_Request_UE(p_requestUri, p_CallId, p_cSeq, p_from, valueof(p_to), vc_via, vc_route));
          f_SendBYE(m_BYE_Request_UE(p_requestUri, p_CallId, p_cSeq, p_from, p_to, vc_via, vc_route));
      
          tc_resp.start(PX_SIP_TRESP);
          alt
+1797 −1779

File changed.

Preview size limit exceeded, changes collapsed.