Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

https://github.com/ipoddubny/webcdr

  • I chose to install this in a separate VM based upon CentOS 7
  • I will mount the recordings via NFS and access the MySQL DB remotely via the FreePBX User
  • Major Thanks to the Author, not only for the code, but for helping me customize/install it!

Install into /opt/:

cd ~
cat << 'EOL' >install_webcdr.sh
firewall-cmd --zone=public --add-port=9030/tcp --permanent
firewall-cmd --reload
yum check-update
yum install -y nodejs git httpd nfs-utils nfs-utils-lib
npm -g install bower browserify
cd /opt/
git clone https://github.com/ipoddubny/webcdr.git
cd webcdr/public
bower install --allow-root
cd ..
npm install
npm run build
EOL
chmod +x install_webcdr.sh
./install_webcdr.sh

Setup config.ini

Configure Remote SQL Params + NFS Mounted Recordings

nano /opt/webcdr/config.ini

TimeZone

America/New_York

http://php.net/manual/en/timezones.america.php

Note: I changed from MP3 to Wav because thats our Format, this interface supports most HTML5 compatible formats.

pattern = /mnt/nfs/monitor/%YYYY%/%MM%/%DD%/*%uniqueid%.wav

Test NFS:

mkdir /mnt/nfs
mount $SERVER:/monitor /mnt/nfs/

Make Permanent:

umount /mnt/nfs
sudo sh -c 'echo "$SERVER:/monitor /mnt/nfs/  nfs    auto  0  0" >> /etc/fstab' 
sudo mount -a 

Prep Astersikcdrdb

- In my case, I had no ID Column

use asteriskcdrdb;
alter table cdr  ADD `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY UNIQUE FIRST;

Add WebCDR Login Admin:

DROP TABLE IF EXISTS `webuser`;
CREATE TABLE `webuser` (
   `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
   `name` VARCHAR(100) NOT NULL DEFAULT '',
   `username` VARCHAR(100) NOT NULL UNIQUE,
   `password` VARCHAR(100) NOT NULL,
   `acl` VARCHAR(1024) NOT NULL DEFAULT '',
   `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `admin` INT(1) NOT NULL DEFAULT 0,
   `acl_in` INT(1) NOT NULL DEFAULT 0,
   `auth_ad` INT(1) NOT NULL DEFAULT 0,
   PRIMARY KEY (`id`)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `webuser` (`name`,`username`,`password`,`admin`) VALUES ('Administrator','admin','admincdr',1);

Modify WebCDR to use "recordingfile" vs "record" searching asteriskcdrdb:

- I didn't want to change my VoIP Server setup, as its a lot of moving parts, but it used the row name "recordingfile", but WebCDR used, 'record' in its seach params.
- To change this I used the following after contacting Ivan directly to inquire where to make the changes

- find and replace the SINGLE instance of ['record'] (Single ' important as there are multiple entries of the word record without ') in the following 2 files 
/opt/webcdr/lib/api/cdrs.js
/opt/webcdr/public/js/cdr/CDRView.js
cd /opt/webcdr/public
bower install --allow-root
cd ..
npm install
npm run build

Start Server:

node /opt/webcdr/server.js

Use admin/admincdr to login for the first time.

Debug, Once "ready" implement SystemD script and enable service on boot, restart and confirm working as expected.

SystemD installation example:

cat << 'EOL' >/etc/systemd/system/webcdr.service
[Service]
ExecStart=/usr/bin/node /opt/webcdr/server.js
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=webcdr
User=root
Group=root

[Install]
WantedBy=multi-user.target
EOL
systemctl start  webcdr.service
systemctl status webcdr.service
systemctl enable webcdr.service
reboot

Test & Profit!


 

 

  • No labels