From: Anthony Minessale Date: Mon, 7 May 2012 16:42:58 +0000 (-0500) Subject: FS-4142 --resolve X-Git-Tag: v1.2-rc1~17^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bafba4a9913def16153fc05dac5abb220d08cc85;p=thirdparty%2Ffreeswitch.git FS-4142 --resolve --- diff --git a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c index 243303d9cd..509aec7da4 100644 --- a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c +++ b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c @@ -314,8 +314,6 @@ static void destroy_session_elem(session_elem_t *session_element) switch_channel_clear_flag(switch_core_session_get_channel(session), CF_CONTROLLED); switch_core_session_rwunlock(session); } - /* this allows the application threads to exit */ - switch_clear_flag_locked(session_element, LFLAG_SESSION_ALIVE); switch_core_destroy_memory_pool(&session_element->pool); /*switch_safe_free(s); */ } @@ -1285,7 +1283,6 @@ session_elem_t *attach_call_to_registered_process(listener_t *listener, char *re session_element->process.type = ERLANG_REG_PROCESS; session_element->process.reg_name = switch_core_session_strdup(session, reg_name); - switch_set_flag(session_element, LFLAG_SESSION_ALIVE); /* attach the session to the listener */ add_session_elem_to_listener(listener, session_element); @@ -1299,7 +1296,6 @@ session_elem_t *attach_call_to_pid(listener_t *listener, erlang_pid * pid, switc session_element->process.type = ERLANG_PID; memcpy(&session_element->process.pid, pid, sizeof(erlang_pid)); - switch_set_flag(session_element, LFLAG_SESSION_ALIVE); /* attach the session to the listener */ add_session_elem_to_listener(listener, session_element); ei_link(listener, ei_self(listener->ec), pid); @@ -1381,7 +1377,6 @@ session_elem_t *attach_call_to_spawned_process(listener_t *listener, char *modul memcpy(&session_element->process.pid, p->pid, sizeof(erlang_pid)); session_element->spawn_reply = NULL; - switch_set_flag(session_element, LFLAG_SESSION_ALIVE); switch_clear_flag(session_element, LFLAG_OUTBOUND_INIT); switch_clear_flag(session_element, LFLAG_WAITING_FOR_PID); @@ -1487,19 +1482,9 @@ SWITCH_STANDARD_APP(erlang_outbound_function) } if (session_element) { - switch_ivr_park(session, NULL); - - /* keep app thread running for lifetime of session */ - if (switch_channel_down(switch_core_session_get_channel(session))) { - if ((session_element = switch_channel_get_private(switch_core_session_get_channel(session), "_erlang_session_"))) { - switch_log_printf(SWITCH_CHANNEL_UUID_LOG(uuid), SWITCH_LOG_DEBUG, "outbound session all done\n"); - switch_clear_flag_locked(session_element, LFLAG_SESSION_ALIVE); - } else { - switch_log_printf(SWITCH_CHANNEL_UUID_LOG(uuid), SWITCH_LOG_DEBUG, "outbound session already done\n"); - } - } } + } switch_log_printf(SWITCH_CHANNEL_UUID_LOG(uuid), SWITCH_LOG_DEBUG, "exit erlang_outbound_function\n"); } diff --git a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h index b6adcdafe5..1721d496fb 100644 --- a/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h +++ b/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h @@ -35,8 +35,7 @@ typedef enum { LFLAG_WAITING_FOR_PID = (1 << 0), /* waiting for a node to return a pid */ LFLAG_OUTBOUND_INIT = (1 << 1), /* Erlang peer has been notified of this session */ - LFLAG_SESSION_ALIVE = (1 << 2), - LFLAG_SESSION_COMPLETE = (1 << 3), + LFLAG_SESSION_COMPLETE = (1 << 2), } session_flag_t; typedef enum {