mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-30 05:56:12 +00:00
Add support for 'getpid'; a way to return the fake cnode process id on the FreeSWITCH side
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10389 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
c15841420a
commit
e7a37e580e
@ -63,7 +63,7 @@ struct event_handler {
|
|||||||
|
|
||||||
struct listener {
|
struct listener {
|
||||||
int sockfd;
|
int sockfd;
|
||||||
const struct ei_cnode_s *ec;
|
struct ei_cnode_s *ec;
|
||||||
erlang_pid log_pid;
|
erlang_pid log_pid;
|
||||||
erlang_pid event_pid;
|
erlang_pid event_pid;
|
||||||
switch_queue_t *event_queue;
|
switch_queue_t *event_queue;
|
||||||
@ -884,6 +884,10 @@ sendmsg_fail:
|
|||||||
switch_clear_flag_locked(listener, LFLAG_RUNNING);
|
switch_clear_flag_locked(listener, LFLAG_RUNNING);
|
||||||
ei_x_encode_atom(rbuf, "ok");
|
ei_x_encode_atom(rbuf, "ok");
|
||||||
goto event_done;
|
goto event_done;
|
||||||
|
} else if (!strncmp(atom, "getpid", MAXATOMLEN)) {
|
||||||
|
ei_x_encode_tuple_header(rbuf, 2);
|
||||||
|
ei_x_encode_atom(rbuf, "ok");
|
||||||
|
ei_x_encode_pid(rbuf, ei_self(listener->ec));
|
||||||
} else {
|
} else {
|
||||||
ei_x_encode_tuple_header(rbuf, 2);
|
ei_x_encode_tuple_header(rbuf, 2);
|
||||||
ei_x_encode_atom(rbuf, "error");
|
ei_x_encode_atom(rbuf, "error");
|
||||||
@ -1007,7 +1011,8 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)
|
|||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "erl_unlink\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "erl_unlink\n");
|
||||||
break;
|
break;
|
||||||
case ERL_EXIT :
|
case ERL_EXIT :
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "erl_exit\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "erl_exit from %s <%d.%d.%d>\n", msg.from.node, msg.from.creation, msg.from.num, msg.from.serial);
|
||||||
|
/* TODO - check if this linked pid is any of the log/event handler processes and cleanup if it is. */
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "unexpected msg type %d\n", (int)(msg.msgtype));
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "unexpected msg type %d\n", (int)(msg.msgtype));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user