org.mobicents.media.server.impl.rtp
Class RtpFactory

java.lang.Object
  extended by org.mobicents.media.server.impl.rtp.RtpFactory

public class RtpFactory
extends java.lang.Object

Author:
Oleg Kulikov

Field Summary
protected  java.net.InetSocketAddress publicAddress
           
protected  java.util.HashMap<java.net.SocketAddress,RtpSocket> rtpSockets
           
 
Constructor Summary
RtpFactory()
          Creates RTP Factory instance
 
Method Summary
 java.lang.String getBindAddress()
          Gets the IP address to which trunk is bound.
 java.util.Map<java.lang.Integer,org.mobicents.media.Format> getFormatMap()
           
 java.lang.Integer getJitter()
          Gets the size of the jitter buffer in milliseconds.
 int getLocalPort()
           
 RtpSocket getRTPSocket()
          Constructs new RTP socket.
 java.lang.String getStunAddress()
          Gets the address of stun server if present.
 org.mobicents.media.server.spi.Timer getTimer()
          Gets media processing timer used by RTP socket.
 void releaseRTPSocket(RtpSocket rtpSocket)
           
 void setBindAddress(java.lang.String bindAddress)
          Modify the bind address.
 void setFormatMap(java.util.Map<java.lang.Integer,org.mobicents.media.Format> originalFormatMap)
           
 void setJitter(java.lang.Integer jitter)
          Modify size of the jitter buffer.
 void setLocalPort(int localPort)
           
 void setStunAddress(java.lang.String address)
          Assigns address of the STUN server.
 void setTimer(org.mobicents.media.server.spi.Timer timer)
          Assigns media processing timer.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

publicAddress

protected java.net.InetSocketAddress publicAddress

rtpSockets

protected volatile java.util.HashMap<java.net.SocketAddress,RtpSocket> rtpSockets
Constructor Detail

RtpFactory

public RtpFactory()
Creates RTP Factory instance

Method Detail

getLocalPort

public int getLocalPort()

setLocalPort

public void setLocalPort(int localPort)

getStunAddress

public java.lang.String getStunAddress()
Gets the address of stun server if present.

Returns:
the address of stun server or null if not assigned.

setStunAddress

public void setStunAddress(java.lang.String address)
Assigns address of the STUN server.

Parameters:
address - the address of the stun server in format host[:port]. if port is not set then default port is used.

start

public void start()
           throws java.net.SocketException,
                  java.io.IOException,
                  net.java.stun4j.StunException
Throws:
java.net.SocketException
java.io.IOException
net.java.stun4j.StunException

stop

public void stop()

getTimer

public org.mobicents.media.server.spi.Timer getTimer()
Gets media processing timer used by RTP socket.

Returns:
timer object.

setTimer

public void setTimer(org.mobicents.media.server.spi.Timer timer)
Assigns media processing timer.

Parameters:
timer - tmer object.

getBindAddress

public java.lang.String getBindAddress()
Gets the IP address to which trunk is bound. All endpoints of the trunk use this address for RTP connection.

Returns:
the IP address string to which this trunk is bound.

setBindAddress

public void setBindAddress(java.lang.String bindAddress)
                    throws java.net.UnknownHostException
Modify the bind address. All endpoints of the trunk use this address for RTP connection.

Parameters:
bindAddress - IP address as string or host name.
Throws:
java.net.UnknownHostException

getJitter

public java.lang.Integer getJitter()
Gets the size of the jitter buffer in milliseconds. Jitter buffer is used at the receiving ends of a VoIP connection. A jitter buffer stores received, time-jittered VoIP packets, that arrive within its time window. It then plays stored packets out, in sequence, and at a constant rate for subsequent decoding. A jitter buffer is typically filled half-way before playing out packets to allow early, or late, packet-arrival jitter compensation. Choosing a large jitter buffer reduces packet dropping from jitter but increases VoIP path delay

Returns:
the size of the buffer in milliseconds.

setJitter

public void setJitter(java.lang.Integer jitter)
Modify size of the jitter buffer. Jitter buffer is used at the receiving ends of a VoIP connection. A jitter buffer stores received, time-jittered VoIP packets, that arrive within its time window. It then plays stored packets out, in sequence, and at a constant rate for subsequent decoding. A jitter buffer is typically filled half-way before playing out packets to allow early, or late, packet-arrival jitter compensation. Choosing a large jitter buffer reduces packet dropping from jitter but increases VoIP path delay

Parameters:
jitter - the new buffer's size in milliseconds

getRTPSocket

public RtpSocket getRTPSocket()
Constructs new RTP socket.

Returns:
the RTPSocketInstance.
Throws:
net.java.stun4j.StunException
java.io.IOException
java.net.SocketException
net.java.stun4j.StunException
java.io.IOException

releaseRTPSocket

public void releaseRTPSocket(RtpSocket rtpSocket)

getFormatMap

public java.util.Map<java.lang.Integer,org.mobicents.media.Format> getFormatMap()

setFormatMap

public void setFormatMap(java.util.Map<java.lang.Integer,org.mobicents.media.Format> originalFormatMap)


Copyright © 2009. All Rights Reserved.