Commit 5a64f9a9 authored by pintar's avatar pintar
Browse files

latest version from validation session week 16

parent cfdb7cc7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -13,6 +13,9 @@ module LibSip_SimpleMsgSummaryTypes language "TTCN-3:2009" { // RFC 3842
        // msg_status line	:= "Message-Waiting"
        const charstring c_messageWaiting	:= "Message-Waiting";
        
        // msg_status line	:= "Message-Account"
        const charstring c_messageAccount	:= "Message-Account";
        
        // msg_summary line	:= "Voice-Message"
        const charstring c_voiceMessage	:= "Voice-Message";
    
+33 −8
Original line number Diff line number Diff line
@@ -967,8 +967,6 @@ group SetHeaders {
	 */	
 	function f_setHeadersGeneral(inout CSeq p_cSeq_s, in charstring p_method) runs on SipComponent
	{
	  var SemicolonParam_List v_params;

	  p_cSeq_s.fieldName := CSEQ_E;
	  p_cSeq_s.seqNumber := p_cSeq_s.seqNumber + 1;
	  p_cSeq_s.method    := p_method ;
@@ -1326,12 +1324,8 @@ group SetHeaders {
	{      
			f_setHeadersGeneral(p_cSeq_s, "NOTIFY"); // cseq, contact, branch, via
			
			//after SUBSCRIBE message callid shall be same
			//vc_callId := { fieldName:=CALL_ID_E, callid:=f_getRndCallId(p_cSeq_s) & c_AT & vc_userprofile.currIpaddr };

			vc_cancel_To := vc_to;
			vc_caller_To := vc_to;
      
			vc_caller_From := vc_from;
            
			vc_reqHostPort := vc_requestUri.hostPort;
@@ -1503,6 +1497,30 @@ group SetHeaders {
      
	} // end f_setHeadersOnReceiptOfSUBSCRIBE
	
    function f_setHeadersOnReceiptOfREFER(Request p_Request)
    runs on SipComponent {

      f_setHeadersOnReceiptOfRequest(p_Request);
	
      vc_requestUri := p_Request.requestLine.requestUri;
      vc_cancel_To := p_Request.msgHeader.toField;
      
      if (ispresent(p_Request.msgHeader.contact)) {
        vc_reqHostPort := f_getContactAddr(p_Request.msgHeader.contact.contactBody.contactAddresses[0]);
        vc_requestUri := f_getContactUri(p_Request.msgHeader.contact.contactBody.contactAddresses[0]);
        }
      
      // update callee information and pick up tag if the call need to be canceled
      vc_callee_To := {fieldName := TO_E,
        addressField := vc_caller_From.addressField,
        toParams := vc_caller_From.fromParams};
      
      vc_callee_From := {fieldName := FROM_E,
        addressField := vc_caller_To.addressField,
        fromParams := vc_caller_To.toParams};
      
    } // end f_setHeadersOnReceiptOfSUBSCRIBE
   
	/**
	 * 
	 * @desc function reads all necessary headers from 
@@ -2554,6 +2572,13 @@ group AwaitingMessage {
			  tc_wait.stop;
			  f_setHeadersOnReceiptOfSUBSCRIBE(v_request);
			}
          [] SIPP.receive(mw_SUBSCRIBE_Request_Base)-> value v_request sender vc_sent_label
            {
              tc_wait.stop;
              setverdict(fail);
              f_setHeadersOnReceiptOfSUBSCRIBE(v_request);
              //f_send200OK();
            }
		}		
	}
	
@@ -3103,7 +3128,7 @@ group AwaitingMessage {
			[] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label
			  {
				tc_wait.stop;
				f_setHeadersOnReceiptOfRequest(v_MSG);
                f_setHeadersOnReceiptOfREFER(v_MSG);
			  }
		}
	} // end of f_awaitingUPDATE
@@ -3993,7 +4018,7 @@ group DefaultsTestStep
			repeat
    	}
	  	// allow 100 replies
		[] SIPP.receive(mw_Response_Base(c_statusLine100,vc_callId, vc_cSeq))
		[] SIPP.receive(mw_Response_Base(c_statusLine100,?, ?))
		  {
			repeat
		  }
+99 −7
Original line number Diff line number Diff line
@@ -53,6 +53,16 @@ module LibSip_Templates
        extension "File:../xsd/ResourceList.xsd"
    }
    
    import from http_uri_etsi_org_ngn_params_xml_comm_div_info language "XSD" all
    with {
        extension "File:../xsd/CDIVN.xsd"
    }

    import from urn_3gpp_ns_cw_1_0 language "XSD" all
        with {
            extension "File:../xsd/cw.xsd"
    }
	
	group ModuleParameters {
	
	    modulepar boolean MB_LENGTH_FROM_ENCVAL:=false; //* to get length of message body from ecoded value
@@ -969,8 +979,19 @@ module LibSip_Templates
			contactAddresses :=
			{
			  {
				addressField := ?,//MRO
				contactParams := {{"isfocus",*}}
				addressField := {
                    nameAddr := {
                        displayName := *,
                        addrSpec := {
                            scheme := ?,  
                            userInfo := *,
                            hostPort := *,
                            urlParameters := {{"isfocus",*},*},
                            headers := *
                        }
                    }
				},
				contactParams := *
			  }
			}
		  } 
@@ -2808,13 +2829,13 @@ group SimpleMsgSummary_Templates {

    template Msg_account m_msgAccount(template charstring p_uri) :=
    {
        msg_type_account := c_messageWaiting,
        msg_type_account := c_messageAccount,
        account_URI := p_uri//m_SipUrl_NumberHostParam(PX_IMS_SUT_UE2_PUBLIC_USER,PX_IMS_SUT_UE2_HOME_DOMAIN,omit)
    }

    template Msg_account mw_msgAccount :=
    {
        msg_type_account := c_messageWaiting,
        msg_type_account := c_messageAccount,
        account_URI := ?
    }
    
@@ -2867,12 +2888,12 @@ group MessageBodies {
	
	template MessageBody m_MBody_MIMESdpXml(template SDP_Message p_sdp, template XmlBody p_xmlBody):=
	{
		mimeMessageBody := {boundary:="PX_SIP_MIME_Boundary", 
		mimeMessageBody := {boundary:="--boundary1", //"PX_SIP_MIME_Boundary", 
			mimeEncapsulatedList:= {
			{content_type:="PX_SIP_SDP_ContentType", 
			{content_type:="application/sdp",//"PX_SIP_SDP_ContentType", 
				content_disposition:=omit,
				mime_encapsulated_part:={sdpMessageBody := p_sdp}},
			{content_type:="PX_SIP_ISUP_ContentType", 
			{content_type:="application/vnd.3gpp.cw+xml",//"PX_SIP_ISUP_ContentType", 
				content_disposition:=omit,
				mime_encapsulated_part:={xmlBody := p_xmlBody}}
			}
@@ -2986,6 +3007,12 @@ group TemplatePreparationFunctions {
    			v_result := f_XMLBody_Length(p_mb_par.xmlBody, USE_FX_FOR_XML_LENGTH );
    		};
    
            //  assume simpleMsgSummary_Body ONLY in the message body
            if (ischosen(p_mb_par.simpleMsgSummary))
            { 
                v_result := f_simpleMsgSummaryBody_Length(p_mb_par.simpleMsgSummary );
            };
    		
    		//  assume MIME_Message in the message body
    		if (ischosen(p_mb_par.mimeMessageBody))
    		{ 
@@ -3264,6 +3291,18 @@ group TemplatePreparationFunctions {
					v_result := f_XMLBody_Mcid_Length(p_mb.mcid);
				};
				
                //  assume CW ONLY in the XML message body
                if (ischosen(p_mb.cw))
                { 
                    v_result := f_XMLBody_Cw_Length(p_mb.cw);
                };
				
                //  assume CDIV ONLY in the XML message body
                if (ischosen(p_mb.cdivn))
                { 
                    v_result := f_XMLBody_Cdivn_Length(p_mb.cdivn);
                };
				
				//  assume PSTNTransit ONLY in the XML message body
				if (ischosen(p_mb.pstnTransit))
				{ 
@@ -3334,6 +3373,32 @@ group TemplatePreparationFunctions {
				return v_result
			} //* f_XMLBody_Mcid_Length
			
			/**
			* 
			* @desc Calculation of XML CW element length
			* @param p_mb contain XML CW body
			* @return xml_length
			*/
			function f_XMLBody_Cw_Length(Ims_cw p_mb) return integer
			{
				var integer v_result:= lengthof(encvalue(p_mb))/8;
				
				return v_result
			} //* f_XMLBody_Cw_Length
			
			/**
			* 
			* @desc Calculation of XML CDIVN element length
			* @param p_mb contain XML CDIVN body
			* @return xml_length
			*/
			function f_XMLBody_Cdivn_Length(Comm_div_info_type p_mb) return integer
			{
				var integer v_result:= lengthof(encvalue(p_mb))/8;
				
				return v_result
			} //* f_XMLBody_Cdivn_Length
			
			/**
			* 
			* @desc Calculation of XML PSTNTransit element length
@@ -3380,6 +3445,33 @@ group TemplatePreparationFunctions {
  	
  }//* group XMLlen_calculation
  
  group simpleMsgSummaryBody_Length{
  
      		function f_simpleMsgSummaryBody_Length(SimpleMsgSummary p_mb) return integer
      		{
                var integer v_result:=2; //*  due to empty line beginning of message body
                var charstring v_auxstring;
        	  	
                v_result := 2+lengthof(p_mb.msg_status_line.msg_type) + 2 + lengthof(p_mb.msg_status_line.msg_status)+c_CRlen; //*  "Message-Waiting: yes"

                if (ispresent(p_mb.msg_account)) //* "Message-Account"
                        {v_result := v_result + 2 + lengthof(p_mb.msg_account.msg_type_account)+2+lengthof(p_mb.msg_account.account_URI)+c_CRlen;};
                if (ispresent(p_mb.msg_summary_line_list)) {
                    for (var integer i:=0; i<sizeof(p_mb.msg_summary_line_list); i:=i+1)
                    {v_result := v_result + 2+c_CRlen + lengthof(p_mb.msg_summary_line_list[i].msg_context_class)+2+lengthof(p_mb.msg_summary_line_list[i].msgs); 
                    if (ispresent(p_mb.msg_summary_line_list[i].urgent_msgs)) 
                      {v_auxstring:=p_mb.msg_summary_line_list[i].urgent_msgs; v_result := v_result + 1 + lengthof(v_auxstring);};
                    };
                };
                if (ispresent(p_mb.opt_msg_headers)) {
                    for (var integer i:=0; i<sizeof(p_mb.opt_msg_headers); i:=i+1)
                    {v_result := v_result + 2+c_CRlen + lengthof(p_mb.opt_msg_headers[i]);
                    };
                };
                return v_result
      		}
  }

  group MIME_Len_calculation{
		/**
		*