[sip-comm-dev] PATCH listening points and outbound proxy init

Hey Javier,

I am not quite sure I follow since the initOutboundProxy method is not
supposed to depend on the listening points. It simply retrieves the
options that the user specified in the accountProperties, converts them
in a format that jain-sip understands and inserts them into the
jainSipStackProperties map.

The jainSipStackProperties are then used to init the stack and we then
use it (the stack) to create the listening points.

In other words, if you are having problems with the initialization of
the outbound proxy then they are most likely caused by something else.

You might want to post your exception here so that we could have a look.

Cheers
Emil

Javier Mendiara Cañardo написа:

···

Hi all,

here it's a little patch that corrects null pointer exceptions in the
current revision.
The exceptions are caused because in the current code,
initOutboundProxy
was performed before
initListeningPoints

and initOutboundProxy needs the listeningpoints initialised

Hope this helps,

Best regards,
Javier

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

---------------------------------------------------------------------
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

Heey, I got it! Very good stuff!

The problem occurs when we set an IP address for an outbound proxy
rather than a domain name. We handle this case separately so that we
make sure we don't try to PTR resolve IP addresses. In such cases we
need to set a default port in the socket address that we return since we
can't get one from the DNS. The thing is that for some reason we were
retrieving the port number from our local listening point.

I just changed this in the code (acked!) and you can try it out with
revision 4549, or build 1427 (as soon as it becomes available).

Could you please give it a try and let me know how it works?

Thanks for reporting this!

Emil

Javier Mendiara Cañardo написа:

···

Hi Emil,

unofortunately I dont have the development environment enabled, but I
will try to reproduce the error by seeing the code. If this is not
sufficient, I will send the exception ASAP.

This NullPointerException is throwed when adding a SIP Account, or when
registering an existing one against the SIP Server.
-------------
In private void initOutboundProxy(SipAccountID accountID,
                                   Properties jainSipProperties)

you make (line 2107)
InetSocketAddress proxySocketAddress = resolveSipAddress(
                            proxyAddressStr, proxyTransport);
----------
And in
public InetSocketAddress resolveSipAddress(String address, String
transport)

you make (line 2641)
InetSocketAddress(addressObj,
                            getListeningPoint(transport).getPort());

--------

Here, getListeningPoint(transport) returns null because the listening
points have not been initialised, so you get the NullPointerException
and this is why I initListeningPoints before the outboundProxy.

Hope you understand me!

Best regards,
Javier

PS: i got this exception short time ago, in a possible recent commit of
ProtocolProviderServiceSipImpl

Emil Ivov escribió:

Hey Javier,

I am not quite sure I follow since the initOutboundProxy method is not
supposed to depend on the listening points. It simply retrieves the
options that the user specified in the accountProperties, converts them
in a format that jain-sip understands and inserts them into the
jainSipStackProperties map.

The jainSipStackProperties are then used to init the stack and we then
use it (the stack) to create the listening points.

In other words, if you are having problems with the initialization of
the outbound proxy then they are most likely caused by something else.

You might want to post your exception here so that we could have a look.

Cheers
Emil

Javier Mendiara Cañardo написа:
  

Hi all,

here it's a little patch that corrects null pointer exceptions in the
current revision.
The exceptions are caused because in the current code,
initOutboundProxy
was performed before
initListeningPoints

and initOutboundProxy needs the listeningpoints initialised

Hope this helps,

Best regards,
Javier

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

---------------------------------------------------------------------
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

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