我是WebRtc技术的新手,必须使用自己的tomcat服务器来实现音频/视频和数据交换。
我已经从github(https://github.com/Mobicents/sip-servlets)分叉了mobicents的实现,但是它是一个庞大的项目,无法正常工作,而且我不具备修复/配置的知识。
我将很高兴看到一些如何在Java中实现服务器端的说明,或者是一些可行的简短示例。当然,我一直在寻找在线教程,但是我发现没有什么可以理解的。
编辑:
现在,我正在尝试运行mobicents演示websockets-sip-servlet。我在浏览器的控制台中遇到一些错误,例如:
* PrivateJainSipClientConnector:processSipRegisterResponse(): SIP registration failed:500 [object Object]
* GET http://localhost:8080/websockets-sip-servlet/Room/undefined 404 (Not Found)
* POST https://api.xirsys.com/getIceServers 400 (Bad Request)
我已经从https://mobicents.ci.cloudbees.com/job/MobicentsSipServlets-Release/lastSuccessfulBuild/artifact/下载了tomcat 8版本。
并从tomcat日志中跟踪堆栈:
2015-05-20 14:56:15,891 ERROR [org.mobicents.servlet.sip.core.dispatchers.DispatchTask] (SIP-TCP-Core-PipelineThreadpool-2) Unexpected exception while processing message REGISTER sip:telestax.com SIP/2.0
[...]
org.mobicents.servlet.sip.core.DispatcherException: An unexpected servlet exception occured while routing an initial request
at org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher$InitialDispatchTask.dispatch(InitialRequestDispatcher.java:744)
at org.mobicents.servlet.sip.core.dispatchers.DispatchTask.dispatchAndHandleExceptions(DispatchTask.java:61)
at org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher.dispatchInsideContainer(InitialRequestDispatcher.java:454)
at org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher.dispatchMessage(InitialRequestDispatcher.java:309)
at org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl.processRequest(SipApplicationDispatcherImpl.java:825)
at gov.nist.javax.sip.EventScanner.deliverEvent(EventScanner.java:230)
at gov.nist.javax.sip.SipProviderImpl.handleEvent(SipProviderImpl.java:185)
at gov.nist.javax.sip.DialogFilter.processRequest(DialogFilter.java:1324)
at gov.nist.javax.sip.stack.SIPServerTransactionImpl.processRequest(SIPServerTransactionImpl.java:807)
at gov.nist.javax.sip.stack.ConnectionOrientedMessageChannel.processMessage(ConnectionOrientedMessageChannel.java:452)
at gov.nist.javax.sip.stack.NioWebSocketMessageChannel.processMessage(NioWebSocketMessageChannel.java:287)
at gov.nist.javax.sip.parser.NioPipelineParser$Dispatch.run(NioPipelineParser.java:174)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.servlet.ServletException: the sip servlet with the name WebSocketB2BUASipServlet doesn't exist in the sip application WebsocketSample
at org.mobicents.servlet.sip.core.session.SipSessionImpl.setHandler(SipSessionImpl.java:1317)
at org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher$InitialDispatchTask.dispatch(InitialRequestDispatcher.java:741)
... 14 more
2015-05-20 14:56:15,904 ERROR [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (SIP-TCP-Core-PipelineThreadpool-2) Unexpected exception while processing request REGISTER sip:telestax.com SIP/2.0
[...]
java.lang.IllegalStateException: Cannot create a response for request REGISTER sip:telestax.com SIP/2.0
transaction is null, a final error response has probably already been sent
at org.mobicents.servlet.sip.message.SipServletRequestImpl.createResponse(SipServletRequestImpl.java:309)
at org.mobicents.servlet.sip.message.SipServletRequestImpl.createResponse(SipServletRequestImpl.java:290)
at org.mobicents.servlet.sip.core.dispatchers.MessageDispatcher.sendErrorResponse(MessageDispatcher.java:126)
at org.mobicents.servlet.sip.core.dispatchers.DispatchTask.dispatchAndHandleExceptions(DispatchTask.java:69)
at org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher.dispatchInsideContainer(InitialRequestDispatcher.java:454)
at org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher.dispatchMessage(InitialRequestDispatcher.java:309)
at org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl.processRequest(SipApplicationDispatcherImpl.java:825)
at gov.nist.javax.sip.EventScanner.deliverEvent(EventScanner.java:230)
at gov.nist.javax.sip.SipProviderImpl.handleEvent(SipProviderImpl.java:185)
at gov.nist.javax.sip.DialogFilter.processRequest(DialogFilter.java:1324)
at gov.nist.javax.sip.stack.SIPServerTransactionImpl.processRequest(SIPServerTransactionImpl.java:807)
at gov.nist.javax.sip.stack.ConnectionOrientedMessageChannel.processMessage(ConnectionOrientedMessageChannel.java:452)
at gov.nist.javax.sip.stack.NioWebSocketMessageChannel.processMessage(NioWebSocketMessageChannel.java:287)
at gov.nist.javax.sip.parser.NioPipelineParser$Dispatch.run(NioPipelineParser.java:174)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
它不是完整的堆栈跟踪
最佳答案
您能解释一下您到底想达到什么目的,以便更轻松地指导您吗?
首先,下载二进制文件比从源代码工作要容易。因此,尝试使用https://mobicents.ci.cloudbees.com/job/MobicentsSipServlets-Release/lastSuccessfulBuild/artifact/中的较新版本
Mobicents SIP Servlet和Restcomm使用WebRTComm作为客户端Javascript库。该库允许您使用抽象WebRTC的复杂性的简单API,并使用SIP over WebSockets作为交换聊天消息或建立和断开音频和视频呼叫的信令协议。
RestComm默认带有一个WebRTC客户端,您可以使用它并对其进行定制以满足您的需求,请参见http://www.telestax.com/livechat-and-video-call-with-restcomm/,或者您可以下载我们正在开发的新版本https://github.com/Mobicents/olympus并帮助其做出贡献。