提交 8d965c32 authored 作者: Anthony Minessale's avatar Anthony Minessale

FSCORE-297 FSCORE-305 FSCORE-315

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12392 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 790f2c9b
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<!-- The port where you want to run the http service (default 8080) --> <!-- The port where you want to run the http service (default 8080) -->
<param name="http-port" value="8080"/> <param name="http-port" value="8080"/>
<!-- if all 3 of the following params exist all http traffic will require auth --> <!-- if all 3 of the following params exist all http traffic will require auth -->
<param name="auth-realm" value="freeswitch"/> <!-- <param name="auth-realm" value="freeswitch"/> -->
<param name="auth-user" value="freeswitch"/> <!-- <param name="auth-user" value="freeswitch"/> -->
<param name="auth-pass" value="works"/> <!-- <param name="auth-pass" value="works"/> -->
</settings> </settings>
</configuration> </configuration>
# This file was automatically generated by SWIG (http://www.swig.org). # This file was created automatically by SWIG 1.3.29.
# Version 1.3.35
#
# Don't modify this file, modify the SWIG interface instead. # Don't modify this file, modify the SWIG interface instead.
package ESL; package ESL;
require Exporter; require Exporter;
require DynaLoader; require DynaLoader;
......
差异被折叠。
...@@ -93,9 +93,9 @@ static void add_route(char *service, char *regex, char *replace) ...@@ -93,9 +93,9 @@ static void add_route(char *service, char *regex, char *replace)
route = switch_core_alloc(globals.pool, sizeof(*route)); route = switch_core_alloc(globals.pool, sizeof(*route));
route->service = strdup(service); route->service = switch_core_strdup(globals.pool, service);
route->regex = strdup(regex); route->regex = switch_core_strdup(globals.pool, regex);
route->replace = strdup(replace); route->replace = switch_core_strdup(globals.pool, replace);
switch_mutex_lock(MUTEX); switch_mutex_lock(MUTEX);
if (!globals.route_order) { if (!globals.route_order) {
......
...@@ -2964,12 +2964,12 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sofia_shutdown) ...@@ -2964,12 +2964,12 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sofia_shutdown)
while (mod_sofia_globals.threads) { while (mod_sofia_globals.threads) {
switch_cond_next(); switch_cond_next();
if (++sanity >= 10000) { if (++sanity >= 60000) {
break; break;
} }
} }
switch_yield(1000000); //switch_yield(1000000);
su_deinit(); su_deinit();
switch_mutex_lock(mod_sofia_globals.hash_mutex); switch_mutex_lock(mod_sofia_globals.hash_mutex);
......
...@@ -662,7 +662,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread ...@@ -662,7 +662,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
return NULL; return NULL;
} }
void launch_sofia_worker_thread(sofia_profile_t *profile) switch_thread_t *launch_sofia_worker_thread(sofia_profile_t *profile)
{ {
switch_thread_t *thread; switch_thread_t *thread;
switch_threadattr_t *thd_attr = NULL; switch_threadattr_t *thd_attr = NULL;
...@@ -680,6 +680,8 @@ void launch_sofia_worker_thread(sofia_profile_t *profile) ...@@ -680,6 +680,8 @@ void launch_sofia_worker_thread(sofia_profile_t *profile)
break; break;
} }
} }
return thread;
} }
void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void *obj) void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void *obj)
...@@ -693,6 +695,8 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void ...@@ -693,6 +695,8 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
int use_timer = !sofia_test_pflag(profile, PFLAG_DISABLE_TIMER); int use_timer = !sofia_test_pflag(profile, PFLAG_DISABLE_TIMER);
const char *supported = NULL; const char *supported = NULL;
int sanity; int sanity;
switch_thread_t *worker_thread;
switch_status_t st;
switch_mutex_lock(mod_sofia_globals.mutex); switch_mutex_lock(mod_sofia_globals.mutex);
mod_sofia_globals.threads++; mod_sofia_globals.threads++;
...@@ -823,7 +827,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void ...@@ -823,7 +827,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
profile->started = switch_epoch_time_now(NULL); profile->started = switch_epoch_time_now(NULL);
sofia_set_pflag_locked(profile, PFLAG_RUNNING); sofia_set_pflag_locked(profile, PFLAG_RUNNING);
launch_sofia_worker_thread(profile); worker_thread = launch_sofia_worker_thread(profile);
switch_yield(1000000); switch_yield(1000000);
...@@ -850,15 +854,11 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void ...@@ -850,15 +854,11 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
sofia_reg_unregister(profile); sofia_reg_unregister(profile);
nua_shutdown(profile->nua); nua_shutdown(profile->nua);
su_root_run(profile->s_root); su_root_run(profile->s_root);
nua_shutdown(profile->nua);
su_root_run(profile->s_root);
sofia_clear_pflag_locked(profile, PFLAG_RUNNING); sofia_clear_pflag_locked(profile, PFLAG_RUNNING);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Waiting for worker thread\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Waiting for worker thread\n");
while (sofia_test_pflag(profile, PFLAG_WORKER_RUNNING)) { switch_thread_join(&st, worker_thread);
switch_yield(100000);
}
sanity = 4; sanity = 4;
while (profile->inuse) { while (profile->inuse) {
...@@ -3243,10 +3243,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, ...@@ -3243,10 +3243,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
case nua_callstate_terminating: case nua_callstate_terminating:
if (status == 488 || switch_channel_get_state(channel) == CS_HIBERNATE) { if (status == 488 || switch_channel_get_state(channel) == CS_HIBERNATE) {
tech_pvt->q850_cause = SWITCH_CAUSE_MANDATORY_IE_MISSING; tech_pvt->q850_cause = SWITCH_CAUSE_MANDATORY_IE_MISSING;
} else if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
sofia_set_flag_locked(tech_pvt, TFLAG_BYE);
} }
break;
case nua_callstate_terminated: case nua_callstate_terminated:
if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) { if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
sofia_set_flag_locked(tech_pvt, TFLAG_BYE); sofia_set_flag_locked(tech_pvt, TFLAG_BYE);
...@@ -3274,17 +3271,17 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, ...@@ -3274,17 +3271,17 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
switch_channel_hangup(channel, cause); switch_channel_hangup(channel, cause);
} }
} }
if (ss_state == nua_callstate_terminated) {
if (tech_pvt->sofia_private) { if (tech_pvt->sofia_private) {
tech_pvt->sofia_private = NULL; tech_pvt->sofia_private = NULL;
} }
tech_pvt->nh = NULL; tech_pvt->nh = NULL;
if (nh) {
if (nh) { nua_handle_bind(nh, NULL);
nua_handle_bind(nh, NULL); nua_handle_destroy(nh);
nua_handle_destroy(nh); }
} }
break; break;
} }
......
...@@ -249,6 +249,20 @@ SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname) ...@@ -249,6 +249,20 @@ SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
return val; return val;
} }
static void switch_core_unset_variables(void)
{
switch_hash_index_t *hi;
const void *var;
void *val;
switch_mutex_lock(runtime.global_var_mutex);
for (hi = switch_hash_first(NULL, runtime.global_vars); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &var, NULL, &val);
free(val);
}
switch_mutex_unlock(runtime.global_var_mutex);
}
SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *value) SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *value)
{ {
char *val; char *val;
...@@ -1488,6 +1502,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void) ...@@ -1488,6 +1502,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Finalizing Shutdown.\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Finalizing Shutdown.\n");
switch_log_shutdown(); switch_log_shutdown();
switch_core_unset_variables();
switch_core_memory_stop(); switch_core_memory_stop();
if (runtime.console && runtime.console != stdout && runtime.console != stderr) { if (runtime.console && runtime.console != stdout && runtime.console != stderr) {
......
...@@ -409,7 +409,26 @@ SWITCH_DECLARE(void) switch_rtp_get_random(void *buf, uint32_t len) ...@@ -409,7 +409,26 @@ SWITCH_DECLARE(void) switch_rtp_get_random(void *buf, uint32_t len)
SWITCH_DECLARE(void) switch_rtp_shutdown(void) SWITCH_DECLARE(void) switch_rtp_shutdown(void)
{ {
switch_core_port_allocator_t *alloc = NULL;
switch_hash_index_t *hi;
const void *var;
void *val;
switch_mutex_lock(port_lock);
for (hi = switch_hash_first(NULL, alloc_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &var, NULL, &val);
if ((alloc = (switch_core_port_allocator_t *) val)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroy port allocator for %s\n", (char *)var);
switch_core_port_allocator_destroy(&alloc);
}
}
switch_core_hash_destroy(&alloc_hash); switch_core_hash_destroy(&alloc_hash);
switch_mutex_unlock(port_lock);
crypto_kernel_shutdown();
} }
SWITCH_DECLARE(switch_port_t) switch_rtp_set_start_port(switch_port_t port) SWITCH_DECLARE(switch_port_t) switch_rtp_set_start_port(switch_port_t port)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论