0

Are there any code example for this? I want to know what should be the flow in processRequest when an INVITE request is received.

I'm particularly interested in how you forward a request from an UA to another previously registered UA.

Adrian Ber
  • 20,474
  • 12
  • 67
  • 117

1 Answers1

1

Check out https://svn.java.net/svn/jsip~svn/trunk/src/test/unit/gov/nist/javax/sip/stack/WebsocketSelfTest.java the WebsocketServer class should be enough to get you started to write a simple client-server.

Forwarding just means you act as client repeating the server side of things. You can do B2BUA like this https://svn.java.net/svn/jsip~svn/trunk/src/examples/websocket/B2BUA.java or a proxy which is less robust and doesn't works so well with websockets.

The next hop must be the address advertised by the other party's Contact header. You aim towards this address in the request URI (or route header).

Adrian Ber
  • 20,474
  • 12
  • 67
  • 117
Vladimir Ralev
  • 1,371
  • 9
  • 18
  • The `processInvite` method in the `WebsocketServer` class is not actually forwarding the request to another peer, but simply sends two responses. This is the actual part that I'm interested in. – Adrian Ber Jan 16 '15 at 14:23
  • Forwarding just means you act as client repeating the server side of things. You can do B2BUA like this https://svn.java.net/svn/jsip~svn/trunk/src/examples/websocket/B2BUA.java or a proxy which is less robust and doesn't works so well with websockets. – Vladimir Ralev Jan 16 '15 at 14:47
  • 1
    What should I do to send the request on the same socket on which a client connected? When I call `provider.getNewClientTransaction(newRequest);` JAIN-SIP tries to create a new socket and I get timeout or "Cannot resolve next hop -- transaction unavailable". – Adrian Ber Jan 21 '15 at 09:14
  • The next hop must be the address advertised by the other party's Contact header. You aim towards this address in the request URI (or route header). – Vladimir Ralev Jan 21 '15 at 22:08