Mysql Phone Book lookup broken

Hi, I am trying to link to a mariadb database to use as a caller ID source.

The suggested query SELECT name FROM phonebook WHERE number LIKE ‘%[NUMBER]%’ works fine when done manually and substituting the number in.

But when the pbx does a lookup it truncates the end of the query. eg

Query SELECT name FROM data WHERE number LIKE ‘%0409820705 the %’; is missing so the query never completes.

I’m just wondering if this setup works for anyone else or does anyone use this?

You might need to escape the % in the script.

I reworked the script to see if it was the % causing the problem…

SET @passnum = [NUMBER]; SELECT name FROM WHERE number LIKE CONCAT(’%’,@passnum,’%’);

Truncates straight after the [NUMBER] as well.

Surely there must be someone using this feature/code path and it can’t be a bug…

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.