mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-23 06:42:05 +01:00
Use Alternative Session Address if default on fail
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7978 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
eb3d196bce
commit
60e0222c14
1 changed files with 15 additions and 1 deletions
|
@ -33,12 +33,15 @@ import javax.media.protocol.PushBufferStream;
|
||||||
import javax.media.rtp.RTPManager;
|
import javax.media.rtp.RTPManager;
|
||||||
import javax.media.rtp.SendStream;
|
import javax.media.rtp.SendStream;
|
||||||
import javax.media.rtp.SessionAddress;
|
import javax.media.rtp.SessionAddress;
|
||||||
|
import javax.media.rtp.InvalidSessionAddressException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.sun.media.rtp.RTPSessionMgr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An Easy to use Audio Channel implemented using JMF.
|
* An Easy to use Audio Channel implemented using JMF.
|
||||||
* It sends and receives jmf for and from desired IPs and ports.
|
* It sends and receives jmf for and from desired IPs and ports.
|
||||||
|
@ -356,8 +359,19 @@ public class AudioChannel {
|
||||||
bc.setBufferLength(bl);
|
bc.setBufferLength(bl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
rtpMgrs[i].initialize(localAddr);
|
rtpMgrs[i].initialize(localAddr);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (InvalidSessionAddressException e) {
|
||||||
|
// In case the local address is not allowed to read, we user another local address
|
||||||
|
SessionAddress sessAddr = new SessionAddress();
|
||||||
|
localAddr = new SessionAddress(InetAddress.getByName(sessAddr.getDataHostAddress()),
|
||||||
|
localPort);
|
||||||
|
rtpMgrs[i].initialize(localAddr);
|
||||||
|
}
|
||||||
|
|
||||||
rtpMgrs[i].addTarget(destAddr);
|
rtpMgrs[i].addTarget(destAddr);
|
||||||
|
|
||||||
System.err.println("Created RTP session at " + localPort + " to: " + remoteIpAddress + " " + port);
|
System.err.println("Created RTP session at " + localPort + " to: " + remoteIpAddress + " " + port);
|
||||||
|
|
Loading…
Reference in a new issue