Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@bandwidth/voice

Package Overview
Dependencies
Maintainers
8
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bandwidth/voice

Bandwidth's HTTP voice platform

latest
npmnpm
Version
6.1.1
Version published
Weekly downloads
1.2K
-0.59%
Maintainers
8
Weekly downloads
 
Created
Source

Bandwidth Node Voice SDK

Test

OSNode
Windows 201612, 14, 16
Windows 201912, 14, 16
Ubuntu 20.0412, 14, 16
Ubuntu 22.0412, 14, 16

Note: As of version 2.0.0, this package has been upgraded to TypeScript

Getting Started

Installation

npm install @bandwidth/voice

Initialize

import { CreateCallRequest, ApiError, ApiController, Client, Response, SpeakSentence } from '@bandwidth/voice';
const client = new Client({
    basicAuthUserName: "username",
    basicAuthPassword: "password"
});

const controller = new ApiController(client);
const accountId = "12345";

To use a custom environment

import { ApiController, Client, Environment } from '@bandwidth/voice';
const client = new Client({
    basicAuthUserName: "username",
    basicAuthPassword: "password",
    environment: Environment.Custom,
    baseUrl: 'https://custom.bandwidth.com'
});

const controller = new ApiController(client);
const accountId = "12345";

Create A Phone Call

var from = "+15554443333";
var to = "+15553334444";
var answerUrl = "https://sample.com";
var applicationId = "3-a-b-c";
var body = {
    from: from,
    to: to,
    answerUrl: answerUrl,
    applicationId: applicationId,
};

var createCallResponse = await controller.createCall(accountId, body);
console.log(createCallResponse.result.callId);

Create BXML

var speakSentence = new SpeakSentence({
    sentence: "test",
    voice: "susan",
    gender: "female",
    locale: "en_US",
});

var response = new Response(speakSentence);

console.log(response.toBxml());

Supported Node Versions

This package can be used with Node >= 10

Credentials

Information for credentials for this package can be found at https://dev.bandwidth.com/guides/accountCredentials.html

FAQs

Package last updated on 20 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts