Skip to main content

CallManager

CallManager ⇐ APIClient

Use Fonoster CallManager, a capability of Fonoster CallManager, to initiate and monitor automated calls. Fonoster CallManager requires of a running Fonoster deployment.

Kind: global class
Extends: APIClient
See: module:core:APIClient

new CallManager()

Constructs a new CallManager Object.

Example

const Fonoster = require("@fonoster/sdk")
const callManager = new Fonoster.CallManager()

callManager.call({
from: "9102104343",
to: "17853178070",
webhook: "https://https://071e-47-132-137-75.ngrok.io/voiceapp",
})
.then(console.log) // successful response
.catch(console.error) // an error occurred

callManager.call(request) ⇒ Promise.<CallResponse>

Call method.

Kind: instance method of CallManager
Returns: Promise.<CallResponse> - - call results
Throws:

  • if the from number doesn't exist
  • if could not connect to the underline services
ParamTypeDescription
requestCallRequestCall request options
request.fromstringNumber you are calling from. You must have this Number configured in your account
request.tostringThe callee
request.webhookstringUrl of the application that will handle the call If none is provided it will use the webook setup in the Number
request.metadataobjectArbitrary payload to send to the Voice Application

Example

callManager.call({
from: "+19102104343",
to: "+17853178070",
webhook: "https://voiceapps.acme.com/myvoiceapp",
metadata?: {}
})
.then(console.log) // successful response
.catch(console.error); // an error occurred