Asterisk with PostgreSQL

Asterisk 13.19.1

I need to use the PostgreSQL database to save the PBX configuration

At the moment, I have configured the ODBC driver to work with PostgreSQL

created 2 databases in PostgreSQL from Asterisk sources


my configuration file /etc/asterisk/res_odbc_additional.conf has the following text:

enabled => yes
dsn => PostgreSQL-asteriskcdrdb
max_connections => 5
pooling => no
limit => 1
pre-connect => yes
username => postgres
password => 123456
database => asteriskcdrdb

The Asterix kernel console, when called odbc show, shows the following:

ODBC DSN Settings

Name: asteriskcdrdb
DSN: PostgreSQL-asteriskcdrdb
Last connection attempt: 1970-01-01 00:00:00
Number of active connections: 1 (out of 5)

Data about calls are written in PostgreSQL -> asteriskcdrdb everything is fine


When adding a new user through the web interface
Applications -> Extension-> Add SIP Extension

I specify the number, click Submit and Apply Config


itself is changed to
enabled => yes
dsn => MySQL-asteriskcdrdb
pre-connect => yes
max_connections => 5
username => freepbxuser
password => bIxbp13Cl5NM
database => asteriskcdrdb

and the PostgreSQL database does not record calls

but in the core of Asteriks
odbc show shows
ODBC DSN Settings

Name: asteriskcdrdb
DSN: MySQL-asteriskcdrdb
Last connection attempt: 2018-06-11 09:52:20
Number of active connections: 1 (out of 5)

why there is a change of settings myself I do not know


  1. How can I change the location of the Asterisk configuration from MySQL to the PostgreSQL database

in the database 1.Asterisk

  1. Where still it is necessary what that to adjust that change ODBC the driver did not occur independently?

I understand that the file /etc/asterisk/res_odbc_additional.conf is generated automatically, but I can not find where to fix it

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.