https://github.com/fonoster/fonoster
๐ The open-source alternative to Twilio.
https://github.com/fonoster/fonoster
cloud cloud-communications-platform cpaas customer-engagement customer-experience javascript kubernetes nodejs programmable-voice telephony twilio typescript ucaas voip webrtc
Last synced: 6 days ago
JSON representation
๐ The open-source alternative to Twilio.
- Host: GitHub
- URL: https://github.com/fonoster/fonoster
- Owner: fonoster
- License: mit
- Created: 2018-02-04T02:58:54.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2024-10-27T07:03:26.000Z (6 months ago)
- Last Synced: 2024-10-29T20:25:38.284Z (6 months ago)
- Topics: cloud, cloud-communications-platform, cpaas, customer-engagement, customer-experience, javascript, kubernetes, nodejs, programmable-voice, telephony, twilio, typescript, ucaas, voip, webrtc
- Language: JavaScript
- Homepage: https://fonoster.com
- Size: 128 MB
- Stars: 6,350
- Watchers: 107
- Forks: 349
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-rtc - Fonoster - Telecommunication stack built with Node.js. (Operations / Web/API Interfaces)
- awesome-open-source-systems - Fonoster - The open-source alternative to Twilio. (Uncategorised / Uptime Monitoring)
- my-awesome-list - fonoster - source alternative to Twilio. | fonoster | 6571 | (TypeScript)
README
# Fonoster: The open-source alternative to Twilio
[Fonoster](https://fonoster.com) is researching an innovative Programmable Telecommunications Stack that will allow businesses to connect telephony services with the Internet entirely through a cloud-based utility.
 [](https://github.com/fonoster/fonoster/actions/workflows/release.yaml) [](https://discord.gg/4QWgSz4hTC)
 
## Features
The most notable features of Fonoster are:
- [x] Multitenancy
- [x] Easy deployment of PBX functionalities
- [x] Programmable Voice Applications
- [x] NodeJS SDK
- [x] Support for Amazon Simple Storage Service (S3)
- [x] Secure API endpoints with Let's Encrypt
- [x] Authentication with OAuth2
- [X] Authentication with JWT
- [x] Role-Based Access Control (RBAC)
- [x] Plugins-based Command-line Tool
- [x] 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 flowVoice Application Example:
```typescript
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 res.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:
```typescript
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:
- [Deploying Fonoster with Docker](https://docs.fonoster.com/self-hosting)
- [Guide for Early Access User](https://docs.fonoster.com/quickstart)
- [Getting started with Fonoster](https://docs.fonoster.com/quickstart)
- [How we created an open-source alternative to Twilio and why it matters](https://dev.to/fonoster/how-we-created-an-open-source-alternative-to-twilio-and-why-it-matters-434g)## 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](https://github.com/fonoster/fonoster/issues)
## Contributing
For contributing, please see the following links:
- [Contribution Documents](https://github.com/fonoster/fonoster/blob/main/CONTRIBUTING.md)
- [Contributors](https://github.com/fonoster/fonoster/contributors)
![]()
Pedro Sanders
![]()
Angel M. Bencosme
![]()
Efrain Peralta
![]()
Wandy Hernandez
![]()
Obruche Wilfred Oghenechohwo
![]()
Wardner Lara
![]()
Richard HC
![]()
Nageswari
![]()
Hoan Luu Huu
![]()
Speedy Monster
![]()
harry_dev
![]()
Kanishka Chowdhury
![]()
Brayan Munoz V.
![]()
Dede kurniawan
![]()
gabriel duncan
![]()
Prasurjya Pran Borah
![]()
Jordan
![]()
Hector Ventura
![]()
0xflotus
![]()
Manish
![]()
Osama Sehgol
![]()
Paul Sรผtterlin
![]()
Riad Vargas
![]()
Shailendra Paliwal
![]()
The Gitter Badger
![]()
Yuri
![]()
cdrsociate
![]()
pavan
![]()
nrjchnd
![]()
Salami Bashir
![]()
Shivam Deepak Chaudhary
![]()
Yossef Haim
![]()
telenautical
![]()
Wisdom Elendu
![]()
Judge Godwins
![]()
Jon Chin
![]()
Harish Chander
![]()
Gary Barnes
![]()
Fidal Mathew
![]()
Enmanuel Toribio
![]()
Dung Duc Huynh (Kaka)
![]()
Ciprian
![]()
Christopher Adigun
![]()
Bruno Gomes
![]()
Bruno Arueira
![]()
Antonius Ostermann
![]()
Ali Firat ARI
![]()
Alex
## Sponsors
We're glad to be supported by respected companies and individuals from several industries.
Find all our supporters [here](https://github.com/sponsors/fonoster)
> [Become a Github Sponsor](https://github.com/sponsors/fonoster)
## Authors
- [Pedro Sanders](https://github.com/psanders)
## License
Copyright (C) 2025 by [Fonoster Inc](https://fonoster.com). MIT License (see [LICENSE](https://github.com/fonoster/fonoster/blob/main/LICENSE) for details).