Routr is a lightweight sip proxy, location server, and registrar that provides a reliable and scalable SIP infrastructure for telephony carriers, communication service providers, and integrators. Content Community Should you try Routr? Contact us Features The official handbook Deployment Docker Kubernetes Getting started with the CTL First steps with the NodeSDK Custom Processors and Middleware Documentation Bugs…
Routr is a lightweight sip proxy, location server, and registrar that provides a reliable and scalable SIP infrastructure for telephony carriers, communication service providers, and integrators.
We are building Routr in the open. The best to communicate with us is via GitHub Discussions. You can also join our Discord server to discuss roadmaps, feature requests, and more.
Should you try Routr?
Routr’s architecture and design is fantastic. A breath of fresh air. Being Docker and Kubernetes ready is a huge win over a more traditional SIP server setup.
Phil Jones, VP of Web Architecture at VQ Communications
I came across Routr, which seems to be the one and only cloud-first Kubernetes-ready SIP server on the planet!
Finally, wait a few minutes for the pods to start. You can check the status of the pods with the following command:
kubectl get pods -n routr
You should see a list of pods and their status. If the status is Running, then you are ready to go.
For more details, please refer to the chart’s README.
Getting started with the CTL
Regardless of the deployment method, you can use the command-line tool to manage your server.
To install the command-line tool, run the following command:
npm install --location=global @routr/ctl
We are using the flag --location=global to tell npm to install the command-line tool globally. If you don’t have npm installed, you can follow the instructions here: https://nodejs.org/en/download/.
Here is an example of how to create a domain:
rctl domains create --insecure
The --insecure flag, in the last example, is required because no certificate was provided to secure the API.
Follow the prompts to create the domain.
The output should look like this:
This utility will help you create a new Domain.
Press ^C at any time to quit.
? Friendly Name Local Domain
? SIP URI sip.local
? IP Access Control List None
? Ready? Yes
Creating Domain Local Domain... a27e9fb2-a71a-4cf3-9b1d-dccf373f9777
For additional examples, refer to the command line documentation.
First steps with the NodeSDK
To begin using the Node.js SDK, first make sure you have Node and NPM installed. Then, start by creating a new project and installing the Routr Connect SDK.
mkdir my-project
cd my-project
npm init -y
Next, install the SDK:
npm install --save @routr/sdk
Now, create a new file called index.js and add the following code:
constSDK=require("@routr/sdk");const domains =newSDK.Domains();const request ={name:"Local domain",domainUri:"sip.local",accessControlListRef:"4671371b-ff5d-48b1-aabe-d3c5ca5317a3",egressPolicies:[{rule:".*",numberRef:"4671371b-ff5d-48b1-aabe-d3c5ca5317a3"}],extended:{"key":"value"}};
domains.createDomain(request).then(console.log).catch(console.error);// an error occurred
In the example above, we assume that the ACL and Number already exist.
One of Routr’s most significant advantages is that it is highly extensible. It enables you to create new Processors and Middleware to extend the functionality of your server.
Processors and Middleware services are responsible for modifying the SIP messages as they pass through the server. However, while both share the same interface, they serve different purposes.
Processors hold feature logic; Middlewares addresses cross-cutting concerns like authentication, authorization, rate limiting, etc.
The repository includes a Dev Container with everything you need to build and run Routr: Node.js 22 and JDK 17, the same versions CI uses.
To get started, open the repository in VS Code and run Dev Containers: Reopen in Container, or use the CLI:
npx @devcontainers/cli@latest up --workspace-folder .
On first creation, the container generates the TLS keystore EdgePort expects and builds the project. The first build takes a while; later rebuilds reuse the cached node_modules, npm, and Gradle volumes.
Once it is ready, check the setup with the echo test. It starts EdgePort, the Dispatcher, and the Echo processor, sends a SIP MESSAGE, and expects a 200 OK, with no database involved:
npm run test:echo
Postgres, Redis, and RTPEngine are not started up front. The commands that need them start them: npm run start:one brings up Postgres and Redis, migrates the database, and starts the all-in-one distribution. Set RTPENGINE_HOST=rtpengine to add RTPEngine. You can also start and stop them yourself with npm run start:deps and npm run stop:deps.
The SIP ports (5060-5063) and the service ports (51901-51908) are forwarded to your machine. For more, see the dev containers guide.
Note 注意
VS Code only forwards TCP ports, so SIP over UDP from a softphone on your host will not reach the container. Use TCP or WebSocket instead.
评论