Back to Top

Guide for Krayin CRM VoIP

Updated 11 February 2026

Krayin CRM VoIP module allows the user to call over a broadband Internet connection and the user can also perform Inbound routes.

With Krayin CRM VoIP you can call between the users and this module also gives the functionality to restrict the permission of the user.

CRM is a system that is used to manage customer interaction throughout the customer life cycle between the customer and sales department through different sources/channels.

Additionally, if you want the store administrator to generate leads via their WhatsApp number. You can check Krayin CRM WhatsApp module.

Feature

  • Support 1 to 1 calls between the user.
  • Call recording is also available.
  • Admin can restrict the permission of the user.
  • Users can download the call recordings.
  • Inbound routes to call directly to the customer.

Start your headless eCommerce
now.
Find out More

Krayin – Laravel CRM

Krayin is built on the most popular PHP framework available in the market today named Laravel, since Krayin inherits features of Laravel, this makes Krayin super flexible and scalable CRM software.

krayin dashboard

With the code-driven approach and also the fully customizable structure, you can easily add/change anything and can even deploy your code in the Krayin CRM.

Krayin ->

Github Link.

Documentation Link.

Readme File(For Installation).

Asterisk – Installation

To install Asterisk 18 on Ubuntu 20.04, you can follow these steps:

1: Update the package index upgrade the system and install the required dependencies

<code>sudo apt update -y

sudo apt upgrade -y

apt-get install unzip git sox gnupg2 curl libnewt-dev libssl-dev libncurses5-dev subversion libsqlite3-dev build-essential libjansson-dev libxml2-dev libedit-dev uuid-dev subversion -y</code>

2: Install Asterisk:

cd ~
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-18-current.tar.gz
tar -zxvf asterisk-18-current.tar.gz

3: Change to the Asterisk source directory and install the required dependencies with the following command:

cd asterisk-18.* contrib/scripts/get_mp3_source.sh contrib/scripts/install_prereq install

4: Run the following command to configure Asterisk:

./configure

Next, set the menu options with the following command and set add-ons, enable core sound modules, music on hold packages, and extra sound packages:

make menu select
Once all the components are installed, build Asterisk with the following command:



make -j2

Step 5:

Install Asterisk using the following command:

make install

Next, install configs and samples using the following command:

make samples
make config
ldconfig

Step 6: Configure Asterisk:

You must create a separate user and group for Asterisk. You can create them with the following command:

groupadd asterisk
useradd -r -d /var/lib/asterisk -g asterisk asterisk

Next, add some required users to the Asterisk group with the following command:

usermod -aG audio,dialout asterisk

Set Permissions:

Now, set proper permissions and ownership using the following command:

chown -R asterisk.asterisk /etc/asterisk
chown -R asterisk.asterisk /var/{lib,log,spool}/asterisk
chown -R asterisk.asterisk /usr/lib/asterisk


Next, edit the /etc/default/asterisk file and set the asterisk user as a default user:

nano /etc/default/asterisk

Change the following lines:

AST_USER=”asterisk” AST_GROUP=”asterisk”

Save and close the file, then edit the Asterisk default configuration file and define the “run as” user and group:

nano /etc/asterisk/asterisk.conf

Change the following lines:

The user to run as.

runuser = asterisk ;

The group to run as.

rungroup = asterisk ;

Save and close the file, then restart the Asterisk service and enable it to start at system reboot with the following command:

systemctl restart asterisk
systemctl enable asterisk

Next, verify the status of the Asterisk service with the following command:

systemctl status asteriskkrayin CRM Configuration

In some cases, you should get the following error:

radcli: rc_read_config: rc_read_config: can’t open /etc/radiusclient-ng/radiusclient.conf: No such file or directory

You can resolve this error using the following commands:

sed -i 's";\[radius\]"\[radius\]"g' /etc/asterisk/cdr.conf
sed -i 's";radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf"radiuscfg => /etc/radcli/radiusclient.conf"g' /etc/asterisk/cdr.conf
sed -i 's";radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf"radiuscfg => /etc/radcli/radiusclient.conf"g' /etc/asterisk/cel.conf

Next, stop and start the Asterisk service again with the following command:

systemctl stop asterisk
systemctl start asterisk

Next, connect to the Asterisk command-line interface with the following command:

asterisk -rvv

Install other required packages like apache, php and composer.

Asterisk Post-Installation Configuration Guide

This guide explains the required updates to PJSIP and HTTP configuration files after installing Asterisk.
These updates enable SIP, TLS, and WebRTC functionality.

1. Update pjsip.conf

nano /etc/asterisk/pjsip.conf

;; SIP configurations
[SIMPLETRANS]
type=transport
protocol=udp
bind=0.0.0.0:5060

[transport-tls]
type=transport
protocol=tls
bind=0.0.0.0:5061
method=tlsv1_2
cert_file=/etc/asterisk/keys/asterisk.pem
priv_key_file=/etc/asterisk/keys/asterisk.key
verify_client=no
verify_server=no
require_client_cert=no

;; WEBRTC configurations
[system]
type=system
timer_t1=500
timer_b=32000
disable_tcp_switch=yes

[global]
type=global
max_initial_qualify_time=0
keep_alive_interval=90
contact_expiration_check_interval=30
default_voicemail_extension=*97
unidentified_request_count=3
unidentified_request_period=5
unidentified_request_prune_interval=30
mwi_tps_queue_high=500
mwi_tps_queue_low=-1
mwi_disable_initial_unsolicited=yes
send_contact_status_on_update_registration=yes

[transport-wss]
type=transport
protocol=wss
bind=0.0.0.0:8089
local_net=10.10.0.9/16
local_net=10.116.0.6/20
external_media_address=accommodating-unflecked-leone.ngrok-free.dev
external_signaling_address=accommodating-unflecked-leone.ngrok-free.dev
method=tlsv1_2
verify_client=no
require_client_cert=no
allow_reload=yes

[webrtc-phones](!)
context=main-context
transport=transport-wss
allow=!all,opus,ulaw,alaw,vp8,vp9,gsm,g729,g723
webrtc=yes

;pjsip accounts
#tryinclude pjsipaccounts/*
#tryinclude trunkpjsipsaccounts/*<a href="https://github.com/sagarkumar-webkul/krayin-voip-installation-setup#1-update-pjsipconf"></a>


Now configure the PJSIP transport settings inside /etc/asterisk/pjsip.conf:

[SIMPLETRANS]
type=transport
protocol=udp
bind=0.0.0.0:5060


Next, configure secure SIP using TLS:

[transport-tls]
type=transport
protocol=tls
bind=0.0.0.0:5061
method=tlsv1_2
cert_file=/etc/asterisk/keys/asterisk.pem
priv_key_file=/etc/asterisk/keys/asterisk.key
verify_client=no
verify_server=no
require_client_cert=no

This enables encrypted SIP on port 5061 using TLS v1.2.


Now configure system-level PJSIP tuning:

[system]
type=system
timer_t1=500
timer_b=32000
disable_tcp_switch=yes

These settings control SIP retransmission timers and prevent automatic UDP to TCP switching.


Next, configure global PJSIP settings:

[global]
type=global
max_initial_qualify_time=0
keep_alive_interval=90
contact_expiration_check_interval=30
default_voicemail_extension=*97
unidentified_request_count=3
unidentified_request_period=5
unidentified_request_prune_interval=30
mwi_tps_queue_high=500
mwi_tps_queue_low=-1
mwi_disable_initial_unsolicited=yes
send_contact_status_on_update_registration=yes

This section handles keepalive, voicemail defaults, and SIP security protections against brute-force attacks.


Now configure WebRTC Secure WebSocket transport:

[transport-wss]
type=transport
protocol=wss
bind=0.0.0.0:8089

This enables WebRTC SIP signaling over secure WebSocket (WSS).


Next, edit the HTTP configuration file:

nano /etc/asterisk/http.conf

Update it with the following configuration:

[general]
enabled=yes
enablestatic=yes
bindaddr=0.0.0.0
bindport=8088

tlsenable=yes
tlsbindaddr=0.0.0.0:8089
tlscertfile=/etc/asterisk/keys/asterisk.pem
tlsprivatekey=/etc/asterisk/keys/asterisk.key

This enables HTTP (8088) and HTTPS/WSS (8089) for WebRTC.


After making changes, reload Asterisk:

asterisk -rx "core reload"

Ensure the following firewall ports are open: 5060 (UDP), 5061 (TLS), 8088 (HTTP), and 8089 (HTTPS/WSS).

4. Firewall / Ports

Ensure the following ports are open:

PortProtocolPurpose
5060UDPSIP
5061TLSSecure SIP
8088TCPHTTP
8089TCPHTTPS / WSS (WebRTC)

5. Notes

TLS certificates must exist at:

/etc/asterisk/keys/asterisk.pem
/etc/asterisk/keys/asterisk.key

If the certificates do not exist, follow the steps below:

1. Create a Directory for Keys

First, ensure the directory exists:

sudo mkdir -p /etc/asterisk/keys
sudo chown asterisk:asterisk /etc/asterisk/keys
sudo chmod 700 /etc/asterisk/keys

This ensures Asterisk has permission to read the key and certificate files.

2. Generate a Private Key

The private key is required to create the certificate. Use OpenSSL:

sudo openssl genrsa -out /etc/asterisk/keys/asterisk.key 2048

asterisk.key is your private key. Keep it secure.

3. Generate a Certificate Signing Request (CSR)

The CSR contains information about your domain and organization and is used to generate the certificate:

sudo openssl req -new -key /etc/asterisk/keys/asterisk.key -out /etc/asterisk/keys/asterisk.csr

OpenSSL will prompt you to fill in the following details:

Country Name (2 letter code) [AU]: IN
State or Province Name (full name) [Some-State]: Delhi
Locality Name (eg, city) []: Delhi
Organization Name (eg, company) [Company Ltd]: MyCompany
Organizational Unit Name (eg, section) []: IT
Common Name (eg, FQDN or YOUR name) []: mydomain.com
Email Address []: [email protected]

Important:

  • The Common Name (CN) must match the domain used to access Asterisk (for WebRTC TLS). Example: pbx.mydomain.com
  • For local testing, you may use your server IP (e.g., 10.10.0.9).

4. Generate a Self-Signed Certificate

For testing or internal use, generate a self-signed certificate:

sudo openssl x509 -req -days 365 -in /etc/asterisk/keys/asterisk.csr -signkey /etc/asterisk/keys/asterisk.key -out /etc/asterisk/keys/asterisk.pem

-days 365 means the certificate will be valid for one year (adjustable).

asterisk.pem is the public certificate paired with your private key.

Now you should have:

/etc/asterisk/keys/asterisk.key   <-- private key
/etc/asterisk/keys/asterisk.pem   <-- certificate

5. (Optional) Verify the Certificate

openssl x509 -in /etc/asterisk/keys/asterisk.pem -text -noout

You should see details such as the domain (CN), validity period, and issuer information.

6. Using CA-Signed Certificates (Optional for Production)

  • Generate a CSR as shown in Step 3.
  • Submit asterisk.csr to a certificate authority (e.g., Let’s Encrypt, DigiCert, GoDaddy).
  • Download the signed certificate.
  • Replace asterisk.pem with the signed certificate.
  • Keep asterisk.key unchanged.

Note: Port 8089 is shared for HTTPS and WSS (WebRTC).

If using NAT or tunneling services (such as ngrok), make sure to configure external_media_address and external_signaling_address properly inside pjsip.conf.


1. install Apache

sudo apt-get install apache2

Now we need to configure apache document root for standard user home directory like we can create a www/html directory in the home directory of standard user instead of root directory.

We need to change the apache document root in the configuration file of apache2 on path /etc/apache2/apache2.conf from /var/www/html to /homw/username/www/ and we must set AllowOverride to ALL.

Next we need to set the document root path to /home/vagrant/www/html/public in /etc/apache2/sites-available/000-default.conf 

Next we need to provide permission on apache document root to asterisk user and need to set apache run user to asterisk in the configuration file present on path /etc/apache2/envvars and after all steps given above, we need to enable rewrite module using command "a2enmod rewrite" and restart apache2 service using command "service apache2 restart" 

2. install php 8.2
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
apt-get -y install php8.2 php8.2-curl php8.2-intl php8.2-gd php8.2-xml php8.2-common php8.2-xsl php8.2-mbstring php8.2-zip php8.2-xml php8.2-bz2 php8.2-common php8.2-phpdbg php8.2-mysql php8.2-fpm php8.2-cli php8.2-cgi libpshp8.2-embed libapache2-mod-php8.2 php8.2-mailparse php8.2-xdebug php8.2-imap php8.2-imagick php8.2-redis php8.2-apcu php8.2-bcmath php8.2-gmp php8.2-soap php8.2-sqlite3

3. install the composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer


4. Configuring Asterisk for WebRTC Clients

please read the asterisk official documentation for the same.

https://docs.asterisk.org/Configuration/WebRTC/Configuring-Asterisk-for-WebRTC-Clients/

Laravel VoIP API

Requirements

  • SERVER: Apache 2
  • RAM: 2 GB or higher.
  • PHP: 8.2 or higher.
  • For SQLite users: 3 or higher.
  • Composer: 2 or higher.

Note:

  • PBX (Private Branch Exchange): It is an open-source that gives the tools to build a phone system tailored to their needs. PBX refers to the private telephone network within a country. We will integrate it with VoIP while setting up the package.
    A PBX is a system that acts like a central brain for all company phone calls. It connects employees to each other using extensions (like 101, 102), and also handles incoming and outgoing calls to external phone numbers. A PBX decides who should receive a call, how it should be routed, and what happens if no one answers—for example, sending the call to voicemail, a queue, or another agent.
  • Lines: A line in VoIP is the capacity that allows one phone call at a time, so more lines mean more people can talk simultaneously.
    These companies sell phone numbers and calling capacity (lines):
  • Common Number: A common number is the main business phone number shown to customers, and the company must purchase this number themselves from a VoIP provider.
    These are the some providers offer business phone numbers along with call capacity (lines) for handling customer calls.

Installation and Configuration

Execute these commands below, in order

composer install
  • Find the .env file in the root directory and change the APP_URL param to your domain.
  • Also, Configure the Database parameters inside the .env file.
php artisan voip:install

Krayin VoIP

The Krayin VoIP Extension is a powerful addition to your Krayin CRM, the extension enables calling features over the internet.

Requirements

  • Krayin: v1.2.5

Installation

To install the Krayin VoIP Extension, follow these steps:

Unzip the respective extension zip and then merge "packages" folders into project root directory..

Open the composer.json file and add the following line under the 'psr-4' section: "Webkul\\VoIP\\": "packages/Webkul/VoIP/src"

In the config/app.php file, add the following line under the 'providers' section: Webkul\VoIP\Providers\VoIPServiceProvider::class,

Run the following commands to complete the setup: composer dump-autoload php artisan migrate php artisan vendor:publish --force -> Press the number before "Webkul\VoIP\Providers\VoIPServiceProvider" and then press enter. php artisan optimize:clear

Add below view render events on following path.In packages/Webkul/Admin/src/Resources/views/layouts/nav-top.blade.php after line no. 20{!! view_render_event('admin.layouts.nav-top.quick-create.before') !!}In packages/Webkul/Admin/src/Resources/views/settings/users/create.blade.php after line no. 216{!! view_render_event('admin.settings.users.create.form_controls.permission.tab.after') !!}In packages/Webkul/Admin/src/Resources/views/settings/users/edit.blade.php after line no. 231{!! view_render_event('admin.settings.users.edit.form_controls.permission.tab.after', ['admin' => $admin]) !!}

After following these steps, the Krayin VoIP Extension should be successfully installed.

Module configuration

After installing the module, the store admin will first configure the module.

On the Krayin Dashboard, the admin will navigate to the Setting -> Other Setting section.

krayin CRM Configuration

Then click on VOIP.

krayin CRM Configuration

In the General section, the admin will :-

Status: Enable/Disable the module.

Secure WebSocket Server (TLS): Enter the Secure WebSocket Server (TLS).
This is the secure WebSocket URL used for real-time voice communication in the browser.

Required for modern browsers (Chrome, Firefox, Edge)

WebRTC (browser calling) uses WebSocket Secure (WSS)

TLS encrypts data so voice traffic is safe and private
example:- wss://voip.example.com

WebSocket Port:
This is the port number used by the WebSocket server.

  • WebSocket handshake starts over HTTP/HTTPS
  • The port depends on how your VoIP server is configured

Common ports:

  • 8080 → Custom setups
  • 443 → Recommended (HTTPS / WSS)
  • 8089 → Often used by Asterisk WebSocket

The WebSocket handshake operates over HTTP, so the port is whatever the HTTP/WebSocket server wants to use

WebSocket Path: Enters the WebSocket Path.

A WebSocket path is essentially the part of the URL that specifies the endpoint on the server where the WebSocket connection will be established.

Domain: Enter the Domain.

After this the admin will Configure the API setting.

krayin CRM Configuration

Here the admin will:-

Email: Enters the Email.

Password: Enters the password.

Host URL: Enter the VoIP server Host URL.

Then click on save.

Also, the admin can sync users to VOIP. By clicking on sync users to VOIP placed on the top of API Credentials.

krayin CRM Configuration

Adding user in Krayin CRM VOIP

For adding users in Krayin VOIP, the admin navigates to Settings -> Users.

In the users, the admin will click on the Create User.

krayin CRM Configuration

Now, the admin will create a new user by:-

In General Section:

  • The admin will enter the name of the new user.
  • Enters the Email of the user.
  • Enable the status of the user.
  • Enter the password, then Enter the confirmed password.

After this, the admin will save the user. Then the admin will grant permission to the user.

krayin CRM Configuration

Here the admin will:-

  • Groups: Select the groups.
  • Role: The admin selects the role for the user as Administrator/User.
  • View Permission: Set the permission for the respected Role.

Now, the admin will set The VoIP setting for the user.

krayin CRM Configuration

Here is the admin Will:

  • SIP user: Enter the SIP User.
  • SIP Password: Enter the password.

Then, click on the save as a user.

The admin can check the list of the user.

krayin CRM Configuration

User – Workflow

Now the user logged in to the Krayin CRM VoIP by entering their credentials.

crayin crm user login

After login, the user will navigate to the VoIP section. Then the user will click on the Trunks.

Here the user will get the list of Trunks.

VoIP Trunks are phone lines that transmit calls over the Internet. A VoIP provider can assign a local number to one or more cities or countries and route it to the PBX phone system.

Usually, VoIP trunks are cheaper than traditional PSTN trunks.

crayin crm user trunks

The users can also create trunks, by clicking on Create Trunk.
8. How to Purchase and Configure a SIP Trunk via Twilio

Twilio provides SIP Trunking services that allow your Asterisk server to make and receive external calls through the public telephone network (PSTN).

Step 1: Create a Twilio Account

  • Go to https://www.twilio.com
  • Create an account and verify your email
  • Complete phone verification
  • Add billing details (Twilio requires an active billing account for trunking)

After login, you will access the Twilio Console dashboard.

Step 2: Purchase a Phone Number

  • Navigate to Phone Numbers → Manage → Buy a Number
  • Choose your country
  • Select a number that supports Voice
  • Purchase the number

This number will be used to receive incoming calls.

Step 3: Create a SIP Trunk

  • Go to Elastic SIP Trunking → Trunks
  • Click Create New Trunk
  • Enter a trunk name (e.g., KrayinTrunk)
  • Create the trunk

Step 4: Configure Termination (Outbound Calls)

Inside your created trunk:

  • Open Termination settings
  • Set Authentication to Credential List
  • Create a new Credential List
  • Add a username and password

These credentials will be used in your Asterisk pjsip.conf.

Step 5: Configure Origination (Inbound Calls)

  • Go to Origination settings
  • Add your Asterisk public IP address
  • Set port to 5060 (or 5061 if using TLS)
  • Choose transport protocol (UDP or TLS)

This allows Twilio to send incoming calls to your Asterisk server.

Step 6: Assign Phone Number to Trunk

  • Go to Phone Numbers
  • Select the number you purchased
  • Assign it to the created SIP Trunk

Important Notes

  • Ensure your server has a public IP address.
  • Firewall must allow SIP traffic (5060/5061).
  • For production, use TLS and secure authentication.
  • Configure proper dialplan in extensions.conf for inbound/outbound routing.

Your Twilio SIP trunk is now ready to make and receive calls through Asterisk and Krayin CRM.

Here the user will:

  • Enter the User Name.
  • Enter the Password.
  • Enter the Server IP.
  • Enter the Server Port.
krayin CRM VoIP

Then, the user will save the Trunk.

The Trunk has been successfully created.

Now, the user will navigate to Inbound Routes.

voip feature krayin crm

The user can also create new Inbound Routes. By clicking on Create Inbound Routes.

krayin CRM VoIP

Call Recording

The admin and the user can check the call recording between the users or with the customer.

For this, they have to navigate to VoIP -> Call Recordings.

krayin CRM VoIP

Call Through Krayin CRM VoIP

The user can check their contact list.

call on krayin VoIP

In the Krayin CRM VoIP, the user can check the recent call logs.

call on krayin VoIP

The user can call through Krayin CRM VoIP. For this the user will enter the number in the dial pad.

call on krayin VoIP

Then, click on the call icon.

On the other side

The user/ customer will pick up the call.

call on krayin VoIP

By clicking on the Accept(Green) button. They pick up the call and the call recording will start.

call on krayin VoIP

Support

So, that is all about Krayin CRM VoIP. If you have any queries regarding the plugin, contact us at Webkul Support System.

Current Product Version - 1.0.0

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home

Guide for Krayin CRM VoIP