<div dir="ltr">I gather that this is an INBOUND ESL connection (your program connects to FreeSwitch).<div>Usually, an INBOUND ESL connection is long lived, taking care of many simultaneous calls.  The BGAPI calls let</div><div>you respond to other ESL messages while a long running command like ORIGINATE proceeds (in the background).</div><div>Why do you want to disconnect from ESL before the ORIGINATE returns a result?</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 23, 2019 at 6:09 PM Michael Avers <<a href="mailto:michael@mailworks.org">michael@mailworks.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u><div><div style="font-family:Arial">Hello,<br></div><div style="font-family:Arial"><br></div><div style="font-family:Arial">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.<br></div><div style="font-family:Arial"><br></div><div style="font-family:Arial">I thought bgapi is supposed to be truly non-blocking?<br></div><div style="font-family:Arial"><br></div><div style="font-family:Arial">When the bgapi originate is executed, FS returns the expected <i>Reply-Text: +OK Job-UUID </i>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 <i>Reply-Text: +OK bye </i>but does not actually proceed to close the connection and issue a <i>Content-Type: text/disconnect-notice </i>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.<br></div><div style="font-family:Arial"><br></div><div style="font-family:Arial">I tested with FS 1.6.2, a 1.8.x instance, and also latest master just now.<br></div><div style="font-family:Arial"><br></div><div style="font-family:Arial">This is an actual telnet ESL connection, just added a comment to indicate where it appears to "hang":<br></div><div style="font-family:Arial"><br></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Trying 45.45.45.45...</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Connected to 45.45.45.45.</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Escape character is '^]'.</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Content-Type: auth/request</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">auth ClueCon</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Content-Type: command/reply</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Reply-Text: +OK accepted</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">bgapi originate {origination_caller_id_number='4154446666',origination_caller_id_name='Callback',originate_timeout=20}user/<a href="mailto:1000@sip.domain.com" target="_blank">1000@sip.domain.com</a> 808080 XML <a href="http://sip.domain.com" target="_blank">sip.domain.com</a></span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Content-Type: command/reply</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Reply-Text: +OK Job-UUID: e53965cd-b0c0-4c39-99ad-946048082ef2</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Job-UUID: e53965cd-b0c0-4c39-99ad-946048082ef2</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">exit</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Content-Type: command/reply</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Reply-Text: +OK bye</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><b><span style="color:rgb(165,42,42)"><span style="font-family:menlo,consolas,monospace,sans-serif"><< here it pauses until originate times out, gets rejected, or answered by the destination user >></span></span></b><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Content-Type: text/disconnect-notice</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Content-Length: 67</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Disconnected, goodbye.</span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">See you at ClueCon! <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a></span><span style="font-family:menlo,consolas,monospace,sans-serif"><br></span></div><div style="font-family:Arial"><span style="font-family:menlo,consolas,monospace,sans-serif">Connection closed by foreign host.</span><br></div><div style="font-family:Arial"><br></div><div style="font-family:Arial">Is this expected behavior? I also tested with ignore_early_media on/off just in case, same result.<br></div><div style="font-family:Arial"><br></div><div style="font-family:Arial">Thanks<br></div><div style="font-family:Arial">Mike</div><div style="font-family:Arial"><br></div></div>_________________________________________________________________________<br>
<br>
The FreeSWITCH project is sponsored by SignalWire <a href="https://signalwire.com" rel="noreferrer" target="_blank">https://signalwire.com</a><br>
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.<br>
Build your next product on our scalable cloud platform.<br>
<br>
Join our online community to chat in real time <a href="https://signalwire.community" rel="noreferrer" target="_blank">https://signalwire.community</a><br>
<br>
Professional FreeSWITCH Services<br>
<a href="mailto:sales@freeswitch.com" target="_blank">sales@freeswitch.com</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="https://freeswitch.com/oss" rel="noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
<a href="https://freeswitch.org/confluence" rel="noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
<a href="https://cluecon.com" rel="noreferrer" target="_blank">https://cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Guillermo Ruiz Camauer<br></div>