Fonoster is a free, open source frameworks & platforms project written in TypeScript and released under MIT. It has 8,113 GitHub stars, 555 forks and 22 open issues, and was last pushed 28 hours ago. On this registry it ranks #16 of 28 tracked projects in Frameworks & Platforms, and is listed as an open source replacement for 1 paid product, with 5 head-to-head comparisons available. It gained 9 stars over the last 6 tracked days.

What is Fonoster?

Fonoster is an MIT-licensed TypeScript platform for programmable voice and telephony that is positioned as the open-source alternative to Twilio, and it is aimed at developers and platform teams building cloud communications, voice applications and customer engagement products.

What it is

Fonoster is an open-source cloud communications platform, described in its README as a "Programmable Telecommunications Stack" that lets businesses connect telephony services with the Internet entirely through a cloud-based utility. It lives in the CPaaS ecosystem, the same category as Twilio, and ships as a TypeScript codebase under the MIT licence. The platform is API-first: a Voice Application is a server that controls a call's flow, written against the Node.js SDK (@fonoster/sdk) and the voice server module (@fonoster/voice). A plugins-based command-line tool drives the same API, and deployments target Kubernetes alongside the other topics attached to the project.

The concrete problem it solves is third-party control of telephony. Instead of routing call control, speech and recording through a paid hosted service, a team hosts the stack itself and keeps the calls it handles. Fonoster supplies the pieces that would otherwise be rented: programmable voice verbs for answering, gathering DTMF or speech, playing media, recording, muting and dialling to an agent or a PSTN number; a multitenant control plane with OAuth2, JWT and Role-Based Access Control; and storage integration with Amazon Simple Storage Service. Everything is an API first, so originating a call takes a few lines of SDK code rather than a bespoke integration.

Key capabilities

  • Programmable Voice Applications assembled from verbs named Answer, Hangup, Play, PlayDtmf, Say, Gather, SGather, Stream, Dial, Record, Mute and Unmute.
  • @fonoster/voice VoiceServer that listens for callbacks on tcp://127.0.0.1:50061, publishable to the Internet with ngrok tcp 50061.
  • @fonoster/sdk with Client, loginWithApiKey and Calls.createCall for originating outbound calls from application code.
  • Multitenancy, OAuth2 and JWT authentication, and Role-Based Access Control (RBAC).
  • Secure API endpoints with Let's Encrypt certificates.
  • Amazon Simple Storage Service support, with the Record verb saving caller audio into the storage subsystem.
  • A plugins-based command-line tool and Google Speech APIs support for speech-driven Gather.

Who uses it and how

  • Developer teams writing voice applications in Node.js and TypeScript, using the SDK and voice verbs instead of a vendor console.
  • Products in customer engagement and customer experience that need call control inside their own stack.
  • Service operators that need multitenancy and RBAC to serve several organisations from one deployment.
  • Infrastructure teams comfortable running Kubernetes workloads, since Kubernetes is a listed topic for the project.
  • Early access users following the project's early access guide while the platform moves through its research phase.

Getting started

Deploy Fonoster with Docker by following the self-hosting documentation at docs.fonoster.com/self-hosting, with a separate guide for early access users also available from the project documentation.

How it compares

The registry lists Twilio as the paid product that Fonoster replaces. Twilio is a commercial hosted service, while Fonoster is MIT-licensed software designed to be self-hosted, so the operator keeps control of the infrastructure and the call data it handles. That difference also shapes the cost model: Twilio is paid for as a service, whereas Fonoster is a stack the user downloads and runs.

When to use it — and when not to

Choose Fonoster when keeping telephony inside your own deployment matters more than handing it to a vendor, and when you can operate the stack yourself. A self-hoster has to run the API endpoints, obtain Let's Encrypt certificates, configure OAuth2 or JWT authentication, provide S3-backed storage and manage the Kubernetes deployment. Teams that want a fully managed service with no infrastructure work, or that need the project to be past its research and early access phase, should look elsewhere for now.

project readme (upstream, from github) — read inline

Fonoster: The open-source alternative to Twilio

Fonoster is researching an innovative Programmable Telecommunications Stack that will allow businesses to connect telephony services with the Internet entirely through a cloud-based utility.

Fonoster community banner

build release Discord Code Of Conduct GitHub Twitter Follow

Features

The most notable features of Fonoster are:

  • Multitenancy
  • Easy deployment of PBX functionalities
  • Programmable Voice Applications
  • NodeJS SDK
  • Support for Amazon Simple Storage Service (S3)
  • Secure API endpoints with Let's Encrypt
  • Authentication with OAuth2
  • Authentication with JWT
  • Role-Based Access Control (RBAC)
  • Plugins-based Command-line Tool
  • Support for Google Speech APIs

Code Examples

A Voice Application is a server that controls a call's flow. A Voice Application can use any combination of the following verbs:

  • Answer - Accepts an incoming call
  • Hangup - Closes the call
  • Play: Takes a URL with a media file and streams the sound back to the calling party
  • PlayDtmf - Takes a DTMF sequence and plays it back to the calling party
  • Say - Takes a text, synthesizes the text into audio, and streams back the result
  • Gather - Waits for DTMF or speech events and returns back the result
  • SGather - Returns a stream for future DTMF and speech results
  • Stream - Creates a bidirectional stream to send and receive audio from a caller
  • Dial - Passes the call to an Agent or a Number at the PSTN
  • Record - It records the voice of the calling party and saves the audio on the Storage sub-system
  • Mute - It tells the channel to stop sending media, effectively muting the channel
  • Unmute - It tells the channel to allow media flow

Voice Application Example:

const VoiceServer = require("@fonoster/voice").default;
const { 
  GatherSource, 
  VoiceRequest, 
  VoiceResponse 
} = require("@fonoster/voice");

new VoiceServer().listen(async (req: VoiceRequest, voice: VoiceResponse) => {
  const { ingressNumber, sessionRef, appRef } = req;

  await voice.answer();

  await voice.say("Hi there! What's your name?");

  const { speech: name } = await voice.gather({
    source: GatherSource.SPEECH
  });

  await voice.say("Nice to meet you " + name + "!");

  await voice.say("Please enter your 4 digit pin.");

  const { digits } = await voice.gather({
    maxDigits: 4,
    finishOnKey: "#"
  });

  await voice.say("Your pin is " + digits);

  await voice.hangup();
});

// Your app will live at tcp://127.0.0.1:50061 
// and you can easily publish it to the Internet with:
// ngrok tcp 50061

Everything in Fonoster is an API first, and initiating a call is no exception. You can use the SDK to start a call with a few lines of code.

Example of originating a call with the SDK:

const SDK = require("@fonoster/sdk");

async function main(request) {
  const apiKey = "your-api-key";
  const apiSecret = "your-api-secret"
  const accessKeyId = "WO00000000000000000000000000000000";

  const client = new SDK.Client({ accessKeyId });
  await client.loginWithApiKey(apiKey, apiSecret);

  const calls = new SDK.Calls(client);
  const response = await calls.createCall(request);

  console.log(response); // successful response
}

const request = {
  from: "+18287854037",
  to: "+17853178070",
  appRef: "3e61ecb7-a1b6-4a93-84c3-4f1979165bca",
  // Optional metadata to be sent to the Voice Application
  metadata: {
    name: "John Doe",
    message: "Please call me back."
  }
};

main(request).catch(console.error);

Getting Started

To get started with Fonoster, use the following resources:

Give a Star! ⭐

Please give it a star if you like this project or plan to use it. Thanks 🙏

Bugs and Feedback

For bugs, questions, and discussions, please use the Github Issues

Contributing

For contributing, please see the following links:

Pedro
Pedro Sanders
Efrain
Efrain Peralta
Angel
Angel M. Bencosme
Wandy
Wandy Hernandez
Obruche
Obruche Wilfred Oghenechohwo
Wardner
Wardner Lara
Richard
Richard HC
Nageswari/

readme truncated — read the full docs on github

Frequently asked questions

Is Fonoster free to use?

Fonoster is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does Fonoster do?

Open-source cloud communications platform for developers

What is Fonoster written in?

Fonoster is primarily written in TypeScript. Its source is publicly available at https://github.com/fonoster/fonoster, and it has 8,113 GitHub stars.

What is a good open source alternative to Twilio?

Fonoster is one of the open source options listed as an alternative to Twilio. Compare licences, stars and activity side by side on the Fonoster profile.