Liberty 上管理会话启动协议 (SIP)

通过在 server.xml 文件中添加并配置元素,可在 Liberty 上配置 SIP。

开始之前

Liberty 服务器中安装 sipServlet-1.1 功能部件。有关更多信息,请参阅添加和移除 Liberty 功能部件

关于此任务

此任务描述如何在 server.xml 文件中为 Liberty 手动配置 SIP。或者,可使用开发者工具配置 SIP,这些工具自动启用 server.xml 文件中的所有配置。有关更多信息,请参阅 WebSphere® Developer Tools > 开发 > 开发 SIP 应用程序。

过程

  1. server.xml 文件中,通过添加 sipContainer 元素来配置 SIP 容器。
    <sipContainer invalidateSessionOnShutdown="true" msgArrivalTimeAttr="true" markInternalResponse="true"></sipContainer>
  2. 通过添加 sipStack 元素来配置 SIP 堆栈。 可配置自动响应、消息通知及连接复用之类的行为。
    <sipStack hideMessageBody="true" hideMessageReqUri="true"
        auto100OnInvite="false" auto482OnMergedRequests="true"
        forceConnectionReuse="false" acceptNonUtf8Bytes="true"
        pathMtu="1600" compactHeaders="API">
        <commaSeparatedHeaders>Comma separated headers</commaSeparatedHeaders>
        <hideMessageHeaders>iup</hideMessageHeaders>
        <sipQuotedParameters>Require</sipQuotedParameters>
    </sipStack>
    SIP 计时器提供了会话到期机制。通过在 sipStack 元素中指定计时器属性,可对 SIP 计时器设置 RFC 3261 中指定的缺省值以外的值。
    <sipStack timerT1="500" timerT2="4000" timerT4="5000" timerA="500" timerB="32000" timerD="32000"
    timerE="500" timerF="32000" timerG="500" timerH="32000" timerI="5000" timerJ="32000" timerK="5000"></sipStack>
  3. 通过添加 sipApplicationRouter 元素来配置 SIP 应用程序路由器。 配置 SIP 应用程序路由器时,您可以使用缺省应用程序路由器 (DAR),也可以创建定制应用程序路由器。此 DAR 组件使用按 Java™ 属性文件建模的配置文本文件,以定义应用程序路由器向应用程序发送 SIP 请求的顺序。

    如果未配置应用程序路由器并且要手动部署应用程序,那么应用程序将按应用程序的部署顺序触发。如果通过 server.xml 文件部署多个应用程序,那么不能定义应用程序顺序。

    • 要将 DAR 组件与 DAR 配置文件配合使用,请在 sipApplicationRouter 元素的 sipDarConfiguration 属性上指定 DAR .properties 文件的位置。
      <sipApplicationRouter sipDarConfiguration="pathToDar.properties"></sipApplicationRouter>
    • 要使用定制应用程序路由器,请在 server.xml 文件中配置路由器:
      1. bells-1.0 功能部件添加至 server.xml 文件。
        <featureManager>
             <feature>bells-1.0</feature>
        </featureManager>
        有关更多信息,请参阅 bells-1.0 的文档。
      2. server.xml 文件中,将定制应用程序路由器 JAR 文件添加为共享库,并对 javax.servlet.sip.ar.spi.SipApplicationRouterProvider 服务添加 bell 配置。
        <library id="carLib" name="carLib" description="Custom App Router Library">
             <file name="pathToJar.jar"></file>
        </library>
        <bell libraryRef="carLib">
        	<service>javax.servlet.sip.ar.spi.SipApplicationRouterProvider</service>
        </bell>
        有关共享库的更多信息,请参阅共享库
      3. sipApplicationRouter 元素上,将 carProvider 属性设置为定制应用程序路由器提供者类的全名。
        <sipApplicationRouter carProvider="example.example"></sipApplicationRouter>
    通过将 sipNoRouteErrorCode 属性添加至 sipApplicationRouter 元素,您可指定没有活动 servlet 可映射至入局初始请求时 SIP 容器发送的错误响应代码。
    <sipApplicationRouter carProvider="example.example" sipNoRouteErrorCode="403"></sipApplicationRouter>
  4. 通过添加 sipEndpoint 元素来配置 SIP 端点。 可配置定制端口、主机和绑定行为。您配置的任何 SIP 端点将覆盖缺省端点。
    <sipEndpoint host="localhost" sipTCPPort="5060" bindRetries="60" bindRetriesDelay="5000"></sipEndpoint>
    注: 缺省情况下将禁用传输层安全性 (TLS)。要对 SIP 容器启用 TLS,请对 Liberty 服务器启用并配置 SSL 通信。有关更多信息,请参阅在 Liberty 中启用 SSL 通信
  5. 通过添加 sipTasksDispatcher 元素来配置 SIP 性能。 可配置能够并行运行的 SIP 任务数。SIP 应用程序任务是一个应用程序代码序列,它在 SIP 容器的单个线程上串行执行。例如,如果从 SipServlet.doInvite() 方法或 SipTimerListener.timeout() 方法调用的应用程序代码在容器提供的受管 Liberty 线程上串行执行,那么会将这两种方法的应用程序实现视为单个任务。实际的最大并行 SIP 任务数受最大受管 Liberty 线程数限制。
    <sipContainer>
         <sipTasksDispatcher concurrentContainerTasks="15"/>
    </sipContainer>
  6. 如果要使用域名系统 (DNS) 命名权限指针 (NAPTR) 记录解析 SIP URI,请配置域解析器。
    1. 添加并配置 domainResolver 元素。 如果配置此元素,那么 SIP URI 通过 DNS 解析为要联系的下一个中继段的 IP 地址、端口和传输协议。
      注: SIP 不支持在主客户机失效时使用服务器的 DNS 过程向备份客户机发送响应。
      <domainResolver dnsAutoResolve="true">
           <dnsServers>dns.server.com</dnsServers>
      </domainResolver>
    2. 配置 DNS 服务器以使用 SIP 容器。 以下示例是 BIND 数据库文件,用于在 DNS 服务器上配置 RFC 3263 支持。
      ; Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
      ; Copyright (C) 2001  Internet Software Consortium.
      ;
      ; Permission to use, copy, modify, and distribute this software for any
      ; purpose with or without fee is hereby granted, provided that the above
      ; copyright notice and this permission notice appear in all copies.
      ;
      ; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
      ; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
      ; AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
      ; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
      ; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
      ; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
      ; PERFORMANCE OF THIS SOFTWARE.
      
      ; $Id: include.db,v 1.2.206.1 2004/03/06 10:22:13 marka Exp $
      
      ; Test $INCLUDE current domain name and origin semantics
      
      example.com.             43200 IN SOA ns.example.com. email.example.com. ( 2003032001 10800 3600 604800 86400 )
      ;
      example.com.             43200 IN NS      ns.example.com.
      ;
      ns.example.com.          43200 IN A       10.0.0.20
      sipserver1.example.com.  43200 IN A       10.0.0.21
      sipserver2.example.com.  43200 IN A       10.0.0.22
      sipserver3.example.com.  43200 IN A       10.0.0.23
      ;
      router.example.com.        43200  IN CNAME sipserver3
      ;
      sipserver1.example.com.  43200 IN AAAA    fec0:0:0:0:0:0:0:abcd
      sipserver2.example.com.  43200 IN AAAA    fec0:0:0:0:0:0:0:abba
      ;
      _sip._udp.example.com.   43200 IN SRV 2 0 5060  sipserver1.example.com.
      _sip._udp.example.com.   43200 IN SRV 2 0 5060  sipserver2.example.com.
      _sip._tcp.example.com.   43200 IN SRV 1 4 5060  sipserver1.example.com.
      _sip._tcp.example.com.   43200 IN SRV 1 2 5060  sipserver2.example.com.
      _sips._tcp.example.com.  43200 IN SRV 0 1 5061  sipserver1.example.com.
      _sips._tcp.example.com.  43200 IN SRV 0 0 5061  sipserver2.example.com.
      ;
      example.com. 43200 IN NAPTR 0 0 "s" "SIPS+D2T" "" _sips._tcp.example.com.
      example.com. 43200 IN NAPTR 1 0 "s" "SIP+D2T"  "" _sip._tcp.example.com.
      example.com. 43200 IN NAPTR 2 0 "s" "SIP+D2U"  "" _sip._udp.example.com.

用于指示主题类型的图标 任务主题

文件名:twlp_sip_adm.html