Smack 3.1.0 audio problem

Friends,

When i am trying to implement smack audio call using demo application for smack version 3.1.0.

I set STUN server primary IP address as my local network IP address(10.5.5.12) and i did not change the STUN primary server port (default 3478). When i was added the smack 3…0.4 jars in library, the audio call works fine in a same LAN but it is not working in different network. I need the solution for the smack audio call working in different LAN. When i change the smack version 3.0.4 to 3.1.0 its throwing following error.

I am the beginner of smack. Any help would be appreciated.

Initialized

java.net.PortUnreachableException: ICMP Port Unreachable

at java.net.PlainDatagramSocketImpl.receive0(Native Method)

at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)

at java.net.DatagramSocket.receive(DatagramSocket.java:712)

at de.javawi.jstun.test.DiscoveryTest.test1(DiscoveryTest.java:99)

at de.javawi.jstun.test.DiscoveryTest.test(DiscoveryTest.java:61)

at de.javawi.jstun.test.demo.ice.ICENegociator.gatherCandidateAddresses(ICENegocia tor.java:85)

at org.jivesoftware.smackx.jingle.nat.ICEResolver.initialize(ICEResolver.java:81)

at org.jivesoftware.smackx.jingle.nat.TransportResolver.initializeAndWait(Transpor tResolver.java:387)

at org.jivesoftware.smackx.jingle.nat.ICETransportManager.(ICETransportManag er.java:36)

at Demo.initialize(Demo.java:61)

at Demo.(Demo.java:50)

at Demo.main(Demo.java:221)

java.net.PortUnreachableException: ICMP Port Unreachable

Initializing transport resolver…

Transport resolved

at java.net.PlainDatagramSocketImpl.receive0(Native Method)

at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)

at java.net.DatagramSocket.receive(DatagramSocket.java:712)

at de.javawi.jstun.test.DiscoveryTest.test1(DiscoveryTest.java:99)

at de.javawi.jstun.test.DiscoveryTest.test(DiscoveryTest.java:61)

at de.javawi.jstun.test.demo.ice.ICENegociator.gatherCandidateAddresses(ICENegocia tor.java:85)

at org.jivesoftware.smackx.jingle.nat.ICEResolver.initialize(ICEResolver.java:81)

at org.jivesoftware.smackx.jingle.nat.TransportResolver.initializeAndWait(Transpor tResolver.java:387)

at org.jivesoftware.smackx.jingle.nat.ICETransportManager.(ICETransportManag er.java:36)

at Demo.initialize(Demo.java:61)

at Demo.(Demo.java:50)

at Demo.main(Demo.java:221)

Exception in thread “main” java.lang.NoClassDefFoundError: mil/jfcom/cie/media/session/MediaSessionListener

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:621)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)

at java.net.URLClassLoader.access$000(URLClassLoader.java:56)

at java.net.URLClassLoader$1.run(URLClassLoader.java:195)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:252)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

at Demo.initialize(Demo.java:65)

at Demo.(Demo.java:50)

at Demo.main(Demo.java:221)

Caused by: java.lang.ClassNotFoundException: mil.jfcom.cie.media.session.MediaSessionListener

at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:252)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

… 15 more

I am also facing the same problem…If you resolved it please share it with us.

I am working through smack jingle slowly myself. I was able to get past this, though I can’t say I have it working so YMMV.

I believe your mistake is when you say “I set STUN server primary IP address as my local network IP address”. Your local machine is likely not a STUN server. Since you didn’t post your code, I’ll assume you are talking about the ICETransportManager constructor, which is not documented in javadocs or the demo code, so I’ll explain what I did:

The first parameter to the constructor should be the active XmppConnection. Make sure you are logged in.

The third parameter will generally be 3478, which is the UDP port assigned to the STUN service.

The second parameter is your remote STUN server. Very often, your XMPP server is also a STUN server, so often you can do this:

ICETransportManager icetm0 = new ICETransportManager( xmppConnection,

xmppConnection.getHost(),

3478 );

That worked for me, but may not for you if your XMPP server is not a stun server. You could try “stunserver.org” and see if that works for you.

I too am receiving an error on that line but it is different:

I don’t understand what is supposed to go in there? I tried your examples bjorn but still the same response. Any other ideas?

java.net.BindException: Cannot assign requested address: Cannot bind

Hi,

I posted the smack audio problem. The problem in my side was the STUN server. In general STUN server needs two public IP address in order to maintain audio communication between two different machines located in two different places. So finally i set STUN server with two different public IP addressess. Now its working fine. If you are not having two public IP address you can still connect to third party STUN server which is listed in open fire admin console under stun setting section. The STUN server port is default port 3478. You can test STUN server and its port functioning status using **winstun **software.

Regards,

Raj.

Hi Raj,

I put server as igniterealtime.org and port as it is 3478, now I am not getting “unable to reach host” error, but I get following error. Please advise how to ignore this error.

java.net.BindException: Cannot assign requested address: Cannot bind

at java.net.PlainDatagramSocketImpl.bind0(Native Method)

at java.net.PlainDatagramSocketImpl.bind(PlainDatagramSocketImpl.java:91)

at java.net.DatagramSocket.bind(DatagramSocket.java:372)

at java.net.DatagramSocket.(DatagramSocket.java:211)

at java.net.DatagramSocket.(DatagramSocket.java:262)

at de.javawi.jstun.test.demo.ice.Candidate.(Candidate.java:35)

at de.javawi.jstun.test.demo.ice.ICENegociator.testInterface(ICENegociator.java:12 2)

at de.javawi.jstun.test.demo.ice.ICENegociator.access$000(ICENegociator.java:40)

at de.javawi.jstun.test.demo.ice.ICENegociator$1.run(ICENegociator.java:88)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 886)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

at java.lang.Thread.run(Thread.java:662)

Exception in thread “main” java.lang.NoClassDefFoundError: mil/jfcom/cie/media/session/MediaSessionListener

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)

at java.lang.ClassLoader.defineClass(ClassLoader.java:615)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

at pushnote.Demo.initialize(Demo.java:86)

at pushnote.Demo.(Demo.java:75)

at pushnote.Demo.main(Demo.java:166)

Caused by: java.lang.ClassNotFoundException: mil.jfcom.cie.media.session.MediaSessionListener

at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

… 15 more

I searched for the above class, couldnt find the jar file it contains. Please help me out.

Rgds

Balaji