xml_cdr not working after update

Skeelkat

Member
Jun 26, 2020
33
4
8
40
Having the same issue on 2x different nodes.
One running on Ubuntu and the other on Debian Buster

Anybody noticed this and perhaps know how to fix?
 

AFKCode

New Member
Sep 22, 2023
2
1
3
44
Ran into this too, did a bunch of debugging on it and found that there were some changes to the xml_cdr class file to clean up some session stuff and looks like a small logic error was introduced that prevents it from loading up the behind the scenes login credentials to make the link between fusionpbx and freeswitch for CDR logging via http.

Good news is it's a simple fix.
edit the file /var/www/fusionpbx/app/xml_cdr/resources/classes/xml_cdr.php (assuming standard install)
Find the following code (Should be line 1047)
Code:
if ($this->setting->get('cdr', 'http_enabled') == "true" && $this->username) {
and change it to
Code:
if ($this->setting->get('cdr', 'http_enabled') == "true" && empty($this->username)) {

That should get things going again.
I have submitted a bug report with fusionPBX so hopefully the fix makes it down the line soon.
 
  • Like
Reactions: markjcrane

markjcrane

Active Member
Staff member
Jul 22, 2018
410
144
43
48
CDR Import with the HTTP POST (not recommended)
This issue should be fixed. Key issue was the if statement on line 1047 removed '&& $this->username'

Fixed the issue with this commit.
- https://github.com/fusionpbx/fusionpbx/commit/09dd09305c8fa9b113a8076873de9fbf4f89ce22


Save CDR to the File System (recommended alternative)
New installs as of a couples weeks ago save files to the file system and skip the HTTP POST. A cron job is then used to import the CDR records from the file system once per minute.

In this file /etc/freeswitch/autoload_configs/xml_cdr.conf.xml comment out the following line by sourounding it with <!-- and -->. Be careful to get this right.

Then run these commands

fs_cli -x 'reloadxml'
fs_cli -x 'reload xml_cdr'

Then add a cron job with this command.

crontab -e

Add this line to the bottom
* * * * * /usr/bin/php /var/www/fusionpbx/app/xml_cdr/xml_cdr_import.php 300

Why use file system import instead of the HTTP POST?

  • Reason HTTP POST if not escaped perfectly from FreeSWITCH the call detail record the web server will reject the HTTP request. This has been a problem for some calls for many years with FreeSWITCH.
  • CDR record imports through HTTP POST can put extra load on the web server.
  • Extra requests on the web server can slow down the web interface
 

Skeelkat

Member
Jun 26, 2020
33
4
8
40
This seems to work for my one node, but I still have issues on my Debian Node.

When running
fs_cli -x 'reloadxml'
fs_cli -x 'reload xml_cdr'

I get an error

+OK Reloading XML
-ERR unloading module [No such module!]
-ERR loading module [module load file routine returned an error]

2023-09-26 08:54:12.868738 91.00% [CRIT] switch_loadable_module.c:1754 Error Loading module /usr/lib/freeswitch/mod/xml_cdr.so
**/usr/lib/freeswitch/mod/xml_cdr.so: cannot open shared object file: No such file or directory**

However, mod_xml_cdr.so is in the /usr/lib/freeswitch/mod folder and via the GUI it shows that it is enabled and running.

Anyu idea on how to correct this issue?
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,006
540
113
Check the xml_cdr config file in the /etc/freeswitch/autoload_configs

Modules that are present but won't load usually have a problem with their config file.