[sip-comm-dev] Re: [nist-sip] SIP stack and changing IP address?


#1

Alvaro,

You can register your own network layer by specifying the class that implements NetworkLayer in the gov.nist.javax.sip.NETWOR_LAYER property. Specify this to the stack when you careat it and you should be OK. If you have multiple interfaces in this version of the spec you need multiple stacks. Each stack does not know about the other one and corresponds to an IP address. Is this how you have configured your application?

Ranga

�lvaro Canivell Garc�a de Paredes wrote:

···

News on the multi interface issue (driving me nuts....):

The problems seems to rely on the stack, paricularly on the sockets it uses. When a message is being send onthe new interface, using UDPMessageChannel.sendMessage, the message just doesn't get through to the network and no error or exception is received. This SendMessage method uses this to get the socket:

   sock = ((UDPMessageProcessor) messageProcessor).sock;
   (the socket looks fine...)

This socket is created in:
SipManager.start->SipManager.createListeningPoint->createMessageProcessor->UDPMessageProcessor(constructor),

just like this:

   this.sock = sipStack.getNetworkLayer().createDatagramSocket(port, sipStack.stackInetAddress);

The getNetworkLayer method returns always the DefaultNetworkLayer, cause sipStack.networkLayer is always null. NetworkLayer is always null because, when SipStackImpl is instantiated, the property "gov.nist.javax.sip.NETWORK_LAYER" does not exist. That means that the DatagramSocket is always created on the DefaultNetworkLayer. So even when the stack is bound to a new interface, the sockets are created with the dafault interface, which might not correspond to the new interface.
This is probably the explanation why multi interface fails to run on this sip-stack.

The questions are:

- Why doesn't the property "gov.nist.javax.sip.NETWORK_LAYER" exist? How can I create it?
- Is there a way to either give the networklayer the proper value, or create a socket without using the networkLayer at all?

I've already seen comments on the involved source code parts, related to multi-interface stuff, so I guess this is not new to all of you... But it is for me, so as usual ANY kind of tip or idea is warmly welcome!! :smiley:

�lvaro

PS : i also posted this on this thread: Multiple network interfaces.

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