SOLVED xml_cdr not working after update

Status
Not open for further replies.

Skeelkat

Member
Jun 26, 2020
35
4
8
41
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
45
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
503
179
43
49
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
35
4
8
41
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,071
577
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.
 

whut

Member
Dec 23, 2022
230
22
18
It looks like new installations do not have the xml_cdr module installed.
 

meshtask

New Member
Jul 17, 2019
19
2
3
I have installed FusionPBX on Debian 11 and 12.
I am also having same issue and even tried to fix it with instructions shared in above posts, but no success.
Can anyone please confirm how to fix this?1696057837034.png
 

whut

Member
Dec 23, 2022
230
22
18
I see in https://github.com/fusionpbx/fusion...ter/debian/resources/switch/package-master.sh that freeswitch-mod-xml-cdr is being installed. modules.conf is missing `<load module="mod_xml_cdr"/>` (and `<load module="mod_tone_stream"/>`).
Still no if I re make mod_xml_cdr and re install and if I add the module to modules.conf and restart freeswitch.

How do we get this module to install and to run? There will be no CDRs until this module is running.

1 week old Debian 11 installation
 

Anand

New Member
Aug 24, 2023
20
3
3
36
I'm also having this same issue on debian 12 installations did anyone solve this issue on Debian?
 
Last edited:

Anand

New Member
Aug 24, 2023
20
3
3
36
The mod_spandsp failing to compile and is stopping a few other modules from being compiled. This compiles the missing modules other than broken spandsp.
Code:
cd /usr/src/freeswitch/src/mod/formats/mod_tone_stream && make install
cd /usr/src/freeswitch/src/mod/applications/mod_valet_parking && make install
cd /usr/src/freeswitch/src/mod/xml_int/mod_xml_cdr && make install
cd /usr/src/fusionpbx-install.sh/debian/resources/switch
./source-permissions.sh
After this go to Advanced -> Modules edit and save one so that it rewrites the modules.conf file. Then restart FreeSWITCH or the server.

Thanks @markjcrane
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,071
577
113
I'll marked this solved and close it so other can find it easily.
 
Status
Not open for further replies.