Awesome Open Source
Awesome Open Source

Fonoster: The open-source alternative to Twilio

Fonoster Inc researches an innovative Programmable Telecommunications Stack that will allow for an entirely cloud-based utility for businesses to connect telephony services with the Internet.

https://user-images.githubusercontent.com/539774/170885814-02c53689-af12-4e05-8351-e78d72f958d9.mov

build release Discord Code Of Conduct GitHub Twitter Follow

Features

The most notable features on FN 0.3 are:

  • [x] Cloud initialization with Cloud-Init
  • [x] Multitenancy
  • [x] Easy deployment of PBXs functionalities
  • [x] Programmable Voice Applications
  • [x] NodeJS SDK
  • [x] Web 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 API
  • [x] Experimental support for Cloud Functions
  • [x] Experimental support for Secret management

Code Examples

A Voice Application is a server that takes control of the flow in a call. A Voice Application can use any combination of the following verbs:

  • Answer - Accepts an incoming call
  • Hangup - Closes the call
  • Play - Takes an URL or file and streams the sound 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
  • 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");

const serverConfig = {
  pathToFiles: `${process.cwd()}/sounds`,
};

new VoiceServer(serverConfig).listen(
  async (req, res) => {
    console.log(req);
    await res.answer();
    await res.play(`sound:${req.selfEndpoint}/sounds/hello-world.sln16`);
    await res.hangup();
  }
);

// your app will live at http://127.0.0.1:3000 
// and you can easily publish it to the Internet with:
// ngrok http 3000

Everything in FN 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 Fonoster = require("@fonoster/sdk");
const callManager = new Fonoster.CallManager();

callManager.call({
 from: "9842753574",
 to: "17853178070",
 webhook: "https://5a2d2ea5d84d.ngrok.io/voiceapp"
})
 .then(console.log)
 .catch(console.error);

Getting Started

To get started with FN use the following resources:

Give a Star!

If you like this project or plan to use it in the future, please give it a star. Thanks

Bugs and Feedback

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

Contributing

For contributing, please see the following links:

Sponsors

We're glad to be supported by respected companies and individuals from several industries.

Find all our supporters here

Become a Github Sponsor

Authors

License

Copyright (C) 2022 by Fonoster Inc. MIT License (see LICENSE for details).

Related Awesome Lists
Top Programming Languages

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,158,774
Typescript (307,126
Cloud (29,186
Kubernetes (25,988
Webrtc (4,513
Twilio (3,988
Voip (894
Telephony (384
Customer Engagement (12
Cpaas (10
Customer Experience (10
Programmable Voice (6
Cloud Communications Platform (3