<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">I would also like to know why FreeSWITCH does this. I'd really like to execute a uuid_broadcast while a lua script is running in the dialplan.</div><div class="gmail_default" style="font-family:courier new,monospace"><br></div><div class="gmail_default" style="font-family:courier new,monospace">The reason for this is I have implemented an alternate dialplan in lua. I want the caller to hear audio while I'm waiting for an agent to become available. After a certain amount of time passes, I want to do different things based on certain conditions. FreeSWITCH's xml dialplan forces you to make all your decisions as soon as the call enters the dialplan which doesn't work in my scenario. In order to make decisions later during the call, I need the lua script to remain in control, sleeping until it's time to make the decision, but that causes problems with uuid_broadcast.</div><div class="gmail_default" style="font-family:courier new,monospace"><br></div><div class="gmail_default" style="font-family:courier new,monospace">FYI, my workaround so far has been to re-execute my script using luarun and have the "dialplan" instance of the script loop on session:sleep(), but this might to be causing an issue with session:recordFile() which is why I'm posting here.</div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><div><font face="arial"><br></font></div><div><font face="arial"><br></font></div><div><font face="arial">Royce Mitchell, IT Consultant</font></div><div><font face="arial">ITAS Solutions</font></div><div><font face="arial"><a href="mailto:royce3@itas-solutions.com" target="_blank">royce3@itas-solutions.com</a></font></div><div><font face="arial"><br></font></div><div><font face="arial">There are three hard problems in computer science: naming things, and off-by-one errors.</font></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 1, 2021 at 2:14 PM Dmitry Mordovin <<a href="mailto:d.mordovin@crestwavetech.ru">d.mordovin@crestwavetech.ru</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"><div style="overflow-wrap: break-word;">Hello<div><br></div><div>I have LUA script which start a call (new session generated)</div><div>Code here</div><div><br></div><div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(178,178,178);background-color:rgb(0,0,163)"><span style="font-variant-ligatures:no-common-ligatures">new_session </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">=</span><span style="font-variant-ligatures:no-common-ligatures"> freeswitch</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">.</span><span style="font-variant-ligatures:no-common-ligatures">Session</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">(</span><span style="font-variant-ligatures:no-common-ligatures">destination</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">);</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(242,242,242);background-color:rgb(0,0,163);min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(178,178,178);background-color:rgb(0,0,163)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">if</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">(</span><span style="font-variant-ligatures:no-common-ligatures">new_session</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">:</span><span style="font-variant-ligatures:no-common-ligatures">ready</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">())</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">then</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(178,178,178);background-color:rgb(0,0,163)"><span style="font-variant-ligatures:no-common-ligatures"> new_session_disp </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">=</span><span style="font-variant-ligatures:no-common-ligatures"> new_session</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">:</span><span style="font-variant-ligatures:no-common-ligatures">getVariable</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(20,153,2)">"endpoint_disposition"</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">);</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(178,178,178);background-color:rgb(0,0,163)"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">while(</span><span style="font-variant-ligatures:no-common-ligatures">new_session</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">:</span><span style="font-variant-ligatures:no-common-ligatures">ready</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">()</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">and</span><span style="font-variant-ligatures:no-common-ligatures"> new_session_disp </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">~=</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(20,153,2)">"ANSWER"</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">)</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">do</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(178,178,178);background-color:rgb(0,0,163)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,255)"><------></span><span style="font-variant-ligatures:no-common-ligatures">new_session_disp </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">=</span><span style="font-variant-ligatures:no-common-ligatures"> new_session</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">:</span><span style="font-variant-ligatures:no-common-ligatures">getVariable</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(20,153,2)">"endpoint_disposition"</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">);</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(178,178,178);background-color:rgb(0,0,163)"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">end</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(178,178,178);background-color:rgb(0,0,163)"><span style="font-variant-ligatures:no-common-ligatures"> api </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">=</span><span style="font-variant-ligatures:no-common-ligatures"> freeswitch</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">.</span><span style="font-variant-ligatures:no-common-ligatures">API</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">();</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(178,178,178);background-color:rgb(0,0,163)"><span style="font-variant-ligatures:no-common-ligatures"> api</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">:</span><span style="font-variant-ligatures:no-common-ligatures">executeString</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(20,153,2)">"bgapi uuid_park "</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">..</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(224,228,9)">tostring</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">(</span><span style="font-variant-ligatures:no-common-ligatures">new_session</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">.</span><span style="font-variant-ligatures:no-common-ligatures">uuid</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(223,223,223)">));</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(178,178,178);background-color:rgb(0,0,163)"><span style="color:rgb(223,223,223)">end</span></div></div><div><br></div><div><br></div><div>On answer event I park the call and script finished.</div><div>I see single active call. Listing below.</div><div><br></div><div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(242,242,242);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">freeswitch@freeswitch43> show calls</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(242,242,242);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">uuid,direction,created,created_epoch,name,state,cid_name,cid_num,ip_addr,dest,presence_id,presence_data,accountcode,callstate,callee_name,callee_num,callee_direction,call_uuid,hostname,sent_callee_name,sent_callee_num,b_uuid,b_direction,b_created,b_created_epoch,b_name,b_state,b_cid_name,b_cid_num,b_ip_addr,b_dest,b_presence_id,b_presence_data,b_accountcode,b_callstate,b_callee_name,b_callee_num,b_callee_direction,b_sent_callee_name,b_sent_callee_num,call_created_epoch</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(242,242,242);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">3aa3a274-c23d-11eb-9150-e74dc4cdb20a,outbound,2021-05-31 18:22:59,1622485379,sofia/external/1000,CS_PARK,,0000000000,,1000,,,,ACTIVE,Outbound Call,1000,,3aa3a274-c23d-11eb-9150-e74dc4cdb20a,freeswitch43,,,,,,,,,,,,,,,,,,,,,,</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(242,242,242);background-color:rgb(0,0,0);min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(242,242,242);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">1 total.</span></div></div><div><br></div><div><br></div><div>After all I execute command from cli:</div><div><br></div><div>Command looks like:</div><div>uuid_broadcast 3aa3a274-c23d-11eb-9a50-e74dc4cdb20a lua::’next-script.lua' both </div><div><br></div><div>In logs I see, command was sent to FS success, but not executed!</div><div>Moveover, after call hangup, FS start execution of command but can’t coz call in terminate state.</div><div><br></div><div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(46,174,187);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">2021-05-31 18:23:30.312133 [NOTICE] sofia.c:1079 Hangup sofia/external/1000 [CS_PARK] [NORMAL_CLEARING]</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(159,160,28);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">2021-05-31 18:23:30.312133 [DEBUG] switch_ivr.c:625 sofia/external/1000 Command Execute lua(next-script.lua)</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(159,160,28);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">2021-05-31 18:23:30.312133 [DEBUG] switch_core_session.c:2668 sofia/external/1000 ZOMBIE EXEC lua(next-script.lua)</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(159,160,28);background-color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">EXECUTE sofia/external/1000 lua(next-script.lua)</span></div></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div>What/why is ZOMBIE EXEC ?</div><div><br></div><div>Could someone help me to find reason of strange behavior FS?</div><div><br></div><div>Looks like the uuid_broadcast command stay in queueu and wait something… and start after call has hangup. </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>