Asterisk 1.6 parses lines in extensions.conf differently to Asterisk 1.4
As a side effect of the application delimiter change, many places that used to need quotes in order to get the proper meaning are no longer required. You now only need to quote strings in configuration files if you literally want quotation marks within a string.
The code generated by cidlookup escapes whitespace and the the SQL command does not execute on Asterisk 1.6
The following patch should fix the problem
--- cidlookup/functions.inc.php.orig 2009-08-24 13:48:59.000000000 +0200
+++ cidlookup/functions.inc.php 2009-08-24 14:16:46.000000000 +0200
@@ -115,10 +115,11 @@
function cidlookup_get_config($engine) {
// TODO: discuss if mysql and http lookup should be implemented in dialplan or in an external AGI
global $ext; // is this the best way to pass this?
global $asterisk_conf;
+ global $version;
switch($engine) {
case "asterisk":
$sources = cidlookup_list();
if(is_array($sources)) {
foreach($sources as $item) {
@@ -177,11 +178,15 @@
')' => '\\)',
'.' => '\\.',
'|' => '\\|'
);
- $query = str_replace(array_keys($replacements), array_values($replacements), $item['mysql_query']);
+ if (version_compare($version, "1.6", "lt")) {
+ $query = str_replace(array_keys($replacements), array_values($replacements), $item['mysql_query']);
+ } else {
+ $query = $item['mysql_query'];
+ }
$query = str_replace('[NUMBER]', '${CALLERID(num)}', $query);
$ext->add('cidlookup', 'cidlookup_'.$item['cidlookup_id'], '', new ext_mysql_connect('connid', $item['mysql_host'], $item['mysql_username'], $item['mysql_password'], $item['mysql_dbname']));
$ext->add('cidlookup', 'cidlookup_'.$item['cidlookup_id'], '', new ext_mysql_query('resultid', 'connid', $query));
$ext->add('cidlookup', 'cidlookup_'.$item['cidlookup_id'], '', new ext_mysql_fetch('fetchid', 'resultid', 'CALLERID(name)'));
Tony