View Single Post
  #1   (View Single Post)  
Old 5th November 2013
Lexus45 Lexus45 is offline
Port Guard
 
Join Date: May 2010
Location: Kurgan, Russia
Posts: 39
Default FreeBSD ODBS PostgreSQL

Hello all.

The situation is as follows. There is a FreeBSD 8.2 server with Asterisk. We need to set up Asterisk Realtime - to take SIP peers from the database, not from the txt config files (like sip.conf).

I tested such an installation on Debian: connected Asterisk with PostgreSQL through ODBC connector. Everything worked. The major thing I had to test was the ability of Asterisk to see the database and to take data from it. So, I know how to set up realtime in Asterisk.

The problem occured with FreeBSD, because I know GNU/Linux better, but the server has been set up many times ago, before I started working here.

So, I installed two packages:
Code:
[root@pbx-office /root]# pkg_info | grep -i odbc
postgresql-odbc-08.04.0200 PostgreSQL ODBC driver
unixODBC-2.3.0_1    ODBC library suite for Unix
And now I need to set up /usr/local/etc/odbcinst.ini and /usr/local/etc/odbc.ini.

In Debian they look like (and work):
Code:
root@debian:~# cat /etc/odbcinst.ini 
[PostgreSQL]
Driver	= psqlodbca.so
Setup		= libodbcpsqlS.so
Code:
root@debian:~# cat /etc/odbc.ini 
[asterisk-test]
Driver = PostgreSQL
Database = astertest
Servername = 10.14.10.12
Port = 5432

Protocol = 8.4
ReadOnly = No
RowVersioning = No
ShowSystemTables = No
ShowOidColumn = No
FakeOidIndex = No
In fact, everything is obvious with odbc.ini.
But what libraries shall I use in odbcinst.ini ?
The FreeBSD system does not have neither psqlodbca.so, nor libodbcpsqlS.so .