<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=PT link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hi all.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I’m using ESL to send “bgapi” commands to Freeswitch and I was expecting to receive the BACKGROUND_JOB event with the command’s response after the action was effectively executed, which is not the case.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I noticed that this happens with commands such as uuid_bridge, uuid_park, uuid_transfer, etc. but it does not happen when executing an “originate”, where the BACKGROUND_JOB event is fired only after the call establishment or rejection.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>This leads to the execution of subsequent commands assuming that the call is in a given state that might not be true.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Does someone faced a similar issue?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>What should be the correct implementation here to make sure that the subsequent logic is only executed when the current command was actually done?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Thanks in advance! Regards, Nuno<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US>Version:</span></b><span lang=EN-US> FreeSWITCH Version 1.10.2-release~64bit ( 64bit)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US>Example for uuid_bridge:<o:p></o:p></span></b></p><p class=MsoNormal><span lang=EN-US>{"Event-Name":"API","Event-Date-Local":"2021-03-25 15:19:32","Event-Date-GMT":"Thu, 25 Mar 2021 15:19:32 GMT","Event-Date-Timestamp":"1616685572613681","Event-Calling-File":"switch_loadable_module.c","Event-Calling-Function":"switch_api_execute","Event-Calling-Line-Number":"2992","Event-Sequence":"1548099","API-Command":"uuid_bridge","API-Command-Argument":"8112abfd-6d77-47ba-bedb-4748452abd78 0f693a5f-8e47-4aa0-b21a-5d5c95195e68"}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>{"Event-Name":"BACKGROUND_JOB","Event-Date-Local":"2021-03-25 15:19:32","Event-Date-GMT":"Thu, 25 Mar 2021 15:19:32 GMT","Event-Date-Timestamp":"1616685572613681","Event-Calling-File":"mod_event_socket.c","Event-Calling-Function":"api_exec","Event-Calling-Line-Number":"1562","Event-Sequence":"1548100","Job-UUID":"bdcff921-7df3-4209-a6f6-6667f39ac8a6","Job-Command":"uuid_bridge","Job-Command-Arg":"8112abfd-6d77-47ba-bedb-4748452abd78 0f693a5f-8e47-4aa0-b21a-5d5c95195e68","Content-Length":"41","_body":"+OK 0f693a5f-8e47-4aa0-b21a-5d5c95195e68\n"}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>{"Event-Name":"CHANNEL_EXECUTE","Event-Date-Local":"2021-03-25 15:19:33","Event-Date-GMT":"Thu, 25 Mar 2021 15:19:33 GMT","Event-Date-Timestamp":"1616685573913991","Event-Calling-File":"switch_ivr_bridge.c","Event-Calling-Function":"uuid_bridge_on_soft_execute","Event-Calling-Line-Number":"1241","Event-Sequence":"1548251","Application":"uuid_bridge","Application-Data":"0f693a5f-8e47-4aa0-b21a-5d5c95195e68",...}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>{"Event-Name":"CHANNEL_EXECUTE","Event-Date-Local":"2021-03-25 15:19:33","Event-Date-GMT":"Thu, 25 Mar 2021 15:19:33 GMT","Event-Date-Timestamp":"1616685573913991","Event-Calling-File":"switch_ivr_bridge.c","Event-Calling-Function":"uuid_bridge_on_soft_execute","Event-Calling-Line-Number":"1248","Event-Sequence":"1548252","Application":"uuid_bridge","Application-Data":"8112abfd-6d77-47ba-bedb-4748452abd78"...}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>{"Event-Name":"CHANNEL_BRIDGE","Event-Date-Local":"2021-03-25 15:19:33","Event-Date-GMT":"Thu, 25 Mar 2021 15:19:33 GMT","Event-Date-Timestamp":"1616685573913991","Event-Calling-File":"switch_ivr_bridge.c","Event-Calling-Function":"switch_ivr_multi_threaded_bridge","Event-Calling-Line-Number":"1694","Event-Sequence":"1548253",...}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>{"Event-Name":"CHANNEL_STATE","Event-Date-Local":"2021-03-25 15:19:33","Event-Date-GMT":"Thu, 25 Mar 2021 15:19:33 GMT","Event-Date-Timestamp":"1616685573913991","Event-Calling-File":"switch_channel.c","Event-Calling-Function":"switch_channel_perform_set_running_state","Event-Calling-Line-Number":"2341","Event-Sequence":"1548254",...}<o:p></o:p></span></p></div></body></html>