]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8999: Fixed broken Erlang outbound connection
authorSergey Safarov <s.safarov@gmail.com>
Thu, 31 Mar 2016 16:14:44 +0000 (19:14 +0300)
committerSergey Safarov <s.safarov@gmail.com>
Thu, 31 Mar 2016 16:45:21 +0000 (19:45 +0300)
src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c

index 2196cadfc77b6a350303ef7960d6f9d5ca251872..4bbe05a4dd220eaca9ebf84eaad7244b6041364b 100644 (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];