[Asterisk-Users] cdr_odbc in CVS-HEAD gives connect error on reload

Matt mhoppes at gmail.com
Fri Aug 26 12:46:26 MST 2005


If I fire up asterisk it connects to my MSSQL server via ODBC just
fine.  However, if I issue a reload it unloads the ODBC.. then loads
it again and I get an error... and keep getting it until I

On a fresh start:
Aug 26 15:43:14 WARNING[13818] cdr_odbc.c: cdr_odbc: table not
specified.  Assuming cdr
Aug 26 15:43:14 VERBOSE[13818] logger.c:     -- cdr_odbc: dsn is MSSQL-asterisk
Aug 26 15:43:14 VERBOSE[13818] logger.c:     -- cdr_odbc: username is voip
Aug 26 15:43:14 VERBOSE[13818] logger.c:     -- cdr_odbc: password is [secret]
Aug 26 15:43:14 VERBOSE[13818] logger.c:     -- cdr_odbc: table is cdr
Aug 26 15:43:14 VERBOSE[13818] logger.c:        > cdr_odbc: Connected
to MSSQL-asterisk


On a reload:
Aug 26 15:43:57 VERBOSE[13818] logger.c:     -- Reloading module
'cdr_odbc.so' (ODBC CDR Backend)
Aug 26 15:43:57 VERBOSE[13818] logger.c:        > cdr_odbc:
Disconnecting from MSSQL-asterisk
Aug 26 15:43:57 VERBOSE[13818] logger.c:        > cdr_odbc: free dsn
Aug 26 15:43:57 VERBOSE[13818] logger.c:        > cdr_odbc: free username
Aug 26 15:43:57 VERBOSE[13818] logger.c:        > cdr_odbc: free password
Aug 26 15:43:57 VERBOSE[13818] logger.c:        > cdr_odbc: free table
Aug 26 15:43:57 VERBOSE[13818] logger.c:   == Unregistered 'ODBC' CDR backend
Aug 26 15:43:57 VERBOSE[13818] logger.c:   == Parsing
'/etc/asterisk/cdr_odbc.conf': Aug 26 15:43:57 VERBOSE[13818]
logger.c:   == Parsing '/etc/asterisk/cdr_odbc.conf': Found
Aug 26 15:43:57 DEBUG[13818] cdr_odbc.c: cdr_odbc: Logging uniqueid
Aug 26 15:43:57 DEBUG[13818] cdr_odbc.c: cdr_odbc: Not logging in GMT
Aug 26 15:43:57 WARNING[13818] cdr_odbc.c: cdr_odbc: table not
specified.  Assuming cdr
Aug 26 15:43:57 VERBOSE[13818] logger.c:     -- cdr_odbc: dsn is MSSQL-asterisk
Aug 26 15:43:57 VERBOSE[13818] logger.c:     -- cdr_odbc: username is voip
Aug 26 15:43:57 VERBOSE[13818] logger.c:     -- cdr_odbc: password is [secret]
Aug 26 15:43:57 VERBOSE[13818] logger.c:     -- cdr_odbc: table is cdr
Aug 26 15:43:57 VERBOSE[13818] logger.c:        > cdr_odbc: Error SQLConnect -2
Aug 26 15:43:57 ERROR[13818] cdr_odbc.c: cdr_odbc: Unable to connect
to datasource: MSSQL-asterisk
Aug 26 15:43:57 VERBOSE[13818] logger.c:     -- cdr_odbc: Unable to
connect to datasource: MSSQL-asterisk


Another reload and it's fine again (no restart this time):
Aug 26 15:44:19 VERBOSE[13818] logger.c:     -- Reloading module
'cdr_odbc.so' (ODBC CDR Backend)
Aug 26 15:44:19 VERBOSE[13818] logger.c:        > cdr_odbc: free dsn
Aug 26 15:44:19 VERBOSE[13818] logger.c:        > cdr_odbc: free username
Aug 26 15:44:19 VERBOSE[13818] logger.c:        > cdr_odbc: free password
Aug 26 15:44:19 VERBOSE[13818] logger.c:        > cdr_odbc: free table
Aug 26 15:44:19 VERBOSE[13818] logger.c:   == Unregistered 'ODBC' CDR backend
Aug 26 15:44:19 VERBOSE[13818] logger.c:   == Parsing
'/etc/asterisk/cdr_odbc.conf': Aug 26 15:44:19 VERBOSE[13818]
logger.c:   == Parsing '/etc/asterisk/cdr_odbc.conf': Found
Aug 26 15:44:19 DEBUG[13818] cdr_odbc.c: cdr_odbc: Logging uniqueid
Aug 26 15:44:19 DEBUG[13818] cdr_odbc.c: cdr_odbc: Not logging in GMT
Aug 26 15:44:19 WARNING[13818] cdr_odbc.c: cdr_odbc: table not
specified.  Assuming cdr
Aug 26 15:44:19 VERBOSE[13818] logger.c:     -- cdr_odbc: dsn is MSSQL-asterisk
Aug 26 15:44:19 VERBOSE[13818] logger.c:     -- cdr_odbc: username is voip
Aug 26 15:44:19 VERBOSE[13818] logger.c:     -- cdr_odbc: password is [secret]
Aug 26 15:44:19 VERBOSE[13818] logger.c:     -- cdr_odbc: table is cdr
Aug 26 15:44:19 VERBOSE[13818] logger.c:   == Parsing
'/etc/asterisk/sip_notify.conf': Aug 26 15:44:19 VERBOSE[13818]
logger.c:   == Parsing '/etc/asterisk/sip_notify.conf': Not found (No
such file or directory)
Aug 26 15:44:19 VERBOSE[13818] logger.c:        > cdr_odbc: Connected
to MSSQL-asterisk


Anyone have any ideas?

my cdr_odbc.conf says:
[global]
dsn=MSSQL-asterisk
username=voip
password=xxxxxxxxxxxxxxxx
loguniqueid=yes

and my odbc.ini file is:
[MSSQL-asterisk]
description     = Asterisk ODBC for MSSQL
driver          = FreeTDS
server          = xxx.xxx.xxx.xxx
port            = 1433
database        = VoIP
tds_version     = 8.0
language        = us_english


Any ideas?



More information about the asterisk-users mailing list