Merge branch 'master' of https://github.com/fusionpbx/fusionpbx
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
/**
|
||||
* cache class provides an abstracted cache
|
||||
*
|
||||
*
|
||||
* @method string set
|
||||
* @method string get
|
||||
* @method string delete
|
||||
|
||||
@@ -366,7 +366,7 @@ include "root.php";
|
||||
$keys=array_keys($data);
|
||||
$values=array_values($data);
|
||||
for($i=0;$i<$count;$i++){
|
||||
$keys[$i]= str_replace("-", "_", $keys[$i]);
|
||||
$keys[$i]= str_replace("-", "_", $keys[$i]);
|
||||
$this->{$keys[$i]}=$values[$i];
|
||||
}
|
||||
}
|
||||
@@ -443,7 +443,7 @@ include "root.php";
|
||||
$xml .= " <param name=\"auth-acl\" value=\"" . $this->auth_acl . "\"/>\n";
|
||||
}
|
||||
$xml .= " </params>\n";
|
||||
|
||||
|
||||
$xml .= " <variables>\n";
|
||||
if (strlen($this->hold_music)) {
|
||||
$xml .= " <variable name=\"hold_music\" value=\"" . $this->hold_music . "\"/>\n";
|
||||
@@ -608,7 +608,7 @@ include "root.php";
|
||||
$xml .= "\n";
|
||||
$xml .= "<include>\n";
|
||||
$xml .= " <!--the domain or ip (the right hand side of the @ in the addr-->\n";
|
||||
if ($extension_dir_name == "default") {
|
||||
if ($extension_dir_name == "default") {
|
||||
$xml .= " <domain name=\"\$\${domain}\">\n";
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -21,7 +21,7 @@ class Syslog extends Event_Handler{
|
||||
if ($_SESSION['event']['syslog']['enable'] <> 0){
|
||||
closelog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function log_event($event_type, $params){
|
||||
if ($_SESSION['event']['syslog']['enable'] <> 0){
|
||||
|
||||
@@ -323,7 +323,7 @@ include "root.php";
|
||||
$database->add();
|
||||
}
|
||||
|
||||
//delete the old dialplan details to prepare for new details
|
||||
//delete the old dialplan details to prepare for new details
|
||||
$database = new database;
|
||||
$database->table = "v_dialplan_details";
|
||||
$database->where[0]['name'] = 'domain_uuid';
|
||||
|
||||
@@ -661,7 +661,7 @@
|
||||
|
||||
//define singular function to convert a word in english to singular
|
||||
private function singular($word) {
|
||||
//"-es" is used for words that end in "-x", "-s", "-z", "-sh", "-ch" in which case you add
|
||||
//"-es" is used for words that end in "-x", "-s", "-z", "-sh", "-ch" in which case you add
|
||||
if (substr($word, -2) == "es") {
|
||||
if (substr($word, -3, 1) == "x") {
|
||||
return substr($word,0,-2);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
/**
|
||||
* permission class
|
||||
*
|
||||
*
|
||||
* @method string add
|
||||
* @method string delete
|
||||
* @method string exists
|
||||
|
||||
@@ -80,7 +80,7 @@ include "root.php";
|
||||
$this->object->assign($key, $value);
|
||||
}
|
||||
if ($this->engine === 'twig') {
|
||||
$this->var_array[$key] = $value;
|
||||
$this->var_array[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ This method causes the script to get its manadatory arguments directly from the
|
||||
session:setVariable("call_block", "")
|
||||
|
||||
--send to the log
|
||||
logger("D", "NOTICE", "params are: " .. string.format("'%s', '%s', '%s', '%s'", params["cid_num"],
|
||||
logger("D", "NOTICE", "params are: " .. string.format("'%s', '%s', '%s', '%s'", params["cid_num"],
|
||||
params["cid_name"], params["userid"], params["domain_name"]));
|
||||
|
||||
--get the cache
|
||||
@@ -91,7 +91,7 @@ This method causes the script to get its manadatory arguments directly from the
|
||||
require "resources.functions.database_handle";
|
||||
dbh = database_handle('system');
|
||||
|
||||
--log if not connect
|
||||
--log if not connect
|
||||
if dbh:connected() == false then
|
||||
logger("W", "NOTICE", "db was not connected")
|
||||
end
|
||||
@@ -108,7 +108,7 @@ This method causes the script to get its manadatory arguments directly from the
|
||||
found_count = rows["call_block_count"];
|
||||
end)
|
||||
-- dbh:affected_rows() doesn't do anything if using core:db so this is the workaround:
|
||||
|
||||
|
||||
--set the cache
|
||||
if (found_cid_num) then -- caller id exists
|
||||
if (found_enabled == "true") then
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
--
|
||||
-- Contributor(s):
|
||||
-- Mark J Crane <markjcrane@fusionpbx.com>
|
||||
-- Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
|
||||
-- Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
|
||||
|
||||
--set variables
|
||||
flags = "";
|
||||
@@ -80,7 +80,7 @@
|
||||
end
|
||||
|
||||
--get the moderator_pin
|
||||
sql = [[SELECT moderator_pin FROM v_meetings
|
||||
sql = [[SELECT moderator_pin FROM v_meetings
|
||||
WHERE meeting_uuid = ']] .. meeting_uuid ..[[']];
|
||||
freeswitch.consoleLog("notice", "[voicemail] sql: " .. sql .. "\n");
|
||||
status = dbh:query(sql, function(row)
|
||||
@@ -159,7 +159,7 @@
|
||||
|
||||
--get the conference sessions
|
||||
if (conference_session_uuid) then
|
||||
sql = [[SELECT count(*) as num_rows
|
||||
sql = [[SELECT count(*) as num_rows
|
||||
FROM v_conference_sessions
|
||||
WHERE conference_session_uuid = ']] .. conference_session_uuid ..[[']];
|
||||
status = dbh:query(sql, function(row)
|
||||
@@ -435,7 +435,7 @@
|
||||
--define the function get_pin_number
|
||||
function get_pin_number(domain_uuid, prompt_audio_file)
|
||||
--if the pin number is provided then require it
|
||||
if (not pin_number) then
|
||||
if (not pin_number) then
|
||||
min_digits = 2;
|
||||
max_digits = 20;
|
||||
max_tries = 1;
|
||||
@@ -447,16 +447,16 @@
|
||||
WHERE r.domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND r.meeting_uuid = m.meeting_uuid
|
||||
AND m.domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND (m.moderator_pin = ']] .. pin_number ..[[' or m.participant_pin = ']] .. pin_number ..[[')
|
||||
AND (m.moderator_pin = ']] .. pin_number ..[[' or m.participant_pin = ']] .. pin_number ..[[')
|
||||
AND r.enabled = 'true'
|
||||
AND m.enabled = 'true'
|
||||
AND (
|
||||
( r.start_datetime <> '' AND r.start_datetime is not null AND r.start_datetime <= ']] .. os.date("%Y-%m-%d %X") .. [[' ) OR
|
||||
( r.start_datetime = '' OR r.start_datetime is null )
|
||||
( r.start_datetime <> '' AND r.start_datetime is not null AND r.start_datetime <= ']] .. os.date("%Y-%m-%d %X") .. [[' ) OR
|
||||
( r.start_datetime = '' OR r.start_datetime is null )
|
||||
)
|
||||
AND (
|
||||
( r.stop_datetime <> '' AND r.stop_datetime is not null AND r.stop_datetime > ']] .. os.date("%Y-%m-%d %X") .. [[' ) OR
|
||||
( r.stop_datetime = '' OR r.stop_datetime is null )
|
||||
( r.stop_datetime <> '' AND r.stop_datetime is not null AND r.stop_datetime > ']] .. os.date("%Y-%m-%d %X") .. [[' ) OR
|
||||
( r.stop_datetime = '' OR r.stop_datetime is null )
|
||||
) ]];
|
||||
if (debug["sql"]) then
|
||||
freeswitch.consoleLog("notice", "[conference center] SQL: " .. sql .. "\n");
|
||||
@@ -496,7 +496,7 @@
|
||||
AND r.conference_center_uuid = ']] .. conference_center_uuid ..[['
|
||||
AND m.domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND (m.moderator_pin = ']] .. pin_number ..[[' or m.participant_pin = ']] .. pin_number ..[[')
|
||||
AND r.enabled = 'true'
|
||||
AND r.enabled = 'true'
|
||||
AND m.enabled = 'true'
|
||||
]];
|
||||
if (debug["sql"]) then
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
api = freeswitch.API();
|
||||
|
||||
--check if the conference exists
|
||||
cmd = "conference "..meeting_uuid.."-"..domain_name.." xml_list";
|
||||
cmd = "conference "..meeting_uuid.."-"..domain_name.." xml_list";
|
||||
freeswitch.consoleLog("INFO","" .. cmd .. "\n");
|
||||
result = trim(api:executeString(cmd));
|
||||
if (string.sub(result, -9) == "not found") then
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
file_subject = scripts_dir.."/app/missed_calls/resources/templates/en/us/email_subject.tpl";
|
||||
file_body = scripts_dir.."/app/missed_calls/resources/templates/en/us/email_body.tpl";
|
||||
end
|
||||
|
||||
|
||||
--prepare the headers
|
||||
headers = '{"X-FusionPBX-Domain-UUID":"'..domain_uuid..'",';
|
||||
headers = headers..'"X-FusionPBX-Domain-Name":"'..domain_name..'",';
|
||||
@@ -86,7 +86,7 @@
|
||||
body = body:gsub("'", "'");
|
||||
body = body:gsub([["]], """);
|
||||
body = trim(body);
|
||||
|
||||
|
||||
--send the email
|
||||
cmd = "luarun email.lua "..missed_call_data.." "..missed_call_data.." "..headers.." '"..subject.."' '"..body.."'";
|
||||
if (debug["info"]) then
|
||||
@@ -188,7 +188,7 @@
|
||||
end
|
||||
|
||||
elseif (originate_disposition == "USER_NOT_REGISTERED") then
|
||||
|
||||
|
||||
--handle USER_NOT_REGISTERED
|
||||
forward_user_not_registered_enabled = session:getVariable("forward_user_not_registered_enabled");
|
||||
if (forward_user_not_registered_enabled == "true") then
|
||||
@@ -204,7 +204,7 @@
|
||||
--send missed call notification
|
||||
missed();
|
||||
end
|
||||
|
||||
|
||||
--send missed call notification
|
||||
--missed();
|
||||
|
||||
|
||||
@@ -154,8 +154,8 @@
|
||||
end
|
||||
|
||||
--get the fax settings from the database
|
||||
sql = [[SELECT * FROM v_fax
|
||||
WHERE fax_uuid = ']] .. fax_uuid ..[['
|
||||
sql = [[SELECT * FROM v_fax
|
||||
WHERE fax_uuid = ']] .. fax_uuid ..[['
|
||||
AND domain_uuid = ']] .. domain_uuid ..[[']];
|
||||
if (debug["sql"]) then
|
||||
freeswitch.consoleLog("notice", "[fax] SQL: " .. sql .. "\n");
|
||||
@@ -196,7 +196,7 @@
|
||||
cmd = quote(php_dir.."/"..php_bin).." "..quote(document_root.."/secure/fax_to_email.php").." ";
|
||||
cmd = cmd .. "email="..quote(fax_email).." ";
|
||||
cmd = cmd .. "extension="..quote(fax_extension).." ";
|
||||
cmd = cmd .. "name="..quote(fax_file).." ";
|
||||
cmd = cmd .. "name="..quote(fax_file).." ";
|
||||
cmd = cmd .. "messages=" .. quote("result:"..fax_result_text.." sender:"..fax_remote_station_id.." pages:"..fax_document_total_pages).." ";
|
||||
cmd = cmd .. "domain="..quote(domain_name).." ";
|
||||
cmd = cmd .. "caller_id_name=" .. quote(caller_id_name or '') .. " ";
|
||||
|
||||
@@ -22,7 +22,7 @@ local task if fax_task_uuid then
|
||||
task = Tasks.select_task(fax_task_uuid)
|
||||
if not task then
|
||||
log.warningf("Can not found fax task: %q", tostring(fax_task_uuid))
|
||||
return
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ local function next_task()
|
||||
local mode = (task.retry_counter % #FAX_OPTIONS) + 1
|
||||
local dial_string = '{' ..
|
||||
task.dial_string .. "api_hangup_hook='lua app/fax/resources/scripts/queue/retry.lua'," ..
|
||||
FAX_OPTIONS[mode] ..
|
||||
FAX_OPTIONS[mode] ..
|
||||
'}' .. task.uri
|
||||
|
||||
local originate = 'originate ' .. dial_string .. ' &lua(app/fax/resources/scripts/queue/exec.lua)'
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
local fax_task_uuid = env:getHeader('fax_task_uuid')
|
||||
if not fax_task_uuid then
|
||||
log.warning("No [fax_task_uuid] channel variable")
|
||||
return
|
||||
return
|
||||
end
|
||||
local task = Tasks.select_task(fax_task_uuid)
|
||||
if not task then
|
||||
log.warningf("Can not find fax task: %q", tostring(fax_task_uuid))
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
-- show all channel variables
|
||||
|
||||
@@ -37,7 +37,7 @@ select
|
||||
t1.fax_task_uuid as uuid,
|
||||
t1.fax_uuid as fax_uuid,
|
||||
t3.domain_name,
|
||||
t3.domain_uuid,
|
||||
t3.domain_uuid,
|
||||
t1.task_status as status,
|
||||
t1.task_uri as uri,
|
||||
t1.task_dial_string as dial_string,
|
||||
@@ -51,7 +51,7 @@ select
|
||||
t2.fax_send_greeting as greeting
|
||||
from v_fax_tasks t1
|
||||
inner join v_fax t2 on t2.fax_uuid = t1.fax_uuid
|
||||
inner join v_domains t3 on t2.domain_uuid = t3.domain_uuid
|
||||
inner join v_domains t3 on t2.domain_uuid = t3.domain_uuid
|
||||
where t1.task_interrupted <> 'true'
|
||||
]]
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
--authentication failed
|
||||
if (authorized == 'false') then
|
||||
result = session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/voicemail/vm-fail_auth.wav");
|
||||
end
|
||||
end
|
||||
|
||||
--this device already has an alternate find the correct device_uuid and then override current one
|
||||
if (authorized == 'true' and action == "login" and device_uuid_alternate ~= nil and device_uuid ~= nil and domain_uuid ~= nil) then
|
||||
|
||||
@@ -203,17 +203,17 @@ local log = require "resources.functions.log".ring_group
|
||||
else
|
||||
--get the strategy of the ring group, if random, we use random() to order the destinations
|
||||
sql = [[
|
||||
SELECT
|
||||
SELECT
|
||||
r.ring_group_strategy
|
||||
FROM
|
||||
FROM
|
||||
v_ring_groups as r
|
||||
WHERE
|
||||
ring_group_uuid = ']]..ring_group_uuid..[['
|
||||
AND r.domain_uuid = ']]..domain_uuid..[['
|
||||
AND r.ring_group_enabled = 'true'
|
||||
WHERE
|
||||
ring_group_uuid = ']]..ring_group_uuid..[['
|
||||
AND r.domain_uuid = ']]..domain_uuid..[['
|
||||
AND r.ring_group_enabled = 'true'
|
||||
]];
|
||||
|
||||
|
||||
|
||||
assert(dbh:query(sql, function(row)
|
||||
if (row.ring_group_strategy == "random") then
|
||||
if (database["type"] == "mysql") then
|
||||
@@ -223,23 +223,23 @@ local log = require "resources.functions.log".ring_group
|
||||
end
|
||||
else
|
||||
sql_order='d.destination_delay, d.destination_number asc'
|
||||
end
|
||||
end
|
||||
end));
|
||||
|
||||
|
||||
--get the ring group destinations
|
||||
sql = [[
|
||||
SELECT
|
||||
r.ring_group_strategy, r.ring_group_timeout_app, r.ring_group_distinctive_ring,
|
||||
d.destination_number, d.destination_delay, d.destination_timeout, d.destination_prompt,
|
||||
SELECT
|
||||
r.ring_group_strategy, r.ring_group_timeout_app, r.ring_group_distinctive_ring,
|
||||
d.destination_number, d.destination_delay, d.destination_timeout, d.destination_prompt,
|
||||
r.ring_group_timeout_data, r.ring_group_cid_name_prefix, r.ring_group_cid_number_prefix, r.ring_group_ringback, r.ring_group_skip_active
|
||||
FROM
|
||||
FROM
|
||||
v_ring_groups as r, v_ring_group_destinations as d
|
||||
WHERE
|
||||
d.ring_group_uuid = r.ring_group_uuid
|
||||
AND d.ring_group_uuid = ']]..ring_group_uuid..[['
|
||||
AND r.domain_uuid = ']]..domain_uuid..[['
|
||||
AND r.ring_group_enabled = 'true'
|
||||
ORDER BY
|
||||
WHERE
|
||||
d.ring_group_uuid = r.ring_group_uuid
|
||||
AND d.ring_group_uuid = ']]..ring_group_uuid..[['
|
||||
AND r.domain_uuid = ']]..domain_uuid..[['
|
||||
AND r.ring_group_enabled = 'true'
|
||||
ORDER BY
|
||||
]]..sql_order..[[
|
||||
]];
|
||||
--freeswitch.consoleLog("notice", "SQL:" .. sql .. "\n");
|
||||
@@ -282,21 +282,21 @@ local log = require "resources.functions.log".ring_group
|
||||
|
||||
--get the dialplan data and save it to a table
|
||||
if (external) then
|
||||
sql = [[select * from v_dialplans as d, v_dialplan_details as s
|
||||
sql = [[select * from v_dialplans as d, v_dialplan_details as s
|
||||
where (d.domain_uuid = ']] .. domain_uuid .. [[' or d.domain_uuid is null)
|
||||
and d.app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3'
|
||||
and d.dialplan_enabled = 'true'
|
||||
and d.dialplan_uuid = s.dialplan_uuid
|
||||
order by
|
||||
d.dialplan_order asc,
|
||||
d.dialplan_name asc,
|
||||
d.dialplan_uuid asc,
|
||||
s.dialplan_detail_group asc,
|
||||
CASE s.dialplan_detail_tag
|
||||
WHEN 'condition' THEN 1
|
||||
WHEN 'action' THEN 2
|
||||
WHEN 'anti-action' THEN 3
|
||||
ELSE 100 END,
|
||||
and d.app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3'
|
||||
and d.dialplan_enabled = 'true'
|
||||
and d.dialplan_uuid = s.dialplan_uuid
|
||||
order by
|
||||
d.dialplan_order asc,
|
||||
d.dialplan_name asc,
|
||||
d.dialplan_uuid asc,
|
||||
s.dialplan_detail_group asc,
|
||||
CASE s.dialplan_detail_tag
|
||||
WHEN 'condition' THEN 1
|
||||
WHEN 'action' THEN 2
|
||||
WHEN 'anti-action' THEN 3
|
||||
ELSE 100 END,
|
||||
s.dialplan_detail_order asc ]]
|
||||
--freeswitch.consoleLog("notice", "SQL:" .. sql .. "\n");
|
||||
dialplans = {};
|
||||
@@ -374,7 +374,7 @@ local log = require "resources.functions.log".ring_group
|
||||
end
|
||||
|
||||
--set confirm
|
||||
if (ring_group_strategy == "simultaneous"
|
||||
if (ring_group_strategy == "simultaneous"
|
||||
or ring_group_strategy == "sequence"
|
||||
or ring_group_strategy == "rollover") then
|
||||
session:execute("set", "group_confirm_key=exec");
|
||||
@@ -413,7 +413,7 @@ local log = require "resources.functions.log".ring_group
|
||||
--record the session
|
||||
if (record_session) then
|
||||
record_session = ",api_on_answer='uuid_record "..uuid.." start ".. record_file .. "'";
|
||||
else
|
||||
else
|
||||
record_session = ""
|
||||
end
|
||||
row.record_session = record_session
|
||||
@@ -569,8 +569,8 @@ local log = require "resources.functions.log".ring_group
|
||||
|
||||
--if the timeout was reached go to the timeout action
|
||||
if (x > 0) then
|
||||
if (session:getVariable("originate_disposition") == "ALLOTTED_TIMEOUT"
|
||||
or session:getVariable("originate_disposition") == "NO_ANSWER"
|
||||
if (session:getVariable("originate_disposition") == "ALLOTTED_TIMEOUT"
|
||||
or session:getVariable("originate_disposition") == "NO_ANSWER"
|
||||
or session:getVariable("originate_disposition") == "NO_USER_RESPONSE") then
|
||||
break;
|
||||
end
|
||||
@@ -609,12 +609,12 @@ local log = require "resources.functions.log".ring_group
|
||||
--timeout destination
|
||||
if (app_data ~= nil) then
|
||||
if session:ready() and (
|
||||
session:getVariable("originate_disposition") == "ALLOTTED_TIMEOUT"
|
||||
or session:getVariable("originate_disposition") == "NO_ANSWER"
|
||||
or session:getVariable("originate_disposition") == "NO_USER_RESPONSE"
|
||||
or session:getVariable("originate_disposition") == "USER_NOT_REGISTERED"
|
||||
or session:getVariable("originate_disposition") == "NORMAL_TEMPORARY_FAILURE"
|
||||
or session:getVariable("originate_disposition") == "NO_ROUTE_DESTINATION"
|
||||
session:getVariable("originate_disposition") == "ALLOTTED_TIMEOUT"
|
||||
or session:getVariable("originate_disposition") == "NO_ANSWER"
|
||||
or session:getVariable("originate_disposition") == "NO_USER_RESPONSE"
|
||||
or session:getVariable("originate_disposition") == "USER_NOT_REGISTERED"
|
||||
or session:getVariable("originate_disposition") == "NORMAL_TEMPORARY_FAILURE"
|
||||
or session:getVariable("originate_disposition") == "NO_ROUTE_DESTINATION"
|
||||
or session:getVariable("originate_disposition") == "USER_BUSY"
|
||||
or session:getVariable("originate_disposition") == "failure"
|
||||
) then
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
--include config.lua
|
||||
require "resources.functions.config";
|
||||
|
||||
|
||||
--connect to the database
|
||||
require "resources.functions.database_handle";
|
||||
dbh = database_handle('system');
|
||||
@@ -96,7 +96,7 @@
|
||||
-- if string.len(destination) == 0) then
|
||||
-- destination = session:playAndGetDigits(1, 1, max_tries, digit_timeout, "#", "ivr/ivr-enter_destination_telephone_number.wav", "", "\\d+");
|
||||
-- freeswitch.consoleLog("NOTICE", "[ring_group] destination: "..destination.."\n");
|
||||
` -- end
|
||||
-- end
|
||||
--end
|
||||
|
||||
--login or logout
|
||||
@@ -109,7 +109,7 @@
|
||||
SELECT COUNT(*) AS in_group FROM
|
||||
v_ring_group_destinations
|
||||
WHERE
|
||||
domain_uuid = ']]..domain_uuid..[['
|
||||
domain_uuid = ']]..domain_uuid..[['
|
||||
AND ring_group_uuid = ']]..ring_group_uuid..[['
|
||||
AND destination_number = ']]..destination..[['
|
||||
]];
|
||||
@@ -118,21 +118,21 @@
|
||||
assert(dbh:query(sql, function(row)
|
||||
if (row.in_group == "0") then
|
||||
sql = [[
|
||||
INSERT INTO
|
||||
v_ring_group_destinations
|
||||
INSERT INTO
|
||||
v_ring_group_destinations
|
||||
( ring_group_destination_uuid,
|
||||
domain_uuid,
|
||||
ring_group_uuid,
|
||||
domain_uuid,
|
||||
ring_group_uuid,
|
||||
destination_number,
|
||||
destination_delay,
|
||||
destination_timeout
|
||||
)
|
||||
VALUES
|
||||
)
|
||||
VALUES
|
||||
( ']]..ring_group_destination_uuid..[[',
|
||||
']]..domain_uuid..[[',
|
||||
']]..ring_group_uuid..[[',
|
||||
']]..destination..[[',
|
||||
]]..destination_delay..[[,
|
||||
']]..domain_uuid..[[',
|
||||
']]..ring_group_uuid..[[',
|
||||
']]..destination..[[',
|
||||
]]..destination_delay..[[,
|
||||
]]..destination_timeout..[[
|
||||
)]];
|
||||
freeswitch.consoleLog("NOTICE", "[ring_group][destination] SQL "..sql.."\n");
|
||||
@@ -148,11 +148,11 @@
|
||||
end
|
||||
if (menu_selection == "2") then
|
||||
sql = [[
|
||||
DELETE FROM
|
||||
v_ring_group_destinations
|
||||
WHERE
|
||||
domain_uuid =']]..domain_uuid..[['
|
||||
AND ring_group_uuid=']]..ring_group_uuid..[['
|
||||
DELETE FROM
|
||||
v_ring_group_destinations
|
||||
WHERE
|
||||
domain_uuid =']]..domain_uuid..[['
|
||||
AND ring_group_uuid=']]..ring_group_uuid..[['
|
||||
AND destination_number=']]..destination..[['
|
||||
]];
|
||||
freeswitch.consoleLog("NOTICE", "[ring_group][destination] SQL "..sql.."\n");
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
--include config.lua
|
||||
require "resources.functions.config";
|
||||
|
||||
|
||||
--connect to the database
|
||||
require "resources.functions.database_handle";
|
||||
dbh = database_handle('system');
|
||||
@@ -39,12 +39,12 @@
|
||||
|
||||
--define uuid function
|
||||
local random = math.random;
|
||||
local function uuid();
|
||||
local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
|
||||
return string.gsub(template, '[xy]', function (c)
|
||||
local v = (c == 'x') and random(0, 0xf) or random(8, 0xb);
|
||||
return string.format('%x', v);
|
||||
end)
|
||||
local function uuid()
|
||||
local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
|
||||
return string.gsub(template, '[xy]', function (c)
|
||||
local v = (c == 'x') and random(0, 0xf) or random(8, 0xb);
|
||||
return string.format('%x', v);
|
||||
end)
|
||||
end
|
||||
|
||||
--get session variables
|
||||
@@ -100,7 +100,7 @@
|
||||
SELECT COUNT(*) AS in_group FROM
|
||||
v_ring_group_destinations
|
||||
WHERE
|
||||
domain_uuid = ']]..domain_uuid..[['
|
||||
domain_uuid = ']]..domain_uuid..[['
|
||||
AND ring_group_uuid = ']]..ring_group_uuid..[['
|
||||
AND destination_number = ']]..destination_number..[['
|
||||
]];
|
||||
@@ -109,21 +109,21 @@
|
||||
assert(dbh:query(sql, function(row)
|
||||
if (row.in_group == "0") then
|
||||
sql = [[
|
||||
INSERT INTO
|
||||
v_ring_group_destinations
|
||||
INSERT INTO
|
||||
v_ring_group_destinations
|
||||
( ring_group_destination_uuid,
|
||||
domain_uuid,
|
||||
ring_group_uuid,
|
||||
domain_uuid,
|
||||
ring_group_uuid,
|
||||
destination_number,
|
||||
destination_delay,
|
||||
destination_timeout
|
||||
)
|
||||
VALUES
|
||||
)
|
||||
VALUES
|
||||
( ']]..ring_group_destination_uuid..[[',
|
||||
']]..domain_uuid..[[',
|
||||
']]..ring_group_uuid..[[',
|
||||
']]..destination..[[',
|
||||
]]..destination_delay..[[,
|
||||
']]..domain_uuid..[[',
|
||||
']]..ring_group_uuid..[[',
|
||||
']]..destination..[[',
|
||||
]]..destination_delay..[[,
|
||||
]]..destination_timeout..[[
|
||||
)]];
|
||||
freeswitch.consoleLog("NOTICE", "[ring_group][destination] SQL "..sql.."\n");
|
||||
@@ -139,11 +139,11 @@
|
||||
end
|
||||
if (menu_selection == "2") then
|
||||
sql = [[
|
||||
DELETE FROM
|
||||
v_ring_group_destinations
|
||||
WHERE
|
||||
domain_uuid =']]..domain_uuid..[['
|
||||
AND ring_group_uuid=']]..ring_group_uuid..[['
|
||||
DELETE FROM
|
||||
v_ring_group_destinations
|
||||
WHERE
|
||||
domain_uuid =']]..domain_uuid..[['
|
||||
AND ring_group_uuid=']]..ring_group_uuid..[['
|
||||
AND destination_number=']]..destination..[['
|
||||
]];
|
||||
freeswitch.consoleLog("NOTICE", "[ring_group][destination] SQL "..sql.."\n");
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
if (voicemail_attach_file == nil) then
|
||||
voicemail_attach_file = "true";
|
||||
end
|
||||
|
||||
|
||||
--valid voicemail
|
||||
if (voicemail_uuid ~= nil) then
|
||||
--answer the session
|
||||
@@ -340,7 +340,7 @@
|
||||
end
|
||||
|
||||
--get the voicemail destinations
|
||||
sql = [[select * from v_voicemail_destinations
|
||||
sql = [[select * from v_voicemail_destinations
|
||||
where voicemail_uuid = ']]..voicemail_uuid..[[']]
|
||||
--freeswitch.consoleLog("notice", "[voicemail][destinations] SQL:" .. sql .. "\n");
|
||||
destinations = {};
|
||||
@@ -361,7 +361,7 @@
|
||||
--determine uuid
|
||||
if (y == 1) then
|
||||
voicemail_message_uuid = uuid;
|
||||
else
|
||||
else
|
||||
voicemail_message_uuid = api:execute("create_uuid");
|
||||
end
|
||||
y = y + 1;
|
||||
@@ -506,7 +506,7 @@
|
||||
--callback (works with DTMF)
|
||||
--http://wiki.freeswitch.org/wiki/Mod_fsv
|
||||
--mkdir(voicemail_dir.."/"..voicemail_id);
|
||||
--session:recordFile(file_name, max_len_secs, silence_threshold, silence_secs)
|
||||
--session:recordFile(file_name, max_len_secs, silence_threshold, silence_secs)
|
||||
--session:sayPhrase(macro_name [,macro_data] [,language]);
|
||||
--session:sayPhrase("voicemail_menu", "1:2:3:#", default_language);
|
||||
--session:streamFile("directory/dir-to_select_entry.wav"); --works with setInputCallback
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
--check to see if the greeting file exists
|
||||
if (storage_type == "base64" or storage_type == "http_cache") then
|
||||
greeting_invalid = true;
|
||||
sql = [[SELECT * FROM v_voicemail_greetings
|
||||
sql = [[SELECT * FROM v_voicemail_greetings
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND voicemail_id = ']].. voicemail_id.. [['
|
||||
AND greeting_id = ']].. greeting_id.. [[' ]];
|
||||
@@ -59,20 +59,20 @@
|
||||
end
|
||||
|
||||
--validate the greeting_id
|
||||
if (greeting_id == "0"
|
||||
or greeting_id == "1"
|
||||
or greeting_id == "2"
|
||||
or greeting_id == "3"
|
||||
or greeting_id == "4"
|
||||
or greeting_id == "5"
|
||||
or greeting_id == "6"
|
||||
or greeting_id == "7"
|
||||
or greeting_id == "8"
|
||||
if (greeting_id == "0"
|
||||
or greeting_id == "1"
|
||||
or greeting_id == "2"
|
||||
or greeting_id == "3"
|
||||
or greeting_id == "4"
|
||||
or greeting_id == "5"
|
||||
or greeting_id == "6"
|
||||
or greeting_id == "7"
|
||||
or greeting_id == "8"
|
||||
or greeting_id == "9") then
|
||||
|
||||
--valid greeting_id update the database
|
||||
if (session:ready()) then
|
||||
if (greeting_id == "0") then
|
||||
if (greeting_id == "0") then
|
||||
sql = [[UPDATE v_voicemails SET greeting_id = null ]];
|
||||
else
|
||||
sql = [[UPDATE v_voicemails SET greeting_id = ']]..greeting_id..[[' ]];
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
--get the greeting from the database
|
||||
if (storage_type == "base64") then
|
||||
sql = [[SELECT * FROM v_voicemail_greetings
|
||||
sql = [[SELECT * FROM v_voicemail_greetings
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND voicemail_id = ']].. voicemail_id.. [['
|
||||
AND greeting_id = ']].. greeting_id.. [[' ]];
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
end
|
||||
--say the message number
|
||||
if (session:ready()) then
|
||||
if (string.len(dtmf_digits) == 0) then
|
||||
if (string.len(dtmf_digits) == 0) then
|
||||
dtmf_digits = macro(session, "message_number", 1, 100, '');
|
||||
end
|
||||
end
|
||||
@@ -72,7 +72,7 @@
|
||||
end
|
||||
--get the recordings from the database
|
||||
if (storage_type == "base64") then
|
||||
sql = [[SELECT * FROM v_voicemail_messages
|
||||
sql = [[SELECT * FROM v_voicemail_messages
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND voicemail_message_uuid = ']].. uuid.. [[' ]];
|
||||
if (debug["sql"]) then
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
table.insert(actions, {app="streamFile",data="voicemail/vm-press.wav"});
|
||||
table.insert(actions, {app="streamFile",data="digits/3.wav"});
|
||||
end
|
||||
--At the tone please record your name press any key or stop talking to end the recording
|
||||
--At the tone please record your name press any key or stop talking to end the recording
|
||||
if (name == "record_name") then
|
||||
table.insert(actions, {app="streamFile",data="voicemail/vm-record_name1.wav"});
|
||||
table.insert(actions, {app="tone_stream",data="L=1;%(1000, 0, 640)"});
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
local accounts = {}
|
||||
table.insert(accounts, voicemail_id);
|
||||
--get the voicemail id and all related mwi accounts
|
||||
sql = [[SELECT extension, number_alias from v_extensions
|
||||
sql = [[SELECT extension, number_alias from v_extensions
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND (mwi_account = ']]..voicemail_id..[[' or mwi_account = ']]..voicemail_id..[[@]]..domain_name..[[')]];
|
||||
if (debug["sql"]) then
|
||||
@@ -47,7 +47,7 @@
|
||||
sql = [[SELECT count(*) as message_count FROM v_voicemail_messages as m, v_voicemails as v
|
||||
WHERE v.domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND v.voicemail_uuid = m.voicemail_uuid
|
||||
AND v.voicemail_id = ']] .. voicemail_id ..[['
|
||||
AND v.voicemail_id = ']] .. voicemail_id ..[['
|
||||
AND (m.message_status is null or m.message_status = '') ]];
|
||||
if (debug["sql"]) then
|
||||
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n");
|
||||
@@ -57,7 +57,7 @@
|
||||
end);
|
||||
|
||||
--send the message waiting event
|
||||
for key,value in pairs(accounts) do
|
||||
for key,value in pairs(accounts) do
|
||||
local event = freeswitch.Event("message_waiting");
|
||||
if (message_count == "0") then
|
||||
if (debug["info"]) then
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
--define on_dtmf call back function
|
||||
function on_dtmf(s, type, obj, arg)
|
||||
if (type == "dtmf") then
|
||||
freeswitch.console_log("info", "[voicemail] dtmf digit: " .. obj['digit'] .. ", duration: " .. obj['duration'] .. "\n");
|
||||
freeswitch.console_log("info", "[voicemail] dtmf digit: " .. obj['digit'] .. ", duration: " .. obj['duration'] .. "\n");
|
||||
if (obj['digit'] == "#") then
|
||||
return 0;
|
||||
else
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
--get the greeting from the database
|
||||
if (storage_type == "base64") then
|
||||
sql = [[SELECT * FROM v_voicemail_greetings
|
||||
sql = [[SELECT * FROM v_voicemail_greetings
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND voicemail_id = ']].. voicemail_id.. [['
|
||||
AND greeting_id = ']].. greeting_id.. [[' ]];
|
||||
|
||||
@@ -39,14 +39,14 @@
|
||||
end
|
||||
|
||||
--validate the greeting_id
|
||||
if (greeting_id == "1"
|
||||
or greeting_id == "2"
|
||||
or greeting_id == "3"
|
||||
or greeting_id == "4"
|
||||
or greeting_id == "5"
|
||||
or greeting_id == "6"
|
||||
or greeting_id == "7"
|
||||
or greeting_id == "8"
|
||||
if (greeting_id == "1"
|
||||
or greeting_id == "2"
|
||||
or greeting_id == "3"
|
||||
or greeting_id == "4"
|
||||
or greeting_id == "5"
|
||||
or greeting_id == "6"
|
||||
or greeting_id == "7"
|
||||
or greeting_id == "8"
|
||||
or greeting_id == "9") then
|
||||
--record your greeting at the tone press any key or stop talking to end the recording
|
||||
if (session:ready()) then
|
||||
@@ -59,7 +59,7 @@
|
||||
freeswitch.consoleLog("notice", "[voicemail] ".. storage_type .. " ".. storage_path .."\n");
|
||||
storage_path = storage_path:gsub("${domain_name}", domain_name);
|
||||
session:execute("record", storage_path .."/"..recording_name);
|
||||
else
|
||||
else
|
||||
--prepare to record the greeting
|
||||
if (session:ready()) then
|
||||
max_len_seconds = 30;
|
||||
@@ -101,12 +101,12 @@
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--clean up any tmp greeting files
|
||||
for gid = 1, 9, 1 do
|
||||
if (file_exists(voicemail_dir.."/"..voicemail_id.."/greeting_"..gid..".tmp.wav")) then
|
||||
os.remove(voicemail_dir.."/"..voicemail_id.."/greeting_"..gid..".tmp.wav");
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -170,7 +170,7 @@
|
||||
--remove temporary greeting file, if any
|
||||
if (file_exists(tmp_file)) then
|
||||
os.remove(tmp_file);
|
||||
end
|
||||
end
|
||||
record_greeting(greeting_id);
|
||||
end
|
||||
if (type == "name") then
|
||||
@@ -181,8 +181,8 @@
|
||||
--remove temporary greeting file, if any
|
||||
if (file_exists(tmp_file)) then
|
||||
os.remove(tmp_file);
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
--hangup
|
||||
if (session:ready()) then
|
||||
dtmf_digits = '';
|
||||
@@ -205,7 +205,7 @@
|
||||
--remove temporary greeting file, if any
|
||||
if (file_exists(tmp_file)) then
|
||||
os.remove(tmp_file);
|
||||
end
|
||||
end
|
||||
advanced();
|
||||
end
|
||||
if (type == "name") then
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
if (dtmf_digits == nil) then
|
||||
dtmf_digits = session:getDigits(max_digits, "#", 1000);
|
||||
else
|
||||
dtmf_digits = dtmf_digits .. session:getDigits(max_digits, "#", 1000);
|
||||
dtmf_digits = dtmf_digits .. session:getDigits(max_digits, "#", 1000);
|
||||
end
|
||||
end
|
||||
if (dtmf_digits) then
|
||||
@@ -166,10 +166,10 @@
|
||||
--delete the wav file, if mp3 exists
|
||||
if (file_exists(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid..".mp3")) then
|
||||
os.remove(voicemail_dir.."/"..voicemail_id.."/msg_"..uuid..".wav");
|
||||
else
|
||||
else
|
||||
vm_message_ext = "wav";
|
||||
end
|
||||
else
|
||||
else
|
||||
freeswitch.consoleLog("notice", "neither mod_shout or lame found, defaulting to wav\n");
|
||||
vm_message_ext = "wav";
|
||||
end
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
os.remove(file);
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -36,7 +36,7 @@
|
||||
debug["sql"] = false;
|
||||
debug["info"] = false;
|
||||
|
||||
--only run the script a single time
|
||||
--only run the script a single time
|
||||
runonce = true
|
||||
--connect to the database
|
||||
require "resources.functions.database_handle";
|
||||
@@ -65,10 +65,10 @@
|
||||
end
|
||||
|
||||
--Send MWI events for voicemail boxes with messages
|
||||
sql = [[SELECT v.voicemail_id, v.voicemail_uuid, v.domain_uuid, d.domain_name, COUNT(*) AS message_count
|
||||
FROM v_voicemail_messages as m, v_voicemails as v, v_domains as d
|
||||
WHERE v.voicemail_uuid = m.voicemail_uuid
|
||||
AND v.domain_uuid = d.domain_uuid
|
||||
sql = [[SELECT v.voicemail_id, v.voicemail_uuid, v.domain_uuid, d.domain_name, COUNT(*) AS message_count
|
||||
FROM v_voicemail_messages as m, v_voicemails as v, v_domains as d
|
||||
WHERE v.voicemail_uuid = m.voicemail_uuid
|
||||
AND v.domain_uuid = d.domain_uuid
|
||||
GROUP BY v.voicemail_id, v.voicemail_uuid, v.domain_uuid, d.domain_name;]];
|
||||
if (debug["sql"]) then
|
||||
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n");
|
||||
@@ -120,5 +120,5 @@
|
||||
--slow the loop down
|
||||
os.execute("sleep "..sleep);
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@
|
||||
table.insert(xml, [[ <control action="vol listen dn" digits="4"/>]]);
|
||||
table.insert(xml, [[ <control action="hangup" digits=""/>]]);
|
||||
table.insert(xml, [[ <control action="execute_application" digits="0" data="lua app/conference_center/resources/scripts/mute.lua non_moderator"/>]]);
|
||||
table.insert(xml, [[ <control action="execute_application" digits="*" data="lua app/conference_center/resources/scripts/unmute.lua non_moderator"/>]]);
|
||||
table.insert(xml, [[ <control action="execute_application" digits="*" data="lua app/conference_center/resources/scripts/unmute.lua non_moderator"/>]]);
|
||||
table.insert(xml, [[ </group>]]);
|
||||
table.insert(xml, [[ <group name="page">]]);
|
||||
table.insert(xml, [[ <control action="mute" digits="0"/>]]);
|
||||
|
||||
+5
-5
@@ -44,7 +44,7 @@
|
||||
assert(dbh:connected());
|
||||
|
||||
--get the ivr menu from the database
|
||||
sql = [[SELECT * FROM v_ivr_menus
|
||||
sql = [[SELECT * FROM v_ivr_menus
|
||||
WHERE ivr_menu_uuid = ']] .. ivr_menu_uuid ..[['
|
||||
AND ivr_menu_enabled = 'true' ]];
|
||||
if (debug["sql"]) then
|
||||
@@ -86,7 +86,7 @@
|
||||
--greet long
|
||||
if (string.len(ivr_menu_greet_long) > 1) then
|
||||
if (not file_exists(recordings_dir.."/"..domain_name.."/"..ivr_menu_greet_long)) then
|
||||
sql = [[SELECT * FROM v_recordings
|
||||
sql = [[SELECT * FROM v_recordings
|
||||
WHERE domain_uuid = ']]..domain_uuid..[['
|
||||
AND recording_filename = ']]..ivr_menu_greet_long..[[' ]];
|
||||
if (debug["sql"]) then
|
||||
@@ -110,7 +110,7 @@
|
||||
--greet short
|
||||
if (string.len(ivr_menu_greet_short) > 1) then
|
||||
if (not file_exists(recordings_dir.."/"..domain_name.."/"..ivr_menu_greet_short)) then
|
||||
sql = [[SELECT * FROM v_recordings
|
||||
sql = [[SELECT * FROM v_recordings
|
||||
WHERE domain_uuid = ']]..domain_uuid..[['
|
||||
AND recording_filename = ']]..ivr_menu_greet_short..[[' ]];
|
||||
if (debug["sql"]) then
|
||||
@@ -134,7 +134,7 @@
|
||||
--invalid sound
|
||||
if (string.len(ivr_menu_invalid_sound) > 1) then
|
||||
if (not file_exists(recordings_dir.."/"..domain_name.."/"..ivr_menu_invalid_sound)) then
|
||||
sql = [[SELECT * FROM v_recordings
|
||||
sql = [[SELECT * FROM v_recordings
|
||||
WHERE domain_uuid = ']]..domain_uuid..[['
|
||||
AND recording_filename = ']]..ivr_menu_invalid_sound..[[' ]];
|
||||
if (debug["sql"]) then
|
||||
@@ -158,7 +158,7 @@
|
||||
--exit sound
|
||||
if (string.len(ivr_menu_exit_sound) > 1) then
|
||||
if (not file_exists(recordings_dir.."/"..domain_name.."/"..ivr_menu_exit_sound)) then
|
||||
sql = [[SELECT * FROM v_recordings
|
||||
sql = [[SELECT * FROM v_recordings
|
||||
WHERE domain_uuid = ']]..domain_uuid..[['
|
||||
AND recording_filename = ']]..ivr_menu_exit_sound..[[' ]];
|
||||
if (debug["sql"]) then
|
||||
|
||||
@@ -170,27 +170,27 @@
|
||||
--determine the type of condition
|
||||
if (dialplan_detail_type == "hour") then
|
||||
condition_type = 'time';
|
||||
elseif (dialplan_detail_type == "minute") then
|
||||
elseif (dialplan_detail_type == "minute") then
|
||||
condition_type = 'time';
|
||||
elseif (dialplan_detail_type == "minute-of-day") then
|
||||
elseif (dialplan_detail_type == "minute-of-day") then
|
||||
condition_type = 'time';
|
||||
elseif (dialplan_detail_type == "mday") then
|
||||
elseif (dialplan_detail_type == "mday") then
|
||||
condition_type = 'time';
|
||||
elseif (dialplan_detail_type == "mweek") then
|
||||
elseif (dialplan_detail_type == "mweek") then
|
||||
condition_type = 'time';
|
||||
elseif (dialplan_detail_type == "mon") then
|
||||
elseif (dialplan_detail_type == "mon") then
|
||||
condition_type = 'time';
|
||||
elseif (dialplan_detail_type == "time-of-day") then
|
||||
elseif (dialplan_detail_type == "time-of-day") then
|
||||
condition_type = 'time';
|
||||
elseif (dialplan_detail_type == "yday") then
|
||||
elseif (dialplan_detail_type == "yday") then
|
||||
condition_type = 'time';
|
||||
elseif (dialplan_detail_type == "year") then
|
||||
elseif (dialplan_detail_type == "year") then
|
||||
condition_type = 'time';
|
||||
elseif (dialplan_detail_type == "wday") then
|
||||
elseif (dialplan_detail_type == "wday") then
|
||||
condition_type = 'time';
|
||||
elseif (dialplan_detail_type == "week") then
|
||||
elseif (dialplan_detail_type == "week") then
|
||||
condition_type = 'time';
|
||||
elseif (dialplan_detail_type == "date-time") then
|
||||
elseif (dialplan_detail_type == "date-time") then
|
||||
condition_type = 'time';
|
||||
else
|
||||
condition_type = 'default';
|
||||
|
||||
+3
-3
@@ -57,9 +57,9 @@
|
||||
|
||||
--build the call group array
|
||||
sql = [[
|
||||
select * from v_extensions
|
||||
where domain_uuid = ']]..domain_uuid..[['
|
||||
order by call_group asc
|
||||
select * from v_extensions
|
||||
where domain_uuid = ']]..domain_uuid..[['
|
||||
order by call_group asc
|
||||
]];
|
||||
if (debug["sql"]) then
|
||||
freeswitch.consoleLog("notice", "[xml_handler] SQL: " .. sql .. "\n");
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
--
|
||||
-- Contributor(s):
|
||||
-- Mark J Crane <markjcrane@fusionpbx.com>
|
||||
-- Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
|
||||
-- Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
|
||||
|
||||
--set the default
|
||||
continue = true;
|
||||
@@ -46,7 +46,7 @@
|
||||
number_alias_string = "";
|
||||
vm_mailto = "";
|
||||
|
||||
-- event source
|
||||
-- event source
|
||||
local event_calling_function = params:getHeader("Event-Calling-Function")
|
||||
local event_calling_file = params:getHeader("Event-Calling-File")
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
dofile(scripts_dir.."/app/xml_handler/resources/scripts/directory/action/directory.lua");
|
||||
else
|
||||
--handle action
|
||||
--all other directory actions: sip_auth, user_call
|
||||
--all other directory actions: sip_auth, user_call
|
||||
--except for the action: group_call
|
||||
|
||||
if (user == nil) then
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
file_handle:close();
|
||||
end
|
||||
--iterate array of file paths, get contents of other xml macro files
|
||||
for key, xml_file_path in pairs(xml_file_paths) do
|
||||
for key, xml_file_path in pairs(xml_file_paths) do
|
||||
if (file_exists(xml_file_path)) then
|
||||
xml_file = io.open(xml_file_path, "r");
|
||||
if (xml_file ~= nil) then
|
||||
@@ -170,7 +170,7 @@
|
||||
xml_file_content = string.gsub(xml_file_content, "</include>", '');
|
||||
table.insert(xml, xml_file_content);
|
||||
--freeswitch.consoleLog("notice", "file contents...\n\n"..xml_file_content.."\n");
|
||||
end
|
||||
end
|
||||
xml_file:close();
|
||||
end
|
||||
end
|
||||
|
||||
@@ -125,7 +125,7 @@ if (session:ready()) then
|
||||
|
||||
--hangup the call
|
||||
session:hangup();
|
||||
else
|
||||
else
|
||||
log.notice("execute " .. app .. " " .. data);
|
||||
|
||||
--exucute the application
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
local forward_caller_id = ""
|
||||
if enabled == "true" and not empty(forward_caller_id_uuid) then
|
||||
local sql = "select destination_number, destination_description,"..
|
||||
"destination_caller_id_number, destination_caller_id_name " ..
|
||||
"destination_caller_id_number, destination_caller_id_name " ..
|
||||
"from v_destinations where domain_uuid = '" .. domain_uuid .. "' and " ..
|
||||
"destination_type = 'inbound' and destination_uuid = '" .. forward_caller_id_uuid .. "'";
|
||||
local row = dbh:first_row(sql)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
-- Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
|
||||
-- Riccardo Granchi <riccardo.granchi@nems.it>
|
||||
--
|
||||
-- add this in Inbound Routes before transfer to use it:
|
||||
-- add this in Inbound Routes before transfer to use it:
|
||||
-- action set caller_id_name=${luarun cidlookup.lua ${uuid}}
|
||||
|
||||
--debug
|
||||
@@ -47,16 +47,16 @@
|
||||
countryCode = api:executeString("uuid_getvar " .. uuid .. " default_countrycode");
|
||||
|
||||
if ((countryCode ~= nil) and (string.len(countryCode) > 0)) then
|
||||
|
||||
|
||||
countryPrefix = "+" .. countryCode;
|
||||
|
||||
|
||||
if (string.sub(caller, 1, string.len(countryPrefix)) == countryPrefix) then
|
||||
cleanCaller = string.sub(caller, string.len(countryPrefix)+1);
|
||||
freeswitch.consoleLog("NOTICE", "[cidlookup] ignoring local international prefix " .. countryPrefix .. ": " .. caller .. " ==> " .. cleanCaller .. "\n");
|
||||
caller = cleanCaller;
|
||||
else
|
||||
if ((exitCode ~= nil) and (string.len(exitCode) > 0)) then
|
||||
|
||||
|
||||
countryPrefix = exitCode .. countryCode;
|
||||
|
||||
if (string.sub(caller, 1, string.len(countryPrefix)) == countryPrefix) then
|
||||
@@ -65,7 +65,7 @@
|
||||
caller = cleanCaller;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
--include config.lua
|
||||
@@ -104,7 +104,7 @@
|
||||
if ((name == nil) or (string.len(name) == 0)) then
|
||||
name = api:executeString("cidlookup " .. caller);
|
||||
end
|
||||
|
||||
|
||||
freeswitch.consoleLog("NOTICE", "[cidlookup] uuid_setvar " .. uuid .. " caller_id_name " .. name);
|
||||
api:executeString("uuid_setvar " .. uuid .. " caller_id_name " .. name);
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
--check if a file exists
|
||||
require "resources.functions.file_exists"
|
||||
|
||||
--define select_entry function
|
||||
--define select_entry function
|
||||
function select_entry()
|
||||
dtmf_digits = "";
|
||||
digit_timeout = "500";
|
||||
@@ -182,7 +182,7 @@
|
||||
return dtmf_digits;
|
||||
end
|
||||
|
||||
--define prompt_for_name function
|
||||
--define prompt_for_name function
|
||||
function prompt_for_name()
|
||||
dtmf_digits = "";
|
||||
min_digits=0; max_digits=3; max_tries=3; digit_timeout = "5000";
|
||||
@@ -196,7 +196,7 @@
|
||||
--get the digits for the name
|
||||
dtmf_digits = prompt_for_name();
|
||||
|
||||
--show the dtmf digits
|
||||
--show the dtmf digits
|
||||
freeswitch.consoleLog("notice", "[directory] first 3 letters of first or last name: " .. dtmf_digits .. "\n");
|
||||
|
||||
--loop through the extensions to find matches
|
||||
@@ -214,7 +214,7 @@
|
||||
if (row.first_name) then
|
||||
--play the recorded name
|
||||
if (storage_type == "base64") then
|
||||
sql = [[SELECT * FROM v_voicemails
|
||||
sql = [[SELECT * FROM v_voicemails
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND voicemail_id = ']].. row.extension.. [[' ]];
|
||||
if (debug["sql"]) then
|
||||
|
||||
@@ -59,7 +59,7 @@ freeswitch.consoleLog("info", "[disa.callback] calling " .. aleg_number .. "\n")
|
||||
freeswitch.msleep(2000);
|
||||
|
||||
while (session1:ready() and not session1:answered()) do
|
||||
if os.time() > t_started + 30 then
|
||||
if os.time() > t_started + 30 then
|
||||
freeswitch.consoleLog("info", "[disa.callback] timed out for " .. aleg_number .. "\n");
|
||||
session1:hangup();
|
||||
else
|
||||
@@ -78,7 +78,7 @@ if session1:ready() and session1:answered() then
|
||||
|
||||
session2 = freeswitch.Session(b_dialstring);
|
||||
while (session2:ready() and not session2:answered()) do
|
||||
if os.time() > t_started2 + 30 then
|
||||
if os.time() > t_started2 + 30 then
|
||||
freeswitch.consoleLog("info", "[disa.callback] timed out for " .. bleg_number .. "\n");
|
||||
session2:hangup();
|
||||
else
|
||||
|
||||
@@ -63,21 +63,21 @@ if (a_user_exists == "true") then
|
||||
extension_uuid = trim(api:executeString(cmd));
|
||||
a_dialstring = "[origination_caller_id_number=*3472,outbound_caller_id_number=*3472,call_timeout=30,context="..context..",sip_invite_domain="..context..",domain_name="..context..",domain="..context..",accountcode="..accountcode..",domain_uuid="..domain_uuid.."]user/"..aleg_number.."@"..context;
|
||||
else
|
||||
sql = [[select * from v_dialplans as d, v_dialplan_details as s
|
||||
sql = [[select * from v_dialplans as d, v_dialplan_details as s
|
||||
where (d.domain_uuid = ']] .. domain_uuid .. [[' or d.domain_uuid is null)
|
||||
and d.app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3'
|
||||
and d.dialplan_enabled = 'true'
|
||||
and d.dialplan_uuid = s.dialplan_uuid
|
||||
order by
|
||||
d.dialplan_order asc,
|
||||
d.dialplan_name asc,
|
||||
d.dialplan_uuid asc,
|
||||
s.dialplan_detail_group asc,
|
||||
CASE s.dialplan_detail_tag
|
||||
WHEN 'condition' THEN 1
|
||||
WHEN 'action' THEN 2
|
||||
WHEN 'anti-action' THEN 3
|
||||
ELSE 100 END,
|
||||
and d.app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3'
|
||||
and d.dialplan_enabled = 'true'
|
||||
and d.dialplan_uuid = s.dialplan_uuid
|
||||
order by
|
||||
d.dialplan_order asc,
|
||||
d.dialplan_name asc,
|
||||
d.dialplan_uuid asc,
|
||||
s.dialplan_detail_group asc,
|
||||
CASE s.dialplan_detail_tag
|
||||
WHEN 'condition' THEN 1
|
||||
WHEN 'action' THEN 2
|
||||
WHEN 'anti-action' THEN 3
|
||||
ELSE 100 END,
|
||||
s.dialplan_detail_order asc ]]
|
||||
if (debug["sql"]) then
|
||||
freeswitch.consoleLog("notice", "[disa ] sql for dialplans:" .. sql .. "\n");
|
||||
@@ -88,7 +88,7 @@ else
|
||||
dialplans[x] = row;
|
||||
x = x + 1;
|
||||
end));
|
||||
|
||||
|
||||
y = 0;
|
||||
previous_dialplan_uuid = '';
|
||||
for k, r in pairs(dialplans) do
|
||||
@@ -151,7 +151,7 @@ freeswitch.consoleLog("info", "[disa.callback] calling " .. aleg_number .. "\n")
|
||||
freeswitch.msleep(2000);
|
||||
|
||||
while (session1:ready() and not session1:answered()) do
|
||||
if os.time() > t_started + 30 then
|
||||
if os.time() > t_started + 30 then
|
||||
freeswitch.consoleLog("info", "[disa.callback] timed out for " .. aleg_number .. "\n");
|
||||
session1:hangup();
|
||||
else
|
||||
@@ -176,21 +176,21 @@ if session1:ready() and session1:answered() then
|
||||
extension_uuid = trim(api:executeString(cmd));
|
||||
b_dialstring = "[origination_caller_id_number=*3472,outbound_caller_id_number=*3472,call_timeout=30,context="..context..",sip_invite_domain="..context..",domain_name="..context..",domain="..context..",accountcode="..accountcode..",domain_uuid="..domain_uuid.."]user/"..bleg_number.."@"..context;
|
||||
else
|
||||
sql = [[select * from v_dialplans as d, v_dialplan_details as s
|
||||
sql = [[select * from v_dialplans as d, v_dialplan_details as s
|
||||
where (d.domain_uuid = ']] .. domain_uuid .. [[' or d.domain_uuid is null)
|
||||
and d.app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3'
|
||||
and d.dialplan_enabled = 'true'
|
||||
and d.dialplan_uuid = s.dialplan_uuid
|
||||
order by
|
||||
d.dialplan_order asc,
|
||||
d.dialplan_name asc,
|
||||
d.dialplan_uuid asc,
|
||||
s.dialplan_detail_group asc,
|
||||
CASE s.dialplan_detail_tag
|
||||
WHEN 'condition' THEN 1
|
||||
WHEN 'action' THEN 2
|
||||
WHEN 'anti-action' THEN 3
|
||||
ELSE 100 END,
|
||||
and d.app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3'
|
||||
and d.dialplan_enabled = 'true'
|
||||
and d.dialplan_uuid = s.dialplan_uuid
|
||||
order by
|
||||
d.dialplan_order asc,
|
||||
d.dialplan_name asc,
|
||||
d.dialplan_uuid asc,
|
||||
s.dialplan_detail_group asc,
|
||||
CASE s.dialplan_detail_tag
|
||||
WHEN 'condition' THEN 1
|
||||
WHEN 'action' THEN 2
|
||||
WHEN 'anti-action' THEN 3
|
||||
ELSE 100 END,
|
||||
s.dialplan_detail_order asc ]]
|
||||
if (debug["sql"]) then
|
||||
freeswitch.consoleLog("notice", "[disa ] sql for dialplans:" .. sql .. "\n");
|
||||
@@ -200,7 +200,7 @@ if session1:ready() and session1:answered() then
|
||||
assert(dbh:query(sql, function(row)
|
||||
dialplans[x] = row;
|
||||
x = x + 1;
|
||||
end));
|
||||
end));
|
||||
y = 0;
|
||||
previous_dialplan_uuid = '';
|
||||
for k, r in pairs(dialplans) do
|
||||
@@ -258,7 +258,7 @@ if session1:ready() and session1:answered() then
|
||||
|
||||
session2 = freeswitch.Session(b_dialstring);
|
||||
while (session2:ready() and not session2:answered()) do
|
||||
if os.time() > t_started2 + 30 then
|
||||
if os.time() > t_started2 + 30 then
|
||||
freeswitch.consoleLog("info", "[disa.callback] timed out for " .. bleg_number .. "\n");
|
||||
session2:hangup();
|
||||
else
|
||||
|
||||
@@ -102,7 +102,7 @@ if ( session:ready() ) then
|
||||
else
|
||||
caller_id_number = session:getVariable("effective_caller_id_number");
|
||||
end
|
||||
else
|
||||
else
|
||||
if (caller_id_name) then
|
||||
--caller id name provided do nothing
|
||||
else
|
||||
|
||||
@@ -195,7 +195,7 @@ if ( session:ready() ) then
|
||||
end
|
||||
|
||||
--contact exists
|
||||
--looks for caller_id_name and caller_id_name
|
||||
--looks for caller_id_name and caller_id_name
|
||||
end
|
||||
|
||||
--if a predefined_destination is provided then set the number to the predefined_destination
|
||||
@@ -221,7 +221,7 @@ if ( session:ready() ) then
|
||||
else
|
||||
caller_id_number = session:getVariable("effective_caller_id_number");
|
||||
end
|
||||
else
|
||||
else
|
||||
if (caller_id_name) then
|
||||
--caller id name provided do nothing
|
||||
else
|
||||
@@ -244,7 +244,7 @@ if ( session:ready() ) then
|
||||
freeswitch.consoleLog("notice", "[disa] cmd "..cmd.."\n");
|
||||
api:executeString(cmd);
|
||||
session:hangup("NORMAL_CLEARING");
|
||||
return;
|
||||
return;
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -47,29 +47,29 @@ if (session:ready()) then
|
||||
fifo_count = api:executeString("fifo count " .. extension_queue);
|
||||
|
||||
-- freeswitch.consoleLog("notice", "fifo count " .. fifo_count .. "]\n");
|
||||
|
||||
|
||||
-- Parsing queue info
|
||||
i = 0;
|
||||
v = {};
|
||||
v = {};
|
||||
for w in string.gmatch(fifo_count,"[^:]+") do
|
||||
v[i] = w;
|
||||
i = i + 1;
|
||||
end
|
||||
|
||||
|
||||
fifo_name = v[0];
|
||||
consumer_count = v[1];
|
||||
caller_count = v[2];
|
||||
member_count = v[3];
|
||||
ring_consumer_count = v[4];
|
||||
idle_consumer_count = v[5];
|
||||
|
||||
|
||||
if( not (member_count == "0") ) then
|
||||
freeswitch.consoleLog("notice", "Adding member [" .. extension .. "] to fifo " .. extension_queue .. " \n");
|
||||
freeswitch.consoleLog("notice", "Adding member [" .. extension .. "] to fifo " .. extension_queue .. " \n");
|
||||
|
||||
session:execute("set", "fifo_member_add_result=${fifo_member(add " .. extension_queue .." {fifo_member_wait=nowait}user/" .. extension .. " " ..fifo_simo .. " " ..fifo_timeout .. " " .. fifo_lag .. "} )"); --simo timeout lag
|
||||
end;
|
||||
|
||||
-- Answerinf the call
|
||||
|
||||
-- Answerinf the call
|
||||
session:answer();
|
||||
session:execute( "fifo", extension_queue .. " in" );
|
||||
end
|
||||
|
||||
@@ -393,12 +393,12 @@
|
||||
--to keep the originate command shorter these are things we always send. One place to adjust for all.
|
||||
originate_same = "for_fax=1,accountcode='"..accountcode.."',domain_uuid="..domain_uuid..",domain_name="..domain_name..",mailto_address='"..email_address.."',mailfrom_address='"..from_address.."',origination_caller_id_name='"..origination_caller_id_name.. "',origination_caller_id_number="..origination_caller_id_number..",fax_uri="..fax_uri..",fax_retry_limit="..fax_retry_limit..",fax_retry_sleep="..fax_retry_sleep..",fax_verbose=true,fax_file='"..fax_file.."'";
|
||||
|
||||
if (fax_retry_attempts < fax_retry_limit) then
|
||||
if (fax_retry_attempts < fax_retry_limit) then
|
||||
|
||||
--timed out waitng for comm or on first message, or busy code
|
||||
if (fax_result_code == "2" or fax_result_code == "3" or hangup_cause_q850 == 17) then
|
||||
--do nothing. don't want to increment
|
||||
freeswitch.consoleLog("INFO","[FAX] Last Fax was probably Busy, don't increment retry_attempts. \n");
|
||||
freeswitch.consoleLog("INFO","[FAX] Last Fax was probably Busy, don't increment retry_attempts. \n");
|
||||
fax_busy_attempts = fax_busy_attempts + 1;
|
||||
if (fax_busy_attempts > fax_busy_limit) then
|
||||
fax_retry_attempts = 17;
|
||||
|
||||
@@ -306,7 +306,7 @@
|
||||
|
||||
else
|
||||
log.noticef("Found child call on remote machine `%s`.", call_hostname)
|
||||
-- we can not find parent on this box because channel on other box so we have to
|
||||
-- we can not find parent on this box because channel on other box so we have to
|
||||
-- forward call to this box
|
||||
session:execute("export", "sip_h_X-child_intercept_uuid="..uuid);
|
||||
return make_proxy_call(pickup_number, call_hostname)
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
api = freeswitch.API();
|
||||
|
||||
--get the ivr menu from the database
|
||||
sql = [[SELECT * FROM v_ivr_menus
|
||||
sql = [[SELECT * FROM v_ivr_menus
|
||||
WHERE ivr_menu_uuid = ']] .. ivr_menu_uuid ..[['
|
||||
AND ivr_menu_enabled = 'true' ]];
|
||||
if (debug["sql"]) then
|
||||
@@ -435,11 +435,11 @@
|
||||
if (storage_type == "base64") then
|
||||
if (ivr_menu_greet_long_is_base64 and file_exists(ivr_menu_greet_long)) then
|
||||
--os.remove(ivr_menu_greet_long);
|
||||
end
|
||||
end
|
||||
if (ivr_menu_greet_short_is_base64 and file_exists(ivr_menu_greet_short)) then
|
||||
--os.remove(ivr_menu_greet_short);
|
||||
end
|
||||
end
|
||||
if (ivr_menu_invalid_sound_is_base64 and file_exists(ivr_menu_invalid_sound)) then
|
||||
--os.remove(ivr_menu_invalid_sound);
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -43,7 +43,7 @@ if ( session:ready() ) then
|
||||
sounds_dir = session:getVariable("sounds_dir");
|
||||
destinations = session:getVariable("destinations");
|
||||
if (destinations == nil) then
|
||||
destinations = session:getVariable("extension_list");
|
||||
destinations = session:getVariable("extension_list");
|
||||
end
|
||||
destination_table = explode(",",destinations);
|
||||
caller_id_name = session:getVariable("caller_id_name");
|
||||
|
||||
@@ -35,7 +35,7 @@ tries = 0;
|
||||
|
||||
function check_pin_number()
|
||||
--sleep
|
||||
session:sleep(500);
|
||||
session:sleep(500);
|
||||
--increment the number of tries
|
||||
tries = tries + 1;
|
||||
--get the user pin number
|
||||
@@ -58,7 +58,7 @@ function check_pin_number()
|
||||
if (not auth) then
|
||||
if (tries < max_tries) then
|
||||
session:streamFile("phrase:voicemail_fail_auth:#");
|
||||
|
||||
|
||||
check_pin_number();
|
||||
else
|
||||
session:streamFile("phrase:voicemail_fail_auth:#");
|
||||
|
||||
@@ -7,7 +7,7 @@ local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
|
||||
|
||||
-- encoding
|
||||
function base64.enc(data)
|
||||
return ((data:gsub('.', function(x)
|
||||
return ((data:gsub('.', function(x)
|
||||
local r,b='',x:byte()
|
||||
for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end
|
||||
return r;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
require "resources.functions.trim";
|
||||
|
||||
local api = api
|
||||
local api = api
|
||||
if not api then
|
||||
if freeswitch then
|
||||
api = freeswitch.API()
|
||||
@@ -92,7 +92,7 @@ function Cache._self_test()
|
||||
local ok, err = Cache.get("a")
|
||||
assert(nil == ok)
|
||||
assert(err == "NOT FOUND")
|
||||
|
||||
|
||||
local s = "hello \\ ' world"
|
||||
assert(true == Cache.set("a", s))
|
||||
assert(s == Cache.get("a"))
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
-- @usage
|
||||
-- @usage
|
||||
-- -- Use default backend
|
||||
-- dbh = Database.new("system")
|
||||
-- .....
|
||||
--
|
||||
-- @usage
|
||||
-- @usage
|
||||
-- -- Use LuaSQL backend
|
||||
-- dbh = Database.backend.luasql("system")
|
||||
-- .....
|
||||
@@ -163,7 +163,7 @@ end
|
||||
-----------------------------------------------------------
|
||||
|
||||
-----------------------------------------------------------
|
||||
local Database = {} do
|
||||
local Database = {} do
|
||||
|
||||
local backend_loader = setmetatable({}, {__index = function(self, backend)
|
||||
local class = require("resources.functions.database." .. backend)
|
||||
|
||||
@@ -8,7 +8,7 @@ local odbc = require "odbc.dba"
|
||||
local function remove_null(row, null, null_value)
|
||||
local o = {}
|
||||
for k, v in pairs(row) do
|
||||
if v == null then
|
||||
if v == null then
|
||||
o[k] = null_value
|
||||
else
|
||||
o[k] = tostring(v)
|
||||
|
||||
@@ -9,7 +9,7 @@ local odbcpool = require "odbc.dba.pool"
|
||||
local function remove_null(row, null, null_value)
|
||||
local o = {}
|
||||
for k, v in pairs(row) do
|
||||
if v == null then
|
||||
if v == null then
|
||||
o[k] = null_value
|
||||
else
|
||||
o[k] = tostring(v)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
--add the explode function
|
||||
function explode ( seperator, str )
|
||||
function explode ( seperator, str )
|
||||
local pos, arr = 0, {}
|
||||
if (seperator ~= nil and str ~= nil) then
|
||||
for st, sp in function() return string.find( str, seperator, pos, true ) end do -- for each divider found
|
||||
|
||||
@@ -95,7 +95,7 @@ function Settings:_load(category, subcategory, name)
|
||||
if type(self._db) == 'string' then
|
||||
db = Database.new(self._db)
|
||||
end
|
||||
|
||||
|
||||
local found = false
|
||||
--get the domain settings
|
||||
if domain_uuid then
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
return max;
|
||||
end
|
||||
|
||||
--define select_entry function
|
||||
--define select_entry function
|
||||
function settings(domain_uuid)
|
||||
|
||||
--define the table
|
||||
@@ -124,7 +124,7 @@
|
||||
subcategory = row.domain_setting_subcategory;
|
||||
name = row.domain_setting_name;
|
||||
value = row.domain_setting_value;
|
||||
|
||||
|
||||
--add the category array
|
||||
if (array[category] == nil) then
|
||||
array[category] = {}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
---
|
||||
-- @tparam table dict Dictionary
|
||||
-- @tparam[opt='en'] string language default language
|
||||
-- @tparam[opt='us'] string dialect default language
|
||||
-- @return[1] nil if key is unknown
|
||||
-- @return[2] empty string if language/dialect unknown or there no appropriate value for default language/dialect
|
||||
-- @return[3] translated value accordint dictionary/language/dialect
|
||||
--
|
||||
--
|
||||
-- @usage
|
||||
-- local dict = {
|
||||
-- ['label-text'] = {
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
function on_dtmf(s, type, obj, arg)
|
||||
if (type == "dtmf") then
|
||||
session:setVariable("dtmf_digits", obj['digit']);
|
||||
freeswitch.console_log("info", "[streamfile] dtmf digit: " .. obj['digit'] .. ", duration: " .. obj['duration'] .. "\n");
|
||||
freeswitch.console_log("info", "[streamfile] dtmf digit: " .. obj['digit'] .. ", duration: " .. obj['duration'] .. "\n");
|
||||
if (obj['digit'] == "*") then
|
||||
return("false"); --return to previous
|
||||
elseif (obj['digit'] == "0") then
|
||||
@@ -92,7 +92,7 @@
|
||||
--if base64, get from db, create temp file
|
||||
if (storage_type == "base64") then
|
||||
if (not file_exists(recordings_dir.."/"..file_name_only)) then
|
||||
sql = [[SELECT * FROM v_recordings
|
||||
sql = [[SELECT * FROM v_recordings
|
||||
WHERE domain_uuid = ']] .. domain_uuid ..[['
|
||||
AND recording_filename = ']].. file_name_only.. [[' ]];
|
||||
if (debug["sql"]) then
|
||||
@@ -110,13 +110,13 @@
|
||||
file:close();
|
||||
end
|
||||
end);
|
||||
else
|
||||
else
|
||||
file_name = recordings_dir.."/"..file_name_only;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--adjust file path
|
||||
if (not file_exists(file_name)) then
|
||||
if (not file_exists(file_name)) then
|
||||
if (file_exists(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..file_name_only)) then
|
||||
file_name = sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/"..file_name_only;
|
||||
elseif (file_exists(recordings_dir.."/"..file_name_only)) then
|
||||
@@ -128,10 +128,10 @@
|
||||
if (session:ready()) then
|
||||
session:answer();
|
||||
slept = session:getVariable("slept");
|
||||
if (slept == nil or slept == "false") then
|
||||
if (slept == nil or slept == "false") then
|
||||
freeswitch.consoleLog("notice", "[ivr_menu] sleeping (1s)\n");
|
||||
session:sleep(1000);
|
||||
if (slept == "false") then
|
||||
if (slept == "false") then
|
||||
session:setVariable("slept", "true");
|
||||
end
|
||||
end
|
||||
@@ -144,5 +144,5 @@
|
||||
if (storage_type == "base64") then
|
||||
if (file_exists(file_name)) then
|
||||
--os.remove(file_name);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -158,7 +158,7 @@ API.txt for details.
|
||||
return makeUtcWrapper(new Date(ts));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// map of app. size of time units in milliseconds
|
||||
|
||||
var timeUnitSize = {
|
||||
@@ -176,9 +176,9 @@ API.txt for details.
|
||||
|
||||
var baseSpec = [
|
||||
[1, "second"], [2, "second"], [5, "second"], [10, "second"],
|
||||
[30, "second"],
|
||||
[30, "second"],
|
||||
[1, "minute"], [2, "minute"], [5, "minute"], [10, "minute"],
|
||||
[30, "minute"],
|
||||
[30, "minute"],
|
||||
[1, "hour"], [2, "hour"], [4, "hour"],
|
||||
[8, "hour"], [12, "hour"],
|
||||
[1, "day"], [2, "day"], [3, "day"],
|
||||
|
||||
Vendored
+3
-3
@@ -53,8 +53,8 @@
|
||||
.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
|
||||
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
|
||||
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
|
||||
.ui-button-icons-only { width: 3.4em; }
|
||||
button.ui-button-icons-only { width: 3.7em; }
|
||||
.ui-button-icons-only { width: 3.4em; }
|
||||
button.ui-button-icons-only { width: 3.7em; }
|
||||
|
||||
/*button text element */
|
||||
.ui-button .ui-button-text { display: block; line-height: 1.4; }
|
||||
@@ -92,7 +92,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
|
||||
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
||||
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
||||
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year { width: 49%;}
|
||||
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
||||
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
||||
|
||||
@@ -23,7 +23,7 @@ WHERE v_contact_phones.contact_uuid = v_contacts.contact_uuid AND (v_contact_pho
|
||||
LIMIT 1
|
||||
"/>
|
||||
|
||||
<!-- comment out citystate-sql to not setup a database (city/state)
|
||||
<!-- comment out citystate-sql to not setup a database (city/state)
|
||||
lookup -->
|
||||
<!--
|
||||
<param name="citystate-sql" value="
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<!-- pick a file name, a function name or 'all' -->
|
||||
<!-- map as many as you need for specific debugging -->
|
||||
<mappings>
|
||||
<!--
|
||||
name can be a file name, function name or 'all'
|
||||
<!--
|
||||
name can be a file name, function name or 'all'
|
||||
value is one or more of debug,info,notice,warning,err,crit,alert,all
|
||||
See examples below
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
Example: the following turns on debugging for error and critical levels only
|
||||
<map name="all" value="err,crit"/>
|
||||
|
||||
NOTE: using map name="all" will override any other settings! If you
|
||||
NOTE: using map name="all" will override any other settings! If you
|
||||
want a more specific set of console messages then you will need
|
||||
to specify which files and/or functions you want to have debug
|
||||
messages. One option is to turn on just the more critical
|
||||
messages with map name="all", then specify the other types of
|
||||
messages. One option is to turn on just the more critical
|
||||
messages with map name="all", then specify the other types of
|
||||
console messages you want to see for various files and functions.
|
||||
|
||||
Example: turn on ERROR, CRIT, ALERT for all modules, then specify other
|
||||
@@ -31,12 +31,12 @@
|
||||
<map name="mod_sndfile.c" value="warning,info,debug"/>
|
||||
-->
|
||||
<map name="all" value="console,debug,info,notice,warning,err,crit,alert"/>
|
||||
|
||||
|
||||
<!--
|
||||
You can use or modify this sample set of mappings. It turns on higher
|
||||
level messages for all modules and then specifies extra lower level
|
||||
messages for OpenZAP, Sofia, and switch core messages.
|
||||
|
||||
|
||||
<map name="all" value="warning,err,crit,alert"/>
|
||||
<map name="zap_analog.c" value="all"/>
|
||||
<map name="zap_io.c" value="all"/>
|
||||
@@ -44,8 +44,8 @@
|
||||
<map name="zap_zt.c" value="all"/>
|
||||
<map name="mod_openzap" value="all"/>
|
||||
<map name="sofia.c" value="notice"/>
|
||||
<map name="switch_core_state_machine.c" value="all"/>
|
||||
|
||||
<map name="switch_core_state_machine.c" value="all"/>
|
||||
|
||||
-->
|
||||
</mappings>
|
||||
<settings>
|
||||
|
||||
@@ -18,4 +18,4 @@
|
||||
<param name="search-order" value="last_name"/>
|
||||
</profile>
|
||||
</profiles>
|
||||
</configuration>
|
||||
</configuration>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<!-- Default Technology and profile -->
|
||||
<param name="default-techprofile" value="sofia/default"/>
|
||||
|
||||
|
||||
<!-- IP or Hostname of Default Route -->
|
||||
<param name="default-gateway" value="192.168.66.6"/>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
call_limit varchar(16) - contains optional call limit
|
||||
tech_prefix varchar(128) - tech prefix used to build dial string (ex: sofia/default )
|
||||
acctcode varchar(128) - used to set channel variable acctcode for logging into the CDRs
|
||||
destination_number varchar(16) - Number returning for the query for building the dial string. (ex: 18005551212)
|
||||
destination_number varchar(16) - Number returning for the query for building the dial string. (ex: 18005551212)
|
||||
See Documentation on the Wiki for further information -->
|
||||
<!-- <param name="custom-query" value="call FS_GET_SIP_LOCATION(%s);"/> -->
|
||||
</settings>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<!-- in additon to cookie, optionally restrict by ACL -->
|
||||
<!--<param name="apply-inbound-acl" value="lan"/>-->
|
||||
<!-- alternative is "binary" -->
|
||||
<!--<param name="encoding" value="string"/>-->
|
||||
<!--<param name="encoding" value="string"/>-->
|
||||
<!-- provide compatability with previous OTP release (use with care) -->
|
||||
<!--<param name="compat-rel" value="12"/> -->
|
||||
</settings>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!-- Please refer to http://wiki.freeswitch.org/wiki/FreeTDM for further documentation -->
|
||||
|
||||
<!--
|
||||
<!--
|
||||
This is a sample FreeSWITCH XML configuration for FreeTDM
|
||||
Remember you still need to configure freetdm.conf (no XML extension) in $prefix/conf/
|
||||
directory of FreeSWITCH. The freetdm.conf (no XML extension) is a simple text file
|
||||
@@ -8,11 +8,11 @@ definining the I/O interfaces (Sangoma, DAHDI etc). This file (freetdm.conf.xml)
|
||||
with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
-->
|
||||
<configuration name="freetdm.conf" description="FreeTDM Configuration">
|
||||
|
||||
|
||||
<settings>
|
||||
<param name="debug" value="0"/>
|
||||
<!--<param name="hold-music" value="$${moh_uri}"/>-->
|
||||
<!-- Analog global options (they apply to all spans)
|
||||
<!-- Analog global options (they apply to all spans)
|
||||
Remember you can only choose between either call-swap
|
||||
or 3-way, not both!
|
||||
-->
|
||||
@@ -65,7 +65,7 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
<!-- whether you want to enable callwaiting feature -->
|
||||
<!--<param name="callwaiting" value="true"/>-->
|
||||
|
||||
<!-- whether you want to answer/hangup on polarity reverse for outgoing calls in FXO devices
|
||||
<!-- whether you want to answer/hangup on polarity reverse for outgoing calls in FXO devices
|
||||
and send polarity reverse on answer/hangup for incoming calls in FXS devices -->
|
||||
<!--<param name="answer-polarity-reverse" value="false"/>-->
|
||||
<!--<param name="hangup-polarity-reverse" value="false"/>-->
|
||||
@@ -76,7 +76,7 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
-->
|
||||
|
||||
<!-- Retrieve caller id on polarity reverse -->
|
||||
<!--
|
||||
<!--
|
||||
<param name="polarity-callerid" value="true"/>
|
||||
-->
|
||||
|
||||
@@ -92,10 +92,10 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
</span>
|
||||
</analog_spans>
|
||||
|
||||
<!--
|
||||
|
||||
<!--
|
||||
|
||||
openr2 (MFC-R2 signaling) spans (ftmod_r2)
|
||||
|
||||
|
||||
In order to use this type of spans your FreeTDM must have been compiled with ftmod_r2 module.
|
||||
The module is compiled if the openr2 library is present when running the ./configure script
|
||||
in the FreeTDM source code
|
||||
@@ -103,17 +103,17 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
MFC-R2 signaling has lots of variants from country to country and even sometimes
|
||||
minor variants inside the same country. The only mandatory parameters here are:
|
||||
variant, but typically you also want to set max_ani and max_dnis.
|
||||
IT IS RECOMMENDED that you leave the default values (leaving them commented) for the
|
||||
other parameters unless you have problems or you have been instructed to change some
|
||||
parameter. OpenR2 library uses the 'variant' parameter to try to determine the
|
||||
best defaults for your country. If you want to contribute your configs for a particular
|
||||
country send them to the e-mail of the primary OpenR2 developer that you can find in the
|
||||
IT IS RECOMMENDED that you leave the default values (leaving them commented) for the
|
||||
other parameters unless you have problems or you have been instructed to change some
|
||||
parameter. OpenR2 library uses the 'variant' parameter to try to determine the
|
||||
best defaults for your country. If you want to contribute your configs for a particular
|
||||
country send them to the e-mail of the primary OpenR2 developer that you can find in the
|
||||
AUTHORS file of the OpenR2 package, they will be added to the samples directory of openr2.
|
||||
|
||||
-->
|
||||
<r2_spans>
|
||||
<span name="wp1" cfgprofile="testr2">
|
||||
|
||||
|
||||
<!--
|
||||
MFC/R2 variant. This depends on the OpenR2 supported variants
|
||||
A list of values can be found by executing the openr2 command r2test -l
|
||||
@@ -130,20 +130,20 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
<param name="dialplan" value="XML"/>
|
||||
<param name="context" value="default"/>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
Max amount of ANI (caller id digits) to ask for
|
||||
<param name="max_ani" value="4"/>
|
||||
<param name="max_ani" value="4"/>
|
||||
-->
|
||||
<!--
|
||||
Max amount of DNIS to ask for
|
||||
<param name="max_dnis" value="4"/>
|
||||
<!--
|
||||
Max amount of DNIS to ask for
|
||||
<param name="max_dnis" value="4"/>
|
||||
-->
|
||||
|
||||
<!-- Do not set parameters below this line unless you desire to tweak it because is not working -->
|
||||
|
||||
<!--
|
||||
|
||||
<!--
|
||||
Whether or not to get the ANI before getting DNIS (only affects incoming calls)
|
||||
Some telcos require ANI first some others do not care, if default go wrong on
|
||||
Some telcos require ANI first some others do not care, if default go wrong on
|
||||
incoming calls, change this value
|
||||
<param name="get_ani_first" value="yes"/>
|
||||
-->
|
||||
@@ -237,23 +237,23 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
WARNING: advanced users only! I really mean it
|
||||
this parameter is commented by default because
|
||||
YOU DON'T NEED IT UNLESS YOU REALLY GROK MFC/R2
|
||||
READ COMMENTS on doc/r2proto.conf in openr2 package
|
||||
READ COMMENTS on doc/r2proto.conf in openr2 package
|
||||
for more info
|
||||
<param name="advanced_protocol_file" value="/usr/local/freeswitch/conf/r2proto.conf"/>
|
||||
-->
|
||||
|
||||
<!-- USE THIS FOR DEBUGGING MFC-R2 PROTOCOL -->
|
||||
<!--
|
||||
<!--
|
||||
Where to dump advanced call file protocol logs
|
||||
<param name="logdir" value="$${base_dir}/log/mfcr2"/>
|
||||
-->
|
||||
|
||||
<!--
|
||||
<!--
|
||||
MFC/R2 valid logging values are: all,error,warning,debug,notice,cas,mf,nothing
|
||||
error,warning,debug and notice are self-descriptive
|
||||
'cas' is for logging ABCD CAS tx and rx
|
||||
'mf' is for logging of the Multi Frequency tones
|
||||
You can mix up values, like: loglevel=error,debug,mf to log just error, debug and
|
||||
You can mix up values, like: loglevel=error,debug,mf to log just error, debug and
|
||||
multi frequency messages
|
||||
'all' is a special value to log all the activity
|
||||
'nothing' is a clean-up value, in case you want to not log any activity for
|
||||
@@ -265,7 +265,7 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
<param name="logging" value="debug,notice,warning,error,mf,cas"/>
|
||||
-->
|
||||
|
||||
<!--
|
||||
<!--
|
||||
whether or not to drop protocol call files into 'logdir'
|
||||
<param name="call_files" value="yes"/>
|
||||
-->
|
||||
@@ -284,7 +284,7 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
<!-- Sangoma ISDN PRI/BRI spans. Requires libsng_isdn to be installed -->
|
||||
<sangoma_pri_spans>
|
||||
<span name="wp1">
|
||||
<!--
|
||||
<!--
|
||||
Switch emulation/Variant
|
||||
Possible values are:
|
||||
national
|
||||
@@ -293,7 +293,7 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
qsig
|
||||
euroisdn
|
||||
ntt
|
||||
|
||||
|
||||
<param name="switchtype" value="national"/>
|
||||
-->
|
||||
<!--
|
||||
@@ -301,7 +301,7 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
Possible values are:
|
||||
net
|
||||
cpe
|
||||
|
||||
|
||||
<param name="signalling" value="cpe"/>
|
||||
-->
|
||||
<!--
|
||||
@@ -381,7 +381,7 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
Bearer Capability - User Layer 1
|
||||
Set the Bearer Capability - User Layer 1 on outbound calls
|
||||
Possible values are:
|
||||
|
||||
|
||||
V.110
|
||||
ulaw
|
||||
alaw
|
||||
@@ -392,13 +392,13 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
Channel Restart Timeout
|
||||
If we do not receive a RESTART message within this timeout on link
|
||||
UP, we will send a channel restart.
|
||||
|
||||
|
||||
|
||||
|
||||
<param name="channel-restart-timeout" value="20"/>
|
||||
-->
|
||||
<!--
|
||||
Local Number (MSN)
|
||||
On incoming calls, we will only respond to this call if
|
||||
On incoming calls, we will only respond to this call if
|
||||
the Called Party Number matches this value.
|
||||
|
||||
Note: Up to 8 local numbers can be added per span.
|
||||
@@ -452,7 +452,7 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
Force sending complete
|
||||
Will add Sending Complete IE to outgoing SETUP message
|
||||
By default, enabled on EuroISDN, disabled on US variants.
|
||||
|
||||
|
||||
<param name="force-sending-complete" value="yes/no"/>
|
||||
-->
|
||||
<!--
|
||||
@@ -464,13 +464,13 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
on-proceed
|
||||
on-progress
|
||||
on-alert
|
||||
|
||||
|
||||
<param name="early-media-override" value="on-alert"/>
|
||||
-->
|
||||
<!--
|
||||
Invert Channel ID Invert Bit
|
||||
|
||||
Invert the Channel ID Extend Bit
|
||||
Invert the Channel ID Extend Bit
|
||||
|
||||
<param name="chan-id-invert-extend-bit" value="yes/no"/>
|
||||
-->
|
||||
@@ -478,7 +478,7 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
CID Name transmit method
|
||||
|
||||
How to transmit Caller ID Name
|
||||
|
||||
|
||||
Possible values:
|
||||
display-ie
|
||||
user-user-ie
|
||||
@@ -499,11 +499,11 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
|
||||
<param name="cid-name-transmit-method" value="default"/>
|
||||
-->
|
||||
<!--
|
||||
<!--
|
||||
Q.931 Timers in seconds
|
||||
|
||||
|
||||
Override default Q.931 values
|
||||
|
||||
|
||||
timers:
|
||||
timer-t301
|
||||
timer-t302
|
||||
@@ -526,9 +526,9 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
-->
|
||||
</span>
|
||||
</sangoma_pri_spans>
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
<!--
|
||||
PRI passive tapping spans. Requires patched version from libpri at http://svn.digium.com/svn/libpri/team/moy/tap-1.4
|
||||
You must also configure FreeTDM with "-with-pritap" (see ./configure help for details)
|
||||
-->
|
||||
@@ -537,13 +537,13 @@ with the signaling protocols that you can run on top of your I/O interfaces.
|
||||
<!-- The peer span name used to tap the link -->
|
||||
<param name="peerspan" value="tapped2"/>
|
||||
|
||||
<!--
|
||||
Whether to mix the audio from the peerspan with the audio from this span
|
||||
<!--
|
||||
Whether to mix the audio from the peerspan with the audio from this span
|
||||
This is most likely what you want (and therefore the default) so you can hear
|
||||
the full conversation being tapped instead of just one side
|
||||
-->
|
||||
<!-- <param name="mixaudio" value="yes"/> -->
|
||||
|
||||
|
||||
<!-- switch parameters (required), where to send calls to -->
|
||||
<param name="dialplan" value="XML"/>
|
||||
<param name="context" value="default"/>
|
||||
|
||||
@@ -29,20 +29,20 @@
|
||||
<permission name="set-vars" value="false">
|
||||
<!-- default to "deny" or "allow" -->
|
||||
<!-- type attr can be "deny" or "allow" nothing defaults to opposite of the list default so allow in this case -->
|
||||
<!--
|
||||
<!--
|
||||
<variable-list default="deny">
|
||||
<variable name="caller_id_name"/>
|
||||
<variable name="hangup"/>
|
||||
<variable name="hangup"/>
|
||||
</variable-list>
|
||||
-->
|
||||
</permission>
|
||||
<permission name="get-vars" value="false">
|
||||
<!-- default to "deny" or "allow" -->
|
||||
<!-- type attr can be "deny" or "allow" nothing defaults to opposite of the list default so allow in this case -->
|
||||
<!--
|
||||
<!--
|
||||
<variable-list default="deny">
|
||||
<variable name="caller_id_name"/>
|
||||
<variable name="hangup"/>
|
||||
<variable name="hangup"/>
|
||||
</variable-list>
|
||||
-->
|
||||
</permission>
|
||||
@@ -58,15 +58,15 @@
|
||||
<permission name="expand-vars-in-tag-body" value="false">
|
||||
<!-- default to "deny" or "allow" -->
|
||||
<!-- type attr can be "deny" or "allow" nothing defaults to opposite of the list default so allow in this case -->
|
||||
<!--
|
||||
<!--
|
||||
<variable-list default="deny">
|
||||
<variable name="caller_id_name"/>
|
||||
<variable name="hangup"/>
|
||||
<variable name="hangup"/>
|
||||
</variable-list>
|
||||
|
||||
<api-list default="deny">
|
||||
<api name="expr"/>
|
||||
<api name="lua"/>
|
||||
<api name="lua"/>
|
||||
</api-list>
|
||||
-->
|
||||
</permission>
|
||||
@@ -79,11 +79,11 @@
|
||||
<permission name="conference" value="true"/>
|
||||
<permission name="conference-set-profile" value="false"/>
|
||||
</permissions>
|
||||
|
||||
|
||||
<params>
|
||||
<!-- default url can be overridden by app data -->
|
||||
<param name="gateway-url" value="http://www.freeswitch.org/api/index.cgi" />
|
||||
|
||||
|
||||
<!-- set this to provide authentication credentials to the server -->
|
||||
<!--<param name="gateway-credentials" value="muser:mypass"/>-->
|
||||
<!--<param name="auth-scheme" value="basic"/>-->
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<param name="id" value="2"/>
|
||||
<param name="order_by" value="reliability,quality"/>
|
||||
</profile>
|
||||
<!--
|
||||
<!--
|
||||
Some samples of how to do custom SQL:
|
||||
|
||||
=============================================================
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</settings>
|
||||
<mappings>
|
||||
<!--
|
||||
name can be a file name, function name or 'all'
|
||||
name can be a file name, function name or 'all'
|
||||
value is one or more of debug,info,notice,warning,err,crit,alert,all
|
||||
Please see comments in console.conf.xml for more information
|
||||
-->
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<configuration name="lua.conf" description="LUA Configuration">
|
||||
<settings>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
Specify local directories that will be searched for LUA modules
|
||||
These entries will be pre-pended to the LUA_CPATH environment variable
|
||||
-->
|
||||
<!-- <param name="module-directory" value="/usr/lib/lua/5.1/?.so"/> -->
|
||||
<!-- <param name="module-directory" value="/usr/local/lib/lua/5.1/?.so"/> -->
|
||||
|
||||
<!--
|
||||
<!--
|
||||
Specify local directories that will be searched for LUA scripts
|
||||
These entries will be pre-pended to the LUA_PATH environment variable
|
||||
-->
|
||||
@@ -21,7 +21,7 @@
|
||||
<!--
|
||||
The following options identifies a lua script that is launched
|
||||
at startup and may live forever in the background.
|
||||
You can define multiple lines, one for each script you
|
||||
You can define multiple lines, one for each script you
|
||||
need to run.
|
||||
-->
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<configuration name="modules.conf" description="Modules">
|
||||
<modules>
|
||||
|
||||
|
||||
<!-- Loggers (I'd load these first) -->
|
||||
<load module="mod_console"/>
|
||||
<load module="mod_logfile"/>
|
||||
@@ -113,7 +113,7 @@
|
||||
<!-- <load module="mod_cepstral"/> -->
|
||||
<!-- <load module="mod_tts_commandline"/> -->
|
||||
<!-- <load module="mod_rss"/> -->
|
||||
|
||||
|
||||
<!-- Say -->
|
||||
<load module="mod_say_en"/>
|
||||
<!-- <load module="mod_say_ru"/> -->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<configuration name="mongo.conf">
|
||||
<settings>
|
||||
<!--
|
||||
<!--
|
||||
connection-string handles different ways to connect to mongo
|
||||
samples:
|
||||
server:port
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<!--<param name="xml-handler-bindings" value="dialplan"/>-->
|
||||
|
||||
<!--
|
||||
The following options identifies a perl script that is launched
|
||||
The following options identifies a perl script that is launched
|
||||
at startup and may live forever in the background.
|
||||
You can define multiple lines, one for each script you
|
||||
You can define multiple lines, one for each script you
|
||||
need to run.
|
||||
-->
|
||||
<!--param name="startup-script" value="startup_script_1.pl"/-->
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<configuration name="portaudio.conf" description="Soundcard Endpoint">
|
||||
<settings>
|
||||
<!-- indev, outdev, ringdev:
|
||||
partial case sensitive string match on something in the name
|
||||
<!-- indev, outdev, ringdev:
|
||||
partial case sensitive string match on something in the name
|
||||
or the device number prefixed with # eg "#1" (or blank for default) -->
|
||||
|
||||
<!-- device to use for input -->
|
||||
@@ -33,7 +33,7 @@
|
||||
<param name="codec-ms" value="20"/>
|
||||
</settings>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
mod_portaudio "streams"
|
||||
|
||||
The portaudio streams were introduced to support multiple devices and multiple channels in mod_portaudio.
|
||||
@@ -41,8 +41,8 @@
|
||||
want to use them at the same time, you can do it configuring streams and endpoints here.
|
||||
|
||||
A "stream" is just a logical container for some settings required by portaudio in order to stream audio and
|
||||
define a friendly name for that configuration. Streams in itself do not do anything else than contain configs.
|
||||
Once you have your streams defined you can proceed to define "endpoints". Go to the "<endpoints>" section
|
||||
define a friendly name for that configuration. Streams in itself do not do anything else than contain configs.
|
||||
Once you have your streams defined you can proceed to define "endpoints". Go to the "<endpoints>" section
|
||||
for more information on endpoints.
|
||||
|
||||
You can use the command "pa shstreams" (portaudio shared streams) to show the configured streams.
|
||||
@@ -56,16 +56,16 @@
|
||||
|
||||
<!-- This sample "usb1" configuration was tested with a USB Griffin iMic device -->
|
||||
<stream name="usb1">
|
||||
<!--
|
||||
Which device to use for input in this stream
|
||||
The value for this parameter must be either in the form '#devno',
|
||||
<!--
|
||||
Which device to use for input in this stream
|
||||
The value for this parameter must be either in the form '#devno',
|
||||
for example '#2' for device number 2, or 'device-name', like 'iMic USB audio system'
|
||||
The output of command "pa devlist" will show you device names and numbers as enumerated
|
||||
by portaudio.
|
||||
-->
|
||||
<param name="indev" value="#2" />
|
||||
|
||||
<!--
|
||||
<!--
|
||||
Same as the indev but for output. In this case the device is capable of input and output
|
||||
Some devices are capable of input only or output only (see the default example)
|
||||
-->
|
||||
@@ -74,13 +74,13 @@
|
||||
<!-- The sample rate to use for this stream -->
|
||||
<param name="sample-rate" value="48000" />
|
||||
|
||||
<!--
|
||||
<!--
|
||||
Size of the packets in milliseconds. The smaller the number the less latency you'll have
|
||||
The minimum value is 10ms
|
||||
The minimum value is 10ms
|
||||
-->
|
||||
<param name="codec-ms" value="10" />
|
||||
|
||||
<!--
|
||||
<!--
|
||||
How many channels to open for this stream.
|
||||
If you're device is stereo, you can choose 2 here. However, bear in mind that then
|
||||
your left and right channels will be separated and when creating endpoints you will have
|
||||
@@ -106,7 +106,7 @@
|
||||
</stream>
|
||||
</streams>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
mod_portaudio "endpoints"
|
||||
|
||||
Endpoints is a way to define the input and output that a given portaudio channel will use.
|
||||
@@ -138,23 +138,23 @@
|
||||
-->
|
||||
<endpoints>
|
||||
|
||||
<!--
|
||||
An endpoint is a handle name to refer to a configuration that determines where to read media from
|
||||
and write media to. The endpoint can use any input/output stream combination for that purpose as
|
||||
<!--
|
||||
An endpoint is a handle name to refer to a configuration that determines where to read media from
|
||||
and write media to. The endpoint can use any input/output stream combination for that purpose as
|
||||
long as the streams match the sampling rate and codec-ms (see <streams> XML tag).
|
||||
You can also omit the instream or the outstream parameter (but obviously not both).
|
||||
-->
|
||||
|
||||
<!--
|
||||
<!--
|
||||
Configuration for a "default" bidirectional endpoint that uses the default stream defined previously in
|
||||
the <streams> section.
|
||||
-->
|
||||
<endpoint name="default">
|
||||
<!--
|
||||
<!--
|
||||
The instream, outstream is the name of the stream and channel to use. The stream
|
||||
name is the same you configured in the <streams> section. This parameters follow
|
||||
name is the same you configured in the <streams> section. This parameters follow
|
||||
the syntax <stream-name>:<channel index>. You can omit either the outstream
|
||||
or the instream, but not both! The channel index is zero-based and must be consistent
|
||||
or the instream, but not both! The channel index is zero-based and must be consistent
|
||||
with the number of channels available for that stream (as configured in the <stream> section).
|
||||
You cannot use index 1 if you chose channels=1 in the stream configuration.
|
||||
-->
|
||||
@@ -162,50 +162,50 @@
|
||||
<param name="outstream" value="default:0" />
|
||||
</endpoint>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
This endpoint uses the USB stream defined previously in the <streams> section and
|
||||
is 'send-only' or 'output-only' and uses the channel index 0 (left channel in a stereo device)
|
||||
is 'send-only' or 'output-only' and uses the channel index 0 (left channel in a stereo device)
|
||||
-->
|
||||
<endpoint name="usb1out-left">
|
||||
<param name="outstream" value="usb1:0" />
|
||||
</endpoint>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
This endpoint uses the USB stream defined previously in the <streams> section and
|
||||
is 'send-only' or 'output-only' and uses the channel index 1 (right channel in a stereo device)
|
||||
is 'send-only' or 'output-only' and uses the channel index 1 (right channel in a stereo device)
|
||||
-->
|
||||
<endpoint name="usb1out-right">
|
||||
<param name="outstream" value="usb1:1" />
|
||||
</endpoint>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
This endpoint uses the USB stream defined previously in the <streams> section and
|
||||
is 'receive-only' or 'input-only' and uses the channel index 0 (left channel in a stereo device)
|
||||
is 'receive-only' or 'input-only' and uses the channel index 0 (left channel in a stereo device)
|
||||
-->
|
||||
<endpoint name="usb1in-left">
|
||||
<param name="instream" value="usb1:0" />
|
||||
</endpoint>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
This endpoint uses the USB stream defined previously in the <streams> section and
|
||||
is 'receive-only' or 'input-only' and uses the channel index 1 (right channel in a stereo device)
|
||||
is 'receive-only' or 'input-only' and uses the channel index 1 (right channel in a stereo device)
|
||||
-->
|
||||
<endpoint name="usb1in-right">
|
||||
<param name="instream" value="usb1:1" />
|
||||
</endpoint>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
This endpoint uses the USB stream defined previously in the <streams> section and
|
||||
is 'bidirectional' or 'send-receive' and uses the channel index 0 (left channel in a stereo device)
|
||||
is 'bidirectional' or 'send-receive' and uses the channel index 0 (left channel in a stereo device)
|
||||
-->
|
||||
<endpoint name="usb1-left">
|
||||
<param name="instream" value="usb1:0" />
|
||||
<param name="outstream" value="usb1:0" />
|
||||
</endpoint>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
This endpoint uses the USB stream defined previously in the <streams> section and
|
||||
is 'bidirectional' or 'send-receive' and uses the channel index 1 (right channel in a stereo device)
|
||||
is 'bidirectional' or 'send-receive' and uses the channel index 1 (right channel in a stereo device)
|
||||
-->
|
||||
<endpoint name="usb1-right">
|
||||
<param name="instream" value="usb1:1" />
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<!--
|
||||
The following options identifies a py module that is launched
|
||||
at startup and may live forever in the background.
|
||||
You can define multiple lines, one for each script you
|
||||
You can define multiple lines, one for each script you
|
||||
need to run.
|
||||
-->
|
||||
<!--<param name="startup-script" value="startup_script_1"/>-->
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
|
||||
<settings>
|
||||
<!--
|
||||
Comma separated list of codecs to register with FreeSWITCH,
|
||||
Comma separated list of codecs to register with FreeSWITCH,
|
||||
by default (if this parameter is not set) all available codecs are registered.
|
||||
Valid codec values are: PCMU,PCMA,G729,G726-32,G722,GSM,G723,AMR,G7221,iLBC
|
||||
If this parameter is not specified only G729 will be registered
|
||||
<param name="register" value="all"/>
|
||||
-->
|
||||
|
||||
<!--
|
||||
<!--
|
||||
List of codecs to not register with FreeSWITCH, by default this is empty,
|
||||
but you may want to not load PCMU and PCMA or may be others to not use your
|
||||
resources in codecs that are done well and fast in software.
|
||||
but you may want to not load PCMU and PCMA or may be others to not use your
|
||||
resources in codecs that are done well and fast in software.
|
||||
<param name="noregister" value="PCMU,PCMA"/>
|
||||
-->
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<configuration name="spandsp.conf" description="SpanDSP config">
|
||||
<modem-settings>
|
||||
<!--
|
||||
total-modems set to N will create that many soft-modems.
|
||||
total-modems set to N will create that many soft-modems.
|
||||
If you use them with Hylafax you need the following for each one numbered 0..N:
|
||||
|
||||
1) A line like this in /etc/inittab:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<key name="10" value="sofia profile internal siptrace on"/>
|
||||
<key name="11" value="sofia profile internal siptrace off"/>
|
||||
<key name="12" value="version"/>
|
||||
</cli-keybindings>
|
||||
</cli-keybindings>
|
||||
|
||||
<default-ptimes>
|
||||
<!-- Set this to override the 20ms assumption of various codecs in the sdp with no ptime defined -->
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
<!--
|
||||
Max number of sessions to allow at any given time.
|
||||
|
||||
|
||||
NOTICE: If you're driving 28 T1's in a single box you should set this to 644*2 or 1288
|
||||
this will ensure you're able to use the entire DS3 without a problem. Otherwise you'll
|
||||
be 144 channels short of always filling that DS3 up which can translate into waste.
|
||||
@@ -64,24 +64,24 @@
|
||||
<!-- Maximum SQL Buffer length must be greater than sql-buffer-len -->
|
||||
<!-- <param name="max-sql-buffer-len" value="2m"/> -->
|
||||
|
||||
<!--
|
||||
The min-dtmf-duration specifies the minimum DTMF duration to use on
|
||||
<!--
|
||||
The min-dtmf-duration specifies the minimum DTMF duration to use on
|
||||
outgoing events. Events shorter than this will be increased in duration
|
||||
to match min_dtmf_duration. You cannot configure a dtmf duration on a
|
||||
to match min_dtmf_duration. You cannot configure a dtmf duration on a
|
||||
profile that is less than this setting. You may increase this value,
|
||||
but cannot set it lower than 400. This value cannot exceed
|
||||
but cannot set it lower than 400. This value cannot exceed
|
||||
max-dtmf-duration. -->
|
||||
<param name="min-dtmf-duration" value="640"/>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
The max-dtmf-duration caps the playout of a DTMF event at the specified
|
||||
duration. Events exceeding this duration will be truncated to this
|
||||
duration. You cannot configure a duration on a profile that exceeds
|
||||
this setting. This setting can be lowered, but cannot exceed 192000.
|
||||
this setting. This setting can be lowered, but cannot exceed 192000.
|
||||
This setting cannot be set lower than min_dtmf_duration. -->
|
||||
<!-- <param name="max-dtmf-duration" value="192000"/> -->
|
||||
|
||||
<!--
|
||||
<!--
|
||||
The default_dtmf_duration specifies the DTMF duration to use on
|
||||
originated DTMF events or on events that are received without a
|
||||
duration specified. This value can be increased or lowered. This
|
||||
@@ -144,7 +144,7 @@
|
||||
<param name="rtp-enable-zrtp" value="true"/>
|
||||
|
||||
<!-- <param name="core-db-dsn" value="$${dsn}" /> -->
|
||||
<!--
|
||||
<!--
|
||||
Allow to specify the sqlite db at a different location (In this example, move it to ramdrive for
|
||||
better performance on most linux distro (note, you loose the data if you reboot))
|
||||
-->
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
${rate}: sample rate (example: 8000)
|
||||
${voice}: voice_name passed to TTS(quoted)
|
||||
${file}: output file (quoted, including .wav extension)
|
||||
|
||||
|
||||
Example commands can be found at:
|
||||
http://wiki.freeswitch.org/wiki/Mod_tts_commandline#Example_commands
|
||||
-->
|
||||
|
||||
@@ -67,4 +67,4 @@
|
||||
<!--<param name="record-copyright" value="Your Copyright"/>-->
|
||||
</profile>
|
||||
</profiles>
|
||||
</configuration>
|
||||
</configuration>
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
<key dtmf="4" action="rerecord" variable="VM-Key-ReRecord-File" />
|
||||
<key dtmf="#" action="skip_instruction" />
|
||||
</keys>
|
||||
</menu>
|
||||
</menu>
|
||||
|
||||
<menu name="std_forward_ask_prepend">
|
||||
<phrases>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<!-- optional: if not present we do log the b leg -->
|
||||
<!-- true or false if we should create a cdr for the b leg of a call-->
|
||||
<param name="log-b-leg" value="false"/>
|
||||
|
||||
|
||||
<!-- optional: if not present, all filenames are the uuid of the call -->
|
||||
<!-- true or false if a leg files are prefixed "a_" -->
|
||||
<param name="prefix-a-leg" value="true"/>
|
||||
@@ -30,15 +30,15 @@
|
||||
<!-- encode the post data may be 'true' for url encoding, 'false' for no encoding, 'base64' for base64 encoding or 'textxml' for text/xml -->
|
||||
<param name="encode" value="true"/>
|
||||
|
||||
<!-- optional: set to true to disable Expect: 100-continue lighttpd requires this setting -->
|
||||
<!-- optional: set to true to disable Expect: 100-continue lighttpd requires this setting -->
|
||||
<param name="disable-100-continue" value="true"/>
|
||||
|
||||
|
||||
<!-- optional: full path to the error log dir for failed web posts if not specified its the same as log-dir -->
|
||||
<!-- either an absolute path, a relative path assuming ${prefix}/logs or a blank or omitted value will default to ${prefix}/logs/xml_cdr -->
|
||||
<!-- <param name="err-log-dir" value="/tmp"/> -->
|
||||
|
||||
<!-- which auhtentification scheme to use. Supported values are: basic, digest, NTLM, GSS-NEGOTIATE or "any" for automatic detection -->
|
||||
<!--<param name="auth-scheme" value="basic"/>-->
|
||||
<!--<param name="auth-scheme" value="basic"/>-->
|
||||
|
||||
<!-- optional: this will enable the CA root certificate check by libcurl to
|
||||
verify that the certificate was issued by a major Certificate Authority.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<include>
|
||||
|
||||
|
||||
<X-PRE-PROCESS cmd="set" data="AT_EPENT1=0 0 0 -1 -1 0 -1 0 -1 -1 0 -1"/>
|
||||
<X-PRE-PROCESS cmd="set" data="AT_EPENT2=1 1 1 -1 -1 1 -1 1 -1 -1 1 -1"/>
|
||||
<X-PRE-PROCESS cmd="set" data="AT_CPENT1=0 -1 -1 0 -1 0 0 0 -1 -1 0 -1"/>
|
||||
@@ -8,9 +8,9 @@
|
||||
<X-PRE-PROCESS cmd="set" data="AT_CMAJ2=1 -1 1 1 -1 1 -1 1 1 -1 1 -1"/>
|
||||
<X-PRE-PROCESS cmd="set" data="AT_BBLUES=1 -1 1 -1 -1 1 -1 1 1 1 -1 -1"/>
|
||||
<X-PRE-PROCESS cmd="set" data="ATGPENT2=-1 1 -1 1 -1 1 -1 -1 1 -1 1 -1"/>
|
||||
|
||||
<extension name="101">
|
||||
<condition field="destination_number" expression="^101$">
|
||||
|
||||
<extension name="101">
|
||||
<condition field="destination_number" expression="^101$">
|
||||
<!-- AUTOTALENT DEFAULTS -->
|
||||
|
||||
<!--
|
||||
@@ -65,13 +65,13 @@
|
||||
|
||||
|
||||
<action application="set"><![CDATA[ladspa_params=${AT_TUNE} ${AT_FIXED} ${AT_PULL} ${AT_EPENT2} ${AT_AMOUNT} ${AT_SMOOTH} ${AT_SHIFT} ${AT_OUTSCALE} ${AT_LFODEPTH} ${AT_LFORATE} ${AT_LFOSHAPE} ${AT_LFOSYMM} ${AT_LFOQUANT} ${AT_FCORR} ${AT_FWARP} ${AT_MIX}]]></action>
|
||||
|
||||
|
||||
<action application="ladspa_run" data="r|autotalent||${ladspa_params}"/>
|
||||
<action application="ladspa_run" data="r|tap_chorusflanger||"/>
|
||||
<action application="ladspa_run" data="r|phasers_1217.so|autoPhaser|"/>
|
||||
<action application="bridge" data="sofia/internal/888@conference.freeswitch.org"/>
|
||||
|
||||
</condition>
|
||||
</extension>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
</include>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<action application="hangup"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
|
||||
<extension name="Talking Clock Date" ><!--e.g. March 8, 2011-->
|
||||
<condition field="destination_number" expression="^9171$">
|
||||
<action application="answer"/>
|
||||
@@ -18,7 +18,7 @@
|
||||
<action application="hangup"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
|
||||
<extension name="Talking Clock Date and Time" ><!--e.g. March 8, 2011
|
||||
10:56pm-->
|
||||
<condition field="destination_number" expression="^9172$">
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
</extension>
|
||||
|
||||
<extension name="is_secure" continue="true">
|
||||
<!-- Only Truly consider it secure if its TLS and SRTP -->
|
||||
<!-- Only Truly consider it secure if its TLS and SRTP -->
|
||||
<condition field="${sip_via_protocol}" expression="tls"/>
|
||||
<condition field="${sip_secure_media_confirmed}" expression="^true$">
|
||||
<action application="sleep" data="1000"/>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
NOTICE:
|
||||
|
||||
This context is usually accessed via the external sip profile listening on port 5080.
|
||||
|
||||
|
||||
It is recommended to have separate inbound and outbound contexts. Not only for security
|
||||
but clearing up why you would need to do such a thing. You don't want outside un-authenticated
|
||||
callers hitting your default context which allows dialing calls thru your providers and results
|
||||
callers hitting your default context which allows dialing calls thru your providers and results
|
||||
in Toll Fraud.
|
||||
-->
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
<!--
|
||||
Tag anything pass thru here as an outside_call so you can make sure not
|
||||
to create any routing loops based on the conditions that it came from
|
||||
the outside of the switch.
|
||||
to create any routing loops based on the conditions that it came from
|
||||
the outside of the switch.
|
||||
-->
|
||||
<extension name="outside_call" continue="true">
|
||||
<condition>
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
<!--
|
||||
If you're hosting multiple domains you will want to set the
|
||||
target_domain on these calls so they hit the proper domain after you
|
||||
transfer the caller into the default context.
|
||||
|
||||
transfer the caller into the default context.
|
||||
|
||||
$${domain} is the default domain set from vars.xml but you can set it
|
||||
to any domain you have setup in your user directory.
|
||||
|
||||
-->
|
||||
-->
|
||||
<action application="set" data="domain_name=$${domain}"/>
|
||||
<!-- This example maps the DID 5551212 to ring 1000 in the default context -->
|
||||
<action application="transfer" data="1000 XML default"/>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<!--
|
||||
NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
||||
|
||||
NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
||||
|
||||
FreeSWITCH works off the concept of users and domains just like email.
|
||||
You have users that are in domains for example 1000@domain.com.
|
||||
|
||||
|
||||
When freeswitch gets a register packet it looks for the user in the directory
|
||||
based on the from or to domain in the packet depending on how your sofia profile
|
||||
is configured. Out of the box the default domain will be the IP address of the
|
||||
@@ -11,10 +11,10 @@
|
||||
CLI. You will register your phones to the IP and not the hostname by default.
|
||||
If you wish to register using the domain please open vars.xml in the root conf
|
||||
directory and set the default domain to the hostname you desire. Then you would
|
||||
use the domain name in the client instead of the IP address to register
|
||||
use the domain name in the client instead of the IP address to register
|
||||
with FreeSWITCH.
|
||||
|
||||
NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
||||
|
||||
NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
||||
-->
|
||||
|
||||
<include>
|
||||
@@ -41,7 +41,7 @@
|
||||
<group name="sales">
|
||||
<users>
|
||||
<!--
|
||||
type="pointer" is a pointer so you can have the
|
||||
type="pointer" is a pointer so you can have the
|
||||
same user in multiple groups. It basically means
|
||||
to keep searching for the user in the directory.
|
||||
-->
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<include>
|
||||
<!--
|
||||
ipauth if you have an cidr= in the user attributes ie cidr="1.2.3.4/32"
|
||||
see <node type="allow" domain="$${domain}"/> in default acl.conf.xml
|
||||
ipauth if you have an cidr= in the user attributes ie cidr="1.2.3.4/32"
|
||||
see <node type="allow" domain="$${domain}"/> in default acl.conf.xml
|
||||
-->
|
||||
<user id="brian" cidr="192.0.2.0/24">
|
||||
<!-- Outbound Registrations Related to this user -->
|
||||
@@ -16,7 +16,7 @@
|
||||
<!--/// domain to use in from: *optional* same as realm, if blank ///-->
|
||||
<!--<param name="from-domain" value="asterlink.com"/>-->
|
||||
<!--/// account password *required* ///-->
|
||||
<!--<param name="password" value="2007"/>-->
|
||||
<!--<param name="password" value="2007"/>-->
|
||||
<!--/// replace the INVITE from user with the channel's caller-id ///-->
|
||||
<!--<param name="caller-id-in-from" value="false"/>-->
|
||||
<!--/// extension for inbound calls: *optional* same as username, if blank ///-->
|
||||
@@ -52,7 +52,7 @@
|
||||
<!--<param name="vm-email-all-messages" value="true"/>-->
|
||||
<!-- optionally use this instead if you want to store the hash of user:domain:pass-->
|
||||
<!--<param name="a1-hash" value="c6440e5de50b403206989679159de89a"/>-->
|
||||
<!-- What this user is allowed to acces -->
|
||||
<!-- What this user is allowed to acces -->
|
||||
<!--<param name="http-allowed-api" value="jsapi,voicemail,status"/> -->
|
||||
</params>
|
||||
<variables>
|
||||
@@ -74,7 +74,7 @@
|
||||
<!--<variable name="numbering_plan" value="US"/>-->
|
||||
<!--<variable name="default_area_code" value="434"/>-->
|
||||
<!--<variable name="default_gateway" value="asterlink.com"/>-->
|
||||
<!--
|
||||
<!--
|
||||
NDLB-connectile-dysfunction - Rewrite contact ip and port
|
||||
NDLB-tls-connectile-dysfunction - Rewrite contact port only.
|
||||
-->
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
Let it be known that this user can register without a password but since we do not assign
|
||||
this user a user_context and we don't authenticate this user they will be put in context 'public'.
|
||||
|
||||
This isn't a security issue as the endpoint would be put into the same context 'public' as the
|
||||
sofia profile that starts on 5080 by default. If you're paranoid just remove this file and
|
||||
This isn't a security issue as the endpoint would be put into the same context 'public' as the
|
||||
sofia profile that starts on 5080 by default. If you're paranoid just remove this file and
|
||||
remove the external profile also.
|
||||
|
||||
-->
|
||||
|
||||
@@ -15,7 +15,7 @@ exten => ~^(18(0{2}|8{2}|7{2}|6{2})\d{7})$,n,bridge(${enum_auto_route})
|
||||
|
||||
; instead of exten, put anything about the call you would rather match on.
|
||||
; either the names of a field in caller_profile or a string of variables to expand.
|
||||
caller_id_number => 2137991400,n,Goto(default|music)
|
||||
caller_id_number => 2137991400,n,Goto(default|music)
|
||||
${sip_from_user} => bill,n,Goto(default|music)
|
||||
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
||||
|
||||
This is the FreeSWITCH default config. Everything you see before you now traverses
|
||||
NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
||||
|
||||
This is the FreeSWITCH default config. Everything you see before you now traverses
|
||||
down into all the directories including files which include more files. The default
|
||||
config comes out of the box already working in most situations as a PBX. This will
|
||||
allow you to get started testing and playing with various things in FreeSWITCH.
|
||||
|
||||
|
||||
Before you start to modify this default please visit this wiki page:
|
||||
|
||||
|
||||
http://wiki.freeswitch.org/wiki/Getting_Started_Guide#Some_stuff_to_try_out.21
|
||||
|
||||
|
||||
If all else fails you can read our FAQ located at:
|
||||
|
||||
|
||||
http://wiki.freeswitch.org/wiki/FreeSwitch_FAQ
|
||||
|
||||
NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
||||
|
||||
NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
|
||||
-->
|
||||
<document type="freeswitch/xml">
|
||||
<!--#comment
|
||||
<!--#comment
|
||||
All comments starting with #command will be preprocessed and never sent to the xml parser
|
||||
Valid instructions:
|
||||
#include ==> Include another file to this exact point
|
||||
@@ -26,10 +26,10 @@
|
||||
#set ==> Set a global variable (can be expanded during preprocessing with $$ variables)
|
||||
(note the double $$ which denotes preprocessor variables)
|
||||
#comment ==> A general comment such as this
|
||||
|
||||
|
||||
The preprocessor will compile the full xml document to ${prefix}/log/freeswitch.xml.fsxml
|
||||
Don't modify it while freeswitch is running cos it is mem mapped in most cases =D
|
||||
|
||||
|
||||
The same can be achieved with the <X-PRE-PROCESS> tag where the attrs 'cmd' and 'data' are
|
||||
parsed in the same way.
|
||||
-->
|
||||
@@ -41,7 +41,7 @@
|
||||
<section name="configuration" description="Various Configuration">
|
||||
<X-PRE-PROCESS cmd="include" data="autoload_configs/*.xml"/>
|
||||
</section>
|
||||
|
||||
|
||||
<section name="dialplan" description="Regex/XML Dialplan">
|
||||
<X-PRE-PROCESS cmd="include" data="dialplan/*.xml"/>
|
||||
</section>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
; whether to launch a thread for CPU usage monitoring
|
||||
cpu_monitor => no
|
||||
|
||||
; How often (in milliseconds) monitor CPU usage
|
||||
; How often (in milliseconds) monitor CPU usage
|
||||
cpu_monitoring_interval => 1000
|
||||
|
||||
; At what CPU percentage raise a CPU alarm
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<entry action="menu-sub" digits="6" param="demo_ivr_submenu"/> <!-- demo sub menu -->
|
||||
<!-- Using a regex in the digits tag lets you define a dial pattern for the caller
|
||||
You may define multiple regexes if you need a different pattern for some reason -->
|
||||
<entry action="menu-exec-app" digits="/^(10[01][0-9])$/" param="transfer $1 XML features"/>
|
||||
<entry action="menu-exec-app" digits="/^(10[01][0-9])$/" param="transfer $1 XML features"/>
|
||||
<entry action="menu-top" digits="9"/> <!-- Repeat this menu -->
|
||||
</menu>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</match>
|
||||
</input>
|
||||
</macro>
|
||||
|
||||
|
||||
<macro name="has_left_conf">
|
||||
<input pattern="^(\d+)$">
|
||||
<match>
|
||||
@@ -85,7 +85,7 @@
|
||||
<action function="sleep" data="400"/>
|
||||
<action function="say" data="$1" method="iterated" type="number"/>
|
||||
<action function="sleep" data="400"/>
|
||||
<action function="play-file" data="digits/2.wav"/>
|
||||
<action function="play-file" data="digits/2.wav"/>
|
||||
<action function="sleep" data="1000"/>
|
||||
<action function="play-file" data="ivr/ivr-extension_number.wav"/>
|
||||
<action function="sleep" data="400"/>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user