Func_odbc Do Not Read LIKE Predicate

Home » Asterisk Users » Func_odbc Do Not Read LIKE Predicate
Asterisk Users 5 Comments

Hello everyone, I would be extremely glad if someone could help me with the following issue:
cat /etc/asterisk/func_odbc.conf
[call_user]
prefix=GET
dsn=asterisk_odbc_sip readsql=SELECT name FROM asterisk_sippeers WHERE name = ‘%477’

Asterisk CLI show the following issue:
— Executing [205@phones_wildcard:1]
NoOp(“SIP/Y_MD_vlungu_477-00000008”,
“000000000000000000000000000000000000000000000000000”) in new stack
— Executing [205@phones_wildcard:2]
NoOp(“SIP/Y_MD_vlungu_477-00000008”, “205”) in new stack
> Found no rows [SELECT name FROM asterisk_sippeers WHERE name =
‘%477’]
— Executing [205@phones_wildcard:3]
Set(“SIP/Y_MD_vlungu_477-00000008”, “YUID=”) in new stack
— Executing [205@phones_wildcard:4]
NoOp(“SIP/Y_MD_vlungu_477-00000008”,
“##################################################”) in new stack
— Executing [205@phones_wildcard:5]
NoOp(“SIP/Y_MD_vlungu_477-00000008”,
“##################################################”) in new stack
— Executing [205@phones_wildcard:6]
Macro(“SIP/Y_MD_vlungu_477-00000008”, “simple,,30”) in new stack

Anyone has any ideas what is going wrong ?

5 thoughts on - Func_odbc Do Not Read LIKE Predicate

  • Not sure what database you are accessing, but have you tried the following:

    readsql=SELECT name FROM asterisk_sippeers WHERE name LIKE ‘%477’

  • Sure , here is the reasult.

    mysql> SELECT name FROM asterisk_sippeers WHERE name LIKE ‘%477’ ;
    +—————–+
    | name |
    +—————–+
    | Y_MD_vlungu_477 |
    +—————–+
    1 row in set (0.00 sec)