java - Sip Servlet 应用程序未启动

标签 java servlets sip-servlet mobicents-sip-servlets

我开发了一个聚合(网络和 SIP)应用程序。我正在使用 mss-3.0.564-apache-tomcat-7.0.50

sip.xml:

<?xml version="1.0" encoding="UTF-8"?>

<sip-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://www.jcp.org/xml/ns/sipservlet"
        xsi:schemaLocation="http://www.jcp.org/xml/ns/sipservlet http://www.jcp.org/xml/ns/sipservlet/sip-app_1_1.xsd">
    <app-name>com.mydomain.myapp</app-name>

    <servlet-selection>
        <main-servlet>MySipServlet</main-servlet>
    </servlet-selection>

    <servlet>
        <servlet-name>MySipServlet</servlet-name>
        <servlet-class>com.mydomain.myapp.sip.MySipServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>      
</sip-app>

mobicents-dar.properties:

ALL: ("com.mydomain.myapp", "DAR:From", "ORIGINATING", "", "NO_ROUTE", "0")

Web 应用程序正确启动,但 SIP 部分似乎并非如此 - MySipServlet.init 方法未执行。

在任何 SIP 请求上,我都会收到以下错误

org.mobicents.servlet.sip.core.DispatcherException: the Request-URI does not point to another domain, and there is no Route header,the container should not send the request as it will cause a loop. Instead, the container must reject the request with 404 Not Found final response with no Retry-After header. You may want to check your dar configuration file to see if the request can be handled or make sure you use the correct Application Router jar.
at org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher.dispatchOutsideContainer(InitialRequestDispatcher.java:488)

控制台日志包含

2014-12-18 11:09:03,758 DEBUG [SipApplicationDispatcherImpl] (SIP-TCP-Core-PipelineThreadpool-0) Routing State INITIAL
2014-12-18 11:09:03,759 DEBUG [InitialRequestDispatcher] (SIP-TCP-Core-PipelineThreadpool-0) Routing of Initial Request REGISTER sip:localhost SIP/2.0
2014-12-18 11:09:03,759 DEBUG [InitialRequestDispatcher] (SIP-TCP-Core-PipelineThreadpool-0) popped route : null
2014-12-18 11:09:03,760 DEBUG [DefaultApplicationRouter] (SIP-TCP-Core-PipelineThreadpool-0) org.mobicents.servlet.sip.router.DefaultApplicationRouter@43350e24 checking for next application for request REGISTER sip:localhost SIP/2.0
...
 , region=null , directive=NEW, targetedRequestInfo=null, stateinfo=null with following dar {ALL=("com.mydomain.myapp", "DAR:From", "ORIGINATING", "", "NO_ROUTE", "0")}
2014-12-18 11:09:03,760 DEBUG [DefaultApplicationRouter] (SIP-TCP-Core-PipelineThreadpool-0) Route Modifier : NO_ROUTE
2014-12-18 11:09:03,760 DEBUG [DefaultApplicationRouter] (SIP-TCP-Core-PipelineThreadpool-0) Previous App Name : com.mydomain.myapp
2014-12-18 11:09:03,760 DEBUG [DefaultApplicationRouter] (SIP-TCP-Core-PipelineThreadpool-0) Previous App Route Region : ORIGINATING
2014-12-18 11:09:03,760 DEBUG [DefaultApplicationRouter] (SIP-TCP-Core-PipelineThreadpool-0) Current App Name : com.mydomain.myapp
2014-12-18 11:09:03,760 DEBUG [DefaultApplicationRouter] (SIP-TCP-Core-PipelineThreadpool-0) Current App Route Region : ORIGINATING
2014-12-18 11:09:03,760 DEBUG [InitialRequestDispatcher] (SIP-TCP-Core-PipelineThreadpool-0) the AR returned the following sip route modifiernull
2014-12-18 11:09:03,760 INFO  [InitialRequestDispatcher] (SIP-TCP-Core-PipelineThreadpool-0) Dispatching the request event outside the container

我正在从 Eclipse 运行服务器。如果我从控制台运行它,一切都很好。

这可能是什么原因造成的?

最佳答案

如果 <Context> 似乎聚合应用程序的 SIP 部分不会启动在 server.xml 中为它定义了标签.通过简单地删除解决问题。问题是每次 Eclipse 部署 Web 应用程序时,都会再次添加该标记。

我还填了一个bug report与 Mobicents。

关于java - Sip Servlet 应用程序未启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27543562/

相关文章:

java - 在/上找不到资源上的 SpringMVC Controller

java - 如何在 Spring 中使用 SipServlet?

java - 获取具有类扩展的变量的通用方法

Java 2d 数组列打印两次

java - 使用servlet在浏览器中禁用返回功能

jsp - HTTP 状态 500 - 处理 JSP 页面时发生异常

tomcat - 如何在 Tomcat 8 上运行 RestComm Sip Servlet 容器

java - 如何使用 J-unit 测试简单的 if else 语句?

java - 当所有操作都可以通过 ActionsClass 完成时,为什么我们需要 Action Interface