[Freeswitch-branches] [commit] r3835 - freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr
Freeswitch SVN
mishehu at freeswitch.org
Tue Dec 26 15:38:03 EST 2006
Author: mishehu
Date: Tue Dec 26 15:38:03 2006
New Revision: 3835
Modified:
freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.cpp
freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.h
freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.cpp
freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/schema.sql
freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/sqlitecdr.cpp
Log:
Ack, no logging of network_addr in a couple of the SQL based logger backends. I believe this is now fixed. Still not tested.
Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.cpp (original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.cpp Tue Dec 26 15:38:03 2006
@@ -62,6 +62,7 @@
dstchannel_length = (long unsigned int)strlen(dstchannel);
lastapp_length = (long unsigned int)strlen(lastapp);
lastdata_length = (long unsigned int)strlen(lastdata);
+ network_addr_length = (long unsigned int)strlen(network_addr);
if(chanvars_fixed_list.size() > 0)
process_channel_variables(chanvars_fixed_list,newchannel->channel);
@@ -195,7 +196,7 @@
if(activated)
{
- tmp_sql_query = "INSERT INTO freeswitchcdr (callstartdate,callanswerdate,calltransferdate,callenddate,originated,clid,src,dst,ani,aniii,dialplan,myuuid,destuuid,srcchannel,dstchannel,lastapp,lastdata,billusec,disposition,hangupcause,amaflags";
+ tmp_sql_query = "INSERT INTO freeswitchcdr (callstartdate,callanswerdate,calltransferdate,callenddate,originated,clid,src,dst,ani,aniii,dialplan,myuuid,destuuid,srcchannel,dstchannel,network_addr,lastapp,lastdata,billusec,disposition,hangupcause,amaflags";
int items_appended = 0;
@@ -213,7 +214,7 @@
}
}
- tmp_sql_query.append(") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?");
+ tmp_sql_query.append(") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?");
if(chanvars_fixed_list.size() > 0 )
{
@@ -353,6 +354,7 @@
add_string_parameter(destuuid,destuuid_length,MYSQL_TYPE_VAR_STRING,0);
add_string_parameter(srcchannel,srcchannel_length,MYSQL_TYPE_VAR_STRING,0);
add_string_parameter(dstchannel,dstchannel_length,MYSQL_TYPE_VAR_STRING,0);
+ add_string_parameter(network_addr,network_addr_length,MYSQL_TYPE_VAR_STRING,0);
add_string_parameter(lastapp,lastapp_length,MYSQL_TYPE_VAR_STRING,0);
add_string_parameter(lastdata,lastdata_length,MYSQL_TYPE_VAR_STRING,0);
add_parameter(billusec,MYSQL_TYPE_LONGLONG,0);
Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.h
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.h (original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mysqlcdr.h Tue Dec 26 15:38:03 2006
@@ -95,6 +95,7 @@
long unsigned int aniii_length;
long unsigned int lastapp_length;
long unsigned int lastdata_length;
+ long unsigned int network_addr_length;
// Now a couple internal methods
template <typename T> void add_parameter(T& param, enum_field_types type, bool *is_null=0);
void add_string_parameter(char* param, long unsigned int& param_length, enum_field_types type, bool* is_null=0);
Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.cpp (original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/odbccdr.cpp Tue Dec 26 15:38:03 2006
@@ -222,7 +222,7 @@
{
tmp_sql_query = "INSERT INTO ";
tmp_sql_query.append(tablename);
- tmp_sql_query.append(" (callstartdate,callanswerdate,calltransferdate,callenddate,originated,clid,src,dst,ani,aniii,dialplan,myuuid,destuuid,srcchannel,dstchannel,lastapp,lastdata,billusec,disposition,hangupcause,amaflags");
+ tmp_sql_query.append(" (callstartdate,callanswerdate,calltransferdate,callenddate,originated,clid,src,dst,ani,aniii,dialplan,myuuid,destuuid,srcchannel,dstchannel,network_addr,lastapp,lastdata,billusec,disposition,hangupcause,amaflags");
int items_appended = 0;
@@ -240,7 +240,7 @@
}
}
- tmp_sql_query.append(") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?");
+ tmp_sql_query.append(") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?");
if(chanvars_fixed_list.size() > 0 )
{
@@ -422,6 +422,7 @@
SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, sizeof(destuuid), 0, destuuid, 0, 0);
SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(srcchannel), 0, srcchannel, 0, 0);
SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(dstchannel), 0, dstchannel, 0, 0);
+ SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(network_addr), 0, network_addr, 0, 0);
SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(lastapp), 0, lastapp, 0, 0);
SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, sizeof(lastdata), 0, lastdata, 0, 0);
SQLBindParameter(ODBC_stmt, index++, SQL_PARAM_INPUT, SQL_C_UBIGINT, SQL_BIGINT, 0, 0, &billusec, 0, 0);
Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/schema.sql
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/schema.sql (original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/schema.sql Tue Dec 26 15:38:03 2006
@@ -15,6 +15,7 @@
destuuid char(36) NOT NULL,
srcchannel varchar(80) NOT NULL,
dstchannel varchar(80) NOT NULL, /* Need to decide - this might be redundant as you can link the records via uuid */
+ network_addr varchar(40) default "",
lastapp varchar(80) default "",
lastdata varchar(255) default "",
billusec bigint default 0,
Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/sqlitecdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/sqlitecdr.cpp (original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/sqlitecdr.cpp Tue Dec 26 15:38:03 2006
@@ -141,7 +141,7 @@
if(activated)
{
- tmp_sql_query = "INSERT INTO freeswitchcdr (callstartdate,callanswerdate,calltransferdate,callenddate,originated,clid,src,dst,ani,aniii,dialplan,myuuid,destuuid,srcchannel,dstchannel,lastapp,lastdata,billusec,disposition,hangupcause,amaflags";
+ tmp_sql_query = "INSERT INTO freeswitchcdr (callstartdate,callanswerdate,calltransferdate,callenddate,originated,clid,src,dst,ani,aniii,dialplan,myuuid,destuuid,srcchannel,dstchannel,network_addr,lastapp,lastdata,billusec,disposition,hangupcause,amaflags";
int items_appended = 0;
@@ -159,7 +159,7 @@
}
}
- tmp_sql_query.append(") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?");
+ tmp_sql_query.append(") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?");
if(chanvars_fixed_list.size() > 0 )
{
@@ -235,6 +235,7 @@
"destuuid TEXT NOT NULL,\n"
"srcchannel TEXT NOT NULL,\n"
"dstchannel TEXT NOT NULL,\n"
+ "network_addr TEXT,\n"
"lastapp TEXT default \"\",\n"
"lastdata TEXT default \"\",\n"
"billusec INTEGER default 0,\n"
@@ -405,6 +406,7 @@
switch_core_db_bind_text(stmt, column++, destuuid,36,SQLITE_STATIC);
switch_core_db_bind_text(stmt, column++, srcchannel,-1,SQLITE_STATIC);
switch_core_db_bind_text(stmt, column++, dstchannel,-1,SQLITE_STATIC);
+ switch_core_db_bind_text(stmt, column++, network_addr,-1,SQLITE_STATIC);
switch_core_db_bind_text(stmt, column++, lastapp,-1,SQLITE_STATIC);
switch_core_db_bind_text(stmt, column++, lastdata,-1,SQLITE_STATIC);
switch_core_db_bind_int64(stmt, column++, (sqlite_int64) billusec);
@@ -438,7 +440,7 @@
if(sql_rc == SQLITE_BUSY)
sql_rc = switch_core_db_step(stmt_chanvars);
else if (sql_rc == SQLITE_ERROR || sql_rc == SQLITE_MISUSE)
- switch_console_printf(SWITCH_CHANNEL_LOG,"There was an error executing switch_core_db_step on SqliteCDR::stmt. The error was: %s\n",switch_core_db_errmsg(db));
+ switch_console_printf(SWITCH_CHANNEL_LOG,"There was an error executing switch_core_db_step on SqliteCDR::stmt_chanvars. The error was: %s\n",switch_core_db_errmsg(db));
}
}
@@ -451,6 +453,8 @@
{
switch_core_db_finalize(stmt_chanvars);
switch_core_db_finalize(stmt);
+ switch_core_db_finalize(stmt_begin);
+ switch_core_db_finalize(stmt_commit);
switch_core_db_close(db);
activated = 0;
logchanvars = 0;
More information about the Freeswitch-branches
mailing list