Dev branch, Fix conference center by adjusting the database connection.
This commit is contained in:
parent
786242e24d
commit
46a068e660
|
|
@ -335,6 +335,15 @@
|
||||||
end);
|
end);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--connect to the switch database
|
||||||
|
if (file_exists(database_dir.."/core.db")) then
|
||||||
|
dbh_switch = freeswitch.Dbh("sqlite://"..database_dir.."/core.db");
|
||||||
|
freeswitch.consoleLog("notice", "[conference center] dbh_switch sqlite\n");
|
||||||
|
else
|
||||||
|
freeswitch.consoleLog("notice", "[conference center] dbh_switch pgsql/mysql\n");
|
||||||
|
dbh_switch = database_handle('switch');
|
||||||
|
end
|
||||||
|
|
||||||
--check if someone has already joined the conference
|
--check if someone has already joined the conference
|
||||||
local_hostname = trim(api:execute("hostname", ""));
|
local_hostname = trim(api:execute("hostname", ""));
|
||||||
freeswitch.consoleLog("notice", "[conference] local_hostname is " .. local_hostname .. "\n");
|
freeswitch.consoleLog("notice", "[conference] local_hostname is " .. local_hostname .. "\n");
|
||||||
|
|
@ -342,17 +351,17 @@
|
||||||
if (debug["sql"]) then
|
if (debug["sql"]) then
|
||||||
freeswitch.consoleLog("notice", "[conference] SQL: " .. sql .. "\n");
|
freeswitch.consoleLog("notice", "[conference] SQL: " .. sql .. "\n");
|
||||||
end
|
end
|
||||||
status = dbh:query(sql, function(rows)
|
status = dbh_switch:query(sql, function(rows)
|
||||||
conference_hostname = string.lower(rows["hostname"]);
|
conference_hostname = string.lower(rows["hostname"]);
|
||||||
end);
|
end);
|
||||||
|
|
||||||
if (conference_hostname ~= nil) then
|
--if conference hosntame exist, then we bridge there
|
||||||
freeswitch.consoleLog("notice", "[conference] conference_hostname is " .. conference_hostname .. "\n");
|
if (conference_hostname ~= nil) then
|
||||||
--if conference hosntame exist, then we bridge there
|
freeswitch.consoleLog("notice", "[conference center] conference_hostname is " .. conference_hostname .. "\n");
|
||||||
if (conference_hostname ~= local_hostname) then
|
if (conference_hostname ~= local_hostname) then
|
||||||
session:execute("bridge","sofia/internal/" .. destination_number .. "@" .. domain_name .. ";fs_path=sip:" .. conference_hostname);
|
session:execute("bridge","sofia/internal/" .. destination_number .. "@" .. domain_name .. ";fs_path=sip:" .. conference_hostname);
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
--call not bridged, so we answer
|
--call not bridged, so we answer
|
||||||
session:answer();
|
session:answer();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue