|
Asterisk - The Open Source Telephony Project GIT-master-80b953f
|
Protected header for the CDR and CEL Custom Backends. More...

Go to the source code of this file.
Enumerations | |
| enum | cdrel_backend_type { cdrel_backend_text = 0 , cdrel_backend_db , cdrel_backend_type_end } |
| enum | cdrel_record_type { cdrel_record_cdr = 0 , cdrel_record_cel , cdrel_record_type_end } |
Functions | |
| AST_VECTOR (cdrel_configs, struct cdrel_config *) | |
| struct cdrel_configs * | cdrel_load_module (enum cdrel_backend_type backend_type, enum cdrel_record_type record_type, const char *config_filename, const char *backend_name, void *logging_cb) |
| Perform initial module load. | |
| int | cdrel_logger (struct cdrel_configs *configs, void *data) |
| Log a record. The module's logging_cb must call this. | |
| int | cdrel_reload_module (enum cdrel_backend_type backend_type, enum cdrel_record_type record_type, struct cdrel_configs **configs, const char *config_filename) |
| Perform module reload. | |
| int | cdrel_unload_module (enum cdrel_backend_type backend_type, enum cdrel_record_type record_type, struct cdrel_configs *configs, const char *backend_name) |
| Perform module unload. | |
Protected header for the CDR and CEL Custom Backends.
Definition in file res_cdrel_custom.h.
| enum cdrel_backend_type |
| Enumerator | |
|---|---|
| cdrel_backend_text | Text file: DSV or JSON |
| cdrel_backend_db | Database (currently only sqlite3) |
| cdrel_backend_type_end | Sentinel |
Definition at line 33 of file res_cdrel_custom.h.
| enum cdrel_record_type |
| Enumerator | |
|---|---|
| cdrel_record_cdr | Call Detail Records |
| cdrel_record_cel | Channel Event Log records |
| cdrel_record_type_end | Sentinel |
Definition at line 40 of file res_cdrel_custom.h.
| AST_VECTOR | ( | cdrel_configs | , |
| struct cdrel_config * | |||
| ) |
| struct cdrel_configs * cdrel_load_module | ( | enum cdrel_backend_type | backend_type, |
| enum cdrel_record_type | record_type, | ||
| const char * | config_filename, | ||
| const char * | backend_name, | ||
| void * | logging_cb | ||
| ) |
Perform initial module load.
Needs to be called by each "custom" module
| backend_type | One of cdrel_backend_type. |
| record_type | One of cdrel_record_type. |
| config_filename | The config file name. |
| backend_name | The name to register the backend as. |
| logging_cb | The logging callback to register with CDR or CEL. |
Definition at line 1431 of file res/cdrel_custom/config.c.
References ast_calloc, ast_debug, AST_VECTOR_INIT, cdrel_unload_module(), load_config_file(), MODULE_TYPE_STR, NULL, RECORD_TYPE_STR, and register_backend().
Referenced by load_module(), load_module(), load_module(), and load_module().
| int cdrel_logger | ( | struct cdrel_configs * | configs, |
| void * | data | ||
| ) |
Log a record. The module's logging_cb must call this.
| configs | A pointer to the VECTOR of config objects returned by cdrel_load_module. |
| data | A pointer to an ast_cdr or ast_event object to log. |
| 0 | Success. |
| -1 | Failure. |
Definition at line 270 of file loggers.c.
References ast_channel_unref, ast_log, AST_VECTOR_GET, AST_VECTOR_SIZE, cdrel_config_legacy, config, dummy(), LOG_ERROR, logger_callbacks, and NULL.
Referenced by custom_log(), custom_log(), custom_log(), and custom_log().
| int cdrel_reload_module | ( | enum cdrel_backend_type | backend_type, |
| enum cdrel_record_type | record_type, | ||
| struct cdrel_configs ** | configs, | ||
| const char * | config_filename | ||
| ) |
Perform module reload.
Needs to be called by each "custom" module
| backend_type | One of cdrel_backend_type. |
| record_type | One of cdrel_record_type. |
| configs | A pointer to the VECTOR of config objects returned by cdrel_load_module. |
| config_filename | The config file name. |
| AST_MODULE_LOAD_SUCCESS | |
| AST_MODULE_LOAD_DECLINE |
Definition at line 1391 of file res/cdrel_custom/config.c.
References ast_malloc, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_VECTOR_INIT, AST_VECTOR_PTR_FREE, AST_VECTOR_RESET, AST_VECTOR_SIZE, config_free(), load_config_file(), and NULL.
| int cdrel_unload_module | ( | enum cdrel_backend_type | backend_type, |
| enum cdrel_record_type | record_type, | ||
| struct cdrel_configs * | configs, | ||
| const char * | backend_name | ||
| ) |
Perform module unload.
Needs to be called by each "custom" module
| backend_type | One of cdrel_backend_type. |
| record_type | One of cdrel_record_type. |
| configs | A pointer to the VECTOR of config objects returned by cdrel_load_module. |
| backend_name | The backend name to unregister. |
| 0 | Success. |
| -1 | Failure. |
Definition at line 1459 of file res/cdrel_custom/config.c.
References AST_VECTOR_PTR_FREE, AST_VECTOR_RESET, config_free(), and unregister_backend().
Referenced by cdrel_load_module(), unload_module(), unload_module(), unload_module(), and unload_module().