Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] How to retrieve all waiting events via ESL in C/C++


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
support at telium.io
Guest





PostPosted: Wed Nov 17, 2021 12:18 am    Post subject: [Freeswitch-users] How to retrieve all waiting events via ES Reply with quote

Well, I got the code working, but still unsure about the event struct.

So I’m freeing the struct with esl_safe_free which I found used in some fs code. Hope that’s correct.

From: FreeSWITCH-users [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Telium Technical Support
Sent: Tuesday, November 16, 2021 4:47 PM
To: 'FreeSWITCH Users Help' <freeswitch-users@lists.freeswitch.org>
Subject: [Freeswitch-users] How to retrieve all waiting events via ESL in C/C++



I am trying to retrieve all waiting events via ESL, using the esl_recv_event_timed function. The documentation doesn't offer much help.

My code below is intended to retrieve all events waiting. But it doesn't work...I just gather an increasing number of headers (always appending onto the last), and the body is the same, for each event. As if the events are not dequeuing.

As well, events I expect (eg HEARTBEAT) are not appearing. So it seems I'm not really iterating through the list of waiting events:

QStringList body;
esl_event_t *save_event = NULL;
while (true) {
esl_status_t connectionStatus = esl_recv_event_timed(&m_EslHandle, 0, 0, &save_event);
if (connectionStatus == ESL_SUCCESS) {
if (save_event) {
esl_event_header_t* nextHeader = save_event->headers;
while ((nextHeader != NULL) && (nextHeader != save_event->last_header)) {
headerList << TL_KeyValuePair(nextHeader->name,nextHeader->value);
nextHeader = nextHeader->next;
}
body = QString(m_EslHandle.last_sr_event->body).split("\n",Qt::SkipEmptyParts);
}
else break;
}
else {
return false;
}
}


Can someone offer a simple code (using C ESL) on how to retrieve all waiting events?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services