在 Liberty 上管理「階段作業起始通訊協定 (SIP)」

您可以在 server.xml 檔中新增和配置元素,以便在 Liberty 上配置 SIP。

開始之前

sipServlet-1.1 特性安裝在 Liberty 伺服器中。如需相關資訊,請參閱新增及移除 Liberty 特性

關於這項作業

這項作業說明如何在您的 server.xml 檔中,手動為 Liberty 配置 SIP。或者,您可以使用會自動在 server.xml 檔中啟用所有配置的開發人員工具,來配置 SIP。如需相關資訊,請參閱 WebSphere® Developer Tools > 開發 > 開發 SIP 應用程式。

如需您可以用來在 Liberty 上配置 SIP 的元素和屬性的相關資訊,請參閱 SipServlet-1.1 的相關說明文件。

程序

  1. server.xml 檔中,新增 sipContainer 元素,來配置 SIP 儲存器。

    如需完整屬性清單和其說明,請參閱 sipContainer 元素

    <sipContainer invalidateSessionOnShutdown="true" msgArrivalTimeAttr="true" markInternalResponse="true"></sipContainer>
  2. 新增 sipStack 元素,以配置 SIP 堆疊。 您可以配置自動回應、訊息資訊以及重複使用連線等行為。

    如需完整屬性清單和其說明,請參閱 sipStack 元素

    <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 服務新增鈴聲配置。
        <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>
        如需共用程式庫的相關資訊,請參閱Liberty:共用程式庫
      3. sipApplicationRouter 元素中,將 carProvider 屬性設為自訂應用程式路由器提供者類別的完整名稱。
        <sipApplicationRouter carProvider="example.example"></sipApplicationRouter>
    您可以在 sipApplicationRouter 元素中新增 sipNoRouteErrorCode 屬性,以指定一旦無法將任何作用中的 Servlet 對映至送入的起始要求時,SIP 儲存器所要傳送的錯誤回應碼。
    <sipApplicationRouter carProvider="example.example" sipNoRouteErrorCode="403"></sipApplicationRouter>

    如需完整屬性清單和其說明,請參閱 sipApplicationRouter 如需完整屬性清單和其說明,請參閱

  4. 新增 sipEndpoint 元素,來配置 SIP 端點。 您可以配置自訂埠、主機和連結行為。您所配置的任何 SIP 端點都會置換預設端點。

    如需完整屬性清單和其說明,請參閱 sipEndpoint 元素

    <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 執行緒數目上限。

    如需完整屬性清單和其說明,請參閱 sipTasksDispatcher 元素

    <sipContainer>
         <sipTasksDispatcher concurrentContainerTasks="15"/>
    </sipContainer>
  6. 如果您想使用「網域名稱系統 (DNS)」的「命名權限指標 (NAPTR)」記錄來解析 SIP URI,請配置網域解析器。
    1. 新增和配置 domainResolver 元素。 如果您配置這個元素,會透過 DNS,將 SIP URI 解析成下一個要聯絡的躍點的 IP 位址、埠和傳輸通訊協定。
      註: 如果主要用戶端失敗,SIP 不支援使用伺服器的 DNS 程序,將回應傳送給備份用戶端。

      如需完整屬性清單和其說明,請參閱 domainResolver 元素

      <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.
    如需在 SIP 應用程式中執行 DNS 查閱的相關資訊,請參閱在 Liberty 上的「階段作業起始通訊協定 (SIP)」應用程式中執行 DNS 查閱

指示主題類型的圖示 作業主題



「時間戳記」圖示 前次更新: 2016 年 11 月 30 日
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=twlp_sip_adm
檔名:twlp_sip_adm.html