mainenotarynet
Not really a Guru - Just a long time user
- Joined
- May 29, 2010
- Messages
- 754
- Reaction score
- 155
Using HiFormance (they use Venet0:0 if it makes any difference) and Incredible 13 with Asterisk 13.20 and the whole enchilada (installed on (2018-03-27 or so) -- this is on CentOS6 if it matters.
I am going through the old system I have on Vultr and making comparisons and as for the CID Superfecta am duplicating sources and credentials (OpenCman and such).
When I try Debug to test if the stuff will pull a name (like from my own Cell Number and such) I get errors similar to this:
this seems to happen on all sources, just different Line numbers -- in above the line is:
This is in an if/else block inside function get_caller_id($thenumber,$run_param=array() )
The function looks like this :
I have searched for two days and find stuff from 2015 and before on Freepbx forum and elsewher (different programs not like ours same type errors) but I am no programmer but I thought semicolons were and 'execute' type terminator (as in mysql) and since the error shows as
and these are to connect to databases (mysql) could the sytax be wrong? and maybe the entire function was just C/p into each source?
Any help would be greatly appreciated.
Another thought is there maybe a yum program or something that may not have been loaded that should have been?
Thanks again.
I am going through the old system I have on Vultr and making comparisons and as for the CID Superfecta am duplicating sources and credentials (OpenCman and such).
When I try Debug to test if the stuff will pull a name (like from my own Cell Number and such) I get errors similar to this:
Code:
Executing Asteridex
Connecting to Asteridex Database....
{"error":{"type":"Whoops\\Exception\\ErrorException","message":"Undefined index: DB_Name","file":"\/var\/www\/html\/admin\/modules\/superfecta\/sources\/source-Asteridex.module","line":51}}
this seems to happen on all sources, just different Line numbers -- in above the line is:
Code:
$dbh = new PDO('mysql:dbname='.$run_param['DB_Name'].';host='.$run_param['DB_Host'].";charset=utf8", $run_param['DB_User'], $run_param['DB_Password']);
This is in an if/else block inside function get_caller_id($thenumber,$run_param=array() )
The function looks like this :
Code:
function get_caller_id($thenumber, $run_param=array()) {
$caller_id = null;
if(class_exists('PDO')) {
$this->DebugPrint(_("Connecting to Asteridex Database...."));
try {
$dbh = new PDO('mysql:dbname='.$run_param['DB_Name'].';host='.$run_param['DB_Host'].";charset=utf8", $run_param['DB_User'], $run_param['DB_Password']);
} catch (PDOException $e) {
$this->DebugPrint(_('Connection failed: ') . $e->getMessage());
return null;
}
} else {
$this->DebugPrint(_("PDO not present on system...Skipping"));
return null;
}
// trim number to filter length if applicable
if ($run_param['Filter_Length'] != 0) {
if (strlen($thenumber) > $run_param['Filter_Length']) $thenumber = substr($thenumber, -$run_param['Filter_Length']);
}
$sql_params = array();
$sql = 'SELECT `name` FROM `user1` where `out` REGEXP :theregex';
// Build regular expression from the $thenumber to avoid non-digit characters stored in database
$theregex = "[^0-9]*";
for( $x=0; $x < ((strlen($thenumber))-1); $x++ ) {
$theregex .= substr($thenumber,$x,1)."[^0-9]*";
}
$theregex = $theregex.(substr($thenumber,-1))."([^0-9]+|$)";
$sql_params[':theregex'] = $theregex;
$sth = $dbh->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
if(!$sth) {
$this->DebugPrint(_("Failed to Prepare the SQL Statement. Are we connected?...Skipping"));
return null;
}
$this->DebugPrint(_("Connected!"));
$this->DebugPrint(_("Searching Database..."));
$sth->execute($sql_params);
$find = $sth->fetch(PDO::FETCH_BOTH);
if($find && is_array($find)) {
$this->DebugPrint(_("Found.."));
return $find[0];
} else {
$this->DebugPrint(_("Not Found"));
return null;
}
}
I have searched for two days and find stuff from 2015 and before on Freepbx forum and elsewher (different programs not like ours same type errors) but I am no programmer but I thought semicolons were and 'execute' type terminator (as in mysql) and since the error shows as
Code:
Undefined index: DB_Name","file":"\/var\/www\/html\/admin\/modules\/superfecta\/sources\/source-Asteridex.module"
Any help would be greatly appreciated.
Another thought is there maybe a yum program or something that may not have been loaded that should have been?
Thanks again.