I'm actually developping a SIP application using Jain SIP and I noticed with WireShark that in fact the port I want to use during the initialization process of the SipProvider object isn't being used to send requests. For example :
public SipLayer(String username, String ip, int port) throws PeerUnavailableException, TransportNotSupportedException, InvalidArgumentException, ObjectInUseException, TooManyListenersException {
setUsername(username);
sipFactory = SipFactory.getInstance();
sipFactory.setPathName("gov.nist");
Properties properties = new Properties();
properties.setProperty("javax.sip.STACK_NAME", "MyApp");
properties.setProperty("javax.sip.IP_ADDRESS", ip);
properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "32");
properties.setProperty("gov.nist.javax.sip.SERVER_LOG",
"textclient.txt");
properties.setProperty("gov.nist.javax.sip.DEBUG_LOG",
"textclientdebug.log");
sipStack = sipFactory.createSipStack(properties);
headerFactory = sipFactory.createHeaderFactory();
addressFactory = sipFactory.createAddressFactory();
messageFactory = sipFactory.createMessageFactory();
ListeningPoint tcp = sipStack.createListeningPoint(ip, port, "tcp");
sipProvider = sipStack.createSipProvider(tcp);
sipProvider.addSipListener(this);
}
Here is my constructor where i'm initializing the sipProvider. I'm using TCP and i want to use the 5600 port. So when sending a stateless request, i'm using the following code in my method :
sipProvider.sendRequest(request);
When making a capture, i noticed that the TCP port being used isn't the 5600 i have chosen but something like 52065 for example.
Can someone please tell me how can i force the sipProvider object to use my 5600 TCP port please?
Thanks for your help :)