Commit 1c0fbc7d authored by pintar's avatar pintar
Browse files

week5/2010 validation on STF368/369

parent de83b6b3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ module LibSip_Interface language "TTCN-3:2005"//MRO
	  var boolean 		vc_send_SDP 			:= false; 	// send SDP in the next outgoing message
	  var boolean 		vc_ignore_bye			:= false; 	// enable ignore of repeated bye in default
	  var boolean 		vc_ignore_invite		:= false; 	// enable ignore invite in default
      var boolean 		vc_ignore_subscribe		:= false; 	// enable ignore subscribe in default
	  var boolean 		vc_ignore181			:= false; 	// enable ignore of 181 in default
	  var boolean 		vc_ignore484			:= false; 	// enable ignore of 484 in default
	  var boolean 		vc_ignore4xx			:= false; 	// enable ignore of 4xx in default
+155 −51
Original line number Diff line number Diff line
@@ -2119,35 +2119,47 @@ group SDPOperations{
		var template charstring  v_mypat := pattern "[ \t]#(0,)([\d]+)*";
		var SDP_attribute_list v_mediaAttributes := {};
		//increase session version
		vc_sdp_local.origin.session_version := 	int2str(str2int(vc_sdp_local.origin.session_version)+1);
		vc_sdp_local.origin.session_version := 	int2str(str2int(vc_sdp_remote.origin.session_version)+1);
		// if more than one codec, select the firs one
		mn:= sizeof(vc_sdp_local.media_list);
		mn:= sizeof(vc_sdp_remote.media_list);
		for (i :=0;  i < mn; i := i+1)
		{
			//for every single media
			if (ispresent(vc_sdp_local.media_list[i].attributes))
			if (ispresent(vc_sdp_remote.media_list[i].attributes))
			{
				cn := sizeof(vc_sdp_local.media_list[i].attributes);
				cn := sizeof(vc_sdp_remote.media_list[i].attributes);
			};
			if (sizeof(vc_sdp_local.media_list[i].media_field.fmts)>1) 
			if (sizeof(vc_sdp_remote.media_list[i].media_field.fmts)>0) 
			{
				// select the first one
				v_PT := vc_sdp_local.media_list[i].media_field.fmts[0];
				v_PT := vc_sdp_remote.media_list[i].media_field.fmts[0];
				vc_sdp_local.media_list[i].media_field.fmts := {v_PT};
				for (j :=0; j<cn; j:=j+1)
				{
					if (ischosen(vc_sdp_local.media_list[i].attributes[j].rtpmap))
					if (ischosen(vc_sdp_remote.media_list[i].attributes[j].rtpmap))
					{
						if (v_PT == regexp(vc_sdp_local.media_list[i].attributes[j].rtpmap.attr_value,	v_mypat,	0))
						if (v_PT == regexp(vc_sdp_remote.media_list[i].attributes[j].rtpmap.attr_value,	v_mypat,	0))
						{
							v_rtpmap := vc_sdp_local.media_list[i].attributes[j].
							v_rtpmap := vc_sdp_remote.media_list[i].attributes[j].
							rtpmap.attr_value;
							v_mediaAttributes[k] := {rtpmap := {attr_value := v_rtpmap}};
							k := k+1;
						} // else line is not copied
					}
					else 
					{
						// simple copy of attribute
						v_mediaAttributes[k] := vc_sdp_remote.media_list[i].attributes[j];
						k := k+1;
					}
				}
				vc_sdp_local.media_list[i].attributes := v_mediaAttributes;
				

                if (ispresent(vc_sdp_local.media_list[i].attributes))
                {
                    cn := sizeof(vc_sdp_local.media_list[i].attributes);
                    for (j :=0; j<cn; j:=j+1)
                    {
    					 // simplified handling of status attributes (copy/keep status from peer):
                         // a) copy/keep SDP_attribute_curr (invert tags if applicable)
                         if (ischosen(vc_sdp_local.media_list[i].attributes[j].curr))
@@ -2182,16 +2194,9 @@ group SDPOperations{
                         {
                             // todo: handle SDP_attribute_conf
                         }
						
					 
					else 
					{
						// simple copy of attribute
						v_mediaAttributes[k] := vc_sdp_local.media_list[i].attributes[j];
						k := k+1;
                    }
				}
				vc_sdp_local.media_list[i].attributes := v_mediaAttributes;
                };
				
			}
		}
		// add handling of prenegotiation, change ports if required etc.
@@ -2452,6 +2457,22 @@ group SDPOperations{

group AwaitingMessage {
   
    /**
     * 
     * @desc Function for time delay 
     */
    function f_awaitingDelayTimer(float p_delay) runs on SipComponent
    {
      tc_tDelay.start(p_delay);
      alt
      {
        [] tc_tDelay.timeout
          {
            setverdict (pass);
          }
      }
    } //end f_awaitingDelayTimer
	
	/**
	 * 
	 * @desc Function waiting for any MSG -request/response 
@@ -3499,7 +3520,7 @@ group Registration {
		 * 
		 * @desc  UE send subscrbe, await on 200 OK, await notify and send 200 OK
		 * @param p_cSeq_s		cseq parameter 
		 * @param p_register	subscribe template
		 * @param p_subscribe	subscribe template
		 */
		function f_Subscription(inout CSeq p_cSeq_s,template SUBSCRIBE_Request p_subscribe) runs on SipComponent
		{
@@ -3518,7 +3539,8 @@ group Registration {
		 * 
		 * @desc  UE send subscrbe, await on 200 OK, await notify and send 200 OK
		 * @param p_cSeq_s		cseq parameter 
		 * @param p_register	subscribe template
		 * @param p_subscribe	subscribe template
		 * @param p_notify		notify template
		 */
		function f_SubscriptionWithNotification(inout CSeq p_cSeq_s, template SUBSCRIBE_Request p_subscribe, template NOTIFY_Request p_notify) runs on SipComponent
		{
@@ -3533,6 +3555,42 @@ group Registration {
	  
		}//end function f_Subscription

		/**
		 * 
		 * @desc  UE await subscrbe, send on 200 OK; possibility to handle also other SUBSCRIBE methods where event is different than reg
		 * @param p_cSeq_s		cseq parameter 
		 * @param p_subscribe	subscribe template
		 */
		function f_awaitingSubscription(inout CSeq p_cSeq_s, template SUBSCRIBE_Request p_subscribe) runs on SipComponent
		{
            var Request	v_request;
      
            tc_wait.start(2.0);//awaiting of all SUBSCRIBES
            alt
            {
              [] SIPP.receive(p_subscribe)-> value v_request sender vc_sent_label
                {
                  f_setHeadersOnReceiptOfSUBSCRIBE(v_request);
                  f_send200OK();
                  repeat;
                }
              [] SIPP.receive(mw_SUBSCRIBE_Request_Base)-> value v_request sender vc_sent_label
                {
                  f_setHeadersOnReceiptOfSUBSCRIBE(v_request);
                  f_send200OK();
                  repeat;
                }
              [] tc_wait.timeout
                {
                  setverdict(pass);
                }
                
                
            }
			//          TODO check how to solve sending of NOTIFY on SUBSCRIBE
	  
		}//end function f_awaitingSubscription

	}//end group Subscription

group Preambles {
@@ -3621,6 +3679,37 @@ group Postambles {
	  }
	}

    function f_cancelCall_await487(template CANCEL_Request p_request)
    runs on SipComponent
    {
      // This function is called to bring back the IUT in idle condition
      // in case of errors or unexpected behaviour.
      
      // Sending of a CANCEL request with the same Cseq
      f_cancelCall(p_request);
      // set method on INVITE
      vc_cSeq.method := "INVITE";
      
      //await on 487 response and send ACK
      f_awaitingResponse(mw_Response_Base(c_statusLine487, vc_callId, vc_cSeq));					
      f_SendACK(m_ACK_Request_Base(vc_requestUri, vc_callId, vc_cSeq, vc_from, vc_to, vc_via));
    }

    function f_awaitCancelCall_send487(template CANCEL_Request p_request)
    runs on SipComponent
    {
      f_awaitingCANCEL(p_request);
      f_sendResponse(m_Response_Base(c_statusLine200, vc_callId, vc_cSeq,vc_caller_From, vc_caller_To, vc_via));
      
      // set method on INVITE
      vc_cSeq.method := "INVITE";
      
      //send 487 response and await ACK
      f_sendResponse(m_Response_Base(c_statusLine487, vc_callId, vc_cSeq,vc_caller_From, vc_caller_To, vc_via));					
      // await ACK
      f_awaitingACK(mw_ACK_Request_Base(vc_callId));
    }

} // end group Postambles

group SipChecks
@@ -3903,6 +3992,21 @@ group DefaultsTestStep
			repeat
		  }
		  
		// awaiting of Notify
        [] SIPP.receive(mw_NOTIFY_Request_Base(vc_callId))->value v_request sender vc_sent_label
          { 
            f_setHeadersOnReceiptOfRequest(v_request); 
            f_send200OK();
            repeat
          }
        // awaiting of subscribe from UE
        [vc_ignore_subscribe] SIPP.receive(mw_SUBSCRIBE_Request_Base)-> value v_request sender vc_sent_label
          {
            f_setHeadersOnReceiptOfSUBSCRIBE(v_request);
            f_send200OK();
            repeat;
          }
		  
		//awaiting of subscribe on proxy
		[] SIPP.receive(mw_SUBSCRIBE_Request_Base)->value v_request sender vc_sent_label
		  { 
+24 −24
Original line number Diff line number Diff line
@@ -55,8 +55,8 @@ module LibSip_Templates
	
	group ModuleParameters {
	
	    modulepar boolean MB_LENGTH_FROM_ENCVAL:=true; //* to get length of message body from ecoded value
	    modulepar boolean USE_FX_FOR_XML_LENGTH:=true; //* To use external functions for calculation of XML message/body length
	    modulepar boolean MB_LENGTH_FROM_ENCVAL:=false; //* to get length of message body from ecoded value
	    modulepar boolean USE_FX_FOR_XML_LENGTH:=false; //* To use external functions for calculation of XML message/body length
	    
	}//* group ModuleParameters
	
@@ -543,6 +543,20 @@ module LibSip_Templates
			eventParams := omit
		};
		
        template Event m_Event_cdiv := 
        {
            fieldName := EVENT_E,
            eventType := "comm-div-info",
            eventParams := omit
        };
        
        template Event m_Event_mcid := 
        {
            fieldName := EVENT_E,
            eventType := "comm-div-info",
            eventParams := omit
        };

		template Expires m_Expires_600000 := 
		{
			fieldName := EXPIRES_E,
@@ -597,7 +611,7 @@ module LibSip_Templates
		template PAssertedID mw_PAssertedID(template PAssertedIDValue p_pAssertedIDValue) := 
		{
			fieldName := P_ASSERTED_ID_E,
			pAssertedIDValueList := {*, p_pAssertedIDValue, *}
			pAssertedIDValueList := {p_pAssertedIDValue}
		};

		template PAssertedIDValue mw_PAssertedIDValue(template SipUrl p_SipUrl) := 
@@ -3095,8 +3109,7 @@ group TemplatePreparationFunctions {
			*/
			function f_XMLBody_ConferenceInfo_Length(Conference_type p_mb) return integer
			{
				var integer v_result:=0;
				//TODO: write function body
                var integer v_result:= lengthof(encvalue(p_mb))/8;
				return v_result
			} //* f_XMLBody_ConferenceInfo_Length
			
@@ -3108,8 +3121,7 @@ group TemplatePreparationFunctions {
			*/
			function f_XMLBody_Cug_Length(Cug p_mb) return integer
			{
				var integer v_result:=0;
				//TODO: write function body
                var integer v_result:= lengthof(encvalue(p_mb))/8;
				return v_result
			} //* f_XMLBody_Cug_Length
			
@@ -3121,15 +3133,7 @@ group TemplatePreparationFunctions {
			*/
			function f_XMLBody_Mcid_Length(Mcid p_mb) return integer
			{
				var integer v_result:=0;
				
				if (ischosen(p_mb.choice.request)){
				
				}
				
				if (ischosen(p_mb.choice.response)){
				
				}
				var integer v_result:= lengthof(encvalue(p_mb))/8;
				
				return v_result
			} //* f_XMLBody_Mcid_Length
@@ -3142,8 +3146,7 @@ group TemplatePreparationFunctions {
			*/
			function f_XMLBody_PSTNTransit_Length(PSTN_transit p_mb) return integer
			{
				var integer v_result:=0;
				//TODO: write function body
                var integer v_result:= lengthof(encvalue(p_mb))/8;
				return v_result
			} //* f_XMLBody_PSTNTransit_Length
			
@@ -3153,8 +3156,7 @@ group TemplatePreparationFunctions {
			*/
			function f_XMLBody_Simservs_Length(Simservs p_mb) return integer
			{
				var integer v_result:=0;
				//TODO: write function body
                var integer v_result:= lengthof(encvalue(p_mb))/8;
				return v_result
			} //* f_XMLBody_Simservs_Length	
			
@@ -3164,8 +3166,7 @@ group TemplatePreparationFunctions {
			*/
			function f_XMLBody_ResourceList_Length(Resource_lists p_mb) return integer
			{
				var integer v_result:=0;
				//TODO: write function body
                var integer v_result:= lengthof(encvalue(p_mb))/8;
				return v_result
			} //* f_XMLBody_ResourceList_Length
			
@@ -3175,8 +3176,7 @@ group TemplatePreparationFunctions {
			*/
			function f_XMLBody_Ims3GPP_Length(TIMS3GPP p_mb) return integer
			{
				var integer v_result:=0;
				//TODO: write function body
                var integer v_result:= lengthof(encvalue(p_mb))/8;
				return v_result
			} //* f_XMLBody_Ims3GPP_Length
			
+11 −0
Original line number Diff line number Diff line
@@ -29,6 +29,11 @@ module LibSip_XMLTypes language "TTCN-3:2009" {

import from XSDAUX all;

    import from org_w3_www__XML_1998_namespace language "XSD" all
    with {
        extension "File:../xsd/xml.xsd"
    }

	import from ietf_params_xml_ns_resource_lists language "XSD" all
	with {
		extension "File:../xsd/ResourceList.xsd"
@@ -64,6 +69,12 @@ import from XSDAUX all;
        extension "File:../xsd/CDIVN.xsd"
    }
    
    import from oma_xml_xdm_common_policy language "XSD" all
    with {
        extension "File:../xsd/xdm_commonPolicy-v1_0.xsd"
    }
    

    group XmlTypes {
    	type union XmlBody {
    		Mcid mcid,							// if there is XML Mcid