CID MYSQL Lookup Source not working

Hi Everyone

I have setup asteridex (http://bestof.nerdvittles.com/applications/asteridex4/) on my Elastix server, it works great

Now i want to use the MYSQL database that asteridex created and use it as a CID lookup Source.

my settings is as follow

Source type: MYSQL
Host: 192.168.10.5
Database: asteridex
Query: SELECT name FROM user1 WHERE out LIKE '%[NUMBER]%'
Username: root
Password: eLaStIx.2oo7

I have added one entry called Sab with number 0116639600

I notice the following in the logs:

– Executing [s@from-pstn:2] Gosub(“Zap/2-1”, "cidlookup|cidlookup_2|1) in new stack
– Executing [cidlookup_2@cidlookup:1] MYSQL(“Zap/2-1”, "Connect connid 192.168.10.5 root eLaStIx.2oo7 asteridex) in new stack
– Executing [cidlookup_2@cidlookup:2] MYSQL(“Zap/2-1”, "Query resultid SELECT name FROM user1 WHERE out LIKE '%0116639600%) in new stack
– Executing [cidlookup_2@cidlookup:3] MYSQL(“Zap/2-1”, "Fetch fetchid CALLERID(name)) in new stack
– Executing [cidlookup_2@cidlookup:4] MYSQL(“Zap/2-1”, "Clear ) in new stack
– Executing [cidlookup_2@cidlookup:5] MYSQL(“Zap/2-1”, "Disconnect ) in new stack
– Executing [cidlookup_2@cidlookup:6] Return(“Zap/2-1”, ) in new stack
– Executing [s@from-pstn:3] GotoIf(“Zap/2-1”, "0 ?cidok) in new stack
– Executing [s@from-pstn:4] Set(“Zap/2-1”, "CALLERID(name)=0116639600) in new stack
– Executing [s@from-pstn:5] NoOp(“Zap/2-1”, "CallerID is “0116639600” <0116639600) in new stack

For some strange reason it does not pickup the name ‘Sab’ from the MYSQL Query

If I do a manual lookup in MYSQL I get the correct result

[root@elastix asterisk]# mysql -uroot -peLaStIx.2oo7 asteridex
mysql> SELECT name FROM user1 WHERE out LIKE ‘%0116639600%’;
±-------+
| name |
±-------+
| Sab |
±-------+
1 row in set (0.00 sec)

So it looks like the query is correct
I also added the Lookup source under my inbound routes

please help

Many thanks
Jaco

I apologize I can’t help you with the lookup, but since you posted your mysql root password, YOU SHOULD IMMEDIATELY CHANGE IT.

Just my 2 cents worth, however.

Thanks for your concern, It is listed in the Elastix Manual as well
the server is behind a firewall

You gotta love people who spout nonsense in ALL CAPS. Must make them feel SO IMPORTANT, just like including a bunch of meaningless letter combinations in their signature!

Ok I found the problem

in /var/log/asterisk/full
I noticed this error

“Connect connid 192.168.10.5 root eLaStIx.2oo7 asteridex”) in new stack
[Dec 6 21:45:51] WARNING[3831] app_addon_sql_mysql.c: mysql_real_connect(mysql,192.168.10.5,root,dbpass,asteridex,…) failed

I changed the db hostname to 127.0.0.1 and now it works

Cheers
Jaco