Commit f6082838 authored by garciay's avatar garciay
Browse files

STF471: Unifies templates (step2)

parent 64533d2a
Loading
Loading
Loading
Loading
+95 −75
Original line number Diff line number Diff line
@@ -687,27 +687,19 @@ module LibSip_Templates
			deltaSec := p_deltaSec
		};


		template(value) PAssertedID m_PAssertedID(template(present) Addr_Union p_pAssertedIDValue) := 
		template(present) Expires mw_Expires (template(present) charstring p_deltaSec) := 
		{
			fieldName := P_ASSERTED_ID_E,
			pAssertedIDValueList := {p_pAssertedIDValue}
			fieldName := EXPIRES_E,
			deltaSec := p_deltaSec
		};

		template(present) HistoryInfo mw_HistoryInfo(template(present) HistoryInfo_List p_HistoryInfo_List) := 
      	template(value) HistoryInfo m_HistoryInfo(template(value) HistoryInfo_List p_HistoryInfo_List) := 
      	{
       		fieldName := HISTORY_INFO_E,
       		historyInfoList := p_HistoryInfo_List
      	};
    
		template(present) HistoryInfoEntry mw_HistoryInfoEntry(template(present) SipUrl p_Url, template IntegerList p_index, template SemicolonParam_List p_paramlist) :=
		{
			nameAddr := {displayName:=*, addrSpec:= p_Url},
			hiIndex := p_index,
			hiExtention := p_paramlist
		}
		
      	template(value) HistoryInfo m_HistoryInfo(template(value) HistoryInfo_List p_HistoryInfo_List) := 
		template(present) HistoryInfo mw_HistoryInfo(template(present) HistoryInfo_List p_HistoryInfo_List) := 
		{
			fieldName := HISTORY_INFO_E,
			historyInfoList := p_HistoryInfo_List
@@ -720,10 +712,22 @@ module LibSip_Templates
      		hiExtention := p_paramlist
      	}
  
		template(value) PAssertedID m_PAssertedID_2x(template(value) Addr_Union p_pAssertedIDValue1, template(value) Addr_Union p_pAssertedIDValue2) := 
		template(present) HistoryInfoEntry mw_HistoryInfoEntry(template(present) SipUrl p_Url, template IntegerList p_index, template SemicolonParam_List p_paramlist) :=
		{
			nameAddr := {displayName:=*, addrSpec:= p_Url},
			hiIndex := p_index,
			hiExtention := p_paramlist
		}
		
        template(value) PAssertedID m_PAssertedID(template(present) Addr_Union p_pAssertedIDValue) := 
        {
            fieldName := P_ASSERTED_ID_E,
			pAssertedIDValueList := {p_pAssertedIDValue1, p_pAssertedIDValue2}
            pAssertedIDValueList := {p_pAssertedIDValue}
        };

		template(value) PAssertedID m_PAssertedID_2x(template(value) Addr_Union p_pAssertedIDValue, template(value) Addr_Union p_pAssertedIDValue2) modifies m_PAssertedID := 
		{
			pAssertedIDValueList := {p_pAssertedIDValue, p_pAssertedIDValue2}
		};
	
		template(present) PAssertedID mw_PAssertedID(template(present) PAssertedIDValue p_pAssertedIDValue) := 
@@ -749,6 +753,15 @@ module LibSip_Templates
			privValueList := {p_privacy}
		};
				
        template(present) Privacy mw_Privacy_Base(template(present) charstring p_value) := 
        {
            fieldName := PRIVACY_E,
            privValueList := {*, p_value ,*}
        };
        template(present) Privacy mw_Privacy_id := mw_Privacy_Base("id");
        
        template(present) Privacy mw_Privacy_user := mw_Privacy_Base("user");
        
		template(value) RAck m_RAck(integer p_responseNum, integer p_seqNumber, charstring p_method) :=
		{
		  	fieldName := RACK_E,
@@ -769,6 +782,22 @@ module LibSip_Templates
			reasonValues := {m_ReasonValue(int2str(21),"call reject")}
		};

        template(present) Reason mw_Reason_Base :=
        {         
            fieldName := REASON_E,
            reasonValues := {}
        }
        
        template(present) Reason mw_Reason(template(value) charstring p_cause) modifies mw_Reason_Base:=
        {
            reasonValues := {mw_ReasonValue(p_cause,?)}
        }
        
        template(present) Reason mw_ReasonSIP(template(value) charstring p_cause) modifies mw_Reason_Base :=
        {
            reasonValues := {mw_ReasonValueSIP(p_cause,?)}
        }
        
		template(value) RecordRoute m_recordRoute_currIpAddr (in SipUserProfile p_userprofile):=
		{   
			fieldName := RECORD_ROUTE_E,
@@ -1006,29 +1035,6 @@ module LibSip_Templates
		  callid := ?
		}
		
		template(present) Privacy mw_Privacy_Base(template(present) charstring p_value) := 
        {
			fieldName := PRIVACY_E,
            privValueList := {*, p_value ,*}
        };
		template(present) Privacy mw_Privacy_id := mw_Privacy_Base("id");
		template(present) Privacy mw_Privacy_user := mw_Privacy_Base("user");
		
		
		template(present) Reason mw_Reason_Base :=
		{		  
			fieldName := REASON_E,
			reasonValues := {}
		}
		template(present) Reason mw_Reason(template(value) charstring p_cause) modifies mw_Reason_Base:=
		{
			reasonValues := {mw_ReasonValue(p_cause,?)}
		}
		template(present) Reason mw_ReasonSIP(template(value) charstring p_cause) modifies mw_Reason_Base :=
		{
			reasonValues := {mw_ReasonValueSIP(p_cause,?)}
		}
		
		template(present) Require mw_Require_Base :=
		{		  
			fieldName := REQUIRE_E,
@@ -1583,8 +1589,24 @@ group dummy_templates {

group base_templates{
    
	group request_send {
	//STF471 Use these 3 templates in LibIMS too
	template(value) CSeq m_cSeq(in integer p_seqNumber, in charstring p_method) := {
        fieldName:=CSEQ_E, 
        seqNumber:= p_seqNumber, 
        method:= p_method
	}

    template(value) ContentLength m_contentLength(in integer p_len) := {
        fieldName := CONTENT_LENGTH_E,   
        len := p_len
    }
        		
    template(value) ContentType m_contentType(in charstring p_mediaType) := {
        fieldName := CONTENT_TYPE_E,   
        mediaType :=  p_mediaType
    }
        		
	group request_send {
		
		template(value) ACK_Request m_ACK_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq,
			From p_from, To p_to, Via p_via) modifies m_ACK_Dummy :=
@@ -1596,7 +1618,7 @@ group base_templates{
			msgHeader :=
			{
				callId := p_callId,
				cSeq := {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "ACK"},
				cSeq := m_cSeq(p_cSeq.seqNumber, "ACK"), //STF471 {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "ACK"},
				fromField := p_from,
				toField := p_to,
				via := p_via
@@ -1611,7 +1633,7 @@ group base_templates{
			{
				route := p_route,
				//recordRoute := p_recordRoute,
				contentLength := {CONTENT_LENGTH_E, 0}
				contentLength := m_contentLength(0) // STF471 {CONTENT_LENGTH_E, 0}
			}
		}
		
@@ -1711,7 +1733,7 @@ group base_templates{
			msgHeader :=
			{
				callId := p_callId,
				cSeq :=  {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "NOTIFY"},
				cSeq :=  m_cSeq(p_cSeq.seqNumber, "NOTIFY"), //STF471 {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "NOTIFY"},
				fromField := p_from,
				toField := p_to,
				via := p_via
@@ -1728,7 +1750,7 @@ group base_templates{
            msgHeader :=
            {
                callId := p_callId,
                cSeq :=  {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "OPTIONS"},
                cSeq :=  m_cSeq(p_cSeq.seqNumber, "OPTIONS"), //STF471 {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "OPTIONS"},
                fromField := p_from,
                toField := p_to,
                via := p_via
@@ -1746,7 +1768,7 @@ group base_templates{
			msgHeader :=
			{
				callId := p_callId,
				cSeq := {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "PRACK"},
				cSeq := m_cSeq(p_cSeq.seqNumber, "PRACK"), //STF471 {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "PRACK"},
				fromField := p_from,
				rAck := p_RAck,
				toField := p_to,
@@ -1767,9 +1789,9 @@ group base_templates{
			msgHeader :=
			{
				callId := p_callId,
				contentLength	:= {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
				contentType := {fieldName := CONTENT_TYPE_E, mediaType :=  c_plainText/*c_sdpAplication*/},
				cSeq := {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "PUBLISH"},
				contentLength	:= m_contentLength(f_MessageBodyLength(valueof(p_mb))), // STF471 {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
				contentType := m_contentType(c_plainText), // STF471 {fieldName := CONTENT_TYPE_E, mediaType :=  c_plainText/*c_sdpAplication*/},
				cSeq := m_cSeq(p_cSeq.seqNumber, "PUBLISH"), //STF471 {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "PUBLISH"},
				event := p_event, 
				rAck := p_RAck,//TODO: added by STF471
				fromField := p_from,
@@ -1799,7 +1821,7 @@ group base_templates{
	  		{
				callId		:= p_callId,
				contact := p_contact,
				cSeq		:= {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "REFER"},
				cSeq		:= m_cSeq(p_cSeq.seqNumber, "REFER"), //STF471 {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "REFER"},
				fromField	:= p_from,
				referTo := p_referTo,
				referredBy := p_referredBy,
@@ -1860,7 +1882,7 @@ group base_templates{
			msgHeader :=
			{
				callId		:= p_callId,
				cSeq		:= {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "SUBSCRIBE"},
				cSeq		:= m_cSeq(p_cSeq.seqNumber, "SUBSCRIBE"), //STF471 {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "SUBSCRIBE"},
				fromField	:= p_from,
				toField		:= p_to,
				via		:= p_via
@@ -1878,9 +1900,9 @@ group base_templates{
			{
				callId		:= p_callId,
				contact		:= p_contact,
				contentLength	:= {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
				contentType := {fieldName := CONTENT_TYPE_E, mediaType :=  c_sdpAplication},
				cSeq		:= {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "UPDATE"},
				contentLength	:= m_contentLength(f_MessageBodyLength(valueof(p_mb))), // STF471 {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
				contentType := m_contentType(c_sdpAplication), // STF471 {fieldName := CONTENT_TYPE_E, mediaType :=  c_sdpAplication},
				cSeq		:= m_cSeq(p_cSeq.seqNumber, "UPDATE"), //STF471 {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "UPDATE"},
				fromField	:= p_from,
				toField		:= p_to,
				via		:= p_via
@@ -2093,8 +2115,8 @@ group request_send {
	  {
		msgHeader :=
		{
			contentLength	:= {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
			contentType := {fieldName := CONTENT_TYPE_E, mediaType :=  c_sdpAplication}
			contentLength	:= m_contentLength(f_MessageBodyLength(valueof(p_mb))), // STF471 {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
			contentType := m_contentType(c_sdpAplication) // STF471 {fieldName := CONTENT_TYPE_E, mediaType := c_sdpAplication }
		},
		messageBody := p_mb
	  }
@@ -2118,8 +2140,8 @@ group request_send {
	{
	  msgHeader :=
	  {
		contentLength	:= {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
		contentType := {fieldName := CONTENT_TYPE_E, mediaType :=  c_sdpAplication}
		contentLength	:= m_contentLength(f_MessageBodyLength(valueof(p_mb))), // STF471 {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
		contentType := m_contentType(c_sdpAplication) // STF471 {fieldName := CONTENT_TYPE_E, mediaType :=  c_sdpAplication}
	  },
	  messageBody := p_mb
	}
@@ -2133,7 +2155,7 @@ group request_send {
	  msgHeader :=
	  {
		contentLength	:= {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
		contentType := {fieldName := CONTENT_TYPE_E, mediaType :=  "application/resource-lists+xml"},
		contentType := m_contentType("application/resource-lists+xml"), // STF471 {fieldName := CONTENT_TYPE_E, mediaType :=  "application/resource-lists+xml"},
		contentDisposition := {
			fieldName := CONTENT_DISPOSITION_E,
			dispositionType := "recipient-list",
@@ -2169,9 +2191,7 @@ group request_send {
		msgHeader :=
		{
			authorization := p_authorization,
		    expires := {
			fieldName := EXPIRES_E,
			deltaSec  := p_expires }
		    expires := m_Expires(p_expires)
		}
	  }
	  
@@ -2215,8 +2235,8 @@ group request_send {
			},
			msgHeader :=
			{
				contentLength	:= {fieldName := CONTENT_LENGTH_E, len:= lengthof(p_sipfrag)},
				contentType := {fieldName := CONTENT_TYPE_E, mediaType :=  "message/sipfrag"},
				contentLength	:= m_contentLength(lengthof(p_sipfrag)), // STF471 {fieldName := CONTENT_LENGTH_E, len:= lengthof(p_sipfrag)},
				contentType := m_contentType("message/sipfrag"), // STF471 {fieldName := CONTENT_TYPE_E, mediaType :=  "message/sipfrag"},
				subscriptionState := {
					fieldName := SUBSCRIPTION_STATE_E,
    				subState := p_state,
@@ -2445,8 +2465,8 @@ group response_send {
	{
		msgHeader :=
			 {
			   contentLength	:= {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
			   contentType := {fieldName := CONTENT_TYPE_E, mediaType :=  c_sdpAplication}
			   contentLength	:= m_contentLength(f_MessageBodyLength(valueof(p_mb))), // STF471 {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
			   contentType := m_contentType(c_sdpAplication) // STF471 {fieldName := CONTENT_TYPE_E, mediaType :=  c_sdpAplication}
			 },
	  	messageBody := p_mb
	}
@@ -2478,8 +2498,8 @@ group response_send {
	{
		msgHeader :=
				{
						contentLength	:= {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
						contentType := {fieldName := CONTENT_TYPE_E, mediaType :=  c_sdpAplication},
						contentLength	:= m_contentLength(f_MessageBodyLength(valueof(p_mb))), // STF471 {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
						contentType := m_contentType(c_sdpAplication), // STF471 {fieldName := CONTENT_TYPE_E, mediaType :=  },
						pAssertedID := p_pAssertedID,
						privacy := p_privacy
				},
@@ -2497,7 +2517,7 @@ group response_receive {
		statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
		msgHeader :=
		{
			expires := {fieldName := EXPIRES_E, deltaSec := p_deltaSec}
			expires := mw_Expires(p_deltaSec)
        }
	}