From 5e912b04a6ab5a3e5643c27c68dc399821072cb1 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Thu, 31 Mar 2016 19:14:44 +0300 Subject: [PATCH] FS-8999: Fixed broken Erlang outbound connection --- src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 2196cadfc7..4bbe05a4dd 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 @@ -1517,8 +1517,6 @@ session_elem_t *attach_call_to_spawned_process(listener_t *listener, char *modul char hash[100]; spawn_reply_t *p; erlang_ref ref; - switch_os_socket_t sockdes; - switch_os_sock_get(&sockdes, listen_list.sock); ei_init_ref(listener->ec, &ref); ei_hash_ref(&ref, hash); @@ -1554,7 +1552,7 @@ session_elem_t *attach_call_to_spawned_process(listener_t *listener, char *modul ei_x_encode_ref(&rbuf, &ref); ei_x_encode_pid(&rbuf, ei_self(listener->ec)); /* should lock with mutex? */ - ei_reg_send(listener->ec, sockdes, module, rbuf.buff, rbuf.index); + ei_reg_send(listener->ec, listener->sockdes, module, rbuf.buff, rbuf.index); #ifdef EI_DEBUG ei_x_print_reg_msg(&rbuf, module, 1); #endif @@ -1563,7 +1561,7 @@ session_elem_t *attach_call_to_spawned_process(listener_t *listener, char *modul switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "rpc call: %s:%s(Ref)\n", module, function); /* should lock with mutex? */ switch_mutex_lock(listener->sock_mutex); - ei_pid_from_rpc(listener->ec, sockdes, &ref, module, function); + ei_pid_from_rpc(listener->ec, listener->sockdes, &ref, module, function); switch_mutex_unlock(listener->sock_mutex); /* char *argv[1];