From: Russell Bryant Date: Fri, 4 Mar 2011 17:40:02 +0000 (+0000) Subject: Fix a buglet that prevented chan_nbs from loading (and subsequently stopped Asterisk). X-Git-Tag: 11.0.0-beta1~1805 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1ba13c1eaca5ea87d748a34ab22781716ebc06b;p=thirdparty%2Fasterisk.git Fix a buglet that prevented chan_nbs from loading (and subsequently stopped Asterisk). In passing, convert the return codes to be the proper AST_MODULE_LOAD_* constants. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309491 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_nbs.c b/channels/chan_nbs.c index 1cd3d75fb3..fdfbd8eb3a 100644 --- a/channels/chan_nbs.c +++ b/channels/chan_nbs.c @@ -280,16 +280,16 @@ static int unload_module(void) static int load_module(void) { ast_format_set(&prefformat, AST_FORMAT_SLINEAR, 0); - if (!(nbs_tech.capabilities == ast_format_cap_alloc())) { - return -1; + if (!(nbs_tech.capabilities = ast_format_cap_alloc())) { + return AST_MODULE_LOAD_FAILURE; } ast_format_cap_add(nbs_tech.capabilities, &prefformat); /* Make sure we can register our channel type */ if (ast_channel_register(&nbs_tech)) { ast_log(LOG_ERROR, "Unable to register channel class %s\n", type); - return -1; + return AST_MODULE_LOAD_DECLINE; } - return 0; + return AST_MODULE_LOAD_SUCCESS; } AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Network Broadcast Sound Support");