Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

  • 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

https://github.com/ipoddubny/webcdr

  • 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

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

sed -i 's/'record'/'recordingfile'/g' /opt/webcdr/lib/api/cdrs.js
sed -i 's/'record'/'recordingfile'/g' /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


 

 

  • No labels