[asterisk-commits] qwell: trunk r41789 - /trunk/channels/chan_skinny.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Sep 1 18:39:42 MST 2006


Author: qwell
Date: Fri Sep  1 20:39:42 2006
New Revision: 41789

URL: http://svn.digium.com/view/asterisk?rev=41789&view=rev
Log:
fix some module loader breakage

Modified:
    trunk/channels/chan_skinny.c

Modified: trunk/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_skinny.c?rev=41789&r1=41788&r2=41789&view=diff
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Fri Sep  1 20:39:42 2006
@@ -4196,7 +4196,7 @@
 	/* We *must* have a config file otherwise stop immediately */
 	if (!cfg) {
 		ast_log(LOG_NOTICE, "Unable to load config %s, Skinny disabled\n", config);
-		return 0;
+		return -1;
 	}
 	memset(&bindaddr, 0, sizeof(bindaddr));
 
@@ -4331,7 +4331,7 @@
 	}
 	ast_mutex_unlock(&netlock);
 	ast_config_destroy(cfg);
-	return 0;
+	return 1;
 }
 
 static void delete_devices(void)
@@ -4391,9 +4391,16 @@
 	}
 	/* load and parse config */
 	res = reload_config();
-	if(!res) {
+	if (res == -1) {
 		return AST_MODULE_LOAD_DECLINE;
 	}
+
+	/* Make sure we can register our skinny channel type */
+	if (ast_channel_register(&skinny_tech)) {
+		ast_log(LOG_ERROR, "Unable to register channel class 'Skinny'\n");
+		return -1;
+	}
+
 	ast_rtp_proto_register(&skinny_rtp);
 	ast_cli_register(&cli_show_devices);
 	ast_cli_register(&cli_show_lines);
@@ -4411,14 +4418,6 @@
 	/* And start the monitor for the first time */
 	restart_monitor();
 
-	/* Announce our presence to Asterisk */
-	if (!res) {
-		/* Make sure we can register our skinny channel type */
-		if (ast_channel_register(&skinny_tech)) {
-			ast_log(LOG_ERROR, "Unable to register channel class 'Skinny'\n");
-			return -1;
-		}
-	}
 	return res;
 }
 



More information about the asterisk-commits mailing list