powered by Jive Software

Possible bug in /src/plugins/sip/src/java/net/java/sipmack/sip/NetworkAddressManager.java?

Dear All,

I am not a good Java programmers but i have seen something which thought to share with you and get an advised if there could be any side-effects.

class /src/plugins/sip/src/java/net/java/sipmack/sip/NetworkAddressManager.java

while loops at line 144 and line 168

first loops tries to get the best ip address

Try to get best IP ( not loopback, not linklocal and not sitelocal )

if (!iaddress.isLoopbackAddress() && !iaddress.isLinkLocalAddress() && !iaddress.isSiteLocalAddress() && !(iaddress instanceof java.net.Inet6Address)) {

then the second while loop

Try to get best IP ( not loopback and not linklocal )

if (!iaddress.isLoopbackAddress() && !iaddress.isLinkLocalAddress() && !(iaddress instanceof java.net.Inet6Address)) {

in my opionion the second while loop is un-necessary because the goal is achieved in the first loop already and the second while loop only causes delays in starting the sip service.

if both the loops are there then it takes atelast 120 seconds to start the sip phone but if i remove the second loop it takes only a 10 seconds to start the phone.

here are debug results with and without the second loop:

with Both loops:

SIP Controller Found
NETWORK DETECTION
NETWORK DETECTION
SELECTED IP: /192.168.150.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
NETWORK DETECTION
NETWORK DETECTION
SELECTED IP: /192.168.150.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.150.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.150.1
createSoftPhone - SIP STARTED
register - net.java.sipmack.sip.CommunicationsException: Could not create a register transaction!
Check that the Registrar address is correct!
net.java.sipmack.sip.CommunicationsException: Could not create a register transaction!
Check that the Registrar address is correct!
at net.java.sipmack.sip.RegisterProcessing.register(RegisterProcessing.java:315)
at net.java.sipmack.sip.SipManager.register(SipManager.java:575)
at net.java.sipmack.sip.SipManager.startRegisterProcess(SipManager.java:615)
at net.java.sipmack.softphone.SoftPhoneManager.handleRegisterRequest(SoftPhoneMana ger.java:452)
at net.java.sipmack.softphone.SoftPhoneManager$2.run(SoftPhoneManager.java:969)
at java.lang.Thread.run(Thread.java:619)
NETWORK DETECTION
SELECTED IP: /192.168.150.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.150.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.150.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.150.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.150.1
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.150.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.150.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.150.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.150.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.150.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.150.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.150.1
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.150.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.150.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.150.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.150.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.150.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.150.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.239.1
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.239.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.239.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.239.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.239.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.239.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.239.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.239.1
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.239.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.239.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.239.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.239.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.239.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.239.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.239.1
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.239.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.239.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.239.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.239.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.239.1
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.239.1
TIME ERROR
NETWORK DETECTION
SELECTED IP: /192.168.2.103
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.2.103
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: /192.168.2.103

[407]


[200]

NETWORK DETECTION
SELECTED IP: /192.168.2.103

[407]

without second while loop

SIP Controller Found
NETWORK DETECTION
SIP STACK CONFIGURED
NETWORK DETECTION
NETWORK DETECTION
SIP STACK CONFIGURED
SIP STACK CONFIGURED
SIP STACK CONFIGURED
NETWORK DETECTION
SELECTED IP: office/192.168.2.103
createSoftPhone - SIP STARTED

[407]


[200]

NETWORK DETECTION
SELECTED IP: office/192.168.2.103

[407]