views:

42

answers:

0

Code:

final int port = 5060;
byte[] inviteBytes = sipInvite.getBytes();
DatagramPacket packet = new DatagramPacket(inviteBytes, inviteBytes.length, toInetAddress, port);
DatagramSocket serverSocket = new DatagramSocket(port);
serverSocket.send(packet);

Which throws:

09-10 19:18:00.107: WARN/System.err(5408): java.net.SocketException: Operation not permitted
09-10 19:18:00.117: WARN/System.err(5408):   at org.apache.harmony.luni.platform.OSNetworkSystem.sendDatagramImpl(Native Method)
09-10 19:18:00.117: WARN/System.err(5408):   at org.apache.harmony.luni.platform.OSNetworkSystem.sendDatagram(OSNetworkSystem.java: 571)
09-10 19:18:00.117: WARN/System.err(5408):   at org.apache.harmony.luni.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java: 275)
09-10 19:18:00.117: WARN/System.err(5408):   at java.net.DatagramSocket.send(DatagramSocket.java:463)
09-10 19:18:00.117: WARN/System.err(5408):   at com.icast.mypie.sip.SipClient.doConnect(SipClient.java:71)
09-10 19:18:00.117: WARN/System.err(5408):   at com.icast.mypie.sip.SipClient.run(SipClient.java:43)

Nexus 2.2, device connects via wifi. Port not blocked. Datagram send works from android 1.5 moto blur.