From 3d36536a415445833eccce4bbcf84f25156ab983 Mon Sep 17 00:00:00 2001 From: Thiago Camargo Date: Fri, 6 Apr 2007 23:43:18 +0000 Subject: [PATCH] New JStun and Media Fixes git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7919 b35dd754-fafc-0310-a699-88a17e54d16e --- jingle/extension/build/merge/jstun.jar | Bin 76890 -> 76890 bytes .../smackx/jingle/IncomingJingleSession.java | 14 ++++++++++++++ .../smackx/jingle/OutgoingJingleSession.java | 14 ++++++++++++++ .../jingle/mediaimpl/jmf/AudioChannel.java | 15 ++++++++++----- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/jingle/extension/build/merge/jstun.jar b/jingle/extension/build/merge/jstun.jar index b98fbfb814b4ffd7dced59487439d9a1f7797c1e..1b8ac75199e8809e0ee2149fec6b04a59603e46b 100644 GIT binary patch delta 37 qcmcb0gXPu@7Ty4FW)=|!4j}x!q^*&6D=*_^QDz`>`(shYaxnn(77YUc delta 37 qcmcb0gXPu@7Ty4FW)=|!4j?RcZ)xP+%FB3Jlo`m}{#cZ;Tnqr(tqU~( diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/IncomingJingleSession.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/IncomingJingleSession.java index 70fd71938..018e8f951 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/IncomingJingleSession.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/IncomingJingleSession.java @@ -454,4 +454,18 @@ public class IncomingJingleSession extends JingleSession { 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; + } } diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/OutgoingJingleSession.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/OutgoingJingleSession.java index db8d4ebf1..3813fc6cd 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/OutgoingJingleSession.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/OutgoingJingleSession.java @@ -461,4 +461,18 @@ public class OutgoingJingleSession extends JingleSession { 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; + } } diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/mediaimpl/jmf/AudioChannel.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/mediaimpl/jmf/AudioChannel.java index 633baef2d..c11fb39a2 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/mediaimpl/jmf/AudioChannel.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/mediaimpl/jmf/AudioChannel.java @@ -176,8 +176,13 @@ public class AudioChannel { ds = javax.media.Manager.createDataSource(locator); } catch (Exception e) { - e.printStackTrace(); - return "Couldn't create DataSource"; + // Try JavaSound Locator as a last resort + try { + ds = javax.media.Manager.createDataSource(new MediaLocator("javasound://")); + } + catch (Exception ee) { + return "Couldn't create DataSource"; + } } // Try to create a processor to handle the input jmf locator @@ -327,7 +332,7 @@ public class AudioChannel { SessionAddress localAddr, destAddr; InetAddress ipAddr; SendStream sendStream; - audioReceiver = new AudioReceiver(this,jingleMediaSession); + audioReceiver = new AudioReceiver(this, jingleMediaSession); int port; for (int i = 0; i < pbss.length; i++) { @@ -475,8 +480,8 @@ public class AudioChannel { try { localhost = InetAddress.getLocalHost(); - 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 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); audioChannel0.start(); audioChannel1.start();