Skip to main content

Using a Twilio Outbound Voice Gateway in Botium

When testing a voice enabled chatbot, Botium offers the option of using a Twilio Voice Gateway to send voice utterances to your voice enabled chatbot.

To utilize a Twilio Outbound SIP gateway for Botium voice testing, two configuration steps are required. First you must configure the Twilio Gateway, then setup the VOIP Connector in Botium, see below for more information on each step.

Configuring Twilio Gateway

Restriction: Before configuring Twilio, ensure your account has a voice-capable phone number available for this project. If needed, you can purchase additional numbers through Twilio.
  1. Add TwiML Bin:
    1. Access the TwiML Bins page via the Twilio Console.

    2. Name the TwiML Bin (e.g., "SipClientOutbound" as recommended by Botium). This name is for your reference only.
    3. Enter the following TwiML code in XML format:
      <?xml version="1.0" encoding="UTF-8"?>
      <Response>
          <Dial answerOnBridge="true" callerId="{{#e164}}{{From}}{{/e164}}">{{#e164}}{{To}}{{/e164}}</Dial>
      </Response>
      
    4. Once the code is validated by Twilio (indicated by a green check-mark), click Create to save the TwiML Bin.
  2. Add Credential List:
    1. While logged into your Twilio account, go to Programmable Voice > Credential Lists.
    2. Click the + icon to create a new credential list:
      • Username: Enter the phone number being used for this Twilio project.
      • Password: Create any password string (record these for later use in Botium).
  3. Add IP / CIDR Access Control List:
    1. In the Twilio Console, navigate to SIP Trunking > Authentication and IP Access Control Lists.
    2. Add a new IP range:
      • CIDR Network Address: Enter the IP address of the VOIP worker (provided by Botium/Cyara).
      • Range: Set to 32.
  4. Add a SIP Domain:
    1. Go to Domains and click the + icon to create a new SIP Domain:
      • Friendly Name: Enter any name for your reference.
      • SIP URI: Provide a valid SIP URI (to be used later in the Botium VoIP Connector settings).
      • IP Access Control Lists: Select the list created in Step 3.
      • A Call Comes In: Choose "SipClientOutbound" (the TwiML Bin created in Step 1).
      • SIP Registration: Enable this option.
      • Credential Lists: Select the list created in Step 2.
  5. (Optional) Enable Geo-Permissions: Certain regional phone numbers are blocked by default, preventing calls to those numbers. To enable calling to these regions, adjust the settings on the Geo-Permissions page.

Configuring the Botium VOIP Connector for Twilio

Now that the VOIP Gateway is available via Twilio, you can configure Botium to connect to it. Follow the steps below:
  1. Create a New Chatbot:
    • From the Chatbots Connections menu, create a new chatbot Botium Tools & Settings > Chatbot Connections > Create new Chatbot
    • Select the 'Voice over IP' chatbot technology, and enter the following details:
      • HTTP endpoint of VOIP Worker: <VOIP worker endpoint provided by Botium/Cyara>
      • VOIP worker API Key: <API Key provided by Botium/Cyara>
      • SIP Address to call: sip:<number to call>@<sip domain>
      • Speech Recognition Profile: Azure STT EN
      • Speech Synthesis Profile (Optional): Azure TTS EN
        Remember: Azure STT/TTS are for English speech recognition and synthesis, select an appropriate speech profiles for languages other than English.
      Note:

      A successful Twilio Connector configuration will look as follows;

  2. Enter SIP Configuration Details: The VoIP connector will work with any provider that supports VoIP protocols (SIP, etc..)
    1. SIP Registrar URI: sip:<sip domain>
    2. SIP Address: sip:<Phone Number>@<sip domain>
    3. SIP Username: <Phone Number from credential list>
      Note: For other providers the SIP Username may be a string <username from credential list>
    4. SIP Password: <Password from credential list>
    Note: Here is an example of a Twilio Configuration:

  3. (Optional) Configure Speech Recognition / ASR Message Handling: For handling ASR behavior, use the JOIN method to combine messages based on silence duration, or the SPLIT method to break sentences by characters.
    Tip: The JOIN method is recommended.
  4. (Optional) Configure Silence Duration Timeouts: Bot Response Timeout in VOIP Connector relates to the final ASR results, which may have delays. To manage silence durations, you can:
    • Assert on the start silence duration until the bot speaks.
    • Set a threshold for all silence durations in a conversation.
    • Use the “Ignore Silence Duration Timeout” Logic Hook to bypass silence duration for specific bot messages.

VOIP Connector Features

  • Sending Audio files directly

  • Sending Text (auto-conversion from Text to Speech using Voice Profiles)

  • Sending DTMF-Tones (= Buttons in Botium)

  • Measuring silence durations between Bot messages

  • Silence duration assertion

Was this article helpful?

0 out of 0 found this helpful