Prevent errors when someone abandons a call to conference center before providing a pin number.

This commit is contained in:
Mark Crane 2013-04-03 07:38:29 +00:00
parent 8266953887
commit 09bb1a1cc1
1 changed files with 143 additions and 133 deletions

View File

@ -147,6 +147,7 @@
dbh = freeswitch.Dbh(database["system"]);
--get the conference sessions
if (conference_session_uuid) then
sql = [[SELECT count(*) as num_rows
FROM v_conference_sessions
WHERE conference_session_uuid = ']] .. conference_session_uuid ..[[']];
@ -188,8 +189,10 @@
dbh:query(SQL_STRING);
freeswitch.consoleLog("notice", "[conference] SQL: " .. SQL_STRING .. "\n");
end
end
--add the conference sessions details
if (conference_session_uuid) then
local sql = {}
table.insert(sql, "INSERT INTO v_conference_session_details ");
table.insert(sql, "(");
@ -227,8 +230,10 @@
table.insert(sql, ") ");
SQL_STRING = table.concat(sql, "\n");
dbh:query(SQL_STRING);
end
--if the conference is empty
if (conference_session_uuid) then
cmd = "conference "..meeting_uuid.."-"..domain_name.." xml_list";
result = trim(api:executeString(cmd));
if (string.sub(result, -9) == "not found") then
@ -290,10 +295,13 @@
end
end);
end
end
--close the database connection
if (conference_session_uuid) then
dbh:release();
end
end
--make sure the session is ready
if (session:ready()) then
@ -433,7 +441,9 @@
dbh:release();
--set the meeting uuid
if (meeting_uuid) then
session:setVariable("meeting_uuid", meeting_uuid);
end
if (conference_center_uuid == nil) then
--invalid pin number