ODBC connection error:No such command “odbc show” ODBC connection fail in asterisk*CLI

笑着哭i 提交于 2019-12-07 02:42:33

In the AsteriskNOW environment, to get res_odbc.so, which is the module that provides the ODBC resource to Asterisk, you need to have the asterisk-odbc package installed.

(Depending on how your AsteriskNOW installation is configured with respect to the packages.asterisk.org repositories, you may need asterisk18-odbc or a similar versioned package instead.)

If you have res_odbc.so (check in /usr/lib/asterisk/modules for this file) and it is still not loading correctly, you should check the Asterisk logs in /var/log/asterisk for messages relating to res_odbc for more information.

Try do follwoing:

asterisk -rvvv
module unload res_odbc.so
module load res_odbc.so

And see output.

Note that when you use the isql command you receive an error (Unknown attribute UserName).

Try with this /etc/odbc.ini file:

[asterisk-connector]
Description = MySQL connection to 'asterisk' database
Driver      = MySQL
DATABASE    = asterisk
SERVER      = localhost
USER        = root
PASSWORD    = mypassword
PORT        = 3306
Option      = 3

I dont known if is valid for CentOS but in Debian I had to recompile Asterisk and execute menuselect in order to work. To do that, go to your Asterisk fonts directory:

$ ./configure

$ make clean

$ make menuselect

Please verify that the following modules are checked:

[*] cdr_odbc

[*] cdr_adaptive_odbc

[*] func_odbc

[*] func_realtime

[*] pbx_realtime

[*] res_config_odbc

[*] res_odbc

and then:

$ sudo make install

I hope that help you.

It seems that you forget to add some important module when you do "make menuselect" check it.

Besides and it is very important you must establish "limit=>1" in the configuration file that you describe (/etc/asterisk/res_odbc.conf) if your are using mysql as relational database o just comment the line. If you are following the orreilly guide (http://ofps.oreilly.com/titles/9781449332426/asterisk-DB.html) you can see the errata (http://oreilly.com/catalog/errata.csp?isbn=9780596517342).

Do

sudo service asterisk restart

Works like a charm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!