FS-8999: Fixed broken Erlang outbound connection

This commit is contained in:
Sergey Safarov 2016-03-31 19:14:44 +03:00
parent 00a3fe4d7c
commit 5e912b04a6
1 changed files with 2 additions and 4 deletions

View File

@ -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];