mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-15 22:08:33 +00:00
spring cleaning
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4795 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
a021945cef
commit
3a54126261
143 files changed
+22413
-31567
No files matched your search
@@ -46,8 +46,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
struct switch_mod_cdr_newchannel_t
|
||||
{
|
||||
struct switch_mod_cdr_newchannel_t {
|
||||
switch_core_session_t *session;
|
||||
switch_channel_t *channel;
|
||||
//switch_channel_timetable_t *timetable;
|
||||
@@ -57,7 +56,7 @@ struct switch_mod_cdr_newchannel_t
|
||||
//bool originate;
|
||||
};
|
||||
|
||||
enum switch_mod_cdr_sql_types_t { CDR_INTEGER,CDR_STRING,CDR_DECIMAL,CDR_DOUBLE,CDR_TINY };
|
||||
enum switch_mod_cdr_sql_types_t { CDR_INTEGER, CDR_STRING, CDR_DECIMAL, CDR_DOUBLE, CDR_TINY };
|
||||
|
||||
#ifdef WIN32
|
||||
#define STDCALL __stdcall
|
||||
@@ -65,54 +64,54 @@ enum switch_mod_cdr_sql_types_t { CDR_INTEGER,CDR_STRING,CDR_DECIMAL,CDR_DOUBLE,
|
||||
#define STDCALL
|
||||
#endif
|
||||
|
||||
typedef switch_status_t (STDCALL *modcdr_time_convert_t)(switch_time_exp_t*,switch_time_t);
|
||||
typedef switch_status_t (STDCALL * modcdr_time_convert_t) (switch_time_exp_t *, switch_time_t);
|
||||
|
||||
class BaseCDR {
|
||||
public:
|
||||
BaseCDR();
|
||||
virtual ~BaseCDR();
|
||||
BaseCDR(switch_mod_cdr_newchannel_t *newchannel);
|
||||
virtual void connect(switch_xml_t& cfg, switch_xml_t& xml, switch_xml_t& settings, switch_xml_t& param) = 0;
|
||||
virtual void disconnect() = 0;
|
||||
virtual bool process_record() = 0;
|
||||
virtual bool is_activated() = 0;
|
||||
virtual void tempdump_record() = 0;
|
||||
virtual void reread_tempdumped_records() = 0;
|
||||
virtual std::string get_display_name() = 0; // Get the module name
|
||||
protected:
|
||||
void parse_channel_variables_xconfig(std::string& unparsed,std::list<std::string>& chanvarslist,bool fixed);
|
||||
void parse_channel_variables_xconfig(std::string& unparsed,std::list<std::string>& chanvarslist,std::vector<switch_mod_cdr_sql_types_t>& chanvars_fixed_types); // Typically used for SQL types
|
||||
void process_channel_variables(const std::list<std::string>& stringlist,const std::list<std::string>& fixedlist,switch_channel_t *channel,bool repeat = 1); //This is used for supplemental chanvars
|
||||
void process_channel_variables(const std::list<std::string>& stringlist,switch_channel_t *channel); // This is used for fixed chanvars
|
||||
void escape_string(std::string& src);
|
||||
std::string escape_chararray(char* src);
|
||||
switch_time_t callstartdate;
|
||||
switch_time_t callanswerdate;
|
||||
switch_time_t callenddate;
|
||||
switch_time_t calltransferdate;
|
||||
switch_call_cause_t hangupcause;
|
||||
char *hangupcause_text;
|
||||
char clid[80];
|
||||
bool originated; // Did they originate this call?
|
||||
char dialplan[80];
|
||||
char myuuid[37]; // 36 + 1 to hold \0
|
||||
char destuuid[37];
|
||||
char src[80];
|
||||
char dst[80];
|
||||
char srcchannel[80];
|
||||
char dstchannel[80];
|
||||
char ani[80];
|
||||
char aniii[80];
|
||||
char network_addr[40];
|
||||
char lastapp[80];
|
||||
char lastdata[255];
|
||||
switch_time_t billusec; // Yes, you heard me, we're measuring in microseconds
|
||||
int disposition; // Currently 0 = Busy/Unanswered, 1 = Answered
|
||||
int amaflags;
|
||||
switch_core_session_t *coresession;
|
||||
std::list<std::pair<std::string,std::string> > chanvars_fixed;
|
||||
std::map<std::string,std::string> chanvars_supp;
|
||||
bool errorstate; // True if there is an error writing the log
|
||||
public:
|
||||
BaseCDR();
|
||||
virtual ~ BaseCDR();
|
||||
BaseCDR(switch_mod_cdr_newchannel_t * newchannel);
|
||||
virtual void connect(switch_xml_t & cfg, switch_xml_t & xml, switch_xml_t & settings, switch_xml_t & param) = 0;
|
||||
virtual void disconnect() = 0;
|
||||
virtual bool process_record() = 0;
|
||||
virtual bool is_activated() = 0;
|
||||
virtual void tempdump_record() = 0;
|
||||
virtual void reread_tempdumped_records() = 0;
|
||||
virtual std::string get_display_name() = 0; // Get the module name
|
||||
protected:
|
||||
void parse_channel_variables_xconfig(std::string & unparsed, std::list < std::string > &chanvarslist, bool fixed);
|
||||
void parse_channel_variables_xconfig(std::string & unparsed, std::list < std::string > &chanvarslist, std::vector < switch_mod_cdr_sql_types_t > &chanvars_fixed_types); // Typically used for SQL types
|
||||
void process_channel_variables(const std::list < std::string > &stringlist, const std::list < std::string > &fixedlist, switch_channel_t *channel, bool repeat = 1); //This is used for supplemental chanvars
|
||||
void process_channel_variables(const std::list < std::string > &stringlist, switch_channel_t *channel); // This is used for fixed chanvars
|
||||
void escape_string(std::string & src);
|
||||
std::string escape_chararray(char *src);
|
||||
switch_time_t callstartdate;
|
||||
switch_time_t callanswerdate;
|
||||
switch_time_t callenddate;
|
||||
switch_time_t calltransferdate;
|
||||
switch_call_cause_t hangupcause;
|
||||
char *hangupcause_text;
|
||||
char clid[80];
|
||||
bool originated; // Did they originate this call?
|
||||
char dialplan[80];
|
||||
char myuuid[37]; // 36 + 1 to hold \0
|
||||
char destuuid[37];
|
||||
char src[80];
|
||||
char dst[80];
|
||||
char srcchannel[80];
|
||||
char dstchannel[80];
|
||||
char ani[80];
|
||||
char aniii[80];
|
||||
char network_addr[40];
|
||||
char lastapp[80];
|
||||
char lastdata[255];
|
||||
switch_time_t billusec; // Yes, you heard me, we're measuring in microseconds
|
||||
int disposition; // Currently 0 = Busy/Unanswered, 1 = Answered
|
||||
int amaflags;
|
||||
switch_core_session_t *coresession;
|
||||
std::list < std::pair < std::string, std::string > >chanvars_fixed;
|
||||
std::map < std::string, std::string > chanvars_supp;
|
||||
bool errorstate; // True if there is an error writing the log
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -42,34 +42,32 @@
|
||||
#ifdef __cplusplus
|
||||
#include <vector>
|
||||
|
||||
template<class T> BaseCDR* basecdr_factory(switch_mod_cdr_newchannel_t *newchannel)
|
||||
template < class T > BaseCDR * basecdr_factory(switch_mod_cdr_newchannel_t * newchannel)
|
||||
{
|
||||
return new T(newchannel);
|
||||
}
|
||||
|
||||
typedef BaseCDR* (*basecdr_creator)(switch_mod_cdr_newchannel_t *newchannel);
|
||||
typedef BaseCDR *(*basecdr_creator) (switch_mod_cdr_newchannel_t * newchannel);
|
||||
|
||||
class BaseRegistry
|
||||
{
|
||||
private:
|
||||
std::vector<basecdr_creator> m_bases; // Stores all modules
|
||||
std::vector<basecdr_creator> active_bases; // Stores only active modules
|
||||
public:
|
||||
typedef std::vector<basecdr_creator>::iterator iterator;
|
||||
static BaseRegistry& get();
|
||||
void add(basecdr_creator);
|
||||
void reset_active(); // Clears the active vector for reloading of configuration.
|
||||
void add_active(iterator);
|
||||
iterator begin();
|
||||
iterator end();
|
||||
iterator active_begin();
|
||||
iterator active_end();
|
||||
class BaseRegistry {
|
||||
private:
|
||||
std::vector < basecdr_creator > m_bases; // Stores all modules
|
||||
std::vector < basecdr_creator > active_bases; // Stores only active modules
|
||||
public:
|
||||
typedef std::vector < basecdr_creator >::iterator iterator;
|
||||
static BaseRegistry & get();
|
||||
void add(basecdr_creator);
|
||||
void reset_active(); // Clears the active vector for reloading of configuration.
|
||||
void add_active(iterator);
|
||||
iterator begin();
|
||||
iterator end();
|
||||
iterator active_begin();
|
||||
iterator active_end();
|
||||
};
|
||||
|
||||
class BaseRegistration
|
||||
{
|
||||
public:
|
||||
BaseRegistration(basecdr_creator);
|
||||
class BaseRegistration {
|
||||
public:
|
||||
BaseRegistration(basecdr_creator);
|
||||
};
|
||||
|
||||
#define AUTO_REGISTER_BASECDR(basecdr) BaseRegistration _basecdr_registration_ ## basecdr(&basecdr_factory<basecdr>);
|
||||
|
||||
@@ -51,11 +51,11 @@ CDRContainer::process_records() will iterate thru the queue and commit the recor
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
class CDRContainer {
|
||||
public:
|
||||
class CDRContainer {
|
||||
public:
|
||||
CDRContainer();
|
||||
CDRContainer(switch_memory_pool_t *module_pool);
|
||||
~CDRContainer();
|
||||
~CDRContainer();
|
||||
void add_cdr(switch_core_session_t *session);
|
||||
void process_records();
|
||||
#ifdef SWITCH_QUEUE_ENHANCED
|
||||
@@ -65,21 +65,19 @@ class CDRContainer {
|
||||
#endif
|
||||
void active(switch_stream_handle_t *stream);
|
||||
void available(switch_stream_handle_t *stream);
|
||||
protected:
|
||||
private:
|
||||
switch_xml_t cfg, xml, settings, param;
|
||||
protected:
|
||||
private:
|
||||
switch_xml_t cfg, xml, settings, param;
|
||||
switch_queue_t *cdrqueue;
|
||||
std::string tempfilepath;
|
||||
std::string tempfilepath;
|
||||
char configfile[13];
|
||||
bool queue_paused;
|
||||
};
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c++
|
||||
|
||||
@@ -44,38 +44,38 @@
|
||||
#ifndef CSVCDR
|
||||
#define CSVCDR
|
||||
|
||||
class CsvCDR : public BaseCDR {
|
||||
public:
|
||||
CsvCDR();
|
||||
CsvCDR(switch_mod_cdr_newchannel_t *newchannel);
|
||||
//CsvCDR(const CsvCDR& copyFrom);
|
||||
virtual ~CsvCDR();
|
||||
virtual bool process_record();
|
||||
virtual void connect(switch_xml_t& cfg, switch_xml_t& xml, switch_xml_t& settings, switch_xml_t& param); // connect and disconnect need to be static because we're persisting connections until shutdown
|
||||
virtual void disconnect();
|
||||
virtual bool is_activated();
|
||||
virtual void tempdump_record();
|
||||
virtual void reread_tempdumped_records();
|
||||
virtual std::string get_display_name();
|
||||
class CsvCDR:public BaseCDR {
|
||||
public:
|
||||
CsvCDR();
|
||||
CsvCDR(switch_mod_cdr_newchannel_t * newchannel);
|
||||
//CsvCDR(const CsvCDR& copyFrom);
|
||||
virtual ~ CsvCDR();
|
||||
virtual bool process_record();
|
||||
virtual void connect(switch_xml_t & cfg, switch_xml_t & xml, switch_xml_t & settings, switch_xml_t & param); // connect and disconnect need to be static because we're persisting connections until shutdown
|
||||
virtual void disconnect();
|
||||
virtual bool is_activated();
|
||||
virtual void tempdump_record();
|
||||
virtual void reread_tempdumped_records();
|
||||
virtual std::string get_display_name();
|
||||
|
||||
private:
|
||||
static bool activated; // Is this module activated?
|
||||
static bool connectionstate; // What is the status of the connection?
|
||||
static bool logchanvars;
|
||||
static modcdr_time_convert_t convert_time;
|
||||
static bool repeat_fixed_in_supp; // Repeat the fixed chanvars in the supplemental?
|
||||
static std::string outputfile_path; // The directory we'll dump these into
|
||||
static std::list<std::string> chanvars_fixed_list; // Normally this would be used, but not in this class
|
||||
static std::list<std::string> chanvars_supp_list; // This will hold the list for all chanvars here
|
||||
static std::string display_name;
|
||||
char formattedcallstartdate[100];
|
||||
char formattedcallanswerdate[100];
|
||||
char formattedcalltransferdate[100];
|
||||
char formattedcallenddate[100];
|
||||
static std::ofstream outputfile;
|
||||
static std::ofstream::pos_type filesize_limit;
|
||||
void check_file_size_and_open(); // Checks the size of the file, and if it's greater than size allowed, rotates it.
|
||||
void open_file();
|
||||
private:
|
||||
static bool activated; // Is this module activated?
|
||||
static bool connectionstate; // What is the status of the connection?
|
||||
static bool logchanvars;
|
||||
static modcdr_time_convert_t convert_time;
|
||||
static bool repeat_fixed_in_supp; // Repeat the fixed chanvars in the supplemental?
|
||||
static std::string outputfile_path; // The directory we'll dump these into
|
||||
static std::list < std::string > chanvars_fixed_list; // Normally this would be used, but not in this class
|
||||
static std::list < std::string > chanvars_supp_list; // This will hold the list for all chanvars here
|
||||
static std::string display_name;
|
||||
char formattedcallstartdate[100];
|
||||
char formattedcallanswerdate[100];
|
||||
char formattedcalltransferdate[100];
|
||||
char formattedcallenddate[100];
|
||||
static std::ofstream outputfile;
|
||||
static std::ofstream::pos_type filesize_limit;
|
||||
void check_file_size_and_open(); // Checks the size of the file, and if it's greater than size allowed, rotates it.
|
||||
void open_file();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -50,37 +50,37 @@
|
||||
#ifndef CURLCDR
|
||||
#define CURLCDR
|
||||
|
||||
class CurlCDR : public BaseCDR {
|
||||
public:
|
||||
CurlCDR();
|
||||
CurlCDR(switch_mod_cdr_newchannel_t *newchannel);
|
||||
//CurlCDR(const CurlCDR& copyFrom);
|
||||
virtual ~CurlCDR();
|
||||
virtual bool process_record();
|
||||
virtual void connect(switch_xml_t& cfg, switch_xml_t& xml, switch_xml_t& settings, switch_xml_t& param); // connect and disconnect need to be static because we're persisting connections until shutdown
|
||||
virtual void disconnect();
|
||||
virtual bool is_activated();
|
||||
virtual void tempdump_record();
|
||||
virtual void reread_tempdumped_records();
|
||||
virtual std::string get_display_name();
|
||||
virtual std::string itos(int i);
|
||||
virtual std::string lltos(long long ll);
|
||||
class CurlCDR:public BaseCDR {
|
||||
public:
|
||||
CurlCDR();
|
||||
CurlCDR(switch_mod_cdr_newchannel_t * newchannel);
|
||||
//CurlCDR(const CurlCDR& copyFrom);
|
||||
virtual ~ CurlCDR();
|
||||
virtual bool process_record();
|
||||
virtual void connect(switch_xml_t & cfg, switch_xml_t & xml, switch_xml_t & settings, switch_xml_t & param); // connect and disconnect need to be static because we're persisting connections until shutdown
|
||||
virtual void disconnect();
|
||||
virtual bool is_activated();
|
||||
virtual void tempdump_record();
|
||||
virtual void reread_tempdumped_records();
|
||||
virtual std::string get_display_name();
|
||||
virtual std::string itos(int i);
|
||||
virtual std::string lltos(long long ll);
|
||||
|
||||
private:
|
||||
static bool activated; // Is this module activated?
|
||||
static bool connectionstate; // What is the status of the connection?
|
||||
static bool logchanvars;
|
||||
static modcdr_time_convert_t convert_time;
|
||||
static const char *gateway_url; // The URL to send data to
|
||||
static const char *gateway_credentials; // The credentials for http auth
|
||||
static std::list<std::string> chanvars_fixed_list; // Normally this would be used, but not in this class
|
||||
static std::list<std::string> chanvars_supp_list; // This will hold the list for all chanvars here
|
||||
static std::string display_name;
|
||||
static std::string postdata;
|
||||
char formattedcallstartdate[100];
|
||||
char formattedcallanswerdate[100];
|
||||
char formattedcalltransferdate[100];
|
||||
char formattedcallenddate[100];
|
||||
private:
|
||||
static bool activated; // Is this module activated?
|
||||
static bool connectionstate; // What is the status of the connection?
|
||||
static bool logchanvars;
|
||||
static modcdr_time_convert_t convert_time;
|
||||
static const char *gateway_url; // The URL to send data to
|
||||
static const char *gateway_credentials; // The credentials for http auth
|
||||
static std::list < std::string > chanvars_fixed_list; // Normally this would be used, but not in this class
|
||||
static std::list < std::string > chanvars_supp_list; // This will hold the list for all chanvars here
|
||||
static std::string display_name;
|
||||
static std::string postdata;
|
||||
char formattedcallstartdate[100];
|
||||
char formattedcallanswerdate[100];
|
||||
char formattedcalltransferdate[100];
|
||||
char formattedcallenddate[100];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -41,66 +41,66 @@
|
||||
#ifndef MYSQLCDR
|
||||
#define MYSQLCDR
|
||||
|
||||
class MysqlCDR : public BaseCDR {
|
||||
public:
|
||||
MysqlCDR();
|
||||
MysqlCDR(switch_mod_cdr_newchannel_t *newchannel);
|
||||
//MysqlCDR(const MysqlCDR& copyFrom);
|
||||
virtual ~MysqlCDR();
|
||||
virtual bool process_record();
|
||||
virtual void connect(switch_xml_t& cfg, switch_xml_t& xml, switch_xml_t& settings, switch_xml_t& param);
|
||||
virtual void disconnect();
|
||||
virtual bool is_activated();
|
||||
virtual void tempdump_record();
|
||||
virtual void reread_tempdumped_records();
|
||||
virtual std::string get_display_name();
|
||||
class MysqlCDR:public BaseCDR {
|
||||
public:
|
||||
MysqlCDR();
|
||||
MysqlCDR(switch_mod_cdr_newchannel_t * newchannel);
|
||||
//MysqlCDR(const MysqlCDR& copyFrom);
|
||||
virtual ~ MysqlCDR();
|
||||
virtual bool process_record();
|
||||
virtual void connect(switch_xml_t & cfg, switch_xml_t & xml, switch_xml_t & settings, switch_xml_t & param);
|
||||
virtual void disconnect();
|
||||
virtual bool is_activated();
|
||||
virtual void tempdump_record();
|
||||
virtual void reread_tempdumped_records();
|
||||
virtual std::string get_display_name();
|
||||
|
||||
private:
|
||||
static bool activated;
|
||||
static char sql_query[1024];
|
||||
static std::string tmp_sql_query; // Object must exist to bind the statement, this used for generating the sql
|
||||
static char sql_query_chanvars[100];
|
||||
static MYSQL *conn;
|
||||
static MYSQL_STMT *stmt;
|
||||
static MYSQL_STMT *stmt_chanvars;
|
||||
static bool connectionstate;
|
||||
static bool logchanvars;
|
||||
static std::list<std::string> chanvars_fixed_list;
|
||||
static std::vector<switch_mod_cdr_sql_types_t> chanvars_fixed_types;
|
||||
static std::list<std::string> chanvars_supp_list; // The supplemental list
|
||||
static bool repeat_fixed_in_supp;
|
||||
static char hostname[255];
|
||||
static char username[255];
|
||||
static char dbname[255];
|
||||
static char password[255];
|
||||
static modcdr_time_convert_t convert_time;
|
||||
static std::string display_name;
|
||||
//static fstream tmpfile;
|
||||
std::vector<MYSQL_BIND> bindme;
|
||||
//MYSQL_BIND *bindme;
|
||||
MYSQL_TIME my_callstartdate;
|
||||
MYSQL_TIME my_callanswerdate;
|
||||
MYSQL_TIME my_calltransferdate;
|
||||
MYSQL_TIME my_callenddate;
|
||||
// Why all these long unsigned int's? MySQL's prep statement API expects these to actually exist and not just be params passed to the function calls. The are to measure the length of actual data in the char* arrays.
|
||||
long unsigned int clid_length;
|
||||
long unsigned int dialplan_length;
|
||||
long unsigned int myuuid_length;
|
||||
long unsigned int destuuid_length;
|
||||
long unsigned int src_length;
|
||||
long unsigned int dst_length;
|
||||
long unsigned int srcchannel_length;
|
||||
long unsigned int dstchannel_length;
|
||||
long unsigned int ani_length;
|
||||
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);
|
||||
void set_mysql_time(switch_time_exp_t& param, MYSQL_TIME& destination);
|
||||
void connect_to_database();
|
||||
private:
|
||||
static bool activated;
|
||||
static char sql_query[1024];
|
||||
static std::string tmp_sql_query; // Object must exist to bind the statement, this used for generating the sql
|
||||
static char sql_query_chanvars[100];
|
||||
static MYSQL *conn;
|
||||
static MYSQL_STMT *stmt;
|
||||
static MYSQL_STMT *stmt_chanvars;
|
||||
static bool connectionstate;
|
||||
static bool logchanvars;
|
||||
static std::list < std::string > chanvars_fixed_list;
|
||||
static std::vector < switch_mod_cdr_sql_types_t > chanvars_fixed_types;
|
||||
static std::list < std::string > chanvars_supp_list; // The supplemental list
|
||||
static bool repeat_fixed_in_supp;
|
||||
static char hostname[255];
|
||||
static char username[255];
|
||||
static char dbname[255];
|
||||
static char password[255];
|
||||
static modcdr_time_convert_t convert_time;
|
||||
static std::string display_name;
|
||||
//static fstream tmpfile;
|
||||
std::vector < MYSQL_BIND > bindme;
|
||||
//MYSQL_BIND *bindme;
|
||||
MYSQL_TIME my_callstartdate;
|
||||
MYSQL_TIME my_callanswerdate;
|
||||
MYSQL_TIME my_calltransferdate;
|
||||
MYSQL_TIME my_callenddate;
|
||||
// Why all these long unsigned int's? MySQL's prep statement API expects these to actually exist and not just be params passed to the function calls. The are to measure the length of actual data in the char* arrays.
|
||||
long unsigned int clid_length;
|
||||
long unsigned int dialplan_length;
|
||||
long unsigned int myuuid_length;
|
||||
long unsigned int destuuid_length;
|
||||
long unsigned int src_length;
|
||||
long unsigned int dst_length;
|
||||
long unsigned int srcchannel_length;
|
||||
long unsigned int dstchannel_length;
|
||||
long unsigned int ani_length;
|
||||
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 ¶m_length, enum_field_types type, bool * is_null = 0);
|
||||
void set_mysql_time(switch_time_exp_t ¶m, MYSQL_TIME & destination);
|
||||
void connect_to_database();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -52,53 +52,53 @@
|
||||
#ifndef ODBCCDR
|
||||
#define ODBCCDR
|
||||
|
||||
class OdbcCDR : public BaseCDR {
|
||||
public:
|
||||
OdbcCDR();
|
||||
OdbcCDR(switch_mod_cdr_newchannel_t *newchannel);
|
||||
//OdbcCDR(const MysqlCDR& copyFrom);
|
||||
virtual ~OdbcCDR();
|
||||
virtual bool process_record();
|
||||
virtual void connect(switch_xml_t& cfg, switch_xml_t& xml, switch_xml_t& settings, switch_xml_t& param);
|
||||
virtual void disconnect();
|
||||
virtual bool is_activated();
|
||||
virtual void tempdump_record();
|
||||
virtual void reread_tempdumped_records();
|
||||
virtual std::string get_display_name();
|
||||
class OdbcCDR:public BaseCDR {
|
||||
public:
|
||||
OdbcCDR();
|
||||
OdbcCDR(switch_mod_cdr_newchannel_t * newchannel);
|
||||
//OdbcCDR(const MysqlCDR& copyFrom);
|
||||
virtual ~ OdbcCDR();
|
||||
virtual bool process_record();
|
||||
virtual void connect(switch_xml_t & cfg, switch_xml_t & xml, switch_xml_t & settings, switch_xml_t & param);
|
||||
virtual void disconnect();
|
||||
virtual bool is_activated();
|
||||
virtual void tempdump_record();
|
||||
virtual void reread_tempdumped_records();
|
||||
virtual std::string get_display_name();
|
||||
|
||||
private:
|
||||
static bool activated;
|
||||
static char sql_query[1024];
|
||||
static modcdr_time_convert_t convert_time;
|
||||
static std::string display_name;
|
||||
static std::string tmp_sql_query; // Object must exist to bind the statement, this used for generating the sql
|
||||
static char sql_query_chanvars[355];
|
||||
static char sql_query_ping[10];
|
||||
static bool connectionstate;
|
||||
static bool logchanvars;
|
||||
static SQLHENV ODBC_env; /* global ODBC Environment */
|
||||
static SQLHDBC ODBC_con; /* global ODBC Connection Handle */
|
||||
static SQLHSTMT ODBC_stmt;
|
||||
static SQLHSTMT ODBC_stmt_chanvars;
|
||||
static SQLHSTMT ODBC_stmt_ping;
|
||||
static std::list<std::string> chanvars_fixed_list;
|
||||
static std::vector<switch_mod_cdr_sql_types_t> chanvars_fixed_types;
|
||||
static std::list<std::string> chanvars_supp_list; // The supplemental list
|
||||
static bool repeat_fixed_in_supp;
|
||||
static char dsn[255];
|
||||
static char hostname[255];
|
||||
static char username[255];
|
||||
static char dbname[255];
|
||||
static char password[255];
|
||||
static char tablename[255];
|
||||
static char tablename_chanvars[255];
|
||||
//static fstream tmpfile;
|
||||
char odbc_callstartdate[128];
|
||||
char odbc_callanswerdate[128];
|
||||
char odbc_calltransferdate[128];
|
||||
char odbc_callenddate[128];
|
||||
void disconnect_stage_1();
|
||||
void connect_to_database();
|
||||
private:
|
||||
static bool activated;
|
||||
static char sql_query[1024];
|
||||
static modcdr_time_convert_t convert_time;
|
||||
static std::string display_name;
|
||||
static std::string tmp_sql_query; // Object must exist to bind the statement, this used for generating the sql
|
||||
static char sql_query_chanvars[355];
|
||||
static char sql_query_ping[10];
|
||||
static bool connectionstate;
|
||||
static bool logchanvars;
|
||||
static SQLHENV ODBC_env; /* global ODBC Environment */
|
||||
static SQLHDBC ODBC_con; /* global ODBC Connection Handle */
|
||||
static SQLHSTMT ODBC_stmt;
|
||||
static SQLHSTMT ODBC_stmt_chanvars;
|
||||
static SQLHSTMT ODBC_stmt_ping;
|
||||
static std::list < std::string > chanvars_fixed_list;
|
||||
static std::vector < switch_mod_cdr_sql_types_t > chanvars_fixed_types;
|
||||
static std::list < std::string > chanvars_supp_list; // The supplemental list
|
||||
static bool repeat_fixed_in_supp;
|
||||
static char dsn[255];
|
||||
static char hostname[255];
|
||||
static char username[255];
|
||||
static char dbname[255];
|
||||
static char password[255];
|
||||
static char tablename[255];
|
||||
static char tablename_chanvars[255];
|
||||
//static fstream tmpfile;
|
||||
char odbc_callstartdate[128];
|
||||
char odbc_callanswerdate[128];
|
||||
char odbc_calltransferdate[128];
|
||||
char odbc_callenddate[128];
|
||||
void disconnect_stage_1();
|
||||
void connect_to_database();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -43,33 +43,33 @@
|
||||
#ifndef PDDCDR
|
||||
#define PDDMCDR
|
||||
|
||||
class PddCDR : public BaseCDR {
|
||||
public:
|
||||
PddCDR();
|
||||
PddCDR(switch_mod_cdr_newchannel_t *newchannel);
|
||||
virtual ~PddCDR();
|
||||
virtual bool process_record();
|
||||
virtual void connect(switch_xml_t& cfg, switch_xml_t& xml, switch_xml_t& settings, switch_xml_t& param); // connect and disconnect need to be static because we're persisting connections until shutdown
|
||||
virtual void disconnect();
|
||||
virtual bool is_activated();
|
||||
virtual void tempdump_record();
|
||||
virtual void reread_tempdumped_records();
|
||||
virtual std::string get_display_name();
|
||||
private:
|
||||
static bool activated; // Is this module activated?
|
||||
static bool connectionstate; // What is the status of the connection?
|
||||
static bool logchanvars;
|
||||
static modcdr_time_convert_t convert_time;
|
||||
static std::string outputfile_path; // The directory we'll dump these into
|
||||
static std::list<std::string> chanvars_fixed_list; // Normally this would be used, but not in this class
|
||||
static std::list<std::string> chanvars_supp_list; // This will hold the list for all chanvars here
|
||||
static std::string display_name;
|
||||
char formattedcallstartdate[100];
|
||||
char formattedcallanswerdate[100];
|
||||
char formattedcalltransferdate[100];
|
||||
char formattedcallenddate[100];
|
||||
std::string outputfile_name;
|
||||
std::ofstream outputfile;
|
||||
class PddCDR:public BaseCDR {
|
||||
public:
|
||||
PddCDR();
|
||||
PddCDR(switch_mod_cdr_newchannel_t * newchannel);
|
||||
virtual ~ PddCDR();
|
||||
virtual bool process_record();
|
||||
virtual void connect(switch_xml_t & cfg, switch_xml_t & xml, switch_xml_t & settings, switch_xml_t & param); // connect and disconnect need to be static because we're persisting connections until shutdown
|
||||
virtual void disconnect();
|
||||
virtual bool is_activated();
|
||||
virtual void tempdump_record();
|
||||
virtual void reread_tempdumped_records();
|
||||
virtual std::string get_display_name();
|
||||
private:
|
||||
static bool activated; // Is this module activated?
|
||||
static bool connectionstate; // What is the status of the connection?
|
||||
static bool logchanvars;
|
||||
static modcdr_time_convert_t convert_time;
|
||||
static std::string outputfile_path; // The directory we'll dump these into
|
||||
static std::list < std::string > chanvars_fixed_list; // Normally this would be used, but not in this class
|
||||
static std::list < std::string > chanvars_supp_list; // This will hold the list for all chanvars here
|
||||
static std::string display_name;
|
||||
char formattedcallstartdate[100];
|
||||
char formattedcallanswerdate[100];
|
||||
char formattedcalltransferdate[100];
|
||||
char formattedcallenddate[100];
|
||||
std::string outputfile_name;
|
||||
std::ofstream outputfile;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -39,43 +39,43 @@
|
||||
#ifndef SQLITECDR
|
||||
#define SQLITECDR
|
||||
|
||||
class SqliteCDR : public BaseCDR {
|
||||
public:
|
||||
SqliteCDR();
|
||||
SqliteCDR(switch_mod_cdr_newchannel_t *newchannel);
|
||||
//SqliteCDR(const SqliteCDR& copyFrom);
|
||||
virtual ~SqliteCDR();
|
||||
virtual bool process_record();
|
||||
virtual void connect(switch_xml_t& cfg, switch_xml_t& xml, switch_xml_t& settings, switch_xml_t& param);
|
||||
virtual void disconnect();
|
||||
virtual bool is_activated();
|
||||
virtual void tempdump_record();
|
||||
virtual void reread_tempdumped_records();
|
||||
virtual std::string get_display_name();
|
||||
class SqliteCDR:public BaseCDR {
|
||||
public:
|
||||
SqliteCDR();
|
||||
SqliteCDR(switch_mod_cdr_newchannel_t * newchannel);
|
||||
//SqliteCDR(const SqliteCDR& copyFrom);
|
||||
virtual ~ SqliteCDR();
|
||||
virtual bool process_record();
|
||||
virtual void connect(switch_xml_t & cfg, switch_xml_t & xml, switch_xml_t & settings, switch_xml_t & param);
|
||||
virtual void disconnect();
|
||||
virtual bool is_activated();
|
||||
virtual void tempdump_record();
|
||||
virtual void reread_tempdumped_records();
|
||||
virtual std::string get_display_name();
|
||||
|
||||
private:
|
||||
static bool activated;
|
||||
static char sql_query[1024];
|
||||
static std::string tmp_sql_query; // Object must exist to bind the statement, this used for generating the sql
|
||||
static char sql_query_chanvars[100];
|
||||
static std::string db_filename;
|
||||
static bool use_utc_time;
|
||||
switch_time_t sqlite_callstartdate;
|
||||
switch_time_t sqlite_callanswerdate;
|
||||
switch_time_t sqlite_calltransferdate;
|
||||
switch_time_t sqlite_callenddate;
|
||||
static switch_core_db_t *db;
|
||||
static switch_core_db_stmt_t *stmt;
|
||||
static switch_core_db_stmt_t *stmt_chanvars;
|
||||
static switch_core_db_stmt_t *stmt_begin;
|
||||
static switch_core_db_stmt_t *stmt_commit;
|
||||
static bool connectionstate;
|
||||
static bool logchanvars;
|
||||
static std::list<std::string> chanvars_fixed_list;
|
||||
static std::vector<switch_mod_cdr_sql_types_t> chanvars_fixed_types;
|
||||
static std::list<std::string> chanvars_supp_list; // The supplemental list
|
||||
static bool repeat_fixed_in_supp;
|
||||
static std::string display_name;
|
||||
private:
|
||||
static bool activated;
|
||||
static char sql_query[1024];
|
||||
static std::string tmp_sql_query; // Object must exist to bind the statement, this used for generating the sql
|
||||
static char sql_query_chanvars[100];
|
||||
static std::string db_filename;
|
||||
static bool use_utc_time;
|
||||
switch_time_t sqlite_callstartdate;
|
||||
switch_time_t sqlite_callanswerdate;
|
||||
switch_time_t sqlite_calltransferdate;
|
||||
switch_time_t sqlite_callenddate;
|
||||
static switch_core_db_t *db;
|
||||
static switch_core_db_stmt_t *stmt;
|
||||
static switch_core_db_stmt_t *stmt_chanvars;
|
||||
static switch_core_db_stmt_t *stmt_begin;
|
||||
static switch_core_db_stmt_t *stmt_commit;
|
||||
static bool connectionstate;
|
||||
static bool logchanvars;
|
||||
static std::list < std::string > chanvars_fixed_list;
|
||||
static std::vector < switch_mod_cdr_sql_types_t > chanvars_fixed_types;
|
||||
static std::list < std::string > chanvars_supp_list; // The supplemental list
|
||||
static bool repeat_fixed_in_supp;
|
||||
static std::string display_name;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -43,34 +43,34 @@
|
||||
#ifndef XMLCDR
|
||||
#define XMLCDR
|
||||
|
||||
class XmlCDR : public BaseCDR {
|
||||
public:
|
||||
XmlCDR();
|
||||
XmlCDR(switch_mod_cdr_newchannel_t *newchannel);
|
||||
virtual ~XmlCDR();
|
||||
virtual bool process_record();
|
||||
virtual void connect(switch_xml_t& cfg, switch_xml_t& xml, switch_xml_t& settings, switch_xml_t& param); // connect and disconnect need to be static because we're persisting connections until shutdown
|
||||
virtual void disconnect();
|
||||
virtual bool is_activated();
|
||||
virtual void tempdump_record();
|
||||
virtual void reread_tempdumped_records();
|
||||
virtual std::string get_display_name();
|
||||
class XmlCDR:public BaseCDR {
|
||||
public:
|
||||
XmlCDR();
|
||||
XmlCDR(switch_mod_cdr_newchannel_t * newchannel);
|
||||
virtual ~ XmlCDR();
|
||||
virtual bool process_record();
|
||||
virtual void connect(switch_xml_t & cfg, switch_xml_t & xml, switch_xml_t & settings, switch_xml_t & param); // connect and disconnect need to be static because we're persisting connections until shutdown
|
||||
virtual void disconnect();
|
||||
virtual bool is_activated();
|
||||
virtual void tempdump_record();
|
||||
virtual void reread_tempdumped_records();
|
||||
virtual std::string get_display_name();
|
||||
|
||||
private:
|
||||
static bool activated; // Is this module activated?
|
||||
static bool connectionstate; // What is the status of the connection?
|
||||
static bool logchanvars;
|
||||
static modcdr_time_convert_t convert_time;
|
||||
static std::string outputfile_path; // The directory we'll dump these into
|
||||
static std::list<std::string> chanvars_fixed_list; // Normally this would be used, but not in this class
|
||||
static std::list<std::string> chanvars_supp_list; // This will hold the list for all chanvars here
|
||||
static std::string display_name;
|
||||
char formattedcallstartdate[100];
|
||||
char formattedcallanswerdate[100];
|
||||
char formattedcalltransferdate[100];
|
||||
char formattedcallenddate[100];
|
||||
std::string outputfile_name;
|
||||
std::ofstream outputfile;
|
||||
private:
|
||||
static bool activated; // Is this module activated?
|
||||
static bool connectionstate; // What is the status of the connection?
|
||||
static bool logchanvars;
|
||||
static modcdr_time_convert_t convert_time;
|
||||
static std::string outputfile_path; // The directory we'll dump these into
|
||||
static std::list < std::string > chanvars_fixed_list; // Normally this would be used, but not in this class
|
||||
static std::list < std::string > chanvars_supp_list; // This will hold the list for all chanvars here
|
||||
static std::string display_name;
|
||||
char formattedcallstartdate[100];
|
||||
char formattedcallanswerdate[100];
|
||||
char formattedcalltransferdate[100];
|
||||
char formattedcallenddate[100];
|
||||
std::string outputfile_name;
|
||||
std::ofstream outputfile;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user