[RESOLVED] CLI Command "odbc show" missing


#1

Hi,

I installed Asterisk 1.2rc2 on a SUSE Linux box. For Realtime Configuration with PostgreSQL I followed the tutorial on asteriskguru.com ( asteriskguru.com/tutorials/r … pgsql.html ). Everything worked fine unless some directory references were different with SUSE (the tutorial ist based on a Debian distribution).

PostgreSQL seems to work just fine. So I wanted to check whether asterisk is connected to the DB properly. At the CLI prompt i tried “odbc show” und got a reply that this command does not exist. “help odbc” also returns the message that there do not exist any commands named “odbc…” ?!

I was looking for a solution to this problem and did not succeed…so I hope anyone here can help!

Is it a Asterisk or a Postgre problem? Is the availabilty of the “odbc show” command depending on anything else?

Thanks a lot in advance!!!

Cheers,
Jens


#2

Did you install unixODBC/-devel before compiling Asterisk? If not, then Asterisk does not build the corresponding res_odbc.so module required to connect to a database via ODBC.

You will need to install unixODBC and the relevant development libraries, recompile Asterisk, and then make sure the appropriate ODBC module exists in /usr/lib/asterisk/modules after you do a make install.


#3

Wow…that’s what I call a quick reply!!!

Thanks a lot! You are perfectly right. I already compiled Asterisk and decided at a later time to work with realtime extensions… Did not know that I have to recompile after installing unixODBC-devel.

… rookie mistake I guess!

cheers,
Jens


#4

Hi I am running Gentoo and did emerge unixODBC and installed the package but I’m not really sure if I have the -devel package? The res_odbc.so module is there in the asterisk modules folder, but I still dont have ODBC show. I am running the latest code from SVN.

When I start up asterisk this is what the ODBC output says…

[res_odbc.so] => (ODBC Resource)
== Parsing ‘/etc/asterisk/res_odbc.conf’: Found
Dec 2 21:56:51 NOTICE[13203]: res_odbc.c:294 load_odbc_config: registered database handle ‘ast_cnf’ dsn->[asterisk]
Dec 2 21:56:51 NOTICE[13203]: res_odbc.c:552 odbc_obj_connect: Connecting ast_cnf
Warning, flexible rate not heavily tested!
Dec 2 21:56:51 NOTICE[13203]: res_odbc.c:567 odbc_obj_connect: res_odbc: Connected to ast_cnf [asterisk]
Dec 2 21:56:51 NOTICE[13203]: res_odbc.c:597 load_module: res_odbc loaded.