Administering Session Initiation Protocol (SIP) on Liberty

You can configure SIP on Liberty by adding and configuring elements in the server.xml file.

Before you begin

Install the sipServlet-1.1 feature in your Liberty server. For more information, see Adding and removing Liberty features.

About this task

This task describes how to manually configure SIP for Liberty in your server.xml file. Alternatively, you can configure SIP by using the developer tools, which automatically enable all configurations in the server.xml file. For more information, see WebSphere® Developer Tools > Developing SIP applications.

For information about the elements and attributes that you can use to configure SIP on Liberty, see the documentation for Sip Servlet.

Procedure

  1. In the server.xml file, configure the SIP container by adding a sipContainer element.

    For a full list of attributes and their descriptions, see sipContainer element.

    <sipContainer invalidateSessionOnShutdown="true" msgArrivalTimeAttr="true" markInternalResponse="true"></sipContainer>
  2. Configure the SIP stack by adding a sipStack element.
    You can configure behavior such as automatic responses, message information, and connection reuse.

    For a full list of attributes and their descriptions, see sipStack element.

    <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 timers provide a mechanism for session expiration. You can set values for the SIP timers that are different from default values that are specified in RFC 3261 by specifying the timer attributes on the sipStack element.
    <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. Configure the SIP application router by adding a sipApplicationRouter element.
    When you configure a SIP application router, you can either use the default application router (DAR) or create a custom application router. The DAR component uses a configuration text file that is modeled as a Java™ properties file to define the order in which the application router sends SIP requests to applications.

    If you do not configure an application router and are manually deploying your applications, applications are triggered in the order that the applications were deployed. If you deploy multiple applications through the server.xml file, you cannot define the application order.

    • To use the DAR component with a DAR configuration file, specify the location of the DAR .properties file on the sipDarConfiguration attribute of the sipApplicationRouter element.
      <sipApplicationRouter sipDarConfiguration="pathToDar.properties"></sipApplicationRouter>
    • To use a custom application router, configure the router in the server.xml file:
      1. Add the bells-1.0 feature to the server.xml file.
        <featureManager>
             <feature>bells-1.0</feature>
        </featureManager>
        For more information, see the documentation for bells-1.0.
      2. In the server.xml file, add your custom application router JAR file as a shared library and add the bell configuration for thejavax.servlet.sip.ar.spi.SipApplicationRouterProvider service.
        <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. On the sipApplicationRouter element, set the carProvider attribute to the full name of the custom application router provider class.
        <sipApplicationRouter carProvider="example.example"></sipApplicationRouter>
    You can specify the error response code that the SIP container sends if no active servlet can be mapped to an incoming initial request by adding the sipNoRouteErrorCode attribute to the sipApplicationRouter element.
    <sipApplicationRouter carProvider="example.example" sipNoRouteErrorCode="403"></sipApplicationRouter>

    For a full list of attributes and their descriptions, see sipApplicationRouter element.

  4. Configure the SIP endpoints by adding a sipEndpoint element.
    You can configure custom ports, hosts, and binding behavior. Any SIP endpoint that you configure overrides the default endpoint.

    For a full list of attributes and their descriptions, see sipEndpoint element.

    <sipEndpoint host="localhost" sipTCPPort="5060" bindRetries="60" bindRetriesDelay="5000"></sipEndpoint>
    Note: Transport Layer Security (TLS) is disabled by default. To enable TLS for your SIP container, enable and configure SSL communication for your Liberty server. For more information, see Enabling SSL communication in Liberty.
    Important: If your requirements dictate that you need to disable a particular transport, then set the respective endpoint to a -1 . See the following examples:
    <sipEndpoint host="localhost" sipTLSPort="-1" bindRetries="60" bindRetriesDelay="5000"></sipEndpoint>
    <sipEndpoint host="localhost" sipTCPPort="-1" bindRetries="60" bindRetriesDelay="5000"></sipEndpoint>
    <sipEndpoint host="localhost" sipUDPPort="-1" bindRetries="60" bindRetriesDelay="5000"></sipEndpoint>
  5. Configure SIP performance by adding a sipTasksDispatcher element.
    You can configure the number of SIP tasks that can be run concurrently. A SIP application task is a sequence of application code that is serially executed on the SIP container on a single thread. For example, the application implementation of a SipServlet.doInvite() method or a SipTimerListener.timeout() method are each considered a single task if the application code that is called from these methods is executed serially on a managed Liberty thread that is provided by the container. The actual maximum number of concurrent SIP tasks is limited by the maximum number of managed Liberty threads.

    For a full list of attributes and their descriptions, see sipTasksDispatcher element.

    <sipContainer>
         <sipTasksDispatcher concurrentContainerTasks="15"/>
    </sipContainer>
  6. If you want to resolve SIP URIs by using Domain Name System (DNS) Naming Authority Pointer (NAPTR) records, configure a domain resolver.
    1. Add and configure a domainResolver element.
      If you configure this element, SIP URIs are resolved through DNS into the IP address, port, and transport protocol of the next hop to contact.
      Note: SIP does not support use of DNS procedures for a server to send a response to a back-up client if the primary client fails.

      For a full list of attributes and their descriptions, see domainResolver element.

      <domainResolver dnsAutoResolve="true">
           <dnsServers>dns.server.com</dnsServers>
      </domainResolver>
    2. Configure your DNS server to work with the SIP container.
      The following example is a BIND db file for configuring RFC 3263 support on a DNS server.
      ; 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 preceeding
      ; 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.
      
    For information about performing DNS lookups in your SIP applications, see Performing DNS lookups in Session Initiation Protocol (SIP) applications on Liberty.