[CDR_PGSQL.SO] not found asterisk 1.4 : problem to compile

Hello to all

I install Asterisk 1.4.23.1 on my CentOS 6.4 operating system . Indeed, it is asked to create a java application to that will allow me from a PostgreSQL database using a JDBC connection type to view call logs made. It goes without saying that this will be the information contained in the CDR asterisk that I should see through this application.
First after doing some research , I saw that it was necessary to bind the database POSTGRESQL to asterisk . But my problem is that I can not find the module cdr_pgsql.so in / usr / lib64/asterisk/modules / .So I managed to select the asterisk menuSelect of content cdr_pgsql module in the call details records section I even tried to load the module manually but I get errors . :

serv_asterisk*CLI> module load cdr_pgsql.so
[Mar 4 16:28:10] WARNING[10714]: loader.c:359 load_dynamic_module: Error loading module ‘cdr_pgsql.so’: /usr/lib64/asterisk/modules/cdr_pgsql.so: cannot open shared object file: No such file or directory
[Mar 4 16:28:10] WARNING[10714]: loader.c:653 load_resource: Module ‘cdr_pgsql.so’ could not be loaded
[color=#FF0000][color=#FF0000][/color][/color]

I would like you to help me to get this file and compile asterisk correctly for that I can insert data CDR in my PostgreSQL database data that I would have to create . Please help me I can not do really

Asterisk 1.4 is several years past end of life.

Don’t double post.

I am not sure if PostreSQL module exist for Asterisk 1.4. I know it exists for Asterisk 1.6 and upwards. In any case, you need to have all the required dependencies in place when you are compiling Asterisk. You can eazily check that with “make menuconfig” - check for cdr_pgsql.

An alternative is to use ODBC driver. For that also you need the correct dependencies when you are compiling Asterisk.

Thank you already try to help me with your answers. In fact I use version 1.4 because this is the version on which the society in which I find myself has dévelloper an application that is already running and can be deployed, everywhere.
Now about compiling asterisk with libs and dev postgres , I did and it allowed me to be able to select cdr_pgsql in menuSelect .

I perform with the help of this command I found during my research :

.[color=#FF0000] root @ asterisk- 1.4.23.1 serv_asterisk ] # / configure - with- postgres = / usr/pgsql-9.2 /[/color]
and here is the result followed by a make and a make menuSelect

[code][color=#FF0000]**************************************************
Asterisk Module and Build Option Selection


Press ‘h’ for help .
[ * ] 1 . cdr_csv
[ * ] 2 . cdr_custom
[ * ] 3 . cdr_manager

XXX 4. cdr_odbc
[ * ] 5 . cdr_pgsql

XXX 6 . cdr_radius

XXX 7 . cdr_sqlite

XXX 8. cdr_tds
[/color][/code]
What I want to know is whether even without this file cdr_pgsql.so ( which to me represents the posrgresql cdr module) in / usr/ib64/asterisk/modules and handling I’ve done it for as cdr_pgsql check above , I can create my database and my postgresql table and allow the intelligence information it by Cdr . And how I should do to achieve with my version of asterisk . Also you talked about alternative ODBC to achieve my purpose was , but I want you not help me not because my goal is to arrive at an ODBC -JDBC connection . So how I should go about installing, configuring ODBC -JDBC connector and foremost what is the right driver to choose?

Here is a state of my CDR :

[color=#FF0000]serv_asterisk * CLI> cdr status CDR logging : enabled CDR mode : Single CDR output unanswered calls : no CDR registered backend : cdr -custom CDR registered backend : csv CDR registered backend : cdr_manager
[/color]

Thank you for helping me get there

Cool, it looks like you successfully compiled the cdr_pgsql module. You should have the cdr_pgsql.so file in the modules folder that you mention.

When you have this set up, modifly the cdr_pgsql.conf file with the proper information for connecting to the PostgreSQL database that you have set up. After that connect to the Asterisk console and do a “module load cdr_pgsql”. If you configured everything correctly, Asterisk should connect to the database and start writing CDR’s to the proper table.

Thank you very much for your help dejanst :smiley: I entered the correct settings in the file / etc / cdr_pgsql.conf as you suggested and now I could save the CDR data in the table in my Postgresql database. Thank you for putting me on the path.

:arrow_right: I also want you to help me if possible to install and configure postgresql JDBC driver so that my database is accesible via a connection JDBC.J 've succeeds to install JDK 1.6 on my Centos. Because I want to create a Java application that would allow me to list the data from the database and view call statistics. Hence the use of the JDBC connector. :bulb: :bulb: :bulb: :wink:

Help Me

I am very glad that you got the cdr_pgsql.so working. Good job.

Sorry, haven’t done anything with JDBC, so I really can’t help you out. So someone else will have to step in.