Skip to content
LibSip_Templates.ttcn 122 KiB
Newer Older
		template(present) REFER_Request mw_REFER_Request(template CallId p_callId, SipUrl p_requestUri, SipUrl p_referredBy) 
			modifies mw_REFER_Request_Base := {
			requestLine := {requestUri := p_requestUri},
			msgHeader := {
				referredBy := {
					fieldName := REFERRED_BY_E,
					nameAddr := {displayName := *, addrSpec := p_referredBy},
					referredbyIdParams := *
				}
			}
		}
	
		template(present) INVITE_Request mw_INVITE_Request(template Require p_require,
						 SipUrl p_referredBy) modifies mw_INVITE_Request_Base := {
			msgHeader := {
				require := p_require,
				referredBy := {
					fieldName := REFERRED_BY_E,
					nameAddr := {displayName := *, addrSpec := p_referredBy},
					referredbyIdParams := *
				}
			}
		}
		
		template(present) REGISTER_Request mw_REGISTER_Request_Base modifies mw_REGISTER_Dummy :=
		template(present) SUBSCRIBE_Request mw_SUBSCRIBE_Request_Base modifies mw_SUBSCRIBE_Dummy :=
		template(present) UPDATE_Request mw_UPDATE_Request_Base(template CallId p_callId) modifies mw_UPDATE_Dummy :=
	} //*  end group request_receive
		template(value) Response m_Response_Base (StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq,
		  From p_from, To p_to, Via p_via) modifies m_Response_Dummy:=
		{
			statusLine := p_statusLine,
			msgHeader :=
			{
				callId		:= p_callId,
				cSeq		:= p_cSeq,
				fromField	:= p_from,
				maxForwards := omit,
				toField		:= p_to,
				via		:= p_via
			},
			messageBody := omit,
			payload			:= omit
		}
	} //*  end group response_send
		template(present) Response mw_Response_Base (template(present) StatusLine p_statusLine, template CallId p_callId,
			template CSeq p_cSeq) modifies mw_Response_Dummy:=
		{
			statusLine := p_statusLine,
			msgHeader :=
			{
			  callId		:= p_callId,
			  contentLength	:= *,
			  cSeq		:= p_cSeq,
			  fromField	:= ?,
			  maxForwards := *,
			  toField		:= ?,
			  via		:= ?
		  }
		}
	} //*  end group message_receive
} //*  end group full_templates

group modified_templates {
	
group request_send {
	
	template(value) ACK_Request m_ACK_Request_route (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq,
	From p_from, To p_to, Via p_via, template Route p_route)
	  modifies m_ACK_Request_Base
	  :=
	  {
		msgHeader :=
		{
		  route		:= p_route
		}
	  }

	template(value) ACK_Request m_ACK_Request_sdp (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq,
	From p_from, To p_to, Via p_via,template MessageBody p_mb)
	  modifies m_ACK_Request_Base
	  :=
	  {
		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 }
	template(value) BYE_Request m_BYE_Request_cause
	  (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, From p_from, To p_to, Via p_via, integer p_cause)
	  modifies m_BYE_Request_Base
	  :=
	  {
		msgHeader :=
		{
			  reason := m_Reason(p_cause) //*  PIXIT value
	template(value) INVITE_Request m_INVITE_Request_sdp
	(SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, From p_from, To p_to,
	  Via p_via, Contact p_contact, template MessageBody p_mb)
	modifies m_INVITE_Request_Base
	:=
	{
	  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}
	template(value) INVITE_Request m_INVITE_Request_ResourceList
	(SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, From p_from, To p_to,
	  Via p_via, Contact p_contact, template MessageBody p_mb)
	modifies m_INVITE_Request_Base
	:=
	{
	  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"},
		contentDisposition := {
			fieldName := CONTENT_DISPOSITION_E,
poglitsch's avatar
poglitsch committed
			dispositionType := "recipient-list",
			dispositionParams := omit
		},
		require := {
			fieldName := REQUIRE_E,
poglitsch's avatar
poglitsch committed
			optionsTags := {"recipient-list-invite"}
		}
	  },
	  messageBody := p_mb
  // TODO STF471 added - check occurence
  template(value) REFER_Request m_REFER_Request_route (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, Contact p_contact,
        From p_from, template To p_to, Via p_via, template ReferTo p_referTo, template ReferredBy p_referredBy, template Route p_route)
        modifies m_REFER_Request_Base
    :=
    {
    msgHeader :=
    {
      route   := p_route
    }
  }
    
	template(value) REGISTER_Request m_REGISTER_Request_expires
	  (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, 
	  From p_from, To p_to, Via p_via, Contact p_contact,
	  template Authorization p_authorization, charstring p_expires)
	  modifies  m_REGISTER_Request_Base
	  :=
	  {
		msgHeader :=
		{
			authorization := p_authorization,
		    expires := m_Expires(p_expires)
	template(value) NOTIFY_Request m_NOTIFY_Request_contact (
		SipUrl p_requestUri, 
		CallId p_callId, 
		CSeq p_cSeq,
		From p_from, 
		To p_to, 
		Via p_via, 
		Contact p_contact
	) modifies m_NOTIFY_Request_Base 
	:= 
	{
		msgHeader :=
		{
			contact := p_contact,
			event := m_Event_reg,
			subscriptionState := m_SubscriptionState_active
		}
	}
	  
	  template(value) NOTIFY_Request m_NOTIFY_Request_sipfrag (
	  	SipUrl p_requestUri, 
	  	CallId p_callId, 
	  	CSeq p_cSeq,
		From p_from, 
		To p_to, 
		Via p_via, 
		charstring p_state, 
		charstring p_sipfrag
	) modifies m_NOTIFY_Request_Base := {
			requestLine	:=
			{
				method := NOTIFY_E,
				requestUri :=
				{	scheme := ?,
                    components := {sip:={userInfo := *,
                        hostPort:= p_requestUri.components.sip.hostPort}}
				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,
    				substateParams := omit	
				},
				event := m_Event_refer
			},
			messageBody := {
				sipfrag := 	p_sipfrag
			}
		}
		// TODO STF471 added - check occurence
		template(value) UPDATE_Request m_UPDATE_Request_route (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq,
      From p_from, To p_to, Via p_via, Contact p_contact, template MessageBody p_mb, template Route p_route) modifies  m_UPDATE_Request_Base
        :=
        {
        msgHeader :=
        {
          route   := p_route
        }
    }
} //*  end group request_send	
	template(present) BYE_Request mw_BYE_Request_Reason(template CallId p_callId, template(value) charstring p_cause) modifies mw_BYE_Request_Base :=
	{
		msgHeader :=
		{
			reason := mw_Reason(p_cause)
		}
	}

	template(present) BYE_Request mw_BYE_Request_ReasonSIP(template CallId p_callId, template(value) charstring p_cause) modifies mw_BYE_Request_Base :=
	{
		msgHeader :=
		{
			reason := mw_ReasonSIP(p_cause)
		}
	}
	template(present) BYE_Request mw_BYE_Request_headerfieldlist
		(
		 template 	CallId 	p_callId, 
		 template 	SipUrl	p_requestUri,
		 template(present) 	To 		p_to, 
		 template(present) 	From 	p_from, 
		 template 	CSeq 	p_cSeq,
		 template	Route	p_route,
		 template	RecordRoute	p_recordRoute,
		 template	Reason 	p_reason
		) modifies mw_BYE_Request_Base :=
	{	requestLine := 
		{
			requestUri	:= p_requestUri
		},
		msgHeader :=
		{	
			callId		:= p_callId, 
			toField		:= p_to, 
			fromField	:= p_from,
			cSeq 		:= p_cSeq,
			route		:= p_route,
			recordRoute := p_recordRoute,
	template(present) BYE_Request mw_BYE_Request_UserToUser(template CallId p_callId) modifies mw_BYE_Request_Base :=
rennoch's avatar
rennoch committed
	{
		msgHeader :=
		{
			userToUser := ?
		}
	}

	template(present) INVITE_Request mw_INVITE_Request_RequestURI (template SipUrl p_sipUrl) modifies mw_INVITE_Dummy :=
	{
		requestLine	:=
		{
			requestUri := p_sipUrl,
			sipVersion := c_sipNameVersion
		}
	}

    template(present) INFO_Request mw_INFO_Request_MB (template CallId p_callId, template MessageBody p_mb) modifies mw_INFO_Request_Base :=
pintar's avatar
pintar committed
    {
     messageBody := p_mb
    }

	template(present) INVITE_Request mw_INVITE_Request_expires modifies  mw_INVITE_Request_Base
	template(present) INVITE_Request mw_INVITE_Request_callid(template CallId p_callId) modifies  mw_INVITE_Request_Base
		msgHeader := {callId := p_callId}
pintar's avatar
pintar committed
	
	template(present) INVITE_Request mw_INVITE_Request_MB (template CallId p_callId, template MessageBody p_mb) modifies mw_INVITE_Request_callid :=
pintar's avatar
pintar committed
	{
		messageBody := p_mb
	}
	template(present) INVITE_Request mw_INVITE_Request_noPaccessNetworkInfo(template CallId p_callId)
		modifies mw_INVITE_Request_Base
		:=
		{
		  msgHeader := {  pAccessNetworkInfo := omit}
		}
	
	template(present) INVITE_Request mw_INVITE_Request_PaccessNetworkInfo(template CallId p_callId)
		modifies mw_INVITE_Request_Base
		:=
		{
		  msgHeader := {  pAccessNetworkInfo := ?}
		}

    template(present) INVITE_Request mw_INVITE_MSRP_Session( 
        in template(present) SDP_media_field p_media_MSRP
garciay's avatar
garciay committed
    ) modifies mw_INVITE_Request_Base := {
        messageBody := {
            sdpMessageBody := {
                protocol_version := ?, 
                origin := ?, 
schmitting's avatar
schmitting committed
                session_name := ?,
                information := *,
                uri := *,
                emails := *,
                phone_numbers := *,
                connection := *,
                bandwidth := *,
                times := ?,
                timezone_adjustments := *,
                key := *,
                attributes := *,
garciay's avatar
garciay committed
                media_list := {
                    {
                        media_field := p_media_MSRP,
                        information := *,
                        connections := *,
                        bandwidth := *,
                        key := *,
                        attributes := {
                            {
                                msrp := {
                                    attr_value := pattern "path:msrp://*" // FIXME Shall parse msrp and msrps for secured msrp
                                } 
                            } 
                        }
                    }
                }
            }
		}
	}
		
	template(present) REGISTER_Request mw_REGISTER_Request_ISC (template  PAccessNetworkInfo p_access , template  PVisitedNetworkID p_visited )modifies mw_REGISTER_Request_Base :=
pintar's avatar
pintar committed
	{
	  msgHeader := {  
		  pAccessNetworkInfo := p_access,
		  pVisitedNetworkID  := p_visited
		  }
pintar's avatar
pintar committed
	}
	template(present) UPDATE_Request mw_UPDATE_Request_SDP(template CallId p_callId, template MessageBody p_mb) modifies mw_UPDATE_Dummy :=
pintar's avatar
pintar committed
	{
		messageBody := p_mb
	}
	
    template(present) NOTIFY_Request mw_NOTIFY_Request_MB (template CallId p_callId, template MessageBody p_mb) modifies mw_NOTIFY_Request_Base :=
pintar's avatar
pintar committed
    {
		messageBody := p_mb
    }
} //*  end group request_receive	
group response_send {
	
	template(value) Response m_Response_AlertInfo (
		StatusLine p_statusLine, 
		CallId p_callId, 
		CSeq p_cSeq,
	  	From p_from, 
	  	To p_to,
	  	Via p_via, 
schmitting's avatar
schmitting committed
	  	template AlertInfo p_alertInfo
	) modifies m_Response_Contact:= {
			alertInfo := p_alertInfo
	template(value) Response m_Response_Contact (
		StatusLine p_statusLine, 
		CallId p_callId, 
		CSeq p_cSeq,
		From p_from, 
		To p_to,
		Via p_via, 
		Contact p_contact
	) modifies m_Response_Base:= {
		msgHeader := {
			contact := p_contact
		}
	}
	template(value) Response m_Response_ext (StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq,
	  From p_from, To p_to, Via p_via, template Route p_route, template RecordRoute p_recordroute) modifies m_Response_Base:=
			route 		:= p_route, //f_route(),
			recordRoute := p_recordroute //f_recordroute()
	template(value) Response m_Response_mbody (StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq,
pintar's avatar
pintar committed
	  From p_from, To p_to, Via p_via,  template Route p_route, template RecordRoute p_recordroute, template MessageBody p_mb) modifies m_Response_ext:=
			   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}
	template(value) Response m_Response_PAsserted_Privacy (StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq,
			From p_from, To p_to, Via p_via,  template Route p_route, template RecordRoute p_recordroute, template PAssertedID p_pAssertedID, template Privacy p_privacy) modifies m_Response_ext:=
	{
		msgHeader :=
				{
						pAssertedID := p_pAssertedID,
						privacy := p_privacy
				}
	}
rennoch's avatar
rennoch committed
	
	template(present) Response mw_Response_PAsserted_Privacy_Supported (template (present) StatusLine p_statusLine, template CallId p_callId,
rennoch's avatar
rennoch committed
		template CSeq p_cSeq, template PAssertedID p_pAssertedID, template Privacy p_privacy, template Supported p_supported) modifies mw_Response_Base:=
	{
		statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
		msgHeader :=
		{
			pAssertedID := p_pAssertedID,
			privacy := p_privacy,
			supported := p_supported
		}
	}
	template(value) Response m_Response_PAsserted_Privacy_mbody (StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq,
			From p_from, To p_to, Via p_via,  template Route p_route, template RecordRoute p_recordroute, template PAssertedID p_pAssertedID, template Privacy p_privacy, MessageBody p_mb) modifies m_Response_ext:=
						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
				},
				messageBody := p_mb
	}

} //*  end group response_send	
	template(present) Response mw_Response_Expires (template(present) StatusLine p_statusLine, template CallId p_callId,
		template CSeq p_cSeq, template(present) DeltaSec p_deltaSec) modifies mw_Response_Base:=
	{
		statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
		msgHeader :=
		{
			expires := mw_Expires(p_deltaSec)
        }
	template(present) Response mw_Response_PAsserted_Privacy (template(present) StatusLine p_statusLine, template CallId p_callId,
		template CSeq p_cSeq, template PAssertedID p_pAssertedID, template Privacy p_privacy) modifies mw_Response_Base:=
	{
		statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
		msgHeader :=
		{
			pAssertedID := p_pAssertedID,
			privacy := p_privacy
		}
	}

	template(present) Response mw_Response_Reason (template(present) StatusLine p_statusLine, template CallId p_callId,
		template CSeq p_cSeq, template(value) charstring p_cause) modifies mw_Response_Base:=
	{
		statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
		msgHeader :=
		{
			reason := mw_Reason(p_cause)
			}
	}

	template(present) Response mw_Response_RecordRoute (template(present) StatusLine p_statusLine, template CallId p_callId,
		template CSeq p_cSeq, template RecordRoute p_recordRoute) modifies mw_Response_Base:=
	{
		statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
		msgHeader :=
		{
			recordRoute := p_recordRoute
	  }
	}

	template(present) Response mw_Response_Via (template(present) StatusLine p_statusLine, template CallId p_callId,
		template CSeq p_cSeq, template(present) Via p_via) modifies mw_Response_Base:=
	{
		statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
		msgHeader :=
		{
			via := p_via
	  }
	}
	
	template(present) Response mw_Response_Contact (template(present) StatusLine p_statusLine, template CallId p_callId,
		template CSeq p_cSeq, template Contact p_contact) modifies mw_Response_Base:=
	{
		statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
		msgHeader :=
		{
			contact := p_contact
	  }
	}
	
	template(present) Response mw_Response_AlertInfo (
		template(present) StatusLine p_statusLine, 
		template CallId p_callId,
		template CSeq p_cSeq, 
		template AlertInfo p_alertInfo
	) modifies mw_Response_Base:= {
		statusLine := {
			sipVersion := c_sipNameVersion, 
			statusCode := p_statusLine.statusCode, 
			reasonPhrase := ?
		},
		msgHeader :=
		{
			alertInfo := p_alertInfo
	  }
	}
	
	template(present) Response mw_Response_HistoryInfo (template(present) StatusLine p_statusLine, template CallId p_callId,
rennoch's avatar
rennoch committed
			template CSeq p_cSeq, template HistoryInfo p_historyInfo) modifies mw_Response_Base:=
		{
			statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
			msgHeader :=
			{
				historyInfo:=p_historyInfo
				}
		}
	
	template(present) Response mw_Response_messageBody (
		template(present) StatusLine p_statusLine, 
poglitsch's avatar
poglitsch committed
		template CallId p_callId,
		template CSeq p_cSeq, 
		template Require p_require,
		template MessageBody p_mb
	) modifies mw_Response_Base:= {
		statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
		msgHeader :=
		{
			require := p_require
	    },
	    messageBody := p_mb
	}
	
	template(present) Response mw_Response_Require (template(present) StatusLine p_statusLine, template CallId p_callId,
		template CSeq p_cSeq, template Require p_require) modifies mw_Response_Base:=
	{
		statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
		msgHeader :=
		{
			require := p_require
	  }
	}
	
	template(present) Response mw_Response_Require_ifpresent (template(present) StatusLine p_statusLine, template CallId p_callId,
poglitsch's avatar
poglitsch committed
	template CSeq p_cSeq, template Require p_require) modifies mw_Response_Base:=
	{
		statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
		msgHeader :=
		{
			require := p_require ifpresent
	  }
	}
	
     template(present) Response mw_Response_Supported (template(present) StatusLine p_statusLine, template CallId p_callId,
      template CSeq p_cSeq, template Supported p_supported) modifies mw_Response_Base:=
     {
      statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
      msgHeader :=
      {
       supported := p_supported
       }
     }
     template(present) Response mw_Response_UserToUser (template(present) StatusLine p_statusLine, template CallId p_callId,
rennoch's avatar
rennoch committed
      template CSeq p_cSeq) modifies mw_Response_Base:=
     {
     statusLine := {sipVersion := c_sipNameVersion, statusCode := p_statusLine.statusCode, reasonPhrase := ?},
     msgHeader :=
     {
     	userToUser := ?
       }
     }
} //*  end group response_receive	
} //*  end group modified_templates	
} //*  end group MessageTemplates

group SDP_Templates {
	
	group SDP_Messages {

	group base_templates {
    	
    	template(value) SDP_Message m_SDP(SDP_media_desc p_media, in SipUserProfile p_userprofile) := {
    		protocol_version := 0, //*  v=0
    		origin := {
    			user_name := "voicesession",
    			session_id := "30000",
    			session_version := "0",
    			net_type := c_in,
    			addr_type := c_ip4,
    			addr := p_userprofile.contactIpaddr },
    		//*  o=voicesession 12345 12345 IN IP4 172.27.1.219
    		session_name := "Voice Session", //*  s=Voice Session
    		information := omit,
    		uri := omit,
    		emails := omit,
    		phone_numbers := omit,
    		connection := {
    			net_type := c_in,
    			addr_type := c_ip4,
    			conn_addr := { addr:= p_userprofile.bearerIpaddr, ttl:=omit, num_of_addr:=omit }
    		}, //* c=IN IP4 172.27.1.219
    		bandwidth := omit,
    		times := { { time_field := { "0", "0" }, time_repeat:=omit
    			}
    		timezone_adjustments := omit,
    		key := omit,
    		attributes := omit,
    		media_list := {p_media}
    	};
    	
    	template(value) SDP_Message m_SDP_mediaList(SDP_media_desc_list p_media_list, in SipUserProfile p_userprofile)
			protocol_version := 0, //*  v=0
			origin := {
				user_name := "voicesession",
				session_id := "30000",
				session_version := "0",
				net_type := c_in,
				addr_type := c_ip4,
				addr := p_userprofile.contactIpaddr },
			//*  o=voicesession 12345 12345 IN IP4 172.27.1.219
			session_name := "Voice Session", //*  s=Voice Session
			information := omit,
			uri := omit,
			emails := omit,
			phone_numbers := omit,
			connection := {
				net_type := c_in,
				addr_type := c_ip4,
				conn_addr := { addr:= p_userprofile.bearerIpaddr, ttl:=omit, num_of_addr:=omit }
			}, //* c=IN IP4 172.27.1.219
			bandwidth := omit,
			times := { { time_field := { "0", "0" }, time_repeat:=omit
				}
			timezone_adjustments := omit,
			key := omit,
			attributes := omit,
			media_list := p_media_list
		};

		template(value) SDP_Message m_SDP_media_attr_preconditions(SDP_media_desc p_media, in SipUserProfile p_userprofile, SDP_attribute_list p_attribute_list)
		modifies m_SDP
		:= {
			media_list := {
				{
					media_field := {
						media := c_audio,
						ports := { port_number := 8500, num_of_ports:=omit },
						transport := c_rtpAvp,
						fmts := { "0" }
					}, //* m=audio 8500 RTP/AVP 0				
					information := omit,
					connections := omit,
					bandwidth := omit,
					key := omit,						
poglitsch's avatar
poglitsch committed
					attributes := p_attribute_list
		template(value) SDP_Message m_SDP_attribute(SDP_media_desc p_media, in SipUserProfile p_userprofile, SDP_attribute loc_attribute) 
    	modifies m_SDP
    		:= {
    			attributes := {loc_attribute}
    		};

			template SDP_Message mw_SDP := {
				protocol_version := 0, //*  v=0
				origin := ?,
				session_name := ?, 
				information := omit,
				uri := omit,
				emails := omit,
				phone_numbers := omit,
				connection := ?,
				bandwidth := omit,
				times := { { time_field := { "0", "0" }, time_repeat:=omit
					}
				timezone_adjustments := omit,
				key := omit,
				attributes := omit,
				media_list := ?
			};
		
		
	}//* end group base_templates

	group modified_templates{
    	template(value) SDP_Message m_SDP_bandwidth(SDP_media_desc p_media, in SipUserProfile p_userprofile) 
    	modifies m_SDP
    	:= {
    		bandwidth := {{PX_SIP_SDP_b_modifier, PX_SIP_SDP_b_bandwidth}}
    	};
    
    	template(value) SDP_Message m_SDP_unacceptable(SDP_media_desc p_media, in SipUserProfile p_userprofile) 
    		protocol_version := 1, //*  v=1 unacceptable version of SDP
    		bandwidth := {{PX_SIP_SDP_b_modifier, PX_SIP_SDP_b_bandwidth}}
    	};
    	
    	template(value) SDP_Message m_SDP_encrypted(SDP_media_desc p_media, in SipUserProfile p_userprofile) 
    			protocol_version := 0,
    			bandwidth := {{PX_SIP_SDP_b_modifier, PX_SIP_SDP_b_bandwidth}}
    		};
    }//* end group modified_templates
	} //*  end group	SDP_Messages	
		template(value) SDP_media_desc m_media(template(value) SDP_media_field p_mf) := {
				media_field := p_mf, 
				information := omit,
				connections := omit,
				bandwidth := omit,
				key := omit,						
				attributes := omit
		};
//		template(value) SDP_media_desc m_mediaFieldBandwdthAttributes(template SDP_media_field p_mf, template SDP_bandwidth p_bw, template SDP_attribute_list p_attributes) := {
//				media_field := p_mf, 
//				information := omit,
//				connections := omit,
//				bandwidth := {p_bw},
//				key := omit,						
//				attributes := p_attributes
//		};
		
        template(value) SDP_media_desc m_mediaFieldBandwdthAttributes(template(value) SDP_media_field p_mf, template SDP_bandwidth_list p_bw_l, template SDP_attribute_list p_attributes) := {
                media_field := p_mf, 
                information := omit,
                connections := omit,
                bandwidth := p_bw_l,
                key := omit,						
                attributes := p_attributes
        };
		template(value) SDP_media_desc m_media_dynPT(charstring p_PT, charstring p_encod) := {
					media := c_audio,//* "audio",
					ports := { port_number := 8500, num_of_ports:=omit },
					transport := c_rtpAvp,//* "RTP/AVP",
				}, //* m=audio 8500 RTP/AVP 8
				information := omit,
				connections := omit,
				bandwidth := omit,
				key := omit,						
				attributes := { { rtpmap := { attr_value := p_PT & " " & p_encod }
								}
		template(value) SDP_media_desc m_media_unsupported := {
				media_field := {
					media := "video",
					ports := { port_number := 11500, num_of_ports:=omit },
					transport := "RTP/AVP",
					fmts := { "99" }
				}, //* m=audio 8500 RTP/AVP 0
				information := omit,
				connections := omit,
				bandwidth := omit,
				key := omit,						
				attributes := { { 
					rtpmap := { attr_value := "99 X-Experimental/180000"}
				}}
		};

		template(value) SDP_bandwidth m_bandwidth(template charstring loc_m, template integer loc_b) := {
			modifier:=loc_m, 
			bandwidth:=loc_b
		};

		template(value) SDP_bandwidth m_bandwidth_as_64:= 
		template(present) SDP_bandwidth mw_bandwidth_rs:= 
		template(present) SDP_bandwidth mw_bandwidth_rr:= 
		template(value) SDP_media_field m_media_field(charstring p_media, integer p_portNum, charstring p_transport, charstring p_fmts) :=
		{
			media := p_media,
			ports := { port_number := p_portNum, num_of_ports:=omit },
			transport := p_transport,
			fmts := { p_fmts }
		}		

        template(present) SDP_media_field mw_media_PCMU :=
        {
			media := c_audio,
			ports := { port_number := ?, num_of_ports:=* },
			transport := c_rtpAvp,
			fmts := { "0" }
        }

		template(present) SDP_media_field mw_media_PCMA :=
poglitsch's avatar
poglitsch committed
			ports := { port_number := 8500, num_of_ports:=omit },
			transport := c_rtpAvp,
			fmts := { "8" }
		}
		
		template(present) SDP_media_field mw_media_PCMA_U_DPT :=
		{
			media := c_audio,
			ports := { port_number := ?, num_of_ports:=* },
			transport := c_rtpAvp,
			fmts := { * }
		}
		
		template(present) SDP_media_field mw_media_T38 :=
		{
			media := c_image,
			ports := { port_number := ?, num_of_ports:=* },
			transport := pattern "*ptl", //* udptl,tcptl
		template(present) SDP_media_field mw_media_G722 :=
		{
			media := c_audio,
			ports := { port_number := ?, num_of_ports:=* },
			transport := "RTP/AVP",
			fmts := { "9" }
		}

		template(present) SDP_media_field mw_media_AMR_DPT :=
		{
			media := c_audio,
			ports := { port_number := ?, num_of_ports:=* },
			transport := c_rtpAvp,
			fmts := { * }
		}
		
		template(present) SDP_media_field mw_media_MSRP :=
garciay's avatar
garciay committed
		{
			media := c_msrp,
			ports := { port_number := ?, num_of_ports:=omit },
			transport := c_msrpTcp,
			fmts := { * }
		}
		
		template(value) SDP_attribute m_attribute_sendonly	 := {sendonly:={}};
		template(present) SDP_attribute mw_attribute_sendonly	 := {sendonly:={}};//MRO
		template(value) SDP_attribute m_attribute_recvonly	 := {recvonly:={}};
		template(present) SDP_attribute mw_attribute_recvonly	 := {recvonly:={}};//MRO
		template(value) SDP_attribute m_attribute_sendrecv	 := {sendrecv:={}};
		template(present) SDP_attribute mw_attribute_sendrecv	 := {sendrecv:={}};//MRO
		template(value) SDP_attribute m_attribute_inactive	 := {inactive:={}};
		template(present) SDP_attribute mw_attribute_inactive	 := {inactive:={}};//MRO
		template(present) SDP_attribute mw_attribute_sendonly_inactive := (mw_attribute_sendonly,mw_attribute_inactive);
		template(present) SDP_attribute mw_attribute_sendrecv_recvonly_omit := (mw_attribute_sendrecv,mw_attribute_recvonly,omit);
		template(value) SDP_attribute m_attribute_AMR_DPT	 := { rtpmap := { attr_value := /*pattern "**/PX_SIP_SDP_dyn & " AMR" }};
		template(value) SDP_attribute m_attribute_CLEARMODE_DPT	 := {rtpmap := { attr_value := /*pattern "**/PX_SIP_SDP_dyn & " CLEARMODE/8000" }};
		template(value) SDP_attribute m_attribute_G722	 := { rtpmap := { attr_value := "9 G722/8000" }};
		template(value) SDP_attribute m_attribute_PCMU	 := { rtpmap := { attr_value := "0 PCMU/8000" }};
		template(value) SDP_attribute m_attribute_PCMU_DPT	 := { rtpmap := { attr_value := /*pattern "**/PX_SIP_SDP_dyn & " PCMU/8000" }};
		template(value) SDP_attribute m_attribute_PCMA	 := { rtpmap := { attr_value := "8 PCMA/8000" }};
		template(value) SDP_attribute m_attribute_PCMA_DPT	 := { rtpmap := { attr_value := /*pattern "**/PX_SIP_SDP_dyn & " PCMA/8000" }};
		//TODO: STF471 template name suggests that this is a send template, while it contains matching mechanisms
		template SDP_attribute m_attribute_T38	 := { unknown := { name:=?, attr_value := pattern "*t38*" }};
		
		template(value) SDP_attribute m_attribute_curr (charstring p_preconditionType, charstring p_statusType, charstring p_direction):= 
		{
			curr:={preconditionType := p_preconditionType, 
			statusType := p_statusType, 
			direction := p_direction}
		};
		template(present) SDP_attribute mw_attribute_curr := 
		template(value) SDP_attribute m_attribute_des (charstring p_preconditionType, charstring p_strength, charstring p_statusType, charstring p_direction):= 
		{
			des:={preconditionType := p_preconditionType, 
			strength := p_strength,
			statusType := p_statusType, 
			direction := p_direction}
		};
		template(present) SDP_attribute mw_attribute_des := 
		template(value) SDP_attribute m_attribute_conf (charstring p_preconditionType, charstring p_statusType, charstring p_direction):= 
		{
			conf:={preconditionType := p_preconditionType, 
			statusType := p_statusType, 
			direction := p_direction}
poglitsch's avatar
poglitsch committed
		};