CID MYSQL Lookup Source not working

JL670

Joined
Nov 27, 2008
Messages
3
Likes
0
Points
0
#1
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
 

JL670

Joined
Nov 27, 2008
Messages
3
Likes
0
Points
0
#2
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
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,915
Messages
130,920
Members
17,594
Latest member
knethardsolutions
Top