Using Media Proxy with Jingle

I want to be able to send media between two computers that are stuck behind NAT’s. I see alot of people suggesting Openfire’s media proxy but how do I program a client to work with it? The data being sent also has to be bi-directional, they both have to receive/send media at the same time. I’ve already gotten a client to work with ICE and STUN.

So, after doing some more research I found that ICE tries to tie in STUN, TURN and “media proxy”, or as they’re calling it “BridgedTransportManager” and RTPBridge". I guess the problem I’m having right now is that I’m trying to give the program I’m working with as much NAT traversal ability as I can. I need it to be able to work with Symmetric NATs(stun DOES NOT WORK with Symmetric nats) as well. Does anyone have anymore advice for me?

I was also looking into upnp as another possibility. I’m going to have to do more research on that one too though. Is upnp enabled on most routers? What about corporate NAT’s?

thank you

So, after touching up some of the most recent jingle code I was able to get the clients behind a symmetric nat and a restricted cone nat to:

  1. Create a media Session (I’m using JMFMediaManager)

  2. Stream the audio to one of the ports in the media proxy (RTPBrdige). I can tell something is being sent because instead of the media session timing out 60 seconds right after creating it, the session stays active. I can also see the packets being sent using wireshark.

This is a step in the right direction but now the problem is Nothing is being sent back through the bridge. The way it seems to be set up is that each user is waiting for the other end to send them an rtp stream. In the RTPBridge setup, no can do since each user has to read from some port in the rtpbridge to read the stream instead of just waiting to receive something. In the documentation/posts that I’ve read it says that when user1 sends to Openfire:portA, user 2 can read the stream on Openfire:(portA+1). There’s no need for each user to initialize their own session.

From here I’m going to see if I can read the stream from Openfire:PortA+1 only if a relay session is needed.

If I’m missing anything important please please tell me!!

Is there a special way to read an rtp stream other than:

String mediaLocation = “rtp://” +

cand.getIp() + “:” +



MediaLocator mediaLocator = new MediaLocator(mediaLocation);

Player p =;


I have a feeling this just isn’t going to work.

I got it to work!!! it turns out that it’s imparative that both use the same rtp bridge. At first they were creating their own rtp bridges and sending to those seperate ones, but if you set them up on the same one (one sends to port A and the other to port B) then it automatically works!!! So make the initiator send to port A and if your not the initiator, send to port B on the same rtp bridge as the initiator!

yay, I figured it out.

see the last post