new_session = freeswitch.Session(destination);
if (new_session:ready()) then
new_session_disp = new_session:getVariable("endpoint_disposition");
while(new_session:ready() and new_session_disp ~= "ANSWER") do
<------>new_session_disp = new_session:getVariable("endpoint_disposition");
end
api = freeswitch.API();
api:executeString("bgapi uuid_park " .. tostring(new_session.uuid));
end
On answer event I park the call and script finished.
I see single active call. Listing below.
freeswitch@freeswitch43> show calls
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
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,,,,,,,,,,,,,,,,,,,,,,
1 total.
Moveover, after call hangup, FS start execution of command but can’t coz call in terminate state.
Looks like the uuid_broadcast command stay in queueu and wait something… and start after call has hangup.