Do you have cidlookup module enabled? Advanced -> Modules -> CID LookupInvalid Application cidlookup
2017-06-11 22:50:08.332564 [ERR] switch_odbc.c:368 STATE: IM002 CODE 0 ERROR: [unixODBC][Driver Manager]Data source name not found, and no default driver specified
2017-06-11 22:50:08.332564 [CRIT] switch_core_sqldb.c:508 Failure to connect to ODBC mysql!
2017-06-11 22:50:08.332564 [ERR] mod_cidlookup.c:530 Unable to lookup cid: Unable to get database handle. dsn: [mysql://hostaddr=103.xx dbname=xxxxxxx user=yyyyy password=zzzzzzzzzzzz]
Hope you haven't posted your real connection details?dsn: [mysql://hostaddr=103.xx dbname=xx user=xx password=xx]
isql -v whmcslookup
SQL> SELECT companyname AS name FROM tblclients WHERE phonenumber = '123456' UNION SELECT companyname AS name FROM tblcontacts WHERE phonenumber = '123456' LIMIT 1 +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| name |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Company Name |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
SQLRowCount returns 1
1 rows fetched
<!-- WHMCS Lookup -->
<param name="odbc-dsn" value="whmcslookup"/>
<param name="sql" value="SELECT companyname AS name FROM tblclients WHERE phonenumber = '${caller_id_number}' UNION SELECT companyname AS name FROM tblcontacts WHERE phonenumber = '${caller_id_number}' LIMIT 1"/>
2017-06-12 12:21:31.172577 [ERR] switch_core_sqldb.c:1197 SQL ERR: [SELECT companyname AS name FROM tblclients WHERE phonenumber = '123456' UNION SELECT companyname AS name FROM tblcontacts WHERE phonenumber = '123456' LIMIT 1] no such table: tblcontacts
2017-06-12 12:21:31.172577 [ERR] mod_cidlookup.c:530 Unable to lookup cid: (null)
<!-- WHMCS Lookup -->
<param name="url" value="https://whmcs-domain.com/whmcs-lookup.php?number=${caller_id_number}"/>
<?php
$number=$_GET['number'];
//We need to know the number
if ($number == '') { ?>
<p>Er, you're not ment to be running this, whats going on here?</p>
<?
exit();
}
//WHMCS stores numbers as 04xxxxxx or 64.4xxxxxxx
//Drop the zero at the start of the number
if (substr($number, 0, 1) === '0') {
$number = substr_replace($number, "", 0, 1);
}
//Drop the 64 the start of the number
if (substr($number, 0, 2) === '64') {
$number = substr_replace($number, "", 0, 2);
}
//Connect to WHMCS DB
$mysqli=new mysqli('localhost','username','password', 'database_name');
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
//Now query company name
$company_name = $mysqli->query("SELECT companyname AS name FROM tblclients WHERE phonenumber like '%$number' UNION SELECT companyname AS name FROM tblcontacts WHERE phonenumber like '%$number' LIMIT 1");
//Display company name
while($row = $company_name->fetch_object()) {
$name= $row->name;
}
//Else, lookup first / last name
if ($name == '') {
$first_last = $mysqli->query("SELECT firstname, lastname FROM tblclients WHERE phonenumber like '%$number' UNION SELECT firstname, lastname FROM tblcontacts WHERE phonenumber like '%$number' LIMIT 1");
while($row = $first_last->fetch_object()) {
$name = $row->firstname.' '.$row->lastname;
}
}
echo $name;
?>