|
|
|
|
@ -12713,13 +12713,6 @@ static int load_module(void)
|
|
|
|
|
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 @@ static int load_module(void)
|
|
|
|
|
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 @@ static int load_module(void)
|
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
|