Skip to content
arheops edited this page Sep 7, 2023 · 10 revisions

Kamailio simple redirect server(stateless)

Features

Features-of-this-config

Installation instructions

Pre-requests

  • Digital Ocean server. Minimal DO droplet server recommended for start. You can upgrade in the future if needed
  • Debian GNU/Linux 11 (bullseye)
  • Attached reserved IP https://cloud.digitalocean.com/networking/reserved_ips
  • Linux shell experience. File editor experience under Linux.

Installation

Copy kamailio folder from the repo to /etc/kamailio/

Edit file /etc/kamailio/local_ips.cfg for server IPs and destination gateway

Edit file /etc/kamailio/dispatcher.list for the list of source servers.

Copy etc/firewall.sh to /etc/ folder

Change control IPs inside, not forget IP you are using now to access server, run it

chmod a+x /etc/firewall.sh

/etc/firewall.sh

Issue this command via console on the server

apt-get update -y && apt-get upgrade -y

apt-get install kamailio kamailio-outbound-modules rsync screen -y

Add content of crontab file to crontab via crontab -e

Add kamailio to be running on boot and run it:

systemctl enable kamailio

systemctl start kamailio

systemctl status kamailio

Howto

Reload gates

Edit file /etc/kamailio/dispatcher.list

Restart firewall

/etc/firewall.sh

Reload dispatcher
kamctl dispatcher reload

Check gates are reachable(after few seconds)

kamctl dispatcher dump

Load considerations

You can check the load in DO console when clicking on the server. Normaly Kamailio takes low CPU. But if your droplet is shared CPU one, recommended to upgrade of droplet size if you reach 50% of CPU(90% for dedicated CPU droplets) at least once during the day.