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
- CallManager ⇐
APIClient
- new CallManager()
- .call(request) ⇒
Promise.<CallResponse>
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
Param | Type | Description |
---|---|---|
request | CallRequest | Call request options |
request.from | string | Number you are calling from. You must have this Number configured in your account |
request.to | string | The callee |
request.webhook | string | Url of the application that will handle the call If none is provided it will use the webook setup in the Number |
request.metadata | object | Arbitrary 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