[asterisk-commits] pabelanger: branch 1.4 r286114 - /branches/1.4/channels/chan_iax2.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Sep 10 15:35:12 CDT 2010
Author: pabelanger
Date: Fri Sep 10 15:35:08 2010
New Revision: 286114
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=286114
Log:
Load iax.conf before registering any functions/applications/actions.
Review: https://reviewboard.asterisk.org/r/914/
Modified:
branches/1.4/channels/chan_iax2.c
Modified: branches/1.4/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=286114&r1=286113&r2=286114
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Fri Sep 10 15:35:08 2010
@@ -12713,13 +12713,6 @@
return AST_MODULE_LOAD_FAILURE;
}
- randomcalltokendata = ast_random();
- ast_custom_function_register(&iaxpeer_function);
-
- iax_set_output(iax_debug_output);
- iax_set_error(iax_error_output);
- jb_setoutput(jb_error_output, jb_warning_output, NULL);
-
#ifdef HAVE_DAHDI
#ifdef DAHDI_TIMERACK
timingfd = open(DAHDI_FILE_TIMER, O_RDWR);
@@ -12735,12 +12728,12 @@
for (x = 0; x < ARRAY_LEN(iaxsl); x++) {
ast_mutex_init(&iaxsl[x]);
}
-
+
ast_cond_init(&sched_cond, NULL);
io = io_context_create();
sched = sched_context_create();
-
+
if (!io || !sched) {
ast_log(LOG_ERROR, "Out of memory\n");
return -1;
@@ -12760,33 +12753,44 @@
}
ast_netsock_init(outsock);
+ randomcalltokendata = ast_random();
+
+ iax_set_output(iax_debug_output);
+ iax_set_error(iax_error_output);
+ jb_setoutput(jb_error_output, jb_warning_output, NULL);
+
ast_mutex_init(&waresl.lock);
AST_LIST_HEAD_INIT(&iaxq.queue);
-
+
+ if (set_config(config, 0) == -1) {
+ return AST_MODULE_LOAD_DECLINE;
+ }
+
ast_cli_register_multiple(cli_iax2, sizeof(cli_iax2) / sizeof(struct ast_cli_entry));
ast_register_application(papp, iax2_prov_app, psyn, pdescrip);
-
+
+ ast_custom_function_register(&iaxpeer_function);
+
ast_manager_register( "IAXpeers", 0, manager_iax2_show_peers, "List IAX Peers" );
ast_manager_register( "IAXnetstats", 0, manager_iax2_show_netstats, "Show IAX Netstats" );
- if(set_config(config, 0) == -1)
- return AST_MODULE_LOAD_DECLINE;
-
- if (ast_channel_register(&iax2_tech)) {
+ if (ast_channel_register(&iax2_tech)) {
ast_log(LOG_ERROR, "Unable to register channel class %s\n", "IAX2");
__unload_module();
return -1;
}
- if (ast_register_switch(&iax2_switch))
+ if (ast_register_switch(&iax2_switch)) {
ast_log(LOG_ERROR, "Unable to register IAX switch\n");
+ }
res = start_network_thread();
if (!res) {
- if (option_verbose > 1)
+ if (option_verbose > 1) {
ast_verbose(VERBOSE_PREFIX_2 "IAX Ready and Listening\n");
+ }
} else {
ast_log(LOG_ERROR, "Unable to start network thread\n");
ast_netsock_release(netsock);
More information about the asterisk-commits
mailing list