Skip to main content

Debian 11 Vicidial scratch install dynamic portal

 Step by step guide to scratch install the vidial dynamic portal in Debian 11 or ubuntu based vicidial scratch installations. If you have installed vicidial using scratch installation instead of using the default vicibox iso then you need to manually install and configure the dynamic portal , follow this blog tutorial to scratch install the vicidial dynamic portal.


Here's the steps to install and configure the vicidial dynamic portal in scratch installations.

Steps to install vicidial dynamic portal



cd /usr/src

git clone https://github.com/manish23k/vicidial-dynamicportal.git

cd vicidial-dynamicportal
chmod +x vici_dynportal.sh

./vici_dynportal.sh
or you can install manually.

Follow the below steps to install and configure the vicidial dynamic portal in your scratch installations,

Step 1: Install the firewalld and ipset

apt install firewalld
apt install ipset


Step 2: Download the Dynamic portal files from my Github

cd /usr/src/

mkdir dynamicportal

cd dynamicportal

wget https://github.com/manish23k/vicidial-dynamicportal/archive/refs/heads/main.zip
unzip main.zip


Step 3: Copy the Firewall zones , services, ipset rules



cd vicidial-dynamicportal-main

cp -r zones /etc/firewalld/

**note: if prompts for override for public give yes

cp -r ipsets /etc/firewalld/
cd services

cp *.xml /usr/lib/firewalld/services/

Step 4: Copy the Dynamic portal files to web folder

cp -r dynamicportal /var/www/html/dynportal

Step 5: Copy the ssl file to the http config folder 

cp vicidial-ssl.conf /etc/apache2/sites-enabled

cp vicidial.conf /etc/apache2/sites-enabled


sudo a2ensite vicidial.conf
sudo a2ensite vicidial-ssl.conf

Step 6: Edit the vicidial-ssl.conf 

Edit the vicidial-ssl.conf file and replace the ssl certificate and ssl key with your domain key.

/etc/apache2/sites-available/vicidial-ssl.conf

SSLCertificateFile /etc/letsencrypt/live/examples.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/examples.com/privkey.pem


Step 7: Add the 81 and 446 as listen port in apache

nano /etc/apache2/ports.conf

Listen 80

Listen 81

<IfModule ssl_module>

       Listen 443

       Listen 446

</IfModule>


<IfModule mod_gnutls.c>

        Listen 443

        Listen 446

</IfModule>


Port 446 is used to access the dynamic portal over https

Port 81 is used to access the dynamic portal over http


Step 8: Copy the VB-firewall script to bin

cp VB-firewall /usr/bin/


chmod +x /usr/bin/VB-firewall

Patch Commmands for VB-firewall

sed -i 's/badips/blackips/g' /usr/bin/VB-firewall
sed -i 's/badnets/blacknets/g' /usr/bin/VB-firewall
sed -i 's/viciblack/ViciBlack/g' /usr/bin/VB-firewall


Step 9: Restart and run on startup the Firewalld

Run the below command to enable and restart the firewall service

systemctl enable firewalld

systemctl restart firewalld


Step 10: Enable the IP List in Vicidial


mysql -e "use asterisk;  INSERT INTO `vicidial_ip_lists` (`ip_list_id`, `ip_list_name`, `active`, `user_group`) VALUES

('ViciWhite', 'ViciWhite', 'Y', 'ADMIN'),

('ViciBlack', 'ViciBlack', 'Y', 'ADMIN');


mysql -e "use asterisk; INSERT INTO `vicidial_ip_list_entries` (`ip_list_id`, `ip_address`) VALUES

('ViciWhite', 'ADD.YOUR.PUBLIC.IP'),

('ViciWhite', 'ADD.YOUR.PUBLIC.IP');


OR Create manually 


Log in to your Vicidial Admin portal 

Navigate to  Admin > System Settings

Enable the IP List

Allow IP Lists: 1

Submit 

 Next Navigate to Users and edit the Admin user who wants the access to add ip whitelist 

Modify any admin user (6666 i am using) and set 1 for Modify IP Lists:

Modify IP Lists::1

submit

Next Create ViciWhite IP list to add static IP's for whitelist

navigate to ADMIN > IP Lists

Create a new IP list with the name as  ViciWhite and ViciBlack

make sure to set the ViciWhite and ViciBlack iplist to active.

submit.


Step 11: Cronjob entry to run VB-firewall every minute

you need to add the VB-firewall script in the cronjob to run every minute to add the static whitelist ip list and dynamic ip list to the Firewall white list rules.

Also you need to run the VB-firewall script on reboot

edit the crontab by typing below command

nano /var/spool/cron/crontabs/root

add the below at the end of the crontab file.

#Entry for ViciWhite and Dynamic Portal

* * * * * /usr/bin/VB-firewall --white --dynamic --quiet
@reboot /usr/bin/VB-firewall --white --dynamic --quiet


#Entry for ViciBlack list
* * * * * /usr/local/bin/VB-firewall.pl  --quiet
@reboot  /usr/local/bin/VB-firewall.pl --quiet


#Entry for voipbl blacklist
@reboot /usr/local/bin/VB-firewall.pl --voipbl --noblack --quiet
0 */6 * * * /usr/local/bin/VB-firewall.pl --voipbl --noblack --flush –quiet


Conclusion: Dynamic portal Testing

    Now you can access the dynamic portal either over http of https by typing your Fqdn with respectice port
https://yourdomain:446/valid8.php
http://yourdomain:81/valid8.php

upon valid credentials the users public ip will be added the in ipset dynamic list within a minute.

To check whether ip added in the list , type the below command
ipset --list



by default script allows level 1users to validate credentials ,if you want to validate other users with level above 1 edit the below file and modify the line PORTAL_userlevel
nano /var/www/html/dynportal/inc/defaults.inc.php


$DYNAMICAGE=14; # Number of 14 days for dynamic IPs stored.

nano /usr/bin/VB-firewall

Change 

 $DYNAMICAGE=30; For 30 Days.


Comments

Popular posts from this blog

voice broadcast in vicidial Step by Step Guide

 Follow all below mention steps:- 1.  Open https://ttsmp3.com/   2.  Select Voice Indian English 3.  Type whatever you want to convert into voice.   4.  Read and confirm and then download as a MP3.   5.  Open downloaded file with wavepad and convert into 16bit Mono 8k PCM WAV. or you can use online audio converter from below mention link. site support .wav file only so you need to convert MP3 file to wav using below mention site. https://g711.org/   6.  Upload file to vicidial audio store.   7.  Manual copy file into /var/lib/asterisk/sound/ folder using winscp software. https://winscp.net/download/WinSCP-5.21.6-Portable.zip   8.  Copy campaign from existing Broadcast camp.   9.  Click on created camp and select details view then click on survey     select Survey First Audio File:- as audio file which we created in step 1 and submit.   10. Create list and select campaign as Newly created campaign broadcast, and change routing extensions.   11. Create user with same name of remote agent

Vicidial Scratch installation Debian 11 with Asterisk 16, WebRTC and Dynamic Portal

  Vicidial Scratch installation Debian 11  Asterisk 16, WebRTC and Dynamic Portal apt update apt upgrade apt-get install git nano wget cd /usr/src/ git clone https://github.com/manish23k/Vici_Install_Scripts_Deb_11.git cd Vici_Install_Scripts_Deb_11/ chmod +x *.sh Run ./vici_install_deb_ast16.sh Install WebRTC ./vicidial-install-webrtc.sh Once Done with Configuration Secure Server with Vici Dynamic Portal Run ./vici_dynportal.sh