Commit 1db460ce authored by poglitsch's avatar poglitsch
Browse files

corrections

parent 113318da
Loading
Loading
Loading
Loading
+114 −51
Original line number Diff line number Diff line
@@ -650,6 +650,28 @@ group FieldOperations {
	  return (false)
	}

	/**
		* 
		* @desc function returns the Host/Port of a given Contact header field
		* @param p_contact contact header field to be analysed
		* @return Host/Port record  from the contact header field
		*/
	function f_getContactUri(in ContactAddress p_contact) runs on SipComponent return SipUrl
	{
		var SipUrl    v_SipUrl;
      
		if (ischosen(p_contact.addressField.nameAddr))
		{
				v_SipUrl := p_contact.addressField.nameAddr.addrSpec;
		}
		else
		{
				v_SipUrl := p_contact.addressField.addrSpecUnion;
		}
      
		return(v_SipUrl);
	} // end f_getContactUri

	/**
	 * 
	 * @desc function returns the Host/Port of a given Contact header field
@@ -942,6 +964,26 @@ group SetHeaders {
	  };
	}// end function f_setHeadersGeneral
	


	/**
		* 
		* @desc function for setting of component variables related to message header fields 
		*		(message type independent: CSeq, contact, via), function uses information from userprofile
		*		
		* @param p_cSeq_s CSeq parameter
		* @param p_method method name for cSeq header field
		*/	
		function f_setHeadersACK() runs on SipComponent
    	{
			vc_requestUri.hostPort := vc_reqHostPort;
			vc_branch := c_branchCookie & f_getRndTag();
			vc_via:={
        		fieldName := VIA_E,
        		viaBody 	 := {valueof(m_ViaBody_currIpaddr(vc_branch, vc_userprofile))}
			};
    	}// end function f_setHeadersGeneral
	
	/**
	 * 
	 * @desc setting of general and basic Bye header fields
@@ -952,7 +994,7 @@ group SetHeaders {
	{      
	  f_setHeadersGeneral(p_cSeq_s, "BYE"); // cseq, contact, branch, via

	  vc_callId := { fieldName:=CALL_ID_E, callid:=f_getRndCallId(p_cSeq_s) & c_AT & vc_userprofile.currIpaddr };
	  //vc_callId := { fieldName:=CALL_ID_E, callid:=f_getRndCallId(p_cSeq_s) & c_AT & vc_userprofile.currIpaddr };

	  f_addTagInTo(vc_to);

@@ -1040,6 +1082,15 @@ group SetHeaders {
	  p_cSeq_s.seqNumber := p_cSeq_s.seqNumber + 1;
	  vc_cSeq := p_cSeq_s;
	  
		vc_requestUri:=
    	{
            scheme := c_sipScheme,
            userInfo := omit,
            hostPort := {host:=vc_userprofile.registrarDomain, portField:=omit},
            urlParameters := omit,
            headers := omit
    	};
		
	  //new branch tag due to different branch tag in new REGISTER method
	  vc_branch := c_branchCookie & f_getRndTag();

@@ -1104,6 +1155,15 @@ group SetHeaders {
		
	  vc_branch := c_branchCookie & f_getRndTag();
	  
		vc_requestUri:=
		{
			scheme := c_sipScheme,
			userInfo := omit,
			hostPort := {host:=vc_userprofile.registrarDomain, portField:=omit},
			urlParameters := omit,
			headers := omit
		};

	  vc_via_REG :={
		fieldName := VIA_E,
		viaBody 	 := {valueof(m_ViaBody_currIpaddr(vc_branch, vc_userprofile))}
@@ -1181,6 +1241,27 @@ group SetHeaders {
      
	}// end function f_setHeadersINVITE
	
	/**
	* 
	* @desc setting of general and basic Update header fields
	* 		in additon to the addresses (To, From, ReqUri)
	* @param p_cSeq_s
	*/
	function f_setHeadersUPDATE(inout CSeq p_cSeq_s) runs on SipComponent
	{      
			f_setHeadersGeneral(p_cSeq_s, "UPDATE"); // cseq, contact, branch, via

			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;
  
	}// end function f_setHeadersUPDATE

	/**
	 * 
	 * @desc setting of general and basic Message header fields
@@ -1375,7 +1456,7 @@ group SetHeaders {

	vc_callId := p_Request.msgHeader.callId;

	vc_requestUri := p_Request.requestLine.requestUri;
	vc_requestUri2 := p_Request.requestLine.requestUri;
      
	vc_cancel_To := p_Request.msgHeader.toField;
	f_addTagInTo(vc_to);
@@ -1385,6 +1466,7 @@ group SetHeaders {
	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
@@ -1404,15 +1486,13 @@ group SetHeaders {
		//cleaning of attributes before assignment
		if (ispresent(vc_sdp_remote.media_list))
		{
				for (var integer i:=0; i<sizeof(vc_sdp_remote.media_list); i:=i+1)
			var integer v_length := sizeof(vc_sdp_remote.media_list);
			for (var integer i:=0; i<v_length; i:=i+1)
			{			
				if (ispresent(vc_sdp_remote.media_list[i].attributes))
				{
							for (var integer j:=0; j<sizeof(vc_sdp_remote.media_list[i].attributes); j:=j+1)
							{		  	
					vc_sdp_remote.media_list[i].attributes := omit ; 
				}
						}
			};
		}		
		
@@ -1525,6 +1605,7 @@ group SetHeaders {
	   if (ischosen(v_contact.contactBody.contactAddresses))
	   {
		 vc_reqHostPort := f_getContactAddr(v_contact.contactBody.contactAddresses[0]);
		 vc_requestUri := f_getContactUri(v_contact.contactBody.contactAddresses[0]);
	   }
	 }
	 else
@@ -1532,10 +1613,12 @@ group SetHeaders {
	   if (ischosen(vc_to.addressField.nameAddr))
	   {
		 vc_reqHostPort := vc_to.addressField.nameAddr.addrSpec.hostPort;
		 vc_requestUri := vc_to.addressField.nameAddr.addrSpec;
	   }
	   else
	   {
		 vc_reqHostPort := vc_to.addressField.addrSpecUnion.hostPort;
		 vc_requestUri := vc_to.addressField.addrSpecUnion;
	   }
	 }
	 
@@ -2477,42 +2560,18 @@ group AwaitingMessage {
		*/
	function f_awaitingResponseSendACK(in template Response p_Response) runs on SipComponent
	{
		var integer statuscode:=valueof(p_Response.statusLine.statusCode);
		
		tc_ack.start(PX_SIP_TACK);
		if(statuscode>=400 and statuscode<=699)
		{
			alt
			{
				[] SIPP.receive	(p_Response) -> value vc_response
				{
    	alt {
			[] SIPP.receive	(p_Response) -> value vc_response {
    			tc_ack.stop;
    			f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response);
				f_SendACK(m_ACK_Request_Base(vc_requestUri, vc_callId, vc_cSeq, vc_from, vc_to, vc_via));
					setverdict(pass)
				}
				[] tc_ack.timeout
				{
					setverdict(fail);
				}
			}
		}
		else
		{
    		alt
    		{
        		[] SIPP.receive	(p_Response) -> value vc_response
        				{
        			tc_ack.stop;
        			f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response);
        			setverdict(pass)
    			setverdict(pass);
    		}
        		[] tc_ack.timeout
        				{
			[] tc_ack.timeout {
    			setverdict(fail);
    		}
    	}
		}
	} //end f_awaitingResponse
	
	/**
@@ -2821,7 +2880,7 @@ group AwaitingMessage {
		tc_resp.start(PX_SIP_TRESP);
		alt
		{
		  [] SIPP.receive(mw_MESSAGE_Request_Base(?))-> value v_MSG sender vc_sent_label
		  [] SIPP.receive(mw_MESSAGE_Request_Base)-> value v_MSG sender vc_sent_label
			{
			  tc_resp.stop;
			  f_setHeadersOnReceiptOfRequest(v_MSG);
@@ -3784,6 +3843,7 @@ group DefaultsTestStep
			all timer.stop; 
			//TODO check how to solve release of call 
			//f_SendCANCEL(m_CANCEL_Request(vc_callId, vc_cSeq, vc_from, vc_cancel_To, vc_reqHostPort, vc_via )); // difference between registration state or transaction state
			vc_callId := vc_callIdReg;
			f_RemoveRegistration(vc_cSeq); 
		}

@@ -3798,7 +3858,10 @@ group DefaultsTestStep
		{
		  repeat
		}

    	[] SIPP.receive (mw_ACK_Request_Base(?))
    	{
			repeat
    	}
	  	// allow 100 replies
		[] SIPP.receive(mw_Response_Base(c_statusLine100,vc_callId, vc_cSeq))
		  {
+6 −10
Original line number Diff line number Diff line
@@ -1294,10 +1294,10 @@ group base_templates{
		{	
			requestLine	:=
			{
				requestUri := 
				{
					hostPort:= p_requestUri.hostPort
				}
				requestUri := p_requestUri
//				{
//					hostPort:= p_requestUri.hostPort
//				}
			},
			msgHeader :=
			{
@@ -1543,10 +1543,7 @@ group base_templates{
		{
			requestLine	:=
			{
				requestUri :=
				{
					hostPort:= p_requestUri.hostPort
				}
				requestUri := p_requestUri
			},
			msgHeader :=
			{
@@ -1606,11 +1603,10 @@ group base_templates{
			}
		}

		template MESSAGE_Request mw_MESSAGE_Request_Base(template CallId p_callId) modifies mw_MESSAGE_Dummy :=
		template MESSAGE_Request mw_MESSAGE_Request_Base modifies mw_MESSAGE_Dummy :=
		{
			msgHeader :=
			{
				callId := p_callId,
				contact := *
			}
		}