How to use sipML5 js with Mobicent SIP servlets?

393 Views Asked by At

I am using sipML5 for audio and video calls that use web socket. When I register a SIP account with details, it sends a request to the server for authentication with details and the server responds with Status(like 401 or 403 Forbidden etc.) in some sipMl.js function. Now I want to get the server response passed in to some Java function like in SIP servlets Process Response for further processing.

2

There are 2 best solutions below

2
jeand On

You can have a look at https://github.com/RestComm/sip-servlets/tree/master/sip-servlets-examples/websocket-b2bua as example of how to handle responses and requests. This application is the out of the box WebRTC application that ships with RestComm SIP Servlets.

Please also read the JSR 289 Specification, it is a good resource to learn more about SIP Servlets in general.

Note: Mobicents brand has been renamed to Restcomm. See more at http://www.telestax.com/restcomm-moves-beyond-mobicents/

0
Jaime Casero On

if you mean how to process the response coming from MobicentsSIPServlets in your Javascript, there is no specific way related to MobicentsSipServlets container, since this is plain SIP over Websocket signalling. In this case, yo ushould take a look to sipML5 doc, and how to regsiter callback JS function to process SIP responses.

From sipML5 doc it seems you may pass a JS function reference during registration as in sipML5 reg/login . Look contents of var eventsListener.