mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 03:08:45 +00:00
Merge "cdr_mysql: Don't clean up on unload unless we can unregister from CDRs"
This commit is contained in:
@@ -382,6 +382,13 @@ static int my_unload_module(int reload)
|
|||||||
{
|
{
|
||||||
struct column *entry;
|
struct column *entry;
|
||||||
|
|
||||||
|
if (!reload) {
|
||||||
|
if (ast_cdr_unregister(name)) {
|
||||||
|
/* If we can't unregister the backend, we can't unload the module */
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ast_cli_unregister_multiple(cdr_mysql_status_cli, sizeof(cdr_mysql_status_cli) / sizeof(struct ast_cli_entry));
|
ast_cli_unregister_multiple(cdr_mysql_status_cli, sizeof(cdr_mysql_status_cli) / sizeof(struct ast_cli_entry));
|
||||||
|
|
||||||
if (connected) {
|
if (connected) {
|
||||||
@@ -406,7 +413,8 @@ static int my_unload_module(int reload)
|
|||||||
if (reload) {
|
if (reload) {
|
||||||
return ast_cdr_backend_suspend(name);
|
return ast_cdr_backend_suspend(name);
|
||||||
} else {
|
} else {
|
||||||
return ast_cdr_unregister(name);
|
/* We unregistered earlier */
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user