Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Compatible with FreePBX (Distro)? #25

Open
SolarWind13 opened this issue Nov 27, 2018 · 1 comment
Open

Compatible with FreePBX (Distro)? #25

SolarWind13 opened this issue Nov 27, 2018 · 1 comment

Comments

@SolarWind13
Copy link

Hello.

This amaizing software compatible with CDR and recording files in FreePBX Distro installation?

@FallenChromium
Copy link

FallenChromium commented Dec 15, 2018

I just tested it and yeah - I got it fully working with FreePBX 14 installation. You will need to make few changes though. I'll probably do PR with instructions and commits, but for now I can just explain this. This is a noob-friendly instruction, but I suppose I shouldn't explain every step.

  1. First I made "webuser" table inside "asteriskwebcdr" MariaDB database on FreePBX. See db.sql for this. Do not forget to change password in "insert" command!
  2. Create webcdr user and grant him to select "cdr" table and select\insert\update on "webuser" table.
  3. By default FreePBX records with .wav format, if your format is same, go to the config.ini and change pattern so it ends with .wav
  4. Uncomment the line with "Id" column and change it to "sequence" (WRONG WAY! Sequence column have duplicate values. Create your own id column (auto-increment, not null, primary key)
  5. Change database connect credentials so it would use "webcdr" user.
  6. Things becoming little more trickier there. At this step I got everything worked except, you know, recordings. This is because by default this web app uses "record" column to identify recordings, and on FreePBX table it named "recordfile" which is quite unfortunate but easy to fix. (Btw if you're not really into code I recommend you to create SQL View so recordfile column will appear like "record" column. That's not the efficent way though, so after all I got better solution.
  7. I had to modify the code in two places, in cdrs.js:
diff --git a/lib/api/cdrs.js b/lib/api/cdrs.js
index bf5c6ed..711cb1e 100644
--- a/lib/api/cdrs.js
+++ b/lib/api/cdrs.js
@@ -159,7 +159,7 @@ function serveRecordsArchive (res, collection) {

   var records = []; // some cdrs use the same record file
   var queue = collection.filter(function (model) {
-    var record = model.get('record');
+    var record = model.get('recordingfile');
     if (!record) {
       return false;
     }
  1. And in the CDRView.js:
diff --git a/public/js/cdr/CDRView.js b/public/js/cdr/CDRView.js
index bff69b9..1324bf3 100644
--- a/public/js/cdr/CDRView.js
+++ b/public/js/cdr/CDRView.js
@@ -89,7 +89,7 @@ var columns = [{
   cell: 'string',
   formatter: TimeFormatter
 }, {
-  name: 'record',
+  name: 'recordingfile',
   label: $$('Recording'),
   editable: false,
   cell: 'audio'

After that recordings export, API overall and ability to listen recordings started to work fine. I quite like this app, but it wasn't mantained for almost half of a year now, and I recommend to also launch npm audit fix to avoid security breaches.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants