Commit dafd573b authored by garciay's avatar garciay
Browse files

STF471: Unifies templates (step3)

parent f6082838
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -70,20 +70,23 @@ group SimpleConstants
      const charstring c_userId := "user";
      
      // SDP name application
      const charstring c_sdpAplication := "application/sdp";
      const charstring c_sdpApplication := "application/sdp";
      
      // XML name application
      const charstring c_xmlAplication := "application/xml";
      const charstring c_xmlApplication := "application/xml";
      
      // XML name application
      const charstring c_xmlreginfoAplication := "application/reginfo+xml";
      const charstring c_xmlreginfoApplication := "application/reginfo+xml";

      // XML name resource-list
      const charstring c_xmlresourcelistApplication := "application/resource-lists+xml";

      // MIME name application
      //TODO TT change: added boundary delimiter
      const charstring c_mimeMultipart := "multipart/mixed;boundary=""" & PX_SIP_MIME_Boundary & """";

      // IMS 3GPP name application
      const charstring c_ims3gppAplication := "application/3gpp-ims+xml";
      const charstring c_ims3gppApplication := "application/3gpp-ims+xml";

      // IMS 3GPP name CW application
      const charstring c_ims3gppCwApplication := "application/vnd.3gpp.cw+xml";
@@ -98,11 +101,14 @@ group SimpleConstants
      const charstring c_imsEtsiSimservsApplication := "application/vnd.etsi.simservs+xml";
      
      // OCTET-STREAM name application
      const charstring c_octetAplication := "application/octet-stream";
      const charstring c_octetApplication := "application/octet-stream";

      // PLAIN-TEXT name application
      const charstring c_plainText := "text/plain";

      // SIP fragment message
      const charstring c_sipfragMessage := "message/sipfrag";

      //text content of 1300 bytes for messages with message body
      const charstring c_longMessageContent_1300Bytes :=//"Hello!";
      "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"&
+45 −41
Original line number Diff line number Diff line
@@ -80,12 +80,20 @@ module LibSip_Templates
		  nameAddr := p_nameAddr
		}

		template(value) Addr_Union m_AddrUnion_DisplayAndSipUrl(template charstring p_displayName, template SipUrl p_addrSpec) :=
		template(value) Addr_Union m_AddrUnion_DisplayAndSipUrl(template(value) charstring p_displayName, template(value) SipUrl p_addrSpec) :=
		{
		  nameAddr := m_CallingAddr(p_displayName, p_addrSpec)
		}
		
		template(value) NameAddr m_CallingAddr(template charstring p_displayName, template SipUrl p_addrSpec) :=
        template(value) NameAddr m_NameAddr(template(omit) charstring p_displayName, template(value) SipUrl p_addrSpec) :=
        {
          displayName := p_displayName,
          addrSpec := p_addrSpec
        }       

		template(value) NameAddr m_CallingAddr(template(value) charstring p_displayName, template(value) SipUrl p_addrSpec) := m_NameAddr(p_displayName, p_addrSpec);

        template(present) NameAddr mw_NameAddr(template charstring p_displayName, template(present) SipUrl p_addrSpec) :=
        {
          displayName := p_displayName,
          addrSpec := p_addrSpec
@@ -148,11 +156,7 @@ module LibSip_Templates
		
		template(present) RouteBody mw_routeBody (template(present) SipUrl p_sipurl):=
		{
			nameAddr :=
			{
				displayName := *,
				addrSpec := p_sipurl
			},
			nameAddr := mw_NameAddr(*, p_sipurl),
			rrParam := *
		}

@@ -619,21 +623,21 @@ module LibSip_Templates
		{
				fieldName := FROM_E,
				addressField :=
				{nameAddr := {
						displayName := "Anonymous",	 	 	//*  optional charstring
						addrSpec := m_SipUrl_Anonymous		//*  SipUrl
				}},//* end addressField
				{nameAddr := m_NameAddr(
						"Anonymous",	 	 	//*  optional charstring
						m_SipUrl_Anonymous		//*  SipUrl
				)},//* end addressField
				fromParams := {{id := c_tagId, paramValue := p_tag_str}}
		};
		
		template(value) From m_From_SipUrl(template SipUrl p_sipUrl) :=
		template(value) From m_From_SipUrl(template(value) SipUrl p_sipUrl) :=
		{
				fieldName := FROM_E,
				addressField :=
				{nameAddr := {
						displayName := omit, 	 			//*  optional charstring
						addrSpec := p_sipUrl		//*  SipUrl
				}},//* end addressField
				{nameAddr := m_NameAddr(
						omit, 	 			//*  optional charstring
						p_sipUrl		//*  SipUrl
				)},//* end addressField
				fromParams := omit
		};
		
@@ -707,14 +711,14 @@ module LibSip_Templates

     	template(value) HistoryInfoEntry m_HistoryInfoEntry(template(value) SipUrl p_Url, template IntegerList p_index, template SemicolonParam_List p_paramlist) :=
      	{
       		nameAddr := {displayName:=omit, addrSpec:= p_Url},
       		nameAddr := m_NameAddr(omit, p_Url),
       		hiIndex := p_index,
      		hiExtention := p_paramlist
      	}
  
		template(present) HistoryInfoEntry mw_HistoryInfoEntry(template(present) SipUrl p_Url, template IntegerList p_index, template SemicolonParam_List p_paramlist) :=
		{
			nameAddr := {displayName:=*, addrSpec:= p_Url},
			nameAddr := mw_NameAddr(*, p_Url),
			hiIndex := p_index,
			hiExtention := p_paramlist
		}
@@ -853,14 +857,14 @@ module LibSip_Templates
		template(value) ReferredBy m_ReferredBy_SipUrl(template(value) SipUrl p_sipUrl) := 
		{
			fieldName := REFERRED_BY_E,
			nameAddr :={displayName := omit, addrSpec:=p_sipUrl},
			nameAddr := m_NameAddr(omit, p_sipUrl), // STF471 {displayName := omit, addrSpec:=p_sipUrl},
			referredbyIdParams := omit
		}

		template(value) ReferTo m_ReferTo_SipUrl(template(value) SipUrl p_sipUrl, charstring p_method) := 
		{
			fieldName := REFER_TO_E,
			nameAddr :={displayName := omit, addrSpec:=p_sipUrl},
			nameAddr :=m_NameAddr(omit, p_sipUrl), // STF471 {displayName := omit, addrSpec:=p_sipUrl},
			referToParams := {{id:="method",paramValue :=p_method}}
		}

@@ -968,10 +972,10 @@ module LibSip_Templates
		{
		  fieldName := TO_E,
		  addressField :=
		  {nameAddr := {
			  displayName := "ETSI Tester", //*  optional charstring
			  addrSpec :=	p_sipUrl		//*  SipUrl
			}},//* end addressField
		  {nameAddr := m_NameAddr(
			  "ETSI Tester", //*  optional charstring
			  p_sipUrl		//*  SipUrl
			)},//* end addressField
		  toParams := omit
		};

@@ -992,13 +996,13 @@ module LibSip_Templates

        template(present) To mw_To(template(present) SipUrl p_sipUrl) := {
        	fieldName := TO_E,
        	addressField := { nameAddr := {displayName := *, addrSpec := p_sipUrl}},
        	addressField := { nameAddr := mw_NameAddr(*, p_sipUrl)},
        	toParams:= *
      	}

		template(present) From mw_From(template(present) SipUrl p_sipUrl) := {
		  fieldName := FROM_E,
		  addressField := { nameAddr := {displayName := *, addrSpec := p_sipUrl}},
		  addressField := { nameAddr := mw_NameAddr(*, p_sipUrl)},
		  fromParams:= *
		}

@@ -1790,7 +1794,7 @@ group base_templates{
			{
				callId := p_callId,
				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*/},
				contentType := m_contentType(c_plainText), // STF471 {fieldName := CONTENT_TYPE_E, mediaType :=  c_plainText/*c_sdp*/},
				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
@@ -1901,7 +1905,7 @@ group base_templates{
				callId		:= p_callId,
				contact		:= p_contact,
				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},
				contentType := m_contentType(c_sdpApplication), // STF471 {fieldName := CONTENT_TYPE_E, mediaType :=  c_sdp},
				cSeq		:= m_cSeq(p_cSeq.seqNumber, "UPDATE"), //STF471 {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "UPDATE"},
				fromField	:= p_from,
				toField		:= p_to,
@@ -2008,7 +2012,7 @@ group base_templates{
			msgHeader := {
				referredBy := {
					fieldName := REFERRED_BY_E,
					nameAddr := {displayName := *, addrSpec := p_referredBy},
					nameAddr := mw_NameAddr(*, p_referredBy), // STF471 {displayName := *, addrSpec := p_referredBy},
					referredbyIdParams := *
				}
			}
@@ -2020,7 +2024,7 @@ group base_templates{
				require := p_require,
				referredBy := {
					fieldName := REFERRED_BY_E,
					nameAddr := {displayName := *, addrSpec := p_referredBy},
					nameAddr := mw_NameAddr(*, p_referredBy), // STF471 {displayName := *, addrSpec := p_referredBy},
					referredbyIdParams := *
				}
			}
@@ -2116,7 +2120,7 @@ group request_send {
		msgHeader :=
		{
			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 }
			contentType := m_contentType(c_sdpApplication) // STF471 {fieldName := CONTENT_TYPE_E, mediaType := c_sdp }
		},
		messageBody := p_mb
	  }
@@ -2141,7 +2145,7 @@ group request_send {
	  msgHeader :=
	  {
		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}
		contentType := m_contentType(c_sdpApplication) // STF471 {fieldName := CONTENT_TYPE_E, mediaType :=  c_sdp}
	  },
	  messageBody := p_mb
	}
@@ -2155,7 +2159,7 @@ group request_send {
	  msgHeader :=
	  {
		contentLength	:= {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))},
		contentType := m_contentType("application/resource-lists+xml"), // STF471 {fieldName := CONTENT_TYPE_E, mediaType :=  "application/resource-lists+xml"},
		contentType := m_contentType(c_xmlresourcelistApplication), // STF471 {fieldName := CONTENT_TYPE_E, mediaType :=  "application/resource-lists+xml"},
		contentDisposition := {
			fieldName := CONTENT_DISPOSITION_E,
			dispositionType := "recipient-list",
@@ -2236,7 +2240,7 @@ group request_send {
			msgHeader :=
			{
				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"},
				contentType := m_contentType(c_sipfragMessage), // STF471 {fieldName := CONTENT_TYPE_E, mediaType :=  "message/sipfrag"},
				subscriptionState := {
					fieldName := SUBSCRIPTION_STATE_E,
    				subState := p_state,
@@ -2466,7 +2470,7 @@ group response_send {
		msgHeader :=
			 {
			   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}
			   contentType := m_contentType(c_sdpApplication) // STF471 {fieldName := CONTENT_TYPE_E, mediaType :=  c_sdp}
			 },
	  	messageBody := p_mb
	}
@@ -2499,7 +2503,7 @@ group response_send {
		msgHeader :=
				{
						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 :=  },
						contentType := m_contentType(c_sdpApplication), // STF471 {fieldName := CONTENT_TYPE_E, mediaType := c_sdpApplication },
						pAssertedID := p_pAssertedID,
						privacy := p_privacy
				},
@@ -3175,7 +3179,7 @@ group MessageBodies {
			mimeEncapsulatedList:= {
    			*,
    			{	
    				content_type:= c_ims3gppAplication, 
    				content_type:= c_ims3gppApplication, 
    				content_disposition:= p_disposition,
    				mime_encapsulated_part :={
    					xmlBody := {