LibSip_SDPTypes.ttcn 9.27 KB
Newer Older
 *  @author   STF 346, STF366, STF368, STF369
 *  @version  $Id$
 *	@desc     This module defines message, attribute, structured and simple 
 *            SDP types as well constants used by LipSip constructs. <br>
 *            Note that any changes made to the definitions in this module
 *            may be overwritten by future releases of this library
 *            End users are encouraged to contact the distributers of this  
 *            module regarding their modifications or additions
 *  @remark   Adding of new attributes types is ok;
 *            Adding of new optional attributes in @see SDP_attribute type 
 *            is ok;
 *            Existing attribute types shall not be changed or removed -
 *            change requests shall be made to http://t-ort.etsi.org
schmitting's avatar
schmitting committed
module LibSip_SDPTypes //MRO
{
  group Constants 
  {	
   	group SimpleConstants
   	{
		const charstring c_in := "IN";
		
		const charstring c_ip4 := "IP4";

		const charstring c_audio := "audio";
    const charstring c_image := "image";
		const charstring c_video := "video";
		
		// SDP_media_desc: transport
		const charstring c_rtpAvp := "RTP/AVP";
		const charstring c_udptl := "Udptl";
		
		// SDP_attribute_list constants:
		const charstring c_local := "local";
		const charstring c_mandatory := "mandatory";
		const charstring c_none := "none";
		const charstring c_qos := "qos";
		const charstring c_remote := "remote"; 
		const charstring c_sendrecv := "sendrecv";
poglitsch's avatar
poglitsch committed
		const charstring c_send := "send";
		const charstring c_recv := "recv";
		const charstring c_e2e := "e2e";
   	}
  } 
  group Types
  {
    group SubTypes
    {
        group AttributeTypes
        {
            type record SDP_attribute_cat {
                charstring attr_value
            }

            type record SDP_attribute_keywds {
                charstring attr_value
            }

            type record SDP_attribute_tool {
                charstring attr_value
            }

            type record SDP_attribute_ptime {
                charstring attr_value
            }

            type record SDP_attribute_recvonly {
            }

            type record SDP_attribute_sendrecv {
            }

            type record SDP_attribute_sendonly {
            }

			type record SDP_attribute_inactive {
			}

            type record SDP_attribute_orient {
                charstring attr_value
            }

            type record SDP_attribute_type {
                charstring attr_value
            }

            type record SDP_attribute_charset {
                charstring attr_value
            }

            type record SDP_attribute_sdplang {
                charstring attr_value
            }

            type record SDP_attribute_lang {
                charstring attr_value
            }

            type record SDP_attribute_framerate {
                charstring attr_value
            }

            type record SDP_attribute_quality {
                charstring attr_value
            }

            type record SDP_attribute_fmtp {
                charstring attr_value
            }

			type record SDP_attribute_curr {
				charstring preconditionType,
				charstring statusType,
				charstring direction
			}

			type record SDP_attribute_des {
				charstring preconditionType,
				charstring strength,
				charstring statusType,
				charstring direction
			}

			type record SDP_attribute_conf {
				charstring preconditionType,
				charstring statusType,
				charstring direction
			}

            type record SDP_attribute_rtpmap {
                charstring attr_value
            }

            type record SDP_attribute_rtcp {
                charstring attr_value
            }

            type record SDP_attribute_unknown {
                charstring name,
                charstring attr_value optional
            }


            type union SDP_attribute {
                SDP_attribute_cat             cat,
                SDP_attribute_keywds          keywds,
                SDP_attribute_tool            tool,
                SDP_attribute_ptime           ptime,
                SDP_attribute_recvonly        recvonly,
                SDP_attribute_sendrecv        sendrecv,
                SDP_attribute_sendonly        sendonly,
				SDP_attribute_inactive		  inactive,
                SDP_attribute_orient          orient,
                SDP_attribute_type            sdp_type,
                SDP_attribute_charset         charset,
                SDP_attribute_sdplang         sdplang,
                SDP_attribute_lang            lang,
                SDP_attribute_framerate       framerate,
                SDP_attribute_quality         quality,
                SDP_attribute_fmtp            fmtp,
                SDP_attribute_curr            curr,
                SDP_attribute_des             des,
                SDP_attribute_conf            conf,
                SDP_attribute_rtpmap          rtpmap,
                //*  unknown has to be the last else encoding/decoding won't work!
                SDP_attribute_unknown unknown
            }
        } //*  group AttributeTypes

      type set of SDP_attribute SDP_attribute_list;

      type record SDP_bandwidth {
        charstring          modifier,
        integer             bandwidth
      }

	  type set of SDP_bandwidth SDP_bandwidth_list;

      type record SDP_connection {
        charstring          net_type,
        charstring          addr_type,
		SDP_conn_addr		conn_addr
      }

      type record SDP_conn_addr {
	  	charstring addr,
		integer ttl optional,
		integer num_of_addr optional
	  }

      type set of SDP_connection SDP_connection_list;

      type record SDP_contact {
        charstring          addr_or_phone,
        charstring          disp_name optional
      }

      type SDP_contact SDP_contact_tel;

      type SDP_contact SDP_contact_email;

      type set of SDP_contact_email SDP_email_list;

      type record of charstring SDP_fmt_list ;

      type record SDP_key {
        charstring          method,
        charstring          key optional
      }

      type record SDP_media_desc {
        SDP_media_field     media_field,
        charstring          information optional,
        SDP_connection_list connections optional,
		SDP_bandwidth_list  bandwidth optional,
        SDP_key             key optional,
        SDP_attribute_list  attributes optional
      }

      type set of SDP_media_desc SDP_media_desc_list;

      type record SDP_media_port {
        integer             port_number,
        integer             num_of_ports optional
      }

      type record SDP_media_field {
        charstring          media,
        SDP_media_port      ports,
        charstring          transport,
        SDP_fmt_list        fmts
      }

      type record SDP_time{
        SDP_time_field      time_field,
        SDP_repeat_list     time_repeat optional
      }

      type record SDP_time_field{
        charstring   start_time, //*  field is numeric strings that may not fit into 32-bit signed int
        charstring   stop_time //*  field is numeric strings that may not fit into 32-bit signed int
      }

      type record SDP_repeat{
        SDP_typed_time      repeat_interval,
        SDP_typed_time      active,
        SDP_typed_time_list offsets
      }

      type set of SDP_repeat SDP_repeat_list;

      type record SDP_typed_time{
        integer        time,
        charstring     unit optional
      }

      type set of SDP_typed_time SDP_typed_time_list;

      type set of SDP_time SDP_time_list;

      type record SDP_timezone{
        charstring          adjustment_time,
        SDP_typed_time      offset
      }

      type set of SDP_timezone SDP_timezone_list;

      type record SDP_Origin{
        charstring          user_name,
        charstring          session_id,//*  field is numeric strings that may not fit into 32-bit signed int
        charstring          session_version, //*  field is numeric strings that may not fit into 32-bit signed int
        charstring          net_type,
        charstring          addr_type,
        charstring          addr
      }

      type set of SDP_contact_tel SDP_phone_list;


    group MessageTypes
    {
      type record SDP_Message{
        integer             protocol_version,
        SDP_Origin          origin,
        charstring          session_name,
        charstring          information optional,
        charstring          uri optional,
        SDP_email_list      emails optional,
        SDP_phone_list      phone_numbers optional,
        SDP_connection      connection optional,
		SDP_bandwidth_list  bandwidth optional,
        SDP_time_list       times,
        SDP_timezone_list   timezone_adjustments optional,
        SDP_key             key optional,
        SDP_attribute_list  attributes optional,
        SDP_media_desc_list media_list optional
      } with { encode "SDPCodec" }
    } //  group MessageTypes
  } //  group Types
} // end module LibSip_SDPTypes