org.mitre.jsip
Class SdpMessage

java.lang.Object
  |
  +--org.mitre.jsip.SdpMessage

public class SdpMessage
extends java.lang.Object


Field Summary
static int APPLICATION
           
static int AUDIO
           
static int CONTROL
           
static int DATA
           
static int VIDEO
           
 
Constructor Summary
SdpMessage()
          Construct a blank SDP message object.
SdpMessage(java.lang.String parseinput)
          Parse the given SDP message.
 
Method Summary
 void addMedia(int media, java.lang.String type, java.lang.String protocol, int port)
          Allows the addition of a standard protocol
 void addMediaAttribute(int media, java.lang.String type, java.lang.String attStr)
           
 java.lang.String getIpAddress()
          Returns the IP address of the session described.
 java.lang.String getName()
          Returns the unique session name.
 int getPort()
          Returns the port on which media is being received.
 boolean isOnHold()
          Returns true if this SDP implies the call is on hold.
 boolean isValid()
          Returns true if the parsed SDP message is valid.
static void main(java.lang.String[] args)
          test out SdpMessage
 java.lang.String message()
          Builds and returns an SDP message given the contents.
 void setIpAddress(java.lang.String newaddr)
          Sets the IP address to which media should be directed.
 void setName(java.lang.String newname)
          Sets the name of the session (the SDP s= line).
 void setPort(int newport)
          Sets the port on which media is to be received.
 void setSessionTimes(java.util.Date startTime, java.util.Date stopTime)
          Sets the times the session is active
 void setUsername(java.lang.String username)
          Sets the username (for the SDP o= line).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUDIO

public static final int AUDIO

VIDEO

public static final int VIDEO

DATA

public static final int DATA

APPLICATION

public static final int APPLICATION

CONTROL

public static final int CONTROL
Constructor Detail

SdpMessage

public SdpMessage()
Construct a blank SDP message object.

SdpMessage

public SdpMessage(java.lang.String parseinput)
Parse the given SDP message.
Parameters:
parseinput -  
Method Detail

isValid

public boolean isValid()
Returns true if the parsed SDP message is valid.
Returns:
bool

isOnHold

public boolean isOnHold()
Returns true if this SDP implies the call is on hold.
Returns:
bool

getName

public java.lang.String getName()
Returns the unique session name. This is the s= line of SDP.
Returns:
String

getIpAddress

public java.lang.String getIpAddress()
Returns the IP address of the session described.
Returns:
String

getPort

public int getPort()
Returns the port on which media is being received.
Returns:
int

setIpAddress

public void setIpAddress(java.lang.String newaddr)
Sets the IP address to which media should be directed.
Parameters:
newaddr -  

setPort

public void setPort(int newport)
Sets the port on which media is to be received.
Parameters:
newport -  

setName

public void setName(java.lang.String newname)
Sets the name of the session (the SDP s= line).
Parameters:
newname -  

setUsername

public void setUsername(java.lang.String username)
Sets the username (for the SDP o= line).
Parameters:
username -  

setSessionTimes

public void setSessionTimes(java.util.Date startTime,
                            java.util.Date stopTime)
Sets the times the session is active

addMedia

public void addMedia(int media,
                     java.lang.String type,
                     java.lang.String protocol,
                     int port)
Allows the addition of a standard protocol

addMediaAttribute

public void addMediaAttribute(int media,
                              java.lang.String type,
                              java.lang.String attStr)

message

public java.lang.String message()
Builds and returns an SDP message given the contents.
Returns:
String

main

public static void main(java.lang.String[] args)
test out SdpMessage