CDR Archive - Settings applied, button not visible?

Status
Not open for further replies.
So I'm attempting to offload my CDR records that are over 90 days to an archive postgres server. I've set the required settings, but the archive button isn't displayed on the CDR screen as the instructions said it would be. I did hit the reload button on the Default Settings screen. I've also flushed cache and reloaded xml just to see if that was the issue. If I attempt to access the /app/xml_cdr/xml_cdr_archive.php directly, it's throwing the following errors:

Warning: Offset or Limit not set to valid integer. Resetting to zero! in /var/www/fusionpbx/resources/classes/database.php on line 329

Fatal error
: Type/Driver must be set to pgsql,mysql,sqlite,odbc in /var/www/fusionpbx/resources/classes/database.php on line 321

I've checked and double checked and I do in fact have archive_database_driver set. I've also set it at the domain level as well just to see if that made a difference.

Attaching my settings. I'm running on an alternate port on this archive server so it's valid. I'm able to connect to the server below from our PBX from command line without issue.

2022-10-10 10_27_46-Default Settings - FusionPBX.png

Any assistance is appreciated!

Thanks, Frank C
 
Nice find. While it would be nice to have the button, I know what file offers up the archive info, but it in itself throws errors as though it's not reading the set variables. I'm just not sure what needs to be done to resolve that part.

Are you able to access xml_cdr_archive.php without the same error throwing?
 

nickbh

Member
Sep 26, 2019
40
3
8
58
this are the changes I added to fix the errors related to database error on line 321 and 329. Based on debugging -- type variable has null value the second time and the break key word is missing in the nested switch/case statement. Hope this helps.

Thanks for your help.


line 311 case 'type':
if(isset($this->type)) break;
case 'driver':
switch($value) {
case 'pgsql':
case 'mysql':
case 'sqlite':
case 'odbc':
$this->type = $value;
$this->driver = $value;
break;
default:
trigger_error("Type/Driver must be set to pgsql,mysql,sqlite,odbc", E_USER_ERROR);
break;
}
line 325 break;
case 'offset':
 

markjcrane

Active Member
Staff member
Jul 22, 2018
499
177
43
49
If you look at that pull request he sent it to an old branch 4.4. Accepted the change as it could be considered a bug fix.
 
this are the changes I added to fix the errors related to database error on line 321 and 329. Based on debugging -- type variable has null value the second time and the break key word is missing in the nested switch/case statement. Hope this helps.

Thanks for your help.


line 311 case 'type':
if(isset($this->type)) break;
case 'driver':
switch($value) {
case 'pgsql':
case 'mysql':
case 'sqlite':
case 'odbc':
$this->type = $value;
$this->driver = $value;
break;
default:
trigger_error("Type/Driver must be set to pgsql,mysql,sqlite,odbc", E_USER_ERROR);
break;
}
line 325 break;
case 'offset':

If I do this, it fails at with an error of:
error: SQLSTATE[08006] [7] connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "password="

Line 520: $this->db = new PDO("pgsql:host=$this->host port=$this->port dbname=$this->db_ name user=$this->username password=$this->password");

Upon further review, it appears that the above code isn't valid, so I tried fixing it, which I believe I did, but it started failing at line 386:
Fatal error: Object property not available in /var/www/fusionpbx/resources/classes/database.php on line 386

I feel like I'm going backwards, but I'm also not sure LOL
 
Status
Not open for further replies.