mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 22:12:05 +01:00
New JStun and Media Fixes
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7919 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
ca19a1ee57
commit
3d36536a41
4 changed files with 38 additions and 5 deletions
Binary file not shown.
|
@ -454,4 +454,18 @@ public class IncomingJingleSession extends JingleSession {
|
||||||
super.eventError(iq);
|
super.eventError(iq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IQ sendFormattedError(JingleError error){
|
||||||
|
IQ perror = null;
|
||||||
|
if (error != null) {
|
||||||
|
perror = createIQ(getSid(), getInitiator(), getResponder(), IQ.Type.ERROR);
|
||||||
|
|
||||||
|
// Fill in the fields with the info from the Jingle packet
|
||||||
|
perror.addExtension(error);
|
||||||
|
|
||||||
|
getConnection().sendPacket(perror);
|
||||||
|
System.err.println(perror.toXML());
|
||||||
|
}
|
||||||
|
return perror;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -461,4 +461,18 @@ public class OutgoingJingleSession extends JingleSession {
|
||||||
super.eventError(iq);
|
super.eventError(iq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IQ sendFormattedError(JingleError error) {
|
||||||
|
IQ perror = null;
|
||||||
|
if (error != null) {
|
||||||
|
perror = createIQ(getSid(), getResponder(), getInitiator(), IQ.Type.ERROR);
|
||||||
|
|
||||||
|
// Fill in the fields with the info from the Jingle packet
|
||||||
|
perror.addExtension(error);
|
||||||
|
|
||||||
|
getConnection().sendPacket(perror);
|
||||||
|
System.err.println(perror.toXML());
|
||||||
|
}
|
||||||
|
return perror;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,9 +176,14 @@ public class AudioChannel {
|
||||||
ds = javax.media.Manager.createDataSource(locator);
|
ds = javax.media.Manager.createDataSource(locator);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
e.printStackTrace();
|
// Try JavaSound Locator as a last resort
|
||||||
|
try {
|
||||||
|
ds = javax.media.Manager.createDataSource(new MediaLocator("javasound://"));
|
||||||
|
}
|
||||||
|
catch (Exception ee) {
|
||||||
return "Couldn't create DataSource";
|
return "Couldn't create DataSource";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Try to create a processor to handle the input jmf locator
|
// Try to create a processor to handle the input jmf locator
|
||||||
try {
|
try {
|
||||||
|
@ -327,7 +332,7 @@ public class AudioChannel {
|
||||||
SessionAddress localAddr, destAddr;
|
SessionAddress localAddr, destAddr;
|
||||||
InetAddress ipAddr;
|
InetAddress ipAddr;
|
||||||
SendStream sendStream;
|
SendStream sendStream;
|
||||||
audioReceiver = new AudioReceiver(this,jingleMediaSession);
|
audioReceiver = new AudioReceiver(this, jingleMediaSession);
|
||||||
int port;
|
int port;
|
||||||
|
|
||||||
for (int i = 0; i < pbss.length; i++) {
|
for (int i = 0; i < pbss.length; i++) {
|
||||||
|
@ -475,8 +480,8 @@ public class AudioChannel {
|
||||||
try {
|
try {
|
||||||
localhost = InetAddress.getLocalHost();
|
localhost = InetAddress.getLocalHost();
|
||||||
|
|
||||||
AudioChannel audioChannel0 = new AudioChannel(new MediaLocator("javasound://8000"), localhost.getHostAddress(), localhost.getHostAddress(), 7002, 7020, new AudioFormat(AudioFormat.GSM_RTP),null);
|
AudioChannel audioChannel0 = new AudioChannel(new MediaLocator("javasound://8000"), localhost.getHostAddress(), localhost.getHostAddress(), 7002, 7020, new AudioFormat(AudioFormat.GSM_RTP), null);
|
||||||
AudioChannel audioChannel1 = new AudioChannel(new MediaLocator("javasound://8000"), localhost.getHostAddress(), localhost.getHostAddress(), 7020, 7002, new AudioFormat(AudioFormat.GSM_RTP),null);
|
AudioChannel audioChannel1 = new AudioChannel(new MediaLocator("javasound://8000"), localhost.getHostAddress(), localhost.getHostAddress(), 7020, 7002, new AudioFormat(AudioFormat.GSM_RTP), null);
|
||||||
|
|
||||||
audioChannel0.start();
|
audioChannel0.start();
|
||||||
audioChannel1.start();
|
audioChannel1.start();
|
||||||
|
|
Loading…
Reference in a new issue