]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Deprecate new_pid message in favor of get_pid which has an extra element, the call...
authorAndrew Thompson <andrew@hijacked.us>
Tue, 15 Sep 2009 19:54:23 +0000 (19:54 +0000)
committerAndrew Thompson <andrew@hijacked.us>
Tue, 15 Sep 2009 19:54:23 +0000 (19:54 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14877 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c

index a560ead3ed6e4617f382a18393cab0176a57023e..8dafdc3c4fbd5e25359a9ec5eb6211155762a2c9 100644 (file)
@@ -1203,6 +1203,19 @@ session_elem_t* attach_call_to_spawned_process(listener_t* listener, char *modul
                ei_x_buff rbuf;
                ei_x_new_with_version(&rbuf);
 
+               ei_x_encode_tuple_header(&rbuf, 4);
+               ei_x_encode_atom(&rbuf, "get_pid");
+               _ei_x_encode_string(&rbuf, switch_core_session_get_uuid(session));
+               ei_x_encode_ref(&rbuf, &ref);
+               ei_x_encode_pid(&rbuf, ei_self(listener->ec));
+               /* should lock with mutex? */
+               ei_reg_send(listener->ec, listener->sockfd, module, rbuf.buff, rbuf.index);
+#ifdef EI_DEBUG
+               ei_x_print_reg_msg(&rbuf, module, 1);
+#endif
+               ei_x_free(&rbuf);
+
+               ei_x_new_with_version(&rbuf);
                ei_x_encode_tuple_header(&rbuf, 3);
                ei_x_encode_atom(&rbuf, "new_pid");
                ei_x_encode_ref(&rbuf, &ref);
@@ -1212,6 +1225,7 @@ session_elem_t* attach_call_to_spawned_process(listener_t* listener, char *modul
 #ifdef EI_DEBUG
                ei_x_print_reg_msg(&rbuf, module, 1);
 #endif
+
                ei_x_free(&rbuf);
        } else {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rpc call: %s:%s(Ref)\n", module, function);