[Freeswitch-users] ESL socket outbound: clean way to close a session?

Stephen Wilde wstephen80 at gmail.com
Fri Feb 25 21:16:12 MSK 2011


I have problem to clean close an outbound session.

I'm using the "esl_oop.h/esl_oop.cpp" files and my application is developed
in c++ and at startup I do a "linger" command.

My event consuming loop is:

while (run)
{
    ESLevent * event = connection.recvEventTimed(sleeptime);


   ... event processing ...
}

This application handle an inbound call (legA), originate an outbound call
(legB) and bridge the two calls.

The problem is present when the legA hangup the call: sometimes is received
the content-type="text/disconnect-notice" (without receiving
"CHANNEL_HANGUP") and the "recvEventTimed" exits with event=NULL.

In this case it's not possible to receive any event or send any other
message to Freeswitch because the "connection.execute" fails.

In this situation, if I have originated (with '& park') an outbound call,
this call remain in parked state and the application cannot hangup it.

What I'm doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110225/08ffcc22/attachment.html 


More information about the FreeSWITCH-users mailing list