Programmable voice
Verb-based voice call control in Fonoster.
This documentation is actively being improved. You may encounter gaps or incomplete sections as we refine and expand the content. We appreciate your understanding and welcome any feedback to help us make this resource even better!
Programmable Voice in Fonoster allows you to control the flow of a phone call using a set of verbs. Verbs work in conjunction with the VoiceServer to create a voice application.
VoiceServer
The VoiceServer works similarly to an Express server. It accepts requests and returns responses. The VoiceServer is responsible for processing the verbs and executing the desired actions.
An example of running a VoiceServer in Fonoster:
Like with Express, you can use the request object to access information about the call. For example, you can access the caller’s phone number with req.callerNumber
.
Verbs
Verbs are the building blocks of a voice application. They are used to control the flow of a phone call. Verbs are executed in the order they are called.
Here is a list of the available verbs in Fonoster:
Answer
- Accepts an incoming callHangup
- Closes the callPlay
- Takes a URL with a media file and streams the sound back to the calling partyPlayDtmf
- Takes a DTMF sequence and plays it back to the calling partySay
- Takes a text, synthesizes the text into audio, and streams back the resultGather
- Waits for DTMF or speech events and returns back the resultSGather
- Returns a stream for future DTMF and speech resultsDial
- Passes the call to an Agent or a Number at the PSTNRecord
- It records the voice of the calling party and saves the audio on the Storage sub-systemMute
- It tells the channel to stop sending media, effectively muting the channelUnmute
- It tells the channel to allow media flow
Run any setup code before calling the Answer verb. The Answer verb should be the first verb in your application. Similarly, the Hangup verb should be the last in your application.
See NPM for details
For full documentation, please visit NPM.