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

voicenter-web-sdk

v1.1.3

Published

Voicenter API Web-service SDK including all what you need for IVR, Popup , Cdr2CRM and more ...

Downloads

12

Readme

VoicenterWebSDK

Voicenter API Web-service SDK including all what you need for IVR, Popup , Cdr2CRM and more.

Running the project

For Running the server, run a script with the following logic :

    const VoicenterWebSDK = require("voicenter-web-sdk");
    const vcSDK = new VoicenterWebSDK({host:'0.0.0.0',port:3000});
    vcSDK.start();

this will start a web service that will serve and interact with the different Web API's that Voicenter offers to its customers. more information can be found in: [https://www.voicenter.co.il/API] The final path of this service will be entered into the "mini-external-url" found in the layer settings tab.

Testing

A call for a TestLogic Call logic controller will look like this: http://127.0.0.1:3000/Ivr/TestLogic

Reloading settings

and call with reload=true will make the server reload the call logic without the need for a server restart. http://127.0.0.1:3000/Ivr/TestLogic?reload=true

Example for a Call Logic

A simple Call Logic module should look the following example and should be located inside a TestLogic.js file in the root of the project:

    module.exports = async function (call) {
	    call.SetParam("foo","Hello");
	    call.SetParam("foo",call.GetParam("foo")+" World");
	    if(call.CallerID==="0512345678"){
		    call.Say(111);
		   }else{
		    call.GoToLayer(22);
	     }
    }

Call Logic parameters:

Call logic are function that the server is executing for each IVR call request. the function will be getting the call object with the following parameters and functions:

Parameter List:

| Parameter name | description | value for example
|:--|--|:--|
| Did | DID number that the call was received on (Incoming number). |031234567 |
| CallerID | Called ID is the number of the current caller calling the DID number | 0512345678 |
| CallID | Voicenter unique ID of a call. Can be used for state purposes (also referred to as IVR_UNIQUE_ID) | 76f4hsd4li45m7ergrtg4562456yt |
| DTMF | If the caller was requested to enter some digits over the phone - the input will be passed in this parameter. *In case the caller did not enter any value (did not make any dial action and timeout has been reached), the default value will always be “0”. | 2 |
| LayerID | The current layer ID in the IVR that the request is sent from. | 1 |
| PreviousLayerID | If the call was passed to the layer from another layer, the previous layer will be shown here. | 0 |

Methods List :

1. call.Do(callLogicName)

Description: Executes different call logics. callLogicName: String name of a .js file (without the suffix ".js"), located in the main project folder - to be used to process the request.

2. call.Say(SayOptions)

Description: Executes the Say action. SayOptions: An object received by the Say function - allowing Voicenter IVR to announce the values its getting, such as audio file names, numbers, digits or dates - by the order they are received.

	{
	 "SayData":[
	 	{"Recording":"youhave.wav"},
		{"Number":"13"},
		{"Recording":"usd.wav"},
		{"Recording":"in-your-account.wav"},
	 	{"Recording":"your-account-number-is.wav"},
	 	{"Digits":"1234"}
	 	],
	 "NextLayer":13,
	 "Language" :"EN"
	}

SayData - can contain any of the following options.

Voicenter IVR will announce it in the order its received:

  1. Recording - A full file name to play.
  2. Number- A number to announce ("101" will be announced as "one hundred and one").
  3. Digits - Digits to announce ("13" will be announced as "one tree" and not as "thirteen").
  4. Date - a date to announce.

Other parameters:

NextLayer - the Next Layer in Voicenter IVR to redirect the call to after playing the Say command. Language- The current language of the current caller to the IVR.

3. call.GoToLayer(GoToLayerOptions)

Description: Allows forwarding the caller to another IVR layer in Voicenter IVRs. GoToLayerOptions:

call.GoToLayer(layerID,callerName)

are is a valid example:

call.GoToLayer({NextLayer:22,callerName:"John Doe"})

4. call.Dial(Targets,DialOptions,call)

Description: Allows forwarding the caller to call external phone number or Voicenter Extensions .

  1. Targets - List of destinations to call (phone or Voicenter Extensions).
  2. DialOptions- Options Dial configuration .
  3. call - call object for internal use , Dynamic callerID for example .
call.Dial("0523574321",{"Recording":true ,"Duration":1800,"Ring":60,"NextVo":666,"CallerID":"0722776772","CallerName":"Voicenter Api Team"},call)

or:

call.Dial(["0523574321","0722776772"],{"Recording":true ,"Duration":1800,"Ring":60,"NextVo":666,"CallerID":"0722776772","CallerName":"Voicenter Api Team"},call)

or:

call.Dial([{"Target":"0523574321","Type":"PHONE"}],{"Recording":true ,"Duration":1800,"Ring":60,"NextVo":666,"CallerID":"0722776772","CallerName":"Voicenter Api Team"},call)

5.call.Execute()

Description: Mandetory action - to finilized the process of the current request and send back the calculated answer back to Voicenter IVR system.