mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	cdr_mysql: Don't clean up on unload unless we can unregister from CDRs
ASTERISK-28566 #close Change-Id: I6daa4e5128e9406d04d3aed670c3bae98d38d40c
This commit is contained in:
		| @@ -382,6 +382,13 @@ static int my_unload_module(int reload) | ||||
| { | ||||
| 	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)); | ||||
|  | ||||
| 	if (connected) { | ||||
| @@ -406,7 +413,8 @@ static int my_unload_module(int reload) | ||||
| 	if (reload) { | ||||
| 		return ast_cdr_backend_suspend(name); | ||||
| 	} else { | ||||
| 		return ast_cdr_unregister(name); | ||||
| 		/* We unregistered earlier */ | ||||
| 		return 0; | ||||
| 	} | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user