Commit 781e622d authored by rennoch's avatar rennoch
Browse files

correction in f_get_attribute_answer

parent 3f539de7
Loading
Loading
Loading
Loading
+39 −34
Original line number Diff line number Diff line
@@ -1565,19 +1565,25 @@ group SDPOperations{
	}		
	
	/**
	*  @desc find and return SDP direction attribute (session or first media attribute)
	 * 
	 * @desc 	identify an SDP direction attribute (session or first media attribute) in a SDP message and return its answer value
	 * @param 	p_sdp 		the SDP message that has been received
	 * @param 	p_attribute incoming SDP attribute that need to be used for the SDP direction (answer)
	 * @return 	the new attribute (to be send out) derived from the incoming SDP value
	 * @verdict 
	 */
	function f_get_attribute_answer(in SDP_Message p_sdp, in template SDP_attribute p_attribute) runs on SipComponent return SDP_attribute {

		var template SDP_attribute v_attribute := p_attribute;
		
		// check if the selected attribute is included in the SDP offer (session attributes)
		if (ispresent(p_sdp.attributes)) {
			for (var integer j:=0; j<sizeof(p_sdp.attributes); j:=j+1){			
				if (match(p_sdp.attributes[j],p_attribute)) {v_attribute := p_sdp.attributes[j];};
				};
		}

		// check if the selected attribute is included in the SDP offer (any of the media attributes)
		if (ispresent(p_sdp.media_list)) {
			for (var integer j:=0; j<sizeof(p_sdp.media_list); j:=j+1){			
				if (ispresent(p_sdp.media_list[j].attributes)) {
@@ -1590,13 +1596,12 @@ group SDPOperations{
		}
		select (v_attribute)
		{
						//case (mw_attribute_sendrecv) {return(m_attribute_sendrecv);}
			case (mw_attribute_sendonly) {return(valueof(m_attribute_recvonly));}
			case (mw_attribute_sendrecv) {return(valueof(m_attribute_sendrecv));}//MRO	
			case (mw_attribute_inactive) {return(valueof(m_attribute_inactive));}//MRO
			case (mw_attribute_recvonly) {return(valueof(m_attribute_sendonly));}//MRO
		}
					return(valueof(m_attribute_sendrecv));//MRO
					//return(v_attribute); // not needed due to case else
		return(valueof(m_attribute_sendrecv));//the default return value in case of missing attribute offer  
	}

	/** 
@@ -2019,8 +2024,8 @@ group SDPOperations{
    /*
     * 
     * @desc check (from remote) and set (local) the session/media attribute lines on directions
     * @param p_direction_in attribute to be check
     * @param p_direction_out attrubyte to be 
     * @param p_direction_in incoming SDP attribute that need to be checked
     * @param p_direction_out SDP attribute that should be included in the SDP answer (to be returned to peer)
     * @return 
     * @verdict 
     */