[Asterisk-Users] cdr_odbc with mysql on a remote server

Adam Goryachev mailinglists at websitemanagers.com.au
Wed May 26 01:22:09 MST 2004


I'm trying to add cdr_odbc.so to log my CDR data to a mysql DB. I've
managed to compile everything, and seem to almost be ready to head home.
I've added a small debug line to cdr_odbc.c as follows:
        if((ODBC_res != SQL_SUCCESS) && (ODBC_res !=
SQL_SUCCESS_WITH_INFO))
        {
                if(option_verbose > 10)
                        ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error
SQLConnect %d\n", ODBC_res);
                SQLGetDiagRec(SQL_HANDLE_DBC, ODBC_con, 1, ODBC_stat,
&ODBC_err, ODBC_msg, 100, &ODBC_mlen);
>>              if(option_verbose > 10)
>>                      ast_verbose( VERBOSE_PREFIX_4 "cdr_odbc: Error
Details: %s\n", ODBC_msg);
                SQLFreeHandle(SQL_HANDLE_ENV, ODBC_env);
                connected = 0;
                return -1;
        }

Lines marked with >> are lines I added. Here are the error messages I
get on the console:

asterisk*CLI> load cdr_odbc.so
 Loaded /usr/lib/asterisk/modules/cdr_odbc.so => (ODBC CDR Backend)
  == Parsing '/etc/asterisk/cdr_odbc.conf':   == Parsing
'/etc/asterisk/cdr_odbc.conf': Found
2004-05-26 18:13:54 NOTICE[6151]: cdr_odbc.c:336 odbc_load_module:
cdr_odbc: Logging uniqueid
       > cdr_odbc: dsn is AsteriskCDR
       > cdr_odbc: username is asteriskcdr
       > cdr_odbc: password is [secret]
       > cdr_odbc: Error SQLConnect -1
       > cdr_odbc: Error Details: [MySQL][ODBC 3.51 Driver]Can't connect
to local MySQL server through socket '/tmp/mysql.sock' (2)
2004-05-26 18:13:54 ERROR[6151]: cdr_odbc.c:363 odbc_load_module:
cdr_odbc: Unable to connect to datasource: AsteriskCDR
       > cdr_odbc: Unable to connect to datasource: AsteriskCDR

So, the problem I am having is that the mysql odbc driver seems to want
to use a local socket, but I am not running mysql locally on the
asterisk machine. I want it to connect to a remote host.

I don't see anything in the source that indicates it can/should be able
to do this. Can someone either tell me it isn't possible, or I need to
hack the source, or it is already there and I am just blind...

Thanks,
Adam




More information about the asterisk-users mailing list