[sip-comm] SIP-Comm call failure due error in RTPManager initialization


#1

I've used to make calls with SIP-Comm , but after migrating from XP to Vista
I'm getting the error shown in attached log files.

Origin SIP-Comm allocates RTP ports and sends INVITE with them:

20:30:04.505 FINE: impl.media.CallSessionImpl.allocateMediaPorts().2123
AudioSessionAddress=DataAddress: agolubev/127.0.0.1
ControlAddress: agolubev/127.0.0.1
DataPort: 5000
ControlPort: 5001
20:30:04.505 FINE: impl.media.CallSessionImpl.allocateMediaPorts().2124
AudioPublicAddress=agolubev/127.0.0.1:5000

20:30:05.364 FINE:
impl.protocol.sip.OperationSetBasicTelephonySipImpl.createOutgoingCall().305
sent request: INVITE sip:user1@localhost:5070;transport=udp SIP/2.0
Call-ID: c37f743d335790387bb5339ea5b86810@0:0:0:0:0:0:0:0
CSeq: 1 INVITE

From: "user2" <sip:user2@127.0.0.1:5080;transport=udp>;tag=5d3cd980

Via: SIP/2.0/UDP 127.0.0.1:5080
;branch=z9hG4bK97e65e00e8317ad2daf61ef32d54ad65
Max-Forwards: 70
User-Agent: SIP Communicator1.0-alpha3-nightly.build.1865Windows Vista
Contact: "user2" <sip:user2@127.0.0.1:5080;transport=udp>
Content-Type: application/sdp
Content-Length: 424

v=0
o=user2 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 5000 RTP/AVP 0 8 97 3 5 4
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no;bitrate=6.3
a=zrtp-hash:1.10
11cb9e47a568a4b0546e39f1d42ac920a51eee046d9b00ab01c97fbbdd1f3e5a
m=video 5002 RTP/AVP 99 34 26 31
a=rtpmap:99 H264/90000
a=fmtp:99 packetization-mode=1
a=recvonly
a=zrtp-hash:1.10
ef9d59b12b7d1026dcad70ea2a88b9c3aa072d802d64b2a15ff60a9e2a08ffba

, but destination SIP-Comm does try to bind to the same port while
"answering" and thus the error arises:

20:30:10.617 FINE: impl.media.CallSessionImpl.allocateMediaPorts().2197
AudioSessionAddress=DataAddress: agolubev/127.0.0.1
ControlAddress: agolubev/127.0.0.1
DataPort: 5000
ControlPort: 5001

20:30:10.628 SEVERE: impl.media.CallSessionImpl.initializeRtpManager().2396
Failed to init an RTP manager.
javax.media.rtp.InvalidSessionAddressException: Can't open local data port:
5000
at com.sun.media.rtp.RTPSessionMgr.initialize(RTPSessionMgr.java:2882)
at com.sun.media.rtp.RTPSessionMgr.initialize(RTPSessionMgr.java:2690)

What can be the problem ?

Why does destination SIP-Comm try to bind to the same RTP ports which it
receives in INVITE from origin SIP-Comm ?

Best Regards,
Alexander.

origin.log (91 KB)

destination.log (30.5 KB)

···

To: <sip:user1@localhost:5070;transport=udp>


#2

Hi,

I'm experiencing a problem with making calls between 2 locally installed
SIP-Comm.

After debugging I've found a place in the code which can potentially cause
some problems
in my case.

The file
is net\java\sip\communicator\impl\netaddr\NetworkAddressManagerServiceImpl.java.
In its method "public InetSocketAddress getPublicAddressFor(InetAddress dst,
int port)" the class
tests a socket to be allocated for RTPManager for example. If binding test
fails then another port number
is tried.

The test in getPublicAddressFor() is simple:

            //we'll still try to bind though so that we could notify the
caller
            //if the port has been taken already.
            DatagramSocket bindTestSocket = new DatagramSocket(port);
            bindTestSocket.close();

But what confuses me - why it doesn't use provided InetAddress dst when
DatagramSocket is created?

So the port availability is tested against localhost interface, whereas our
interest is a port on the interface specified
in InetAddress dst.

As a result some port number can pass the test but will fail while real
allocation because such port can be available
for binding on localhost interface, but for interface specified in supplied
InetAddress that port can be already bound.

Best Regards,
Alexander.

origin.log (91 KB)

destination.log (30.5 KB)

···

---------- Forwarded message ----------

From: Alexander Golubev <golubec@gmail.com>

Date: 2009/8/3
Subject: SIP-Comm call failure due error in RTPManager initialization
To: users@sip-communicator.dev.java.net

I've used to make calls with SIP-Comm , but after migrating from XP to Vista
I'm getting the error shown in attached log files.

Origin SIP-Comm allocates RTP ports and sends INVITE with them:

20:30:04.505 FINE: impl.media.CallSessionImpl.allocateMediaPorts().2123
AudioSessionAddress=DataAddress: agolubev/127.0.0.1
ControlAddress: agolubev/127.0.0.1
DataPort: 5000
ControlPort: 5001
20:30:04.505 FINE: impl.media.CallSessionImpl.allocateMediaPorts().2124
AudioPublicAddress=agolubev/127.0.0.1:5000

20:30:05.364 FINE:
impl.protocol.sip.OperationSetBasicTelephonySipImpl.createOutgoingCall().305
sent request: INVITE sip:user1@localhost:5070;transport=udp SIP/2.0
Call-ID: c37f743d335790387bb5339ea5b86810@0:0:0:0:0:0:0:0
CSeq: 1 INVITE

From: "user2" <sip:user2@127.0.0.1:5080;transport=udp>;tag=5d3cd980

To: <sip:user1@localhost:5070;transport=udp>
Via: SIP/2.0/UDP 127.0.0.1:5080
;branch=z9hG4bK97e65e00e8317ad2daf61ef32d54ad65
Max-Forwards: 70
User-Agent: SIP Communicator1.0-alpha3-nightly.build.1865Windows Vista
Contact: "user2" <sip:user2@127.0.0.1:5080;transport=udp>
Content-Type: application/sdp
Content-Length: 424

v=0
o=user2 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 5000 RTP/AVP 0 8 97 3 5 4
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no;bitrate=6.3
a=zrtp-hash:1.10
11cb9e47a568a4b0546e39f1d42ac920a51eee046d9b00ab01c97fbbdd1f3e5a
m=video 5002 RTP/AVP 99 34 26 31
a=rtpmap:99 H264/90000
a=fmtp:99 packetization-mode=1
a=recvonly
a=zrtp-hash:1.10
ef9d59b12b7d1026dcad70ea2a88b9c3aa072d802d64b2a15ff60a9e2a08ffba

, but destination SIP-Comm does try to bind to the same port while
"answering" and thus the error arises:

20:30:10.617 FINE: impl.media.CallSessionImpl.allocateMediaPorts().2197
AudioSessionAddress=DataAddress: agolubev/127.0.0.1
ControlAddress: agolubev/127.0.0.1
DataPort: 5000
ControlPort: 5001

20:30:10.628 SEVERE: impl.media.CallSessionImpl.initializeRtpManager().2396
Failed to init an RTP manager.
javax.media.rtp.InvalidSessionAddressException: Can't open local data port:
5000
at com.sun.media.rtp.RTPSessionMgr.initialize(RTPSessionMgr.java:2882)
at com.sun.media.rtp.RTPSessionMgr.initialize(RTPSessionMgr.java:2690)

What can be the problem ?

Why does destination SIP-Comm try to bind to the same RTP ports which it
receives in INVITE from origin SIP-Comm ?

Best Regards,
Alexander.


#3

Hello,

Making sure that archives have the complete story:

This thread has been continued on dev, and archives can be found here:
https://sip-communicator.dev.java.net/servlets/BrowseList?list=dev&by=thread&from=1937320

Emil

Alexander Golubev wrote:

···

I've used to make calls with SIP-Comm , but after migrating from XP to
Vista I'm getting the error shown in attached log files.

Origin SIP-Comm allocates RTP ports and sends INVITE with them:

20:30:04.505 FINE: impl.media.CallSessionImpl.allocateMediaPorts().2123
AudioSessionAddress=DataAddress: agolubev/127.0.0.1 <http://127.0.0.1>
ControlAddress: agolubev/127.0.0.1 <http://127.0.0.1>
DataPort: 5000
ControlPort: 5001
20:30:04.505 FINE: impl.media.CallSessionImpl.allocateMediaPorts().2124
AudioPublicAddress=agolubev/127.0.0.1:5000 <http://127.0.0.1:5000>

20:30:05.364 FINE:
impl.protocol.sip.OperationSetBasicTelephonySipImpl.createOutgoingCall().305
sent request: INVITE sip:user1@localhost:5070;transport=udp SIP/2.0
Call-ID: c37f743d335790387bb5339ea5b86810@0:0:0:0:0:0:0:0
CSeq: 1 INVITE
From: "user2" <sip:user2@127.0.0.1:5080;transport=udp>;tag=5d3cd980
To: <sip:user1@localhost:5070;transport=udp>
Via: SIP/2.0/UDP
127.0.0.1:5080;branch=z9hG4bK97e65e00e8317ad2daf61ef32d54ad65
Max-Forwards: 70
User-Agent: SIP Communicator1.0-alpha3-nightly.build.1865Windows Vista
Contact: "user2" <sip:user2@127.0.0.1:5080;transport=udp>
Content-Type: application/sdp
Content-Length: 424

v=0
o=user2 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 5000 RTP/AVP 0 8 97 3 5 4
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no;bitrate=6.3
a=zrtp-hash:1.10
11cb9e47a568a4b0546e39f1d42ac920a51eee046d9b00ab01c97fbbdd1f3e5a
m=video 5002 RTP/AVP 99 34 26 31
a=rtpmap:99 H264/90000
a=fmtp:99 packetization-mode=1
a=recvonly
a=zrtp-hash:1.10
ef9d59b12b7d1026dcad70ea2a88b9c3aa072d802d64b2a15ff60a9e2a08ffba

, but destination SIP-Comm does try to bind to the same port while
"answering" and thus the error arises:

20:30:10.617 FINE: impl.media.CallSessionImpl.allocateMediaPorts().2197
AudioSessionAddress=DataAddress: agolubev/127.0.0.1 <http://127.0.0.1>
ControlAddress: agolubev/127.0.0.1 <http://127.0.0.1>
DataPort: 5000
ControlPort: 5001

20:30:10.628 SEVERE:
impl.media.CallSessionImpl.initializeRtpManager().2396 Failed to init an
RTP manager.
javax.media.rtp.InvalidSessionAddressException: Can't open local data
port: 5000
at com.sun.media.rtp.RTPSessionMgr.initialize(RTPSessionMgr.java:2882)
at com.sun.media.rtp.RTPSessionMgr.initialize(RTPSessionMgr.java:2690)

What can be the problem ?

Why does destination SIP-Comm try to bind to the same RTP ports which it
receives in INVITE from origin SIP-Comm ?

Best Regards,
Alexander.

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: users-help@sip-communicator.dev.java.net

--
Emil Ivov, Ph.D. 67000 Strasbourg,
Project Lead France
SIP Communicator
emcho@sip-communicator.org PHONE: +33.1.77.62.43.30
http://sip-communicator.org FAX: +33.1.77.62.47.31

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: users-help@sip-communicator.dev.java.net


#4

It's odd, in allocatePort the catch never happens.
This catch increments the port number each time a binding error occurs.

            catch (IOException ex)
            {
                logger.warn("Retrying a bind because of a failure. "
                            + "Failed Address is: "
                            + sessionAddress.toString(), ex);

                //reinit the session address we tried with and prepare to
retry.
                sessionAddress
                    .setDataPort(sessionAddress.getDataPort()+2);
                sessionAddress
                    .setControlPort(sessionAddress.getControlPort()+2);
            }


#5

The catch never happens beacuse SC do specify the InetAddress when it test
port in allocatePort.

Try with this patch and tell me if it works for you.

Cheers

Romain

localCalls.patch (3.33 KB)

···

2009/8/6 Romain <filirom1@gmail.com>

It's odd, in allocatePort the catch never happens.
This catch increments the port number each time a binding error occurs.

            catch (IOException ex)
            {
                logger.warn("Retrying a bind because of a failure. "
                            + "Failed Address is: "
                            + sessionAddress.toString(), ex);

                //reinit the session address we tried with and prepare to
retry.
                sessionAddress
                    .setDataPort(sessionAddress.getDataPort()+2);
                sessionAddress
                    .setControlPort(sessionAddress.getControlPort()+2);
            }


#6

Romain, thanks!

Your patch really works for me. And it makes the code more readable since
the things
are more explicit now.

Best Regards,
Alexander.

···

2009/8/6 Romain <filirom1@gmail.com>

The catch never happens beacuse SC do specify the InetAddress when it test
port in allocatePort.

Try with this patch and tell me if it works for you.

Cheers

Romain

2009/8/6 Romain <filirom1@gmail.com>

It's odd, in allocatePort the catch never happens.
This catch increments the port number each time a binding error occurs.

            catch (IOException ex)
            {
                logger.warn("Retrying a bind because of a failure. "
                            + "Failed Address is: "
                            + sessionAddress.toString(), ex);

                //reinit the session address we tried with and prepare to
retry.
                sessionAddress
                    .setDataPort(sessionAddress.getDataPort()+2);
                sessionAddress
                    .setControlPort(sessionAddress.getControlPort()+2);
            }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#7

If you want to integrate this patch in the trunk, I make it look nicer.

This patch correct the fact that getPublicAddressFor function didn't use the
local IP adress to check if a socket is free or not.

Cheers

Romain

localCalls.patch (4.69 KB)

···

2009/8/10 Alexander Golubev <golubec@gmail.com>

Romain, thanks!

Your patch really works for me. And it makes the code more readable since
the things
are more explicit now.

Best Regards,
Alexander.

2009/8/6 Romain <filirom1@gmail.com>

The catch never happens beacuse SC do specify the InetAddress when it test
port in allocatePort.

Try with this patch and tell me if it works for you.

Cheers

Romain

2009/8/6 Romain <filirom1@gmail.com>

It's odd, in allocatePort the catch never happens.
This catch increments the port number each time a binding error occurs.

            catch (IOException ex)
            {
                logger.warn("Retrying a bind because of a failure. "
                            + "Failed Address is: "
                            + sessionAddress.toString(), ex);

                //reinit the session address we tried with and prepare to
retry.
                sessionAddress
                    .setDataPort(sessionAddress.getDataPort()+2);
                sessionAddress
                    .setControlPort(sessionAddress.getControlPort()+2);
            }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#8

Hi Romain,

Not sure about integrating this patch in the trunk myself.
I'm not a committer for the project and don't have proper experience.

Best Regards,
Alexander.

···

2009/8/17 Romain <filirom1@gmail.com>

If you want to integrate this patch in the trunk, I make it look nicer.

This patch correct the fact that getPublicAddressFor function didn't use
the local IP adress to check if a socket is free or not.

Cheers

Romain

2009/8/10 Alexander Golubev <golubec@gmail.com>

Romain, thanks!

Your patch really works for me. And it makes the code more readable since
the things
are more explicit now.

Best Regards,
Alexander.

2009/8/6 Romain <filirom1@gmail.com>

The catch never happens beacuse SC do specify the InetAddress when it
test port in allocatePort.

Try with this patch and tell me if it works for you.

Cheers

Romain

2009/8/6 Romain <filirom1@gmail.com>

It's odd, in allocatePort the catch never happens.
This catch increments the port number each time a binding error occurs.

            catch (IOException ex)
            {
                logger.warn("Retrying a bind because of a failure. "
                            + "Failed Address is: "
                            + sessionAddress.toString(), ex);

                //reinit the session address we tried with and prepare
to retry.
                sessionAddress
                    .setDataPort(sessionAddress.getDataPort()+2);
                sessionAddress
                    .setControlPort(sessionAddress.getControlPort()+2);
            }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net