Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch

This commit is contained in:
David Yat Sin 2012-04-02 18:00:38 -04:00
commit d730df77e4
7 changed files with 22 additions and 8 deletions

View File

@ -4834,11 +4834,13 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_freetdm_load)
ftdm_global_set_config_directory(SWITCH_GLOBAL_dirs.conf_dir);
if (ftdm_global_init() != FTDM_SUCCESS) {
ftdm_global_destroy();
ftdm_log(FTDM_LOG_ERROR, "Error loading FreeTDM\n");
return SWITCH_STATUS_TERM;
}
if (ftdm_global_configuration() != FTDM_SUCCESS) {
ftdm_global_destroy();
ftdm_log(FTDM_LOG_ERROR, "Error configuring FreeTDM\n");
return SWITCH_STATUS_TERM;
}

View File

@ -5829,6 +5829,8 @@ FT_DECLARE(ftdm_status_t) ftdm_global_destroy(void)
/* destroy signaling and io modules */
ftdm_unload_modules();
ftdm_global_set_logger( NULL );
/* finally destroy the globals */
ftdm_mutex_lock(globals.mutex);
ftdm_sched_destroy(&globals.timingsched);

View File

@ -119,10 +119,15 @@ static void *run_main_schedule(ftdm_thread_t *thread, void *data)
/* there are no free runs, wait a bit and check again (FIXME: use ftdm_interrupt_t for this) */
ftdm_mutex_unlock(sched_globals.mutex);
ftdm_sleep(sleepms);
if (ftdm_running()) {
ftdm_sleep(sleepms);
}
}
for (current = sched_globals.freeruns; current; current = current->next) {
if (!ftdm_running()) {
break;
}
/* first run the schedule */
ftdm_sched_run(current);
@ -142,7 +147,9 @@ static void *run_main_schedule(ftdm_thread_t *thread, void *data)
ftdm_mutex_unlock(sched_globals.mutex);
ftdm_sleep(sleepms);
if (ftdm_running()) {
ftdm_sleep(sleepms);
}
}
ftdm_log(FTDM_LOG_NOTICE, "Main scheduling thread going out ...\n");
sched_globals.running = 0;

View File

@ -87,8 +87,8 @@ void sofia_handle_sip_r_notify(switch_core_session_t *session, int status,
nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip,
sofia_dispatch_event_t *de, tagi_t tags[])
{
#if 0
if (status >= 300 && sip && !sip->sip_retry_after && sip->sip_call_id && (!sofia_private || !sofia_private->is_call)) {
if (status == 481 && sip && !sip->sip_retry_after && sip->sip_call_id && (!sofia_private || !sofia_private->is_call)) {
char *sql;
sql = switch_mprintf("delete from sip_subscriptions where call_id='%q'", sip->sip_call_id->i_id);
@ -96,7 +96,7 @@ void sofia_handle_sip_r_notify(switch_core_session_t *session, int status,
sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
nua_handle_destroy(nh);
}
#endif
}
#define url_set_chanvars(session, url, varprefix) _url_set_chanvars(session, url, #varprefix "_user", #varprefix "_host", #varprefix "_port", #varprefix "_uri", #varprefix "_params")

View File

@ -1380,7 +1380,7 @@ SWITCH_DECLARE(void) switch_channel_wait_for_state(switch_channel_t *channel, sw
for (;;) {
if ((channel->state < CS_HANGUP && channel->state == channel->running_state && channel->running_state == want_state) ||
(other_channel && switch_channel_down_nosig(other_channel)) || switch_channel_down_nosig(channel)) {
(other_channel && switch_channel_down_nosig(other_channel)) || switch_channel_down(channel)) {
break;
}
switch_yield(20000);
@ -1399,6 +1399,8 @@ SWITCH_DECLARE(void) switch_channel_wait_for_state_timeout(switch_channel_t *cha
break;
}
switch_channel_check_signal(channel, SWITCH_TRUE);
switch_cond_next();
if (++count >= timeout) {

View File

@ -1875,6 +1875,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
runtime.runlevel++;
switch_core_set_signal_handlers();
switch_load_network_lists(SWITCH_FALSE);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Bringing up environment.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Loading Modules.\n");
@ -1884,7 +1885,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
return SWITCH_STATUS_GENERR;
}
switch_load_network_lists(SWITCH_FALSE);
switch_load_core_config("post_load_switch.conf");

View File

@ -776,7 +776,7 @@ static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *sessio
state = switch_channel_get_state(other_channel);
running_state = switch_channel_get_running_state(other_channel);
if (switch_channel_down_nosig(other_channel) || switch_channel_down_nosig(channel)) {
if (switch_channel_down_nosig(other_channel) || switch_channel_down(channel)) {
break;
}