@ -57,6 +57,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static int usegmtime = 0 ;
static int usegmtime = 0 ;
static int loguniqueid = 0 ;
static int loguniqueid = 0 ;
static int loguserfield = 0 ;
static int loguserfield = 0 ;
static int loaded = 0 ;
static char * config = " cdr.conf " ;
static char * config = " cdr.conf " ;
/* #define CSV_LOGUNIQUEID 1 */
/* #define CSV_LOGUNIQUEID 1 */
@ -324,6 +325,7 @@ static int csv_log(struct ast_cdr *cdr)
static int unload_module ( void )
static int unload_module ( void )
{
{
ast_cdr_unregister ( name ) ;
ast_cdr_unregister ( name ) ;
loaded = 0 ;
return 0 ;
return 0 ;
}
}
@ -337,13 +339,21 @@ static int load_module(void)
res = ast_cdr_register ( name , ast_module_info - > description , csv_log ) ;
res = ast_cdr_register ( name , ast_module_info - > description , csv_log ) ;
if ( res ) {
if ( res ) {
ast_log ( LOG_ERROR , " Unable to register CSV CDR handling \n " ) ;
ast_log ( LOG_ERROR , " Unable to register CSV CDR handling \n " ) ;
} else {
loaded = 1 ;
}
}
return res ;
return res ;
}
}
static int reload ( void )
static int reload ( void )
{
{
load_config ( ) ;
if ( load_config ( ) ) {
loaded = 1 ;
} else {
loaded = 0 ;
ast_log ( LOG_WARNING , " No [csv] section in cdr.conf. Unregistering backend. \n " ) ;
ast_cdr_unregister ( name ) ;
}
return 0 ;
return 0 ;
}
}