Class MrcpProvider

java.lang.Object
com.bytedesk.call.mrcp4j.client.MrcpProvider

public class MrcpProvider extends Object
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 Details

    • PROTOCOL_TCP_MRCPv2

      public static final String PROTOCOL_TCP_MRCPv2
      Transport protocol string for MRCPv2 over TCP.
      See Also:
    • PROTOCOL_TLS_MRCPv2

      public static final String 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_SOCKETS
      Compile time flag for setting whether to share MrcpSocket instances.
      See Also:
    • _sockets

      private Map<String,MrcpSocket> _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 is PROTOCOL_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

      private MrcpSocket getSocket(InetAddress host, int port, String transport) throws IOException
      Throws:
      IOException
    • getSocketKey

      private static String getSocketKey(InetAddress host, int port, String transport)