Asterisk v11 reconnects to Database Realtime ODBC but does not save CDR anymore


I’ve go Asterisk v11.15 with Realtime Database (ODBC - Postgresql).

If database goes down o restarts, Asterisk reconnects to database and reads info such as Queue configuration, sippeers, agents defined on Queue, etc…

However, Asterisk does not save to the CDR table anymore.

show odbc all shows “Connected: Yes”

If I reload with module reload it still doesn’t save CDR info.

I have to restart Asterisk.

Is there any other way to recover from this situation?


` enabled => yes

   dsn => asterisk-connector

   username => xxxxx
   password => xxxxx

   pre-connect => yes
   pooling => no
   limit => 5



[asterisk-connector] Description = PostgreSQL connection to 'asterisk' database Driver = PostgreSQL Database = xxxxxxx Servername = xxxxxxx UserName = xxxxx Password = xxxxx Port = 5432 Protocol = 8.1 ReadOnly = No RowVersioning = No ShowSystemTables = No ShowOidColumn = No FakeOidIndex = No ConnSettings =

Ok, the previous scenario is not the wrong one. In that situation Asterisk stores CDR ok.

The bad scenario is when I switched off both Asterisk and DDBB (as if it were an outage) and I start Asterisk before DDBB.

SIP agents cannot register because Asterisk ODBC cannot connect to DDBB. That’s OK.

I start DDBB and agents start to register.

Now, we make an incoming call to Queue (or a call between agents). When it finishes, there is no CDR data saved.

Now I tried to “module reload” and it fixed the problem. CDR is working again.

cdr show status” shows the same status being connected to DDBB and not connected to DDBB:
Call Detail Record (CDR) settings
Logging: Enabled
Mode: Simple
Log unanswered calls: Yes
Log congestion: Yes
Registered Backends
Adaptive ODBC

Is there a way to fix this situtation without not reloading manually?