IT. Expert System.

Android Reference


Class SimpleSessionDescription

  • public class SimpleSessionDescription
    extends Object
    An object used to manipulate messages of Session Description Protocol (SDP). It is mainly designed for the uses of Session Initiation Protocol (SIP). Therefore, it only handles connection addresses ("c="), bandwidth limits, ("b="), encryption keys ("k="), and attribute fields ("a="). Currently this implementation does not support multicast sessions.

    Here is an example code to create a session description.

     SimpleSessionDescription description = new SimpleSessionDescription(
         System.currentTimeMillis(), "");
     Media media = description.newMedia("audio", 56789, 1, "RTP/AVP");
     media.setRtpPayload(0, "PCMU/8000", null);
     media.setRtpPayload(8, "PCMA/8000", null);
     media.setRtpPayload(127, "telephone-event/8000", "0-15");
     media.setAttribute("sendrecv", "");

    Invoking description.encode() will produce a result like the one below.

     o=- 1284970442706 1284970442709 IN IP4
     c=IN IP4
     t=0 0
     m=audio 56789 RTP/AVP 0 8 127
     a=rtpmap:0 PCMU/8000
     a=rtpmap:8 PCMA/8000
     a=rtpmap:127 telephone-event/8000
     a=fmtp:127 0-15
    • Constructor Detail

      • SimpleSessionDescription

        public SimpleSessionDescription(long sessionId,
                                String address)
        Creates a minimal session description from the given session ID and unicast address. The address is used in the origin field ("o=") and the connection field ("c="). See SimpleSessionDescription for an example of its usage.
      • SimpleSessionDescription

        public SimpleSessionDescription(String message)
        Creates a session description from the given message.
        IllegalArgumentException - if message is invalid.
    • Method Detail

      • newMedia

        public SimpleSessionDescription.Media newMedia(String type,
                                              int port,
                                              int portCount,
                                              String protocol)
        Creates a new media description in this session description.
        type - The media type, e.g. "audio".
        port - The first transport port used by this media.
        portCount - The number of contiguous ports used by this media.
        protocol - The transport protocol, e.g. "RTP/AVP".
      • encode

        public String encode()
        Encodes the session description and all its media descriptions in a string. Note that the result might be incomplete if a required field has never been added before.
      • getAddress

        public String getAddress()
        Returns the connection address or null if it is not present.
      • setAddress

        public void setAddress(String address)
        Sets the connection address. The field will be removed if the address is null.
      • getEncryptionMethod

        public String getEncryptionMethod()
        Returns the encryption method or null if it is not present.
      • getEncryptionKey

        public String getEncryptionKey()
        Returns the encryption key or null if it is not present.
      • setEncryption

        public void setEncryption(String method,
                         String key)
        Sets the encryption method and the encryption key. The field will be removed if the method is null.
      • getBandwidthTypes

        public String[] getBandwidthTypes()
        Returns the types of the bandwidth limits.
      • getBandwidth

        public int getBandwidth(String type)
        Returns the bandwidth limit of the given type or -1 if it is not present.
      • setBandwidth

        public void setBandwidth(String type,
                        int value)
        Sets the bandwith limit for the given type. The field will be removed if the value is negative.
      • getAttributeNames

        public String[] getAttributeNames()
        Returns the names of all the attributes.
      • getAttribute

        public String getAttribute(String name)
        Returns the attribute of the given name or null if it is not present.
      • setAttribute

        public void setAttribute(String name,
                        String value)
        Sets the attribute for the given name. The field will be removed if the value is null. To set a binary attribute, use an empty string as the value.


Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)





Java Script








Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 72 / 159454129. Delta: 0.11952 с