org.jivesoftware.smackx.jingle.nat
Class RTPBridge

java.lang.Object
  extended by IQ
      extended by org.jivesoftware.smackx.jingle.nat.RTPBridge

public class RTPBridge
extends IQ

RTPBridge IQ Packet used to request and retrieve a RTPBridge Candidates that can be used for a Jingle Media Transmission between two parties that are behind NAT. This Jingle Bridge has all the needed information to establish a full UDP Channel (Send and Receive) between two parties. This transport method should be used only if other transport methods are not allowed. Or if you want a more reliable transport.

High Level Usage Example:

RTPBridge rtpBridge = RTPBridge.getRTPBridge(xmppConnection, sessionID);

Author:
Thiago Camargo

Nested Class Summary
static class RTPBridge.Provider
          IQProvider for RTP Bridge packets.
 
Field Summary
static java.lang.String ELEMENT_NAME
          Element name of the packet extension.
static java.lang.String NAME
          Element name of the packet extension.
static java.lang.String NAMESPACE
          Namespace of the packet extension.
 
Constructor Summary
RTPBridge()
          Creates a RTPBridge Packet without Session ID
RTPBridge(org.jivesoftware.smackx.jingle.nat.RTPBridge.BridgeAction action)
          Creates a RTPBridge Instance with defined Session ID
RTPBridge(java.lang.String sid)
          Creates a RTPBridge Instance with defined Session ID
RTPBridge(java.lang.String sid, org.jivesoftware.smackx.jingle.nat.RTPBridge.BridgeAction bridgeAction)
          Creates a RTPBridge Instance with defined Session ID
 
Method Summary
 java.lang.String getAttributes()
          Get the attributes string
 java.lang.String getChildElementXML()
          Get the Child Element XML of the Packet
 java.lang.String getHostA()
          Get the Host A IP Address
 java.lang.String getHostB()
          Get the Host B IP Address
 java.lang.String getIp()
          Get the RTP Bridge IP
 java.lang.String getName()
          Get the name of the Candidate
 java.lang.String getPass()
          Get the RTP Agent Pass
 int getPortA()
          Get Side A receive port
 int getPortB()
          Get Side B receive port
static java.lang.String getPublicIP(XMPPConnection xmppConnection)
          Get Public Address from the Server.
static RTPBridge getRTPBridge(XMPPConnection xmppConnection, java.lang.String sessionID)
          Get a new RTPBridge Candidate from the server.
 java.lang.String getSid()
          Get the Session ID of the Packet (usually same as Jingle Session ID)
static RTPBridge relaySession(XMPPConnection xmppConnection, java.lang.String sessionID, java.lang.String pass, TransportCandidate proxyCandidate, TransportCandidate localCandidate)
          Check if the server support RTPBridge Service.
static boolean serviceAvailable(XMPPConnection xmppConnection)
          Check if the server support RTPBridge Service.
 void setHostA(java.lang.String hostA)
          Set the Host A IP Address
 void setHostB(java.lang.String hostB)
          Set the Host B IP Address
 void setIp(java.lang.String ip)
          Set the RTP Bridge IP
 void setName(java.lang.String name)
          Set the name of the Candidate
 void setPass(java.lang.String pass)
          Set the RTP Agent Pass
 void setPortA(int portA)
          Set Side A receive port
 void setPortB(int portB)
          Set Side B receive port
 void setSid(java.lang.String sid)
          Set the Session ID of the Packet (usually same as Jingle Session ID)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
Element name of the packet extension.

See Also:
Constant Field Values

ELEMENT_NAME

public static final java.lang.String ELEMENT_NAME
Element name of the packet extension.

See Also:
Constant Field Values

NAMESPACE

public static final java.lang.String NAMESPACE
Namespace of the packet extension.

See Also:
Constant Field Values
Constructor Detail

RTPBridge

public RTPBridge(java.lang.String sid)
Creates a RTPBridge Instance with defined Session ID

Parameters:
sid -

RTPBridge

public RTPBridge(org.jivesoftware.smackx.jingle.nat.RTPBridge.BridgeAction action)
Creates a RTPBridge Instance with defined Session ID

Parameters:
action -

RTPBridge

public RTPBridge(java.lang.String sid,
                 org.jivesoftware.smackx.jingle.nat.RTPBridge.BridgeAction bridgeAction)
Creates a RTPBridge Instance with defined Session ID

Parameters:
sid -
bridgeAction -

RTPBridge

public RTPBridge()
Creates a RTPBridge Packet without Session ID

Method Detail

getAttributes

public java.lang.String getAttributes()
Get the attributes string


getSid

public java.lang.String getSid()
Get the Session ID of the Packet (usually same as Jingle Session ID)

Returns:

setSid

public void setSid(java.lang.String sid)
Set the Session ID of the Packet (usually same as Jingle Session ID)

Parameters:
sid -

getHostA

public java.lang.String getHostA()
Get the Host A IP Address

Returns:

setHostA

public void setHostA(java.lang.String hostA)
Set the Host A IP Address

Parameters:
hostA -

getHostB

public java.lang.String getHostB()
Get the Host B IP Address

Returns:

setHostB

public void setHostB(java.lang.String hostB)
Set the Host B IP Address

Parameters:
hostB -

getPortA

public int getPortA()
Get Side A receive port

Returns:

setPortA

public void setPortA(int portA)
Set Side A receive port

Parameters:
portA -

getPortB

public int getPortB()
Get Side B receive port

Returns:

setPortB

public void setPortB(int portB)
Set Side B receive port

Parameters:
portB -

getIp

public java.lang.String getIp()
Get the RTP Bridge IP

Returns:

setIp

public void setIp(java.lang.String ip)
Set the RTP Bridge IP

Parameters:
ip -

getPass

public java.lang.String getPass()
Get the RTP Agent Pass

Returns:

setPass

public void setPass(java.lang.String pass)
Set the RTP Agent Pass

Parameters:
pass -

getName

public java.lang.String getName()
Get the name of the Candidate

Returns:

setName

public void setName(java.lang.String name)
Set the name of the Candidate

Parameters:
name -

getChildElementXML

public java.lang.String getChildElementXML()
Get the Child Element XML of the Packet

Returns:

getRTPBridge

public static RTPBridge getRTPBridge(XMPPConnection xmppConnection,
                                     java.lang.String sessionID)
Get a new RTPBridge Candidate from the server. If a error occurs or the server donīt support RTPBridge Service, null is returned.

Parameters:
xmppConnection -
sessionID -
Returns:

serviceAvailable

public static boolean serviceAvailable(XMPPConnection xmppConnection)
Check if the server support RTPBridge Service.

Parameters:
xmppConnection -
Returns:

relaySession

public static RTPBridge relaySession(XMPPConnection xmppConnection,
                                     java.lang.String sessionID,
                                     java.lang.String pass,
                                     TransportCandidate proxyCandidate,
                                     TransportCandidate localCandidate)
Check if the server support RTPBridge Service.

Parameters:
xmppConnection -
Returns:

getPublicIP

public static java.lang.String getPublicIP(XMPPConnection xmppConnection)
Get Public Address from the Server.

Parameters:
xmppConnection -
Returns:
public IP String or null if not found