This chapter describes the External Service Discovery feature and how to configure it for Oracle Communications Instant Messaging Server.
External Service Discovery enables the XMPP server to support and share information about services external to the XMPP server, mainly TURN (Traversal Using Relay NAT) and STUN (Session Traversal Utilities for NAT) server details, with clients.
This feature is available as a plugin that handles different types of packets, for example, IQ, and Presence and Message. Currently, Instant Message Server supports only the custom IQ handler.
To configure the XMPP/HTTP Gateway to enable the External Service Discovery Plugin:
Change to the /opt/sun/comms/im/sbin directory.
cd /opt/sun/comms/im/sbin
Run the following command to enable the External Service Discovery plugin:
imconfutil -c InstantMessaging_home/config/iim.conf.xmladd-plugin id=XEP0215 type=iq
enable=true handlerclass=oracle.communications.ucs.ocim.handler.
ExtDiscoHandler
namespace=urn:xmpp:extdisco:2
Run the following command to add the provider class for External Service Discovery:
imconfutil -c InstantMessaging_home/config/iim.conf.xml set-prop iim_server.ext_disco.provider=oracle.communications.ucs.ocim.provider.sample.FileServiceDiscoProvider
Note:
Instead of using the sample file-based provider, you can specify a differently implemented provider class, such as a provider that fetches STUN and TURN server details from a database.Point the file-based provider to fetch STUN and TURN data from a CSV file by creating a file named extServiceDisco.csv in the config directory:
vi ../config/extServiceDisco.csv
Add STUN and TURN server details in the following format:
# expires, host, name, password, port, restricted, transport, type, username
For example:
1971-07-21T02:56:15Z, stun.example.com, "STUN Server", jj929jkj5sadjfj93v3n, 9998, false, udp, stun, nb78932lkjlskjfdb7g
Table 19-1 describes the attributes of services external to the XMPP server, their definition, and whether their inclusion is required, recommended, or optional.
Table 19-1 Attributes of Services External to the XMPP Server
Attribute | Definition | Inclusion |
---|---|---|
expires |
A timestamp indicating when the provided user name and password credentials expire. The format must adhere to the dateTime format specified in XMPP Date and Time Profiles standard (XEP-0082), and must be expressed in UTC. For more information, see the XEP specification at: |
Optional |
host |
Either a fully qualified domain name (FQDN) or an IP address (IPv4 or IPv6). |
Required |
name |
A friendly (human-readable) name or label for the service. |
Optional |
password |
A service- or server-generated password for use at the service. |
Optional |
port |
The communications port used by the host. |
Recommended |
restricted |
A boolean value indicating that user name and password credentials are required and must be requested if not already provided. For more information, see the discussion about requesting credentials at: |
Optional |
transport |
The underlying transport protocol used when communicating with the service (typically either TCP or UDP). |
Recommended |
type |
The service type as registered with the XMPP Registrar. For more information, see: |
Required |
username |
A service- or server-generated user name for use by the service. |
Optional |
If not already present, create a sysServiceDisco.acl file to specify which users are allowed access to fetch TURN and STUN details:
vi ../config/acls/sysServiceDisco.acl
Add the JID of users authorized to receive the services information. For example, if all the users are to be allowed, add the following line to the acl file:
d:true
If only two users having JIDs such as bard1@example.com and bard2@example.com are to be allowed, add the following lines to the acl file:
u:bard1@example.com u:bard2@example.com d:false