Commit 5c2c2f25 authored by garciay's avatar garciay
Browse files

Merge code with STF467

parent d7eae644
Loading
Loading
Loading
Loading
+79 −8
Original line number Original line Diff line number Diff line
@@ -50,6 +50,26 @@ module LibIms_Steps
          }
          }
        }
        }
        
        
        /**
         ** @desc functions remove own via parameter
         * @param p_message (request) SIP message to be used to prepair via header
         * @param p_userprofile user profile
         */
        function f_removeOwnViaParameter(in Response p_message) runs on ImsComponent {
            var integer v_intVia;
            var Via v_via := c_empty_Via;
         
            if (ispresent(p_message.msgHeader.via)) {          

                v_intVia := sizeof(p_message.msgHeader.via.viaBody)-1;
           
                for (var integer i := 0; i < v_intVia; i := i + 1) {
                    v_via.viaBody[i] := p_message.msgHeader.via.viaBody[i+1]; 
                }
                vc_via := v_via;
            }
        }
        
       /**
       /**
        * 
        * 
        * @desc functions add new via parameter
        * @desc functions add new via parameter
@@ -189,11 +209,14 @@ module LibIms_Steps
			var Response v_response;
			var Response v_response;
			v_response := vc_response;
			v_response := vc_response;
			
			
			vc_via:= v_response.msgHeader.via; // TODO via header need to be adapted due to standards
           vc_caller_To := v_response.msgHeader.toField;
            vc_to := v_response.msgHeader.toField;
            vc_contact := v_response.msgHeader.contact;
			
			
			if (isvalue(v_response.msgHeader.recordRoute)) {
			if (ispresent(v_response.msgHeader.recordRoute)) {
			vc_recordRoute:= valueof(v_response.msgHeader.recordRoute); // TODO recordRoute header need to be adapted due to standards
				vc_recordRoute:= v_response.msgHeader.recordRoute;
			}
			}
            f_removeOwnViaParameter(v_response);
		}// end function f_setHeadersForwardResponse
		}// end function f_setHeadersForwardResponse


		/*
		/*
@@ -917,7 +940,7 @@ module LibIms_Steps
				scheme := c_urnScheme,  			// contains "urn"
				scheme := c_urnScheme,  			// contains "urn"
                components := { urn:= {
                components := { urn:= {
                        				namespaceId := "service",
                        				namespaceId := "service",
                    					namespaceSpecificString := "sos"}},
                    					namespaceSpecificString := PX_IMS_SUT_EMERGENCY_SERVICE_namespaceSpecificString}},
				urlParameters := omit,
				urlParameters := omit,
				headers := omit};
				headers := omit};
				
				
@@ -1351,6 +1374,27 @@ module LibIms_Steps
      //Preamble
      //Preamble
      f_init_userprofile(p_userprofile); // assignment of PIXIT values to component variable
      f_init_userprofile(p_userprofile); // assignment of PIXIT values to component variable
      vc_sdp_local := valueof(m_SDP_bandwidth(m_media_dynPT(PX_SIP_SDP_dyn, PX_SIP_SDP_encoding), vc_userprofile));
      vc_sdp_local := valueof(m_SDP_bandwidth(m_media_dynPT(PX_SIP_SDP_dyn, PX_SIP_SDP_encoding), vc_userprofile));
    }

       /*
        *
        * @desc  Sets variables and default initialization for user profile and handle registration and authentication with MD5 
        * @param p_userprofile   	user profile of call
        * @param p_cSeq_s		  	cseq parameter
        * @param p_register		register template
        */
        function f_IMS_preamble_withEmergencyRegistration (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);
            //Preamble
            f_Registration(p_cSeq_s, p_register, PX_SIP_REGISTER_AUTHENTICATION_ENABLED, true);

            //	deregistration in case of successful registration
            vc_DeregDone := false;
			
        }
        }


		/*
		/*
@@ -1603,11 +1647,16 @@ module LibIms_Steps
		 * @param p_reqHostPort parameter for outgoing BYE
		 * @param p_reqHostPort parameter for outgoing BYE
		 */
		 */
		function f_terminateCall_UE(SipUrl p_requestUri, CallId p_CallId, inout CSeq p_cSeq, From p_from,
		function f_terminateCall_UE(SipUrl p_requestUri, CallId p_CallId, inout CSeq p_cSeq, From p_from,
		  template(value) To p_to) runs on ImsComponent
		  template(value) To p_to, template RecordRoute p_recordRoute := omit) runs on ImsComponent
		{
		{
		  LibSip_Steps.f_setHeadersBYE(p_cSeq);
		  LibSip_Steps.f_setHeadersBYE(p_cSeq);
		  // Sending of a BYE request to release the call and expect a final response
		  // 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, p_to, vc_via, vc_route));
		  if(ispresent(p_recordRoute)) {
		    var Route v_route := { ROUTE_E, valueof(p_recordRoute.routeBody)};
		  	f_SendBYE(m_BYE_Request_UE(p_requestUri, p_CallId, p_cSeq, p_from, valueof(p_to), vc_via, v_route));
		  } else {
		  	f_SendBYE(m_BYE_Request_UE(p_requestUri, p_CallId, p_cSeq, p_from, valueof(p_to), vc_via, vc_route));
		  }
		  
		  
		  tc_resp.start(PX_SIP_TRESP);
		  tc_resp.start(PX_SIP_TRESP);
		  alt
		  alt
@@ -1866,6 +1915,28 @@ module LibIms_Steps
            [] SIPP.receive(mw_Response_Base(c_statusLine183,vc_callId, vc_cSeq))
            [] SIPP.receive(mw_Response_Base(c_statusLine183,vc_callId, vc_cSeq))
              { 
              { 
                repeat;
                repeat;
              } 
            // unexpected CANCEL is acknowledged to avoid retransmissions
            [] SIPP.receive(mw_CANCEL_Request_Base(?))-> value v_request sender vc_sent_label
              {
                setverdict(fail);
                f_setHeadersOnReceiptOfRequest(v_request);
                f_send200OK(); 
              } 

            // unexpected BYE is acknowledged to avoid retransmissions
            [] SIPP.receive(mw_BYE_Request_Base(?))-> value v_request sender vc_sent_label
              {
                setverdict(fail);
                f_setHeadersOnReceiptOfRequest(v_request); 
                f_send200OK();
              }
  
            [] SIPP.receive(mw_Response_Base(? ,vc_callId, vc_cSeq))-> value vc_response
              { 
                log("Response matched in DEFAULT!!!");
                setverdict(fail);
                repeat;
              }
              }
			  // any	  
			  // any	  
            [] SIPP.receive
            [] SIPP.receive
+27 −4
Original line number Original line Diff line number Diff line
@@ -1304,6 +1304,28 @@ group request_send {
        messageBody := p_mb
        messageBody := p_mb
    }
    }
    
    
    template(value) ACK_Request m_ACK_Request_Mime_IMS(
                                                       template(value) SipUrl p_requestUri, template(value) CallId p_callId, template(value) CSeq p_cSeq,
                                                       template(value) From p_from, 
                                                       template(value) To p_to, 
                                                       template(value) Via p_via,
                                                       template MessageBody p_mb, 
                                                       template(omit) 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_mimeMultipart
            },
            route := p_route
        },
        messageBody := p_mb
      }

      template(value) BYE_Request m_BYE_Request_IMS(template(value) SipUrl p_requestUri,
      template(value) BYE_Request m_BYE_Request_IMS(template(value) SipUrl p_requestUri,
                                                  template(value) CallId p_callId,
                                                  template(value) CallId p_callId,
                                                  template(value) CSeq p_cSeq,
                                                  template(value) CSeq p_cSeq,
@@ -2918,10 +2940,11 @@ group response_send
     }
     }
 
 
    template(value) Response m_Response_18XonINVITE_PchargingVector (template(value) StatusLine p_statusLine, template(value) CallId p_callId, template(value) CSeq p_cSeq,
    template(value) Response m_Response_18XonINVITE_PchargingVector (template(value) StatusLine p_statusLine, template(value) CallId p_callId, template(value) CSeq p_cSeq,
          template(value) From p_from, template(value) To p_to, template(value) Via p_via, template(value) PChargingVector p_pChargingVector ) modifies m_Response_Base:=
          template(value) From p_from, template(value) To p_to, template(value) Via p_via, Contact p_contact, template(value) PChargingVector p_pChargingVector ) modifies m_Response_Base:=
    {
    {
        msgHeader :=
        msgHeader :=
        {
        {
            contact := p_contact,
            pChargingFunctionAddresses := m_pChargingFunctionAddresses_fixedValue,
            pChargingFunctionAddresses := m_pChargingFunctionAddresses_fixedValue,
            pChargingVector := p_pChargingVector
            pChargingVector := p_pChargingVector