support

Caller ID Lookup Mysql

gsigalas
Posts: 72
Member Since:
2006-11-04

I ve been trying to get CIDlookup to work with mysql with no luck
I created a CID lookup source in freepbx pointing to a mysql database
using this query
select name from users where phone1 = '[NUMBER]' ( this is tested with command line and it works )
but
-- Executing Gosub("Zap/4-1", "cidlookup|cidlookup_1|1") in new stack
-- Executing MYSQL("Zap/4-1", "Connect connid 192.168.100.49 root password c
id") in new stack
-- Executing MYSQL("Zap/4-1", "Query resultid select name from users where
phone1 = '306945370192' ") in new stack
-- Executing MYSQL("Zap/4-1", "Fetch fetchid CALLERID(name)") in new stack
-- Executing MYSQL("Zap/4-1", "Clear ") in new stack
-- Executing MYSQL("Zap/4-1", "Disconnect ") in new stack
-- Executing Return("Zap/4-1", "") in new stack
-- Executing GotoIf("Zap/4-1", "0 ?cidok") in new stack
-- Executing Set("Zap/4-1", "CALLERID(name)=XXXXX370192") in new stack <-- XXXX are my additions

any hints ???



gsigalas
Posts: 72
Member Since:
2006-11-04
SOLVED

I found a "bug" in freepbx
it was creating the query string wrong
in /var/www/html/admin/modules/cidlookup
file functions.inc.php
changed ( on line 172 mysql sql replacement strings ) to
$replacements = array (
'\\' => '\\\\',
'"' => '\\"',
'\'' => '\\\'',
' ' => '\\ ',
',' => '\\,',
'(' => '\\(',
')' => '\\)',
'.' => '\\.',
'|' => '\\|',
';' => '\\;'
);
actually the only thing I added was the last line with the semicolon sub
it now gets generated correctly and works fine
G.



WB3FFV
Posts: 144
Member Since:
2007-03-15
report it

If you haven't already, you should make sure you report the bug to the FreePBX developers on their site..



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.