npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ivr-tester-mark

v1.0.0

Published

[![npm](https://img.shields.io/npm/v/ivr-tester)](https://www.npmjs.com/package/ivr-tester) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/SketchingDev/ivr-tester.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Sket

Downloads

36

Readme

IVR Tester

npm Language grade: JavaScript FOSSA Status

IVR Tester automates the testing of IVR flows by calling them, interpreting prompts and replying with DTMF tones based on fluent test definitions.

Features:

  • Fully automates testing call flows
  • Test multiple scenarios in parallel
  • Expressive test definitions help document call flow
  • Record audio of tests
  • Record transcriptions of tests
  • Supports Google Speech-to-Text and AWS Transcript for transcribing calls
  • Open-source
const config = { transcriber: googleSpeechToText({ languageCode: "en-GB" }) };

new IvrTester(config).run(
  { from: "0123 456 789", to: "0123 123 123" },
  {
    name: "Customer is provided a menu after their account number confirmed",
    steps: [
      {
        whenPrompt: similarTo("Please enter your account number"),
        then: press("184748"),
        silenceAfterPrompt: 3000,
        timeout: 6000,
      },
      {
        whenPrompt: similarTo(
          "press 1 for booking a repair or 2 for changing your address"
        ),
        then: hangUp(),
        silenceAfterPrompt: 3000,
        timeout: 6000,
        },
     ],
  }
);

Quick Start

  1. Create a Twilio account (referral link for $10 free if you upgrade), load it with money and rent a phone number
    1. Store an authentication token in environment variables:
    export TWILIO_ACCOUNT_SID=ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    export TWILIO_AUTH_TOKEN=your_auth_token
  2. Configure your environment for either Google or Amazon's transcription service
  3. Install and start ngrok
    npm install ngrok -g
    ngrok http 8080
  4. Run the tests
    # Local port that IVR Tester will listen on
    export LOCAL_SERVER_PORT=8080
    # URL that ngrok exposes to the outside world
    export PUBLIC_SERVER_URL=$(curl -s localhost:4040/api/tunnels | jq -r .tunnels[0].public_url)
    
    node test.js

How it works

Under the hood this orchestrates:

  1. Establishing a bi-directional audio stream of the call to the IVR flow - using Twilio
  2. Transcribing the voice responses from the flow - using Google Speech-to-Text
  3. Using the test to conditionally respond with DTMF tones to transcripts

Writing tests

| When | Overview | | -------------|--------------------------------------| | contains | Prompt contains a piece of text | | matches | Prompt matches regular expression | | similarTo | Prompt is similar to a piece of text | | isAnything | Prompt can be anything |

| Then | Overview | | ------------|---------------------| | press | Produces DTMF tones | | hangUp | Terminates the call | | doNothing | Doesn't do anything |

Development

Documentation

Where possible the documentation is generated from the code using the following script in the root directory or individual packages:

yarn docs

The documentation is automatically generated and committed as part of the CI pipeline when merged to the main branch.

The official website can be previewed locally by running:

docsify serve docs

License

FOSSA Status