java - tomcat 上的 WebRTC

标签 java tomcat webrtc mobicents-sip-servlets mobicents

我是 WebRtc 技术的新手,我必须使用我自己的 tomcat 服务器来实现音频/视频和数据交换以进行信号传输。

我已经从 github ( https://github.com/Mobicents/sip-servlets ) 中 fork 了 mobicents 的实现,但这是一个无法正常工作的庞大项目,而且我没有修复/配置它的知识。

我会很高兴获得一些如何在 Java 中实现服务器端的说明,或者可能是一些有效的简短示例。当然,我一直在网上找教程,但没有找到任何看得懂的东西。

编辑:

现在,我正在尝试运行 mobicents demo 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 Servlets 和 Restcomm 使用 WebRTComm作为客户端 Javascript 库。该库允许您使用简单的 API 来抽象 WebRTC 的复杂性,并使用 SIP Over WebSockets 作为交换聊天消息或设置和取消音频和视频通话的信号协议(protocol)。

RestComm 默认带有一个 WebRTC 客户端,您可以使用和自定义以满足您的需要,请参阅 http://www.telestax.com/livechat-and-video-call-with-restcomm/或者您可以下载我们正在开发的更新版本 https://github.com/Mobicents/olympus并帮助做出贡献。

关于java - tomcat 上的 WebRTC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30347116/

相关文章:

flutter - 未处理的异常 : Unable to getUserMedia: getUserMedia(): DOMException, NotAllowedError

java - 为什么 java 是平台无关的,而 c/c++ 不是?

java - 为什么H2O通过Spark而不是直接集成TensorFlow?

java - 使用 Spring 的服务器内存上的单个类文件会导致问题

java - Jasper Report 无法导出为 PDF

apache - 如何使用 Apache http 代理到两个不同的 tomcat 服务器?

html - 如何检测断开的 RTCPeerConnection

java - 多个 Controller 共享的ExceptionHandler

Apache 反向代理阻止 SAP fiori 启动板 URL

google-chrome - 是否可以在 WebRtc 中组合媒体轨道/流