Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Does cdr adaptive odbc re-connect automatically after a long idle time?


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
lazy.charles at gmail.com
Guest





PostPosted: Sat Jan 11, 2014 4:56 pm    Post subject: [asterisk-users] Does cdr adaptive odbc re-connect automatic Reply with quote

Hi all,


I use astersk 11.7.0 on Ubuntu 12.04.01 TLS (i386). I use cdr_adaptive_odbc to write CDR to my MySQL's cdr table.
After my testing, this scenario is working well.


After a long idle time, I didn't make any call to the asterisk server. 
When I try to make a call again after 8 hours, I found that the cdr lost. It cannot be inserted to cdr table.
Also, I could not find the insert CDR messages in the CLI at this period.


Could you please tell me which settings are wrong? Why dose my odbc connection not re-connect to MySQL automatically? 




I checked the setting below:


CLI:
ubuntu*CLI> cdr show status 


Call Detail Record (CDR) settings
----------------------------------
  Logging:                    Enabled
  Mode:                       Simple
  Log unanswered calls:       Yes
  Log congestion:             Yes


* Registered Backends
  -------------------
    cdr-custom
    Adaptive ODBC
    csv


ubuntu*CLI> odbc show all


ODBC DSN Settings
-----------------


  Name:   asterisk
  DSN:    asterisk-connector
    Last connection attempt: 2014-01-11 18:16:40
  Pooled: Yes
  Limit:  1000
  Connections in use: 0
  
  
-------------- /etc/asterisk/cdr.conf lists below: 
[general]
enable=yes
unanswered = yes
congestion = yes
endbeforehexten=yes


[csv]
usegmtime=no    ; log date/time in GMT.  Default is "no"
loguniqueid=yes  ; log uniqueid.  Default is "no"
loguserfield=yes ; log user field.  Default is "no"
accountlogs=yes  ; create separate log file for each account code. Default is "yes"


-------------- /etc/odbc.ini
[asterisk-connector]
Description           = MySQL connection to 'asterisk' database
Driver                = MySQL
Database              = mydatabase
Server                = localhost
UserName              = root
Password              = mypassword
Port                  = 3306
Socket                = /var/run/mysqld/mysqld.sock




-------------- /etc/asterisk/res_odbc.conf lists below: 
[ENV]


[asterisk]
enabled => yes
dsn => asterisk-connector
password => mypassword
pre-connect => yes
sanitysql => select 1
pooling => yes
idlecheck => 30
share_connections => yes
limit => 1000
connect_timeout => 60
negative_connection_cache => 600




-------------- /etc/asterisk/cdr_adaptive_odbc.conf lists below: 
[cdr]
connection=asterisk
table=cdr
alias start => calldate
alias phoneno => phoneno
alias userid => userid
alias callerid => callerid




--
Best Regards
Charles
Back to top
paul.belanger at polyb...
Guest





PostPosted: Mon Jan 13, 2014 8:33 pm    Post subject: [asterisk-users] Does cdr adaptive odbc re-connect automatic Reply with quote

On Sat, Jan 11, 2014 at 4:56 PM, Charles Wang <lazy.charles@gmail.com> wrote:
Quote:
Hi all,

I use astersk 11.7.0 on Ubuntu 12.04.01 TLS (i386). I use cdr_adaptive_odbc
to write CDR to my MySQL's cdr table.
After my testing, this scenario is working well.

After a long idle time, I didn't make any call to the asterisk server.
When I try to make a call again after 8 hours, I found that the cdr lost. It
cannot be inserted to cdr table.
Also, I could not find the insert CDR messages in the CLI at this period.

Could you please tell me which settings are wrong? Why dose my odbc
connection not re-connect to MySQL automatically?


I checked the setting below:

CLI:
ubuntu*CLI> cdr show status

Call Detail Record (CDR) settings
----------------------------------
Logging: Enabled
Mode: Simple
Log unanswered calls: Yes
Log congestion: Yes

* Registered Backends
-------------------
cdr-custom
Adaptive ODBC
csv

ubuntu*CLI> odbc show all

ODBC DSN Settings
-----------------

Name: asterisk
DSN: asterisk-connector
Last connection attempt: 2014-01-11 18:16:40
Pooled: Yes
Limit: 1000
Connections in use: 0


-------------- /etc/asterisk/cdr.conf lists below:
[general]
enable=yes
unanswered = yes
congestion = yes
endbeforehexten=yes

[csv]
usegmtime=no ; log date/time in GMT. Default is "no"
loguniqueid=yes ; log uniqueid. Default is "no"
loguserfield=yes ; log user field. Default is "no"
accountlogs=yes ; create separate log file for each account code. Default
is "yes"

-------------- /etc/odbc.ini
[asterisk-connector]
Description = MySQL connection to 'asterisk' database
Driver = MySQL
Database = mydatabase
Server = localhost
UserName = root
Password = mypassword
Port = 3306
Socket = /var/run/mysqld/mysqld.sock


-------------- /etc/asterisk/res_odbc.conf lists below:
[ENV]

[asterisk]
enabled => yes
dsn => asterisk-connector
password => mypassword
pre-connect => yes
sanitysql => select 1
pooling => yes
idlecheck => 30
share_connections => yes
limit => 1000
connect_timeout => 60
negative_connection_cache => 600


-------------- /etc/asterisk/cdr_adaptive_odbc.conf lists below:
[cdr]
connection=asterisk
table=cdr
alias start => calldate
alias phoneno => phoneno
alias userid => userid
alias callerid => callerid

I would be inclined to check the database side over asterisk. We use
almost the same setup and don't have any issues. We go some time 12
hours between calls. Once thing you could do is enable debug logs and
see what Asterisk is doing when the odbc connection is down. EG: it
should be attempting to reconnect.

--
Paul Belanger | PolyBeacon, Inc.
Jabber: paul.belanger@polybeacon.com | IRC: pabelanger (Freenode)
Github: https://github.com/pabelanger | Twitter: https://twitter.com/pabelanger

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services