[Freeswitch-users] ESL connection appears to hang on bgapi originate - isn't the whole point of it being in the background?

Guillermo Ruiz Camauer grcamauer at gmail.com
Wed Oct 23 21:36:58 UTC 2019

I gather that this is an INBOUND ESL connection (your program connects to
Usually, an INBOUND ESL connection is long lived, taking care of many
simultaneous calls.  The BGAPI calls let
you respond to other ESL messages while a long running command like
ORIGINATE proceeds (in the background).
Why do you want to disconnect from ESL before the ORIGINATE returns a

On Wed, Oct 23, 2019 at 6:09 PM Michael Avers <michael at mailworks.org> wrote:

> Hello,
> When an ESL connection is opened to FS, there is no way to close the
> connection with "exit" until the A Leg of a bgapi originate answers or
> rejects the call, or the originate times out.
> I thought bgapi is supposed to be truly non-blocking?
> When the bgapi originate is executed, FS returns the expected *Reply-Text:
> +OK Job-UUID *response, I am able to continue to communicate with FS over
> the ESL connection while the originate is in progress and the A Leg is
> ringing, and get responses to other standard commands. It all works, except
> for "exit", to which FS responds with *Reply-Text: +OK bye *but does not
> actually proceed to close the connection and issue a *Content-Type:
> text/disconnect-notice *response until the (supposedly in the background)
> originate is rejected or answered. However, after the exit command, ESL
> will no longer process any new commands, it just hangs until the originate
> has some kind of result.
> I tested with FS 1.6.2, a 1.8.x instance, and also latest master just now.
> This is an actual telnet ESL connection, just added a comment to indicate
> where it appears to "hang":
> Trying
> Connected to
> Escape character is '^]'.
> Content-Type: auth/request
> auth ClueCon
> Content-Type: command/reply
> Reply-Text: +OK accepted
> bgapi originate
> {origination_caller_id_number='4154446666',origination_caller_id_name='Callback',originate_timeout=20}user/
> 1000 at sip.domain.com 808080 XML sip.domain.com
> Content-Type: command/reply
> Reply-Text: +OK Job-UUID: e53965cd-b0c0-4c39-99ad-946048082ef2
> Job-UUID: e53965cd-b0c0-4c39-99ad-946048082ef2
> exit
> Content-Type: command/reply
> Reply-Text: +OK bye
> *<< here it pauses until originate times out, gets rejected, or answered
> by the destination user >>*
> Content-Type: text/disconnect-notice
> Content-Length: 67
> Disconnected, goodbye.
> See you at ClueCon! http://www.cluecon.com/
> Connection closed by foreign host.
> Is this expected behavior? I also tested with ignore_early_media on/off
> just in case, same result.
> Thanks
> Mike
> _________________________________________________________________________
> The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
> services.
> Build your next product on our scalable cloud platform.
> Join our online community to chat in real time
> https://signalwire.community
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> https://freeswitch.org/confluence
> https://cluecon.com
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> https://freeswitch.com

Guillermo Ruiz Camauer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20191023/8a36acb9/attachment.html>

More information about the FreeSWITCH-users mailing list