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
-
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>
-
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 thesipStack
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>
-
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 thesipApplicationRouter
element.<sipApplicationRouter sipDarConfiguration="pathToDar.properties"></sipApplicationRouter>
- To use a custom application router, configure the router in the
server.xml file:
- Add the
bells-1.0
feature to the server.xml file.
For more information, see the documentation for bells-1.0.<featureManager> <feature>bells-1.0</feature> </featureManager>
- In the server.xml file, add your custom application router JAR file as a
shared library and add the bell
configuration for the
javax.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>
- On the
sipApplicationRouter
element, set thecarProvider
attribute to the full name of the custom application router provider class.<sipApplicationRouter carProvider="example.example"></sipApplicationRouter>
- Add the
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 thesipNoRouteErrorCode
attribute to thesipApplicationRouter
element.<sipApplicationRouter carProvider="example.example" sipNoRouteErrorCode="403"></sipApplicationRouter>
For a full list of attributes and their descriptions, see sipApplicationRouter element.
- To use the DAR component with a DAR configuration file, specify the location of the DAR
.properties file on the
-
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>
-
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 aSipServlet.doInvite()
method or aSipTimerListener.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>
-
If you want to resolve SIP URIs by using Domain Name System (DNS) Naming Authority Pointer
(NAPTR) records, configure a domain resolver.
-
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>
-
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. -
Add and configure a