Skip to content

Instantly share code, notes, and snippets.

@fmateo05
Last active May 26, 2024 05:23
Show Gist options
  • Save fmateo05/77fcbac6fe840cc95aeb48eb0cf153e4 to your computer and use it in GitHub Desktop.
Save fmateo05/77fcbac6fe840cc95aeb48eb0cf153e4 to your computer and use it in GitHub Desktop.
Kazoo VoIP PBX Next-Gen Embedded Weekly Images

Welcome!!

This gist describes about using Kazoo Next-Gen Embedded Images. You can download and Flash (or clone) the image to your test on-premise or VPS server's storage disk and get system running in a matter of some minutes. This guide is provisional, in the mean time an script will be written for automate and ease this process

Download Link: https://kazoo-embedded-images.nyc3.cdn.digitaloceanspaces.com/kazoo-embedded-x64-build-2024-05-25.img.gz

  1. Download and Clone the image to the first hard disk, where sdX is your hard drive.

zcat kazoo-embedded-img.gz | dd of=/dev/sdX bs=1M .

  1. Just before boot the system, You must enlarge the second partition previously cloned to harddrive (I recommend GpartEd https://gparted.org/download.php ) .

  2. Boot GPartED or similar partition tool and resize (to grow) the /dev/sdX2 partition. Try to keep the initial label that is set to it. If you prefer another Filesystem, Keep in mind to set 'OVL' label to it .

  3. After system being first booted, the root password is adminadmin01 ; change it immediately if you are on a VPS or public environment .

  4. List the containers and then; Start the containers on the following order

lxc list lxc start cdb01 lxc start rabbit1-z100 lxc start haproxy-z100 lxc start fs1-z100 lxc start kz1-z100 lxc start km1-z100

Note: They will take some more time tan usual to start up, please be patient.

  1. *After starting them; please track kazoo logs to ensure it started correctly, you can access to container's shell using:

lxc shell -or- lxc exec -- bash

  1. With this command you can test if the services are running properly; note that you must create network forwards to get public access to kazoo setup.

  2. Create network forwards for public access and to get proper audio from the media service (freeswitch) and registrations from SBC (kamailio)

incus network forward create incusbr0 138.197.95.168 incus network forward port add incusbr0 138.197.95.168 udp 16384-32768 10.179.0.27 (freeswitch RTP) incus network forward port add incusbr0 138.197.95.168 udp 5060,7000 10.179.0.20 (Kamailio SBC) incus network forward port add incusbr0 138.197.95.168 tcp 5060,7000 10.179.0.20(Kamailio SBC) incus network forward port add incusbr0 138.197.95.168 tcp 80,443 10.179.0.21 (Kazoo Monster-UI https and API ports)

The external IP and/or internal ip may change, it is related to each container's IP

  1. Configure DNS A record (example: portal.mydomain.com) and nginx with SSL (Letsencrypt or any SSL Provider's certificates)

Add the A record with the public server's IP

lxc shell kz1-z100 dnf install -y certbot systemctl stop nginx (to allow certbot work with the SSL certificates setup) certbot certonly -d portal.mydomain.com --standalone

  1. With an editor, open /etc/nginx.conf.d/kazoo.conf and uncomment the following lines and please set the correct path to LetsEncrypt certificates, also set server_name to your domain (ie. portal.mydomain.com):

listen 443 ssl;

listen [::]:443 ssl;

ssl_certificate /etc/ssl/certs/ca-bundle.crt ;

ssl_certificate_key /etc/ssl/certs/ca-bundle.trust.crt ;

  1. Start nginx service

systemctl restart nginx

  1. go to /var/www and create a symlink for monster-ui, also set-up the config.js parameters cd /var/www ln -s monster-ui-4.3 monster-ui cd monster-ui nano ./js/config.js

Just before 'whitelabel' you can add this: api: { 'default': 'https://portal.mydomain.com/v2/', socket: 'wss://portal.mydomain.com/' },

  1. Still inside kz1-z100 container, create the master account, add the FS node to ecallmgr and import the apps and sounds.

set +o history

sup crossbar_maintenance create_account

sup crossbar_maintenance init_apps /var/www/monster-ui/apps/ https://portal.mydomain.com/v2/

sup -n ecallmgr ecallmgr_maintenance add_fs_node freeswitch@fs1-z100.incus 'false'

set -o history

  1. Install kazoo prompts to the system: cd /opt/ git clone --depth 1 https://github.com/2600hz/kazoo-sounds sup kazoo_media_maintenance import_prompts /opt/kazoo-sounds/kazoo-core/en/us/ en-us

  2. Configure NAT for freeswitch and Kamailio.(tbd)

  3. Now you can login to monster-ui ; then create accounts add numbers, and users/devices

*If kazoo won't start correctly:

  1. Stop kazoo container, and haproxy container lxc stop kz1-z100 haproxy-z100

  2. Login to couchdb container and stop the service only lxc shell cdb01 set +o history systemctl stop kazoo-couchdb

Delete the database files rm -rf /srv/*

  1. Start the couchdb service systemctl start kazoo-couchdb
  2. Return to main console and start haproxy and kazoo once again ctrl+d lxc start haproxy-z100 lxc start kz1-z100
  3. Track log files to ensure kazoo is running properly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment