-
Notifications
You must be signed in to change notification settings - Fork 172
Expand file tree
/
Copy pathastpp.lua
More file actions
executable file
·86 lines (69 loc) · 2.66 KB
/
Copy pathastpp.lua
File metadata and controls
executable file
·86 lines (69 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
-------------------------------------------------------------------------------------
-- ASTPP - Open Source VoIP Billing Solution
--
-- Copyright (C) 2016 iNextrix Technologies Pvt. Ltd.
-- Samir Doshi <samir.doshi@inextrix.com>
-- ASTPP Version 3.0 and above
-- License https://www.gnu.org/licenses/agpl-3.0.html
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as
-- published by the Free Software Foundation, either version 3 of the
-- License, or (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------------------
-- Define script path
local script_path = "/usr/share/freeswitch/scripts/astpp/";
-- Load config file
dofile("/var/lib/astpp/astpp.lua");
-- Load CONSTANT file
dofile("/usr/share/freeswitch/scripts/astpp/constant.lua");
-- Load json file to decode json string
JSON = (loadfile (script_path .."lib/JSON.lua"))();
-- Load utility file
dofile(script_path.."lib/astpp.utility.lua");
-- Include Logger file to print messages
dofile(script_path.."lib/astpp.logger.lua");
-- Include database connection file to connect database
dofile(script_path.."lib/astpp.db.lua");
-- Call database connection
db_connect()
-- Include common functions file
dofile(script_path.."lib/astpp.functions.lua");
config = load_conf()
--load_addon_list array
addon_list = load_addon_list()
-- Include file to build xml for fs
dofile(script_path.."scripts/astpp.xml.lua");
-- Include custom file to load custom function
dofile(script_path.."lib/astpp.custom.lua");
-- Load addons files
dirname = script_path..'lib/addons/'
f = io.popen('ls ' .. dirname)
for name in f:lines() do dofile(dirname..name..'') end
if (not params) then
params = {}
function params:getHeader(name)
self.name = name;
end
function params:serialize(name)
self.name = name;
end
end
if (config['debug'] == '0') then
-- print all params
if (params:serialize() ~= nil) then
Logger.notice ("[xml_handler] Params:\n" .. params:serialize())
end
for param_key,param_value in pairs(XML_REQUEST) do --pseudocode
Logger.info ("[xml_REQUEST] "..param_key..": " .. param_value)
end
end
dofile(script_path.."scripts/astpp."..XML_REQUEST["section"]..".lua")