Adam Goryachev
2004-May-26 01:22 UTC
[Asterisk-Users] cdr_odbc with mysql on a remote server
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: ErrorDetails: %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
Hi All Does anyone know how I can get more information about an incoming SIP call from a SIP proxy. Like FWD or any other SER proxy. My * box shows the channel name as:> -----Original Message----- > From: asterisk-users-admin@lists.digium.com > [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of > Adam Goryachev > Sent: 26 May 2004 10:22 AM > To: asterisk-users@lists.digium.com > Subject: [Asterisk-Users] cdr_odbc with mysql on a remote server > > 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 > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > >
Hi all Does nayone know how to get more specific info about an incoming SIP call from a SIP proxy like FWD or any other SER proxy. All incmoing calls into my * box from FWD and other SER proxies have the following channel name: SIP/-081833b8 or something similar but with the same format (random) Ie they are quite random. I would far rather have something like SIP/fwd.pulver.comXXXXXX Does anyone have any suggestions Thankls in advance Jason> -----Original Message----- > From: asterisk-users-admin@lists.digium.com > [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of > Adam Goryachev > Sent: 26 May 2004 10:22 AM > To: asterisk-users@lists.digium.com > Subject: [Asterisk-Users] cdr_odbc with mysql on a remote server > > 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 > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > >
Its very clear why its not working. Visit www.voip-info.org for some examples on how to set it up. If you didn't compile unixODBC and MyODBC from src then you will need to do so. Installing via RPM or package has proven in the past to not work. bkw> -----Original Message----- > From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users- > admin@lists.digium.com] On Behalf Of Adam Goryachev > Sent: Wednesday, May 26, 2004 3:22 AM > To: asterisk-users@lists.digium.com > Subject: [Asterisk-Users] cdr_odbc with mysql on a remote server > > 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 > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Adam Goryachev wrote:> 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.This is an ODBC issue, not an Asterisk issue. Check odbc.ini F
Chris Robertson
2004-May-26 21:59 UTC
[Asterisk-Users] cdr_odbc with mysql on a remote server
Have you ltraced the asterisk process to see if it's actually opening the library? (or straced/ptraced/trussed, I can never keep the various ones straight...). Chris ________________________________ From: asterisk-users-admin@lists.digium.com on behalf of Adam Goryachev Sent: Wed 5/26/2004 9:34 PM To: asterisk-users@lists.digium.com Subject: RE: [Asterisk-Users] cdr_odbc with mysql on a remote server On Wed, 2004-05-26 at 23:54, brian wrote:> Its very clear why its not working. Visit www.voip-info.org for some > examples on how to set it up. If you didn't compile unixODBC and MyODBC > from src then you will need to do so. Installing via RPM or package has > proven in the past to not work. >Well, it is clear, it is trying to connect to the local socket instead of the remote host. I did look at www.voip-info.org for information on how to install it, and how to configure it. It was quite helpful. I didn't use any RPM's, I compiled everything from source. However, the details on the wiki all talk about using a local socket, I couldn't find any example using mysql (or any other DB) on a remote host. I have correctly configure the odbc.ini file with the remote hostname and port, but asterisk seems to ignore that. In fact, I have to wonder why the cdr_odbc.conf requires the username/password settings when these values are configured in the odbc.ini file already. Contents of cdr_odbc.conf: [global] dsn=AsteriskCDR username=asteriskcdr password=yeahright loguniqueid=yes Contents of odbc.ini: [AsteriskCDR] Driver = /usr/local/lib/libmyodbc3.so Description = MySQL ODBC 3.51 Driver DSN SERVER = mysql.websitemanagers.com.au PORT USER = asteriskcdr Password = yeahright Database = phones OPTION = 3 SOCKET Like I said, I didn't see anything in the cdr_odbc.c which suggested it would support connecting to a remote server.... Then again, I am not expert. Any assistance would be very much appreciated.> > -----Original Message----- > > From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users- > > admin@lists.digium.com] On Behalf Of Adam Goryachev > > Sent: Wednesday, May 26, 2004 3:22 AM > > To: asterisk-users@lists.digium.com > > Subject: [Asterisk-Users] cdr_odbc with mysql on a remote server > > > > 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 > > > > ______________________________________________________________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 9744 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20040527/44382ca1/attachment.bin