Cleanup unload calls

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-12-09 23:55:17 +00:00
parent 23cfe10d94
commit 2f69b332d8
8 changed files with 390 additions and 360 deletions

View File

@@ -252,27 +252,30 @@ static struct ast_channel *nbs_request(char *type, int format, void *data)
return tmp;
}
static int __unload_module(void)
{
/* First, take us out of the channel loop */
ast_channel_unregister(type);
return 0;
}
int unload_module(void)
{
return __unload_module();
}
int load_module()
{
/* Make sure we can register our Adtranphone channel type */
if (ast_channel_register(type, tdesc,
AST_FORMAT_SLINEAR, nbs_request)) {
ast_log(LOG_ERROR, "Unable to register channel class %s\n", type);
unload_module();
__unload_module();
return -1;
}
return 0;
}
int unload_module()
{
/* First, take us out of the channel loop */
ast_channel_unregister(type);
return 0;
}
int usecount()
{
int res;