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

altervoice-asterisk-callbot

v1.1.5

Published

Jovo plugin for Altervoice asterisk integration

Downloads

32

Readme

Altervoice Asterisk Callbot

Altervoice Asterisk Callbot

About

Altervoice Asterisk Callbot is a plugin of JOVO framework. It works with telephony platform such as Asterisk and the Altervoice Speech Controller module developed by Altervoice

Installation

npm install altervoice-asterisk-callbot

Prerequisite

To use the plugin, you must deploy and properly configure the following systems :

The plugin works with Dialogflow NUL engine

Additionally the Altervoice Speech Controller must be connected with STT and TTS engines

Jovo Integration

Setup

Import Dialogflow and altervoice-asterisk-callbot plugins. Install middlewares as shown in this example.

const { App } = require('jovo-framework');
const { Dialogflow } = require('jovo-platform-dialogflow');
const { AltervoiceAsteriskCallbot } = require('altervoice-asterisk-callbot');
const app = new App();
app.use(
	new Dialogflow().use(
		new AltervoiceAsteriskCallbot()
		)
})
app.setHandler({
    LAUNCH() {
        this.tell("Hello callbot");
      }
})

The tell() method disable the voice recognition during the prompt. Then the call hang up. Use ask() method to maintain the call. More JOVO Basic concepts

Actions to Telephony platform

The Jovo handler has new method to send actions to Asterisk

app.setHandler({
    LAUNCH() {
        this.addActions({telephonyHangup:true, setMode : 'AFTER_PLAY'}});
      }
})

In this example, the application hangup the call after playing the prompt

The first attribut of object define the action type that can be :

  • telephonyDtmf : {grammar:string}

to set allowed dtmf regex. Setting is maintained active until new regex or "" string

  • telephonyMaxCall : {duration:number, prompt: string|SpeechBuilder }

to set the maximum duration of call. duration is in seconds. prompt is the ssml content. When the max duration is riched, the prompt is played back and call hangup

  • telephonyInact : {duration:number, prompt: string|SpeechBuilder, max_count:number }

to set the user inactivity. duration is maximum duration of user inactivity in seconds. prompt is the ssml content to be play back. max_count is the number of prompt is played. When the user inactivity occurs all prompt and reprompt defined in ask() method are played, until the max_count is riched. If the max_count is bigger than number of prompt and reprompt defined in ask() method, the warning prmpt is played.

  • telephonyCallTransfer : {phoneNumber: string}

to transfer the call to an other destination number.

  • telephonyCallCancel : true

to cancel the call transfer .

  • telephonyHangup : boolean

to hangup the call

  • telephonyError : string| SpeechBuilder;

to set ssml content when any error occurs

SetMode attribut defines when the action must be applied. It can be:

  • BEFORE_PLAY : the action is applied before the prompt is played back (ex: DTMf grammar change).
  • AFTER_PLAY : the action is applied after playing is complete (ex: call transfer)
  • AFTER_INACT : the action is applied after the inactivity delay is over (ex: hangup)

Jovo Model

Use the jovo model to associate the event and the Intent

"intents": [
  { "name": "dtmfIntent",
    "dialogflow": {"events": [{"name": "TELEPHONY_DTMF"}]}
  }
]

In this example : intent "dtmfIntent" is associated with TELEPHONY_DTMF event.

Data from Telephony platform

Asterisk Speech Controller send events when the user or call change.

The Jovo handler has new method to get data from Asterisk, such as getDtmf().

app.setHandler({
    dtmfIntent() {
        const digits = this.getDtmf();
      }
})

In this example : getDtmf() method is used to get the DTMF sequence when dtmfIntent is run by the jovo handler.

Events from Telephony platform

Here are the list of events and associated methods to get data from the Telephony platform :

  • TELEPHONY_DTMF : sent when user press key on the phone and the sequence matches the active regex.

    getDtmf(void) return an object {digits:string}

  • TELEPHONY_HANGUP : sent when call has hangup.

    getResult(void) return an object {cause_txt :string, cause_code: number}

  • TELEPHONY_RESULT : sent when the call status has changed. Example when a call transfer is in progress.

    getResult(void) return an object {cause_txt :string, cause_code: number}

Support

[email protected]

Visit Altervoice website https://www.altervoice.com