Skip to main content

AudioCodes Voice Stream Channel

New in 3.12

From Rasa Pro 3.12, you can stream conversation audio directly from AudioCodes to your Rasa Assistant.

This channel is a voice-stream channel connector to AudioCodes where the conversation audio is streamed directly to Rasa. Rasa also offers a voice-ready channel connector with AudioCodes, read about it on AudioCodes VoiceAI Connect

Configure Rasa Assistant

Use the built-in channel audiocodes_stream to configure your Rasa Assistant. Create or edit the credentials.yml file at the root of your assistant directory to add audiocodes_stream channel. Here's an example:

credentials.yml
# websocket_url: wss://<your-domain>/webhooks/audiocodes_stream/websocket
audiocodes_stream:
server_url: "<your-domain>"
asr:
name: deepgram
tts:
name: cartesia

# Optional configurations
token: "<authentication-token>"
monitor_silence: false

This channel expects WebSocket requests on the URL described above as "websocket_url". The channel configuration accepts the following properties:

  • server_url (required): The domain at which Rasa server is available. Do not include protocol (ws:// or wss://). For example, if your server is deployed on https://example.ngrok.app, server_url should be example.ngrok.app.

  • asr (required): Configuration for Automatic Speech Recognition. See Speech Integrations for a list of ASR engines for which Rasa provides built-in integration with.

  • tts (required): Configuration for Text-To-Speech. See Speech Integrations for a list of TTS engines for which Rasa provides built-in integration with.

  • token (optional): An authentication token configured in AudioCodes. This field is optional, as AudioCodes permits empty values. If no token is provided, authentication will be skipped.

  • monitor_silence (optional, default false): Boolean parameter that enables user silence monitoring. If enabled, it triggers the pattern "user silence" when the user has been silent for longer than a threshold time. The silence threshold is controlled by the slot silence_timeout.

You can run the assistant using the command rasa run. You'll need a URL accessible by AudioCodes for your Rasa assistant. For development, you can use tools like ngrok, Cloudflare Tunnel, or localhost.run.

You can also run it with a development inspector using rasa run --inspect. To see all available parameters for this command, use rasa run -h.

Bot URLs for development

Visit this section to learn how to generate the required bot URL when testing the channel on your local machine.

Configuration on AudioCodes

This channel connector uses AudioCodes Voice Streaming API. Create a bot connection for Streaming Mode bots on AudioCodes, please refer to AudioCodes Documentation for detailed instructions.

  1. On the Bot Connections page, click on Add new voice bot connection.

  2. Select AudioCodes Bot API

  3. Set an appropriate name for the Bot Connection. For "Bot connection API type", select "Streaming Mode".

  4. Set the "Bot URL". Depending on the hostname and TLS configuration, the URL would be wss://<your-domain>/webhooks/audiocodes_stream/websocket

  5. Set an authentication token, ensure that Rasa channel configuration has the same authentication token.

You can validate your Rasa Channel configuration with the button "Validate bot connection configuration". Ensure that the Rasa Server is running, AudioCodes will open a websocket on the Bot URL and send a "connection.validate" message.

  1. On the next page, select Enable voice streaming. For 'Language' field, leave the default setting as it has no impact on Rasa Assistant

Click Create to create the bot connection. You can now define a Routing to connect the Bot Connection to a phone number.