<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div style="font-family:Arial;">Quite simple - in my web app I have a button where a user can see a list of calls in a queue, and click a button to initiate an eavesdrop operation that rings his own extension with the various eavesdrop config for that call. Elsewhere I have a list of numbers that requested a callback, and pressing a button allows the user to initiate a callback to that number by sending a bgapi originate to their own extension and once answered we bridge it to the final destination. Both of these hang until the user answers their device.<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">Mike<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;"><br></div><div>On Wed, Oct 23, 2019, at 2:36 PM, Guillermo Ruiz Camauer wrote:<br></div><blockquote type="cite" id="qt"><div dir="ltr"><div style="font-family:Arial;">I gather that this is an INBOUND ESL connection (your program connects to FreeSwitch).<br></div><div>Usually, an INBOUND ESL connection is long lived, taking care of many simultaneous calls.  The BGAPI calls let<br></div><div>you respond to other ESL messages while a long running command like ORIGINATE proceeds (in the background).<br></div><div>Why do you want to disconnect from ESL before the ORIGINATE returns a result?<br></div><div><br></div></div><div style="font-family:Arial;"><br></div><div class="qt-gmail_quote"><div class="qt-gmail_attr" dir="ltr">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 style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;" class="qt-gmail_quote"><div style="font-family:Arial;"><u></u><br></div><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" class="font">Trying 45.45.45.45...</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">Connected to 45.45.45.45.</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">Escape character is '^]'.</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">Content-Type: auth/request</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">auth ClueCon</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">Content-Type: command/reply</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">Reply-Text: +OK accepted</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">bgapi originate {origination_caller_id_number='4154446666',origination_caller_id_name='Callback',originate_timeout=20}user/<a href="mailto:1000@sip.domain.com">1000@sip.domain.com</a> 808080 XML <a href="http://sip.domain.com">sip.domain.com</a></span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">Content-Type: command/reply</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">Reply-Text: +OK Job-UUID: e53965cd-b0c0-4c39-99ad-946048082ef2</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">Job-UUID: e53965cd-b0c0-4c39-99ad-946048082ef2</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">exit</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">Content-Type: command/reply</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">Reply-Text: +OK bye</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><b><span style="color:rgb(165, 42, 42)" class="colour"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"><< 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" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">Content-Type: text/disconnect-notice</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">Content-Length: 67</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">Disconnected, goodbye.</span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">See you at ClueCon! <a href="http://www.cluecon.com/">http://www.cluecon.com/</a></span><span style="font-family:menlo, consolas, monospace, sans-serif" class="font"></span><br></div><div style="font-family:Arial;"><span style="font-family:menlo, consolas, monospace, sans-serif" class="font">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<br></div><div style="font-family:Arial;"><br></div></div><div style="font-family:Arial;">_________________________________________________________________________<br></div><div style="font-family:Arial;"> <br></div><div style="font-family:Arial;"> The FreeSWITCH project is sponsored by SignalWire <a rel="noreferrer" href="https://signalwire.com">https://signalwire.com</a><br></div><div style="font-family:Arial;"> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.<br></div><div style="font-family:Arial;"> Build your next product on our scalable cloud platform.<br></div><div style="font-family:Arial;"> <br></div><div style="font-family:Arial;"> Join our online community to chat in real time <a rel="noreferrer" href="https://signalwire.community">https://signalwire.community</a><br></div><div style="font-family:Arial;"> <br></div><div style="font-family:Arial;"> Professional FreeSWITCH Services<br></div><div style="font-family:Arial;"> <a href="mailto:sales@freeswitch.com">sales@freeswitch.com</a><br></div><div style="font-family:Arial;"> <a rel="noreferrer" href="https://freeswitch.com">https://freeswitch.com</a><br></div><div style="font-family:Arial;"> <br></div><div style="font-family:Arial;"> Official FreeSWITCH Sites<br></div><div style="font-family:Arial;"> <a rel="noreferrer" href="https://freeswitch.com/oss">https://freeswitch.com/oss</a><br></div><div style="font-family:Arial;"> <a rel="noreferrer" href="https://freeswitch.org/confluence">https://freeswitch.org/confluence</a><br></div><div style="font-family:Arial;"> <a rel="noreferrer" href="https://cluecon.com">https://cluecon.com</a><br></div><div style="font-family:Arial;"> <br></div><div style="font-family:Arial;"> FreeSWITCH-users mailing list<br></div><div style="font-family:Arial;"> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br></div><div style="font-family:Arial;"> <a rel="noreferrer" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br></div><div style="font-family:Arial;"> UNSUBSCRIBE:<a rel="noreferrer" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br></div><div style="font-family:Arial;"> <a rel="noreferrer" href="https://freeswitch.com">https://freeswitch.com</a><br></div></blockquote></div><div style="font-family:Arial;"><br></div><div><br></div><div style="font-family:Arial;">-- <br></div><div class="qt-gmail_signature" dir="ltr">Guillermo Ruiz Camauer<br></div><div>_________________________________________________________________________<br></div><div><br></div><div>The FreeSWITCH project is sponsored by SignalWire https://signalwire.com<br></div><div>Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.<br></div><div>Build your next product on our scalable cloud platform.<br></div><div><br></div><div>Join our online community to chat in real time https://signalwire.community<br></div><div><br></div><div>Professional FreeSWITCH Services<br></div><div>sales@freeswitch.com<br></div><div>https://freeswitch.com<br></div><div><br></div><div>Official FreeSWITCH Sites<br></div><div>https://freeswitch.com/oss<br></div><div>https://freeswitch.org/confluence<br></div><div>https://cluecon.com<br></div><div><br></div><div>FreeSWITCH-users mailing list<br></div><div>FreeSWITCH-users@lists.freeswitch.org<br></div><div>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br></div><div>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br></div><div>https://freeswitch.com<br></div></blockquote><div style="font-family:Arial;"><br></div></body></html>