[Freeswitch-users] Use of esl_recv_event

Telium Technical Support support at telium.io
Sat Nov 13 01:31:42 UTC 2021


I'm looking at how to use the esl_recv_event function in esl.c and the docs
are missing some details.  Could someone tell me:

 

1.       Do I have to lock a mutex before accessing this function (since it
dequeues an event)

2.       The third parameter is a ptr to a ptr to a struct.  So, do I have
to allocate a struct before calling (to get the data)?  Or will the lib
allocate the struct and I have to free it?

 

Comments from esl.c:

 

/*!

    \brief Poll the handle's socket until an event is received or a
connection error occurs 

    \param handle Handle to poll

    \param check_q If set to 1, will check the handle queue
(handle->race_event) and return the last event from it

    \param[out] save_event If this is not NULL, will return the event
received

*/

ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, int check_q,
esl_event_t **save_event);

/*!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20211113/c5ef0e32/attachment-0001.html>


More information about the FreeSWITCH-users mailing list