Class RTSPServer

java.lang.Object
javaforce.voip.RTSP
javaforce.voip.RTSPServer
All Implemented Interfaces:
STUN.Listener, RTSPInterface, TransportInterface

public class RTSPServer extends RTSP implements RTSPInterface, STUN.Listener
Handles the server end of a RTSP link.
  • Field Details

    • userobj

      public Object userobj
    • expires

      public int expires
  • Constructor Details

    • RTSPServer

      public RTSPServer()
  • Method Details

    • init

      public boolean init(int localport, RTSPServerInterface iface, TransportType type)
      Initialize this instance for RTSP.
      Parameters:
      localport - is the TCP port to bind to locally (usually 554).
      iface - must be a RTSPServerInterface where RTSP events are dispatched to.
    • uninit

      public void uninit()
      Free all resources.
      Overrides:
      uninit in class RTSP
    • setNAT

      public static void setNAT(RTSPServer.NAT nat, String host, String user, String pass)
      Sets the type of NAT traversal type (global setting).
    • useNATOnPrivateNetwork

      public static void useNATOnPrivateNetwork(boolean state)
      Disable/enable use of NAT traversal on private networks (global setting) Private networks : 192.168.x.x , 10.x.x.x , 172.[16-31].x.x
    • isPrivateNetwork

      public static boolean isPrivateNetwork(String ip)
      Determine if server is on a local private network.
    • getlocalRTPhost

      public String getlocalRTPhost(RTSPSession sess)
      Returns local RTP IP address.
      Specified by:
      getlocalRTPhost in class RTSP
    • stunPublicIP

      public void stunPublicIP(STUN stun, String ip, int port)
      Specified by:
      stunPublicIP in interface STUN.Listener
    • turnAlloc

      public void turnAlloc(STUN stun, String ip, int port, byte[] token, int lifetime)
      Specified by:
      turnAlloc in interface STUN.Listener
    • turnBind

      public void turnBind(STUN stun)
      Specified by:
      turnBind in interface STUN.Listener
    • turnRefresh

      public void turnRefresh(STUN stun, int lifetime)
      Specified by:
      turnRefresh in interface STUN.Listener
    • turnFailed

      public void turnFailed(STUN stun)
      Specified by:
      turnFailed in interface STUN.Listener
    • turnData

      public void turnData(STUN stun, byte[] data, int offset, int length, short channel)
      Specified by:
      turnData in interface STUN.Listener
    • reply

      public boolean reply(RTSPSession sess, int code, String msg, String header)
      Issues a reply to the RTSP client.
    • reply

      public boolean reply(RTSPSession sess, int reply, String msg)
      Issues a reply to the RTSP client.
    • getSessions

      public RTSPSession[] getSessions()
    • getTransportClients

      public String[] getTransportClients()
    • onPacket

      public void onPacket(RTSP rtsp, String[] msg, String remoteip, int remoteport)
      Processes RTSP messages sent from clients.
      Specified by:
      onPacket in interface RTSPInterface
    • onConnect

      public void onConnect(RTSP rtsp, String remoteip, int remoteport)
      Specified by:
      onConnect in interface RTSPInterface
    • onDisconnect

      public void onDisconnect(RTSP rtsp, String remoteip, int remoteport)
      Specified by:
      onDisconnect in interface RTSPInterface