For more information, refer to the Cisco Unified Communications Manager Administration Guide.
Registration
After a media termination device is properly provisioned in Cisco Unified Communications Manager, the
application may obtain a reference to the corresponding CiscoMediaTerminal object by using either the
Provider.getTerminal() method or CiscoProvider.getMediaTerminal() method. The two methods differ in that
the CiscoProvider.getMediaTerminal() method only returns CiscoMediaTerminals, whereas
Provider.getTerminal() will return any terminal object that is associated with the provider, including those
representing physical IP phones.
Use the CiscoMediaTerminal.register() method to notify Cisco Unified Communications Manager of the
intent to terminate RTP streams of certain payload types. The CiscoMediaTermina.register() method takes
an IP address, a port number, and an array of CiscoMediaCapability objects that indicate the types of codecs
that the application supports as well as codec-specific parameters.
The IP address and port indicate the address where the application can receive media streams. The following
sample code demonstrates how to register a CiscoMediaTerminal and bind it to a local address, port number
1234:
CiscoMediaTerminal registerTerminal (Provider provider,
String terminalName) {
final int PORT_NUMBER
1234;
try {
CiscoMediaTerminal terminal
provider.getTerminal (terminalName);
CiscoMediaCapability [] caps
new CiscoMediaCapability [1];
caps[0]
CiscoMediaCapability.G711_64K_30_MILLISECONDS;
terminal.register (InetAddress.getLocalHost (),
PORT_NUMBER,
caps);
}
catch (Exception e) {
return null;
}
}
For this sample code to work, ensure the specified provider is IN_SERVICE. Further, be aware that this code
uses the constant CiscoMediaCapability.G711_64K_30_MILLISECONDS. This actually represents a static
reference to a CiscoG711MediaCapability object that specifies a 30-millisecond maximum RTP packet size.
The CiscoMediaCapability class predefines this and other common media formats.
To specify a media payload that is not listed in the CiscoMediaCapability class, two options exist. If the
desired payload type is a simple variation of one of the existing subclasses of CiscoMediaCapability, you
only need to construct a new instance of the subclass. For instance, if an application can support G.711 payloads
with a 60-millisecond maximum RTP packet size, it can construct the CiscoG711MediaCapability object
directly; including specifying 60 milliseconds in the constructor.
Alternatively, if no existing subclass of CiscoMediaCapability that matches the desired payload type exists,
construct an instance of the CiscoMediaCapability class directly. The maximum packet size, for example,
30-milliseconds, represents the only other parameter that may be specified when a CiscoMediaCapability is
constructed.
The following code illustrates registering a custom payload capability:
CiscoMediaTerminal registerTerminal (Provider provider,
String terminalName) {
final int PORT_NUMBER
1234;
try {
CiscoMediaTerminal terminal
provider.getTerminal (terminalName);
CiscoMediaCapability [] caps
new CiscoMediaCapability [1];
Cisco Unified JTAPI Developers Guide for Cisco Unified Communications Manager, Release 15 and SUs
49
Features Supported by Cisco Unified JTAPI
Registration