Hi there,
I am attempting to connect Asterisk 22 to a MariaDB server with ODBC. ODBC is working correctly, verified by running isql -v asterisk
and it connects successfully:
root@sip:/etc/asterisk# isql -v asterisk
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| echo [string] |
| quit |
| |
+---------------------------------------+
SQL>
I have verified in MySQL/MariaDB logs that the correct user is connecting to the correct database, however when I run `database query “SELECT * FROM ps_endpoints LIMIT 1;” I get an error telling me there is no such table:
sip*CLI> database query "SELECT * FROM ps_endpoints LIMIT 1;"
[2025-03-27 15:40:21] WARNING[3131]: db.c:335 db_execute_sql: Error executing SQL (SELECT id FROM ps_endpoints LIMIT 1;): no such table: ps_endpoints
It works when running it in isql:
SQL> SELECT id FROM ps_endpoints;
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
SQLRowCount returns 0
SQL> SELECT id FROM ps_endpoints;
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 1 |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
SQLRowCount returns 1
1 rows fetched