Package com.bytedesk.call.mrcp4j.client
Class MrcpProvider
java.lang.Object
com.bytedesk.call.mrcp4j.client.MrcpProvider
Provides functionality for simplified management of
MrcpChannel instances by an MRCPv2 client.
To construct a MrcpProvider instance use MrcpFactory.createProvider().
- Author:
- Niels Godfredsen <ngodfredsen@users.sourceforge.net>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<String,MrcpSocket> static final StringTransport protocol string for MRCPv2 over TCP.static final StringTransport protocol string for MRCPv2 over TLS over TCP (not yet supported in current version of MRCP4J).private static final booleanCompile time flag for setting whether to shareMrcpSocketinstances. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateChannel(String channelID, InetAddress host, int port, String protocol) Constructs a new MRCP channel and initiates an active connection with the specified MRCP resource.private MrcpSocketgetSocket(InetAddress host, int port, String transport) private static StringgetSocketKey(InetAddress host, int port, String transport)
-
Field Details
-
PROTOCOL_TCP_MRCPv2
Transport protocol string for MRCPv2 over TCP.- See Also:
-
PROTOCOL_TLS_MRCPv2
Transport protocol string for MRCPv2 over TLS over TCP (not yet supported in current version of MRCP4J).- See Also:
-
SHARE_SOCKETS
private static final boolean SHARE_SOCKETSCompile time flag for setting whether to shareMrcpSocketinstances.- See Also:
-
_sockets
-
-
Constructor Details
-
MrcpProvider
MrcpProvider()
-
-
Method Details
-
createChannel
public MrcpChannel createChannel(String channelID, InetAddress host, int port, String protocol) throws IOException, IllegalArgumentException, IllegalValueException Constructs a new MRCP channel and initiates an active connection with the specified MRCP resource.- Parameters:
channelID- the channel ID for the channel being created. This ID should be discovered during the resource allocation phase which is mediated using SIP messages between the client and server.host- the location of the MRCP resource being accessed by the channel.port- the port at which the MRCP resource is listening for MRCP messages.protocol- the transport protocol being used to carry the MRCP messages (currently the only supported value isPROTOCOL_TCP_MRCPv2).- Returns:
- an active MRCP channel connected to the host and port specified
- Throws:
IOException- if an I/O error occurs.IllegalArgumentException- if an unsupported protocol value is passed.IllegalValueException- if the channelID is not a valid value.
-
getSocket
- Throws:
IOException
-
getSocketKey
-