<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>&nbsp;<div><div>I'm trying to set up an event handler that will send some user data to a callback function. &nbsp;I am using:<br><br><br>&nbsp;pvt = (switch_audio_weaver_t*) switch_core_session_alloc(session, sizeof(*pvt));<br><br>&nbsp;if (switch_event_bind(modname, SWITCH_EVENT_CUSTOM, AUDIOWEAVER_SEND_MESSAGE, audioweaver_message_event_handler, pvt) != SWITCH_STATUS_SUCCESS) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* indicate that the module should continue to be loaded */<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return SWITCH_STATUS_FALSE;<br>}<br><br>This works fine and my event handler is called. &nbsp;But, I am unclear how to get the event_user_data. &nbsp;My event handler is:<br><br>static void audioweaver_message_event_handler(switch_event_t *event)<br>{<br>&nbsp;switch_audio_weaver_t *pvt = (switch_audio_weaver_t *) event-&gt;event_user_data;<br>&nbsp;switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "AudioWeaver Message Event Handler Reached!");<br>&nbsp;switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, switch_event_get_body(event));<br>&nbsp;&nbsp;std::string reply;<br>&nbsp;&nbsp;int ret = pvt-&gt;aw_talker-&gt;SendMessage("set_value,Sine1.freq,110.0", reply);<div><br></div><div><div>I am using mod_event_socket, which uses switch_event_fire. &nbsp;I note in switch_event.h, the following:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); ">/*!</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); ">&nbsp;&nbsp;<span style="color: rgb(0, 76, 20); ">\brief</span>&nbsp;Fire an event filling in most of the arguements with obvious values</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); ">&nbsp;&nbsp;<span style="color: rgb(0, 76, 20); ">\param</span>&nbsp;event the event to send (will be nulled on success)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); ">&nbsp;&nbsp;<span style="color: rgb(0, 76, 20); ">\return</span>&nbsp;SWITCH_STATUS_SUCCESS if the operation was successful</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); ">&nbsp;&nbsp;<span style="color: rgb(0, 76, 20); ">\note</span>&nbsp;the body supplied by this function will supersede an existing body the event may have</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); ">*/</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(120, 73, 42); ">#define switch_event_fire(event) switch_event_fire_detailed(__FILE__, (const char * )__SWITCH_FUNC__, __LINE__, event, NULL)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); ">/*!</div></div><div><br></div><div>How would I use switch_event_fire_detailed with mod_event_socket, which I believe is necessary in order to send the user_data?</div>}<br><br>However, the pointer doesn't seem to point to the private data. &nbsp;Am I setting up my event handler correctly to get this data?<br><br>Thanks.<br><br>-Jon</div></div></div></div></body></html>