diff --git a/core/databases/app_defaults.php b/core/databases/app_defaults.php index 4d3611f6b6..596bc9b2fb 100644 --- a/core/databases/app_defaults.php +++ b/core/databases/app_defaults.php @@ -101,33 +101,48 @@ if ($domains_processed == 1) { if (strlen($_SESSION['switch']['sounds']['dir']) > 0) { $tmp .= " sounds_dir = \"".$_SESSION['switch']['sounds']['dir']."\";\n"; } + if (strlen($_SESSION['switch']['db']['dir']) > 0) { + $tmp .= " database_dir = \"".$_SESSION['switch']['db']['dir']."\";\n"; + } if (strlen($_SESSION['switch']['recordings']['dir']) > 0) { $tmp .= " recordings_dir = \"".$recordings_dir."\";\n"; } $tmp .= "\n"; - $tmp .= "--database connection info\n"; - if (strlen($db_type) > 0) { - $tmp .= " db_type = \"".$db_type."\";\n"; + $tmp .= "--define the database array\n"; + $tmp .= " database = {}\n"; + + $tmp .= "\n"; + $tmp .= "--database information\n"; + $tmp .= " database[\"type\"] = \"".$db_type."\";\n"; + $tmp .= " database[\"name\"] = \"".$db_name."\";\n"; + $tmp .= " database[\"path\"] = \"".$db_path."\";\n"; + if ($db_type == "pgsql") { + if ($db_host = "localhost") { $db_host = "127.0.0.1"; } + $tmp .= " database[\"system\"] = \"pgsql://hostaddr=".$db_host." port=".$db_port." dbname=".$db_name." user=".$db_username." password=".$db_password." options='-c client_min_messages=NOTICE' application_name='".$db_name."'\";\n"; + $tmp .= " database[\"switch\"] = \"pgsql://hostaddr=".$db_host." port=".$db_port." dbname=freeswitch user=".$db_username." password=".$db_password." options='-c client_min_messages=NOTICE' application_name='freeswitch'\";\n"; } - if (strlen($db_name) > 0) { - $tmp .= " db_name = \"".$db_name."\";\n"; + elseif ($db_type == "sqlite") { + $tmp .= " database[\"system\"] = \"sqlite://".$db_path."/".$db_name."\";\n"; + $tmp .= " database[\"switch\"] = \"sqlite://".$_SESSION['switch']['db']['dir']."\";\n"; } - if (strlen($db_path) > 0) { - $tmp .= " db_path = \"".$db_path."\";\n"; - } - if (strlen($dsn_name) > 0) { - $tmp .= " dsn_name = \"".$dsn_name."\";\n"; - } - if (strlen($dsn_username) > 0) { - $tmp .= " dsn_username = \"".$dsn_username."\";\n"; - } - if (strlen($dsn_password) > 0) { - $tmp .= " dsn_password = \"".$dsn_password."\";\n"; + elseif ($db_type == "mysql") { + if (strlen($dsn_name) > 0) { + $tmp .= " database[\"system\"] = \"odbc://".$dsn_name.":".$dsn_username.":".$dsn_password.";\"\n"; + $tmp .= " database[\"switch\"] = \"odbc://freeswitch:".$dsn_username.":".$dsn_password.";\"\n"; + } + else { + $tmp .= " database[\"system\"] = \"\"\n"; + $tmp .= " database[\"switch\"] = \"\"\n"; + } } + $tmp .= "\n"; $tmp .= "--additional info\n"; $tmp .= " domain_count = ".count($_SESSION["domains"]).";\n"; - $tmp .= " tmp_dir = \"".$tmp_dir."\";\n"; + $tmp .= " temp_dir = \"".$_SESSION['server']['temp']['dir']."\";\n"; + $tmp .= "\n"; + $tmp .= "--include local.lua\n"; + $tmp .= " include = loadfile(scripts_dir .. \"/resources/local.lua\"); if (include ~= nil) then include(); end\n"; fwrite($fout, $tmp); unset($tmp); fclose($fout); diff --git a/includes/install/scripts/app.lua b/includes/install/scripts/app.lua index 402bcdf16d..7f4bc71c5b 100644 --- a/includes/install/scripts/app.lua +++ b/includes/install/scripts/app.lua @@ -23,9 +23,9 @@ -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ---include the lua script +--include config.lua scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1)); - dofile(scripts_dir .. "/resources/config.lua"); + dofile(scripts_dir.."/resources/config.lua"); --get the argv values script_name = argv[0]; diff --git a/includes/install/scripts/app/conference_center/index.lua b/includes/install/scripts/app/conference_center/index.lua index 333e156b35..8a884ed030 100644 --- a/includes/install/scripts/app/conference_center/index.lua +++ b/includes/install/scripts/app/conference_center/index.lua @@ -30,14 +30,7 @@ digit_timeout = 5000; --connect to the database - --ODBC - data source name - if (dsn_name) then - dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password); - end - --FreeSWITCH core db handler - if (db_type == "sqlite") then - dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name); - end + dbh = freeswitch.Dbh(database["system"]); --prepare the api object api = freeswitch.API(); @@ -151,14 +144,7 @@ end_epoch = os.time(); --connect to the database - --ODBC - data source name - if (dsn_name) then - dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password); - end - --FreeSWITCH core db handler - if (db_type == "sqlite") then - dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name); - end + dbh = freeswitch.Dbh(database["system"]); --get the conference sessions sql = [[SELECT count(*) as num_rows @@ -613,6 +599,9 @@ end end + --close the database connection + dbh:release(); + --send the call to the conference profile = "default"; cmd = meeting_uuid.."-"..domain_name.."@"..profile.."+flags{".. flags .."}"; diff --git a/includes/install/scripts/app/voicemail/index.lua b/includes/install/scripts/app/voicemail/index.lua index 0f41717112..ca029aa50a 100644 --- a/includes/install/scripts/app/voicemail/index.lua +++ b/includes/install/scripts/app/voicemail/index.lua @@ -49,14 +49,7 @@ password_tries = 0; --connect to the database - --ODBC - data source name - if (dsn_name) then - dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password); - end - --FreeSWITCH core db handler - if (db_type == "sqlite") then - dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name); - end + dbh = freeswitch.Dbh(database["system"]); --set the api api = freeswitch.API(); @@ -282,7 +275,7 @@ end --close the database connection - --dbh:release(); + dbh:release(); --notes --record the video diff --git a/includes/install/scripts/call_flow.lua b/includes/install/scripts/call_flow.lua index 9c43c36d4b..9ac5509b00 100644 --- a/includes/install/scripts/call_flow.lua +++ b/includes/install/scripts/call_flow.lua @@ -28,20 +28,12 @@ max_tries = "3"; digit_timeout = "5000"; ---include the lua script +--include config.lua scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1)); - include = assert(loadfile(scripts_dir .. "/resources/config.lua")); - include(); + dofile(scripts_dir.."/resources/config.lua"); --connect to the database - --ODBC - data source name - if (dsn_name) then - dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password); - end - --FreeSWITCH core db handler - if (db_type == "sqlite") then - dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name); - end + dbh = freeswitch.Dbh(database["system"]); if (session:ready()) then --get the variables diff --git a/includes/install/scripts/call_flow_monitor.lua b/includes/install/scripts/call_flow_monitor.lua index 04d5d7f4e4..214fdac98c 100644 --- a/includes/install/scripts/call_flow_monitor.lua +++ b/includes/install/scripts/call_flow_monitor.lua @@ -31,20 +31,12 @@ debug["log"] = false; debug["sql"] = false; ---include the lua script +--include config.lua scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1)); - include = assert(loadfile(scripts_dir .. "/resources/config.lua")); - include(); + dofile(scripts_dir.."/resources/config.lua"); --connect to the database - --ODBC - data source name - if (dsn_name) then - dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password); - end - --FreeSWITCH core db handler - if (db_type == "sqlite") then - dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name); - end + dbh = freeswitch.Dbh(database["system"]); --make sure the scripts/run dir exists os.execute("mkdir -p " .. scripts_dir .. "/run"); diff --git a/includes/install/scripts/destination_caller_id.lua b/includes/install/scripts/destination_caller_id.lua index 0b658c3d3a..453a442b14 100644 --- a/includes/install/scripts/destination_caller_id.lua +++ b/includes/install/scripts/destination_caller_id.lua @@ -24,20 +24,12 @@ -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ---include the lua script +--include config.lua scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1)); - include = assert(loadfile(scripts_dir .. "/resources/config.lua")); - include(); + dofile(scripts_dir.."/resources/config.lua"); --connect to the database - --ODBC - data source name - if (dsn_name) then - dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password); - end - --FreeSWITCH core db handler - if (db_type == "sqlite") then - dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name); - end + dbh = freeswitch.Dbh(database["system"]); --add a trim function function trim (s) diff --git a/includes/install/scripts/dial_string.lua b/includes/install/scripts/dial_string.lua index 0dc4f8fde8..7d04fca285 100644 --- a/includes/install/scripts/dial_string.lua +++ b/includes/install/scripts/dial_string.lua @@ -32,20 +32,12 @@ db_dial_string = ""; db_extension_uuid = ""; ---include the lua script +--include config.lua scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1)); - include = assert(loadfile(scripts_dir .. "/resources/config.lua")); - include(); + dofile(scripts_dir.."/resources/config.lua"); --connect to the database - --ODBC - data source name - if (dsn_name) then - dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password); - end - --FreeSWITCH core db handler - if (db_type == "sqlite") then - dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name); - end + dbh = freeswitch.Dbh(database["system"]); if ( session:ready() ) then session:answer(); diff --git a/includes/install/scripts/directory.lua b/includes/install/scripts/directory.lua index 56ab2fd4af..208510d28d 100644 --- a/includes/install/scripts/directory.lua +++ b/includes/install/scripts/directory.lua @@ -37,20 +37,12 @@ debug["info"] = false; debug["sql"] = false; ---include the lua script +--include config.lua scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1)); - include = assert(loadfile(scripts_dir .. "/resources/config.lua")); - include(); + dofile(scripts_dir.."/resources/config.lua"); --connect to the database - --ODBC - data source name - if (dsn_name) then - dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password); - end - --FreeSWITCH core db handler - if (db_type == "sqlite") then - dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name); - end + dbh = freeswitch.Dbh(database["system"]); --prepare the api object api = freeswitch.API(); diff --git a/includes/install/scripts/disa.lua b/includes/install/scripts/disa.lua index 85fe8e8e31..7ce526edc5 100644 --- a/includes/install/scripts/disa.lua +++ b/includes/install/scripts/disa.lua @@ -82,9 +82,8 @@ if ( session:ready() ) then --pin is correct else session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/ivr/ivr-pin_or_extension_is-invalid.wav"); - session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/ivr/ivr-im_sorry.wav"); - session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/voicemail/vm-goodbye.wav"); - + session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/ivr/ivr-im_sorry.wav"); + session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/voicemail/vm-goodbye.wav"); session:hangup("NORMAL_CLEARING"); return; end diff --git a/includes/install/scripts/eavesdrop.lua b/includes/install/scripts/eavesdrop.lua index 1cb5535c1f..9772ee77f4 100644 --- a/includes/install/scripts/eavesdrop.lua +++ b/includes/install/scripts/eavesdrop.lua @@ -27,13 +27,23 @@ digit_timeout = "5000"; extension = argv[1]; ---database - --connect to the database - --local dbh = freeswitch.Dbh("dsn","user","pass"); -- when using ODBC - local dbh = freeswitch.Dbh("core:core"); -- when using sqlite +--include config.lua + scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1)); + dofile(scripts_dir.."/resources/config.lua"); - --exits the script if we didn't connect properly - assert(dbh:connected()); +--add the file_exists function + dofile(scripts_dir.."/resources/functions/file_exists.lua"); + +--connect to the database + if (file_exists(database_dir.."/core.db") then + --dbh = freeswitch.Dbh("core:core"); -- when using sqlite + dbh = freeswitch.Dbh("sqlite://"..database_dir.."/core.db"); + else + dbh = freeswitch.Dbh(database["switch"]); + end + +--exits the script if we didn't connect properly + assert(dbh:connected()); if ( session:ready() ) then session:answer( ); diff --git a/includes/install/scripts/intercept.lua b/includes/install/scripts/intercept.lua index f078b6c55c..b2f9f9af20 100644 --- a/includes/install/scripts/intercept.lua +++ b/includes/install/scripts/intercept.lua @@ -30,22 +30,20 @@ --set the debug options debug["sql"] = false; ---include the lua script +--include config.lua scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1)); - include = assert(loadfile(scripts_dir .. "/resources/config.lua")); include(); - include = loadfile(scripts_dir .. "/resources/local.lua"); if (include ~= nil) then include(); end + dofile(scripts_dir.."/resources/config.lua"); --connect to the database - --ODBC - data source name - if (switch_dsn_name) then - dbh = freeswitch.Dbh(switch_dsn_name,switch_dsn_username,switch_dsn_password); - end - --FreeSWITCH core db handler - if (db_type == "sqlite") then - dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name); - end - --exit the script if we didn't connect properly - assert(dbh:connected()); + if (file_exists(database_dir.."/core.db") then + --dbh = freeswitch.Dbh("core:core"); -- when using sqlite + dbh = freeswitch.Dbh("sqlite://"..database_dir.."/core.db"); + else + dbh = freeswitch.Dbh(database["switch"]); + end + +--exits the script if we didn't connect properly + assert(dbh:connected()); if ( session:ready() ) then --answer the session diff --git a/includes/install/scripts/ivr_menu.lua b/includes/install/scripts/ivr_menu.lua index bc9663b8a8..9191f3ad9e 100644 --- a/includes/install/scripts/ivr_menu.lua +++ b/includes/install/scripts/ivr_menu.lua @@ -31,20 +31,12 @@ debug["dtmf"] = false; debug["tries"] = false; ---include the lua script +--include config.lua scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1)); - include = assert(loadfile(scripts_dir .. "/resources/config.lua")); include(); - include = loadfile(scripts_dir .. "/resources/local.lua"); if (include ~= nil) then include(); end + dofile(scripts_dir.."/resources/config.lua"); --connect to the database - --ODBC - data source name - if (dsn_name) then - dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password); - end - --FreeSWITCH core db handler - if (db_type == "sqlite") then - dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name); - end + dbh = freeswitch.Dbh(database["system"]); --get the variables domain_name = session:getVariable("domain_name"); diff --git a/includes/install/scripts/park.lua b/includes/install/scripts/park.lua index 2952b732f2..30e46bf8c2 100644 --- a/includes/install/scripts/park.lua +++ b/includes/install/scripts/park.lua @@ -14,12 +14,17 @@ --action set park_music=$${hold_music} --action lua park.lua ---connect to the database - --ODBC - data source name - --local dbh = freeswitch.Dbh("name","user","pass"); - --FreeSWITCH core db - local dbh = freeswitch.Dbh("core:park"); +--include config.lua + scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1)); + dofile(scripts_dir.."/resources/config.lua"); +--connect to the database + --dbh = freeswitch.Dbh("core:core"); -- when using sqlite + dbh = freeswitch.Dbh("sqlite://"..database_dir.."/park.db"); + --dbh = freeswitch.Dbh(database["system"]); + +--exits the script if we didn't connect properly + assert(dbh:connected()); --get the session variables sounds_dir = session:getVariable("sounds_dir"); park_direction = session:getVariable("park_direction"); diff --git a/includes/install/scripts/park_monitor.lua b/includes/install/scripts/park_monitor.lua index 5be0010b6f..78c5106683 100644 --- a/includes/install/scripts/park_monitor.lua +++ b/includes/install/scripts/park_monitor.lua @@ -28,11 +28,14 @@ --if the call has been answered --then send presence terminate, and delete from the database +--include config.lua + scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1)); + dofile(scripts_dir.."/resources/config.lua"); + --connect to the database - --ODBC - data source name - --local dbh = freeswitch.Dbh("name","user","pass"); - --FreeSWITCH core db - local dbh = freeswitch.Dbh("core:park"); + --dbh = freeswitch.Dbh("core:core"); -- when using sqlite + dbh = freeswitch.Dbh("sqlite://"..database_dir.."/park.db"); + --dbh = freeswitch.Dbh(database["system"]); --get the argv values script_name = argv[0]; diff --git a/includes/install/scripts/ring_group.lua b/includes/install/scripts/ring_group.lua index bb306462ff..ead66f5e75 100644 --- a/includes/install/scripts/ring_group.lua +++ b/includes/install/scripts/ring_group.lua @@ -24,20 +24,12 @@ -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ---include the lua script +--include config.lua scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1)); - include = assert(loadfile(scripts_dir .. "/resources/config.lua")); - include(); + dofile(scripts_dir.."/resources/config.lua"); --connect to the database - --ODBC - data source name - if (dsn_name) then - dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password); - end - --FreeSWITCH core db handler - if (db_type == "sqlite") then - dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name); - end + dbh = freeswitch.Dbh(database["system"]); --get the variables if (session:ready()) then diff --git a/includes/install/scripts/xml_handler.lua b/includes/install/scripts/xml_handler.lua index 9ae9fbaf17..06ec5b44ab 100644 --- a/includes/install/scripts/xml_handler.lua +++ b/includes/install/scripts/xml_handler.lua @@ -37,20 +37,12 @@ debug["xml_string"] = false; debug["cache"] = false; ---include the lua script +--include config.lua scripts_dir = string.sub(debug.getinfo(1).source,2,string.len(debug.getinfo(1).source)-(string.len(argv[0])+1)); - include = assert(loadfile(scripts_dir .. "/resources/config.lua")); - include(); + dofile(scripts_dir.."/resources/config.lua"); --connect to the database - --ODBC - data source name - if (dsn_name) then - dbh = freeswitch.Dbh(dsn_name,dsn_username,dsn_password); - end - --FreeSWITCH core db handler - if (db_type == "sqlite") then - dbh = freeswitch.Dbh("sqlite://"..db_path.."/"..db_name); - end + dbh = freeswitch.Dbh(database["system"]); --add the trim function function trim(s) @@ -59,7 +51,7 @@ end --add the explode function - function explode ( seperator, str ) + function explode ( seperator, str ) local pos, arr = 0, {} for st, sp in function() return string.find( str, seperator, pos, true ) end do -- for each divider found table.insert( arr, string.sub( str, pos, st-1 ) ) -- attach chars left of current divider @@ -86,7 +78,7 @@ end --get the params and set them as variables - local domain_uuid = params:getHeader("variable_domain_uuid"); + local domain_name = params:getHeader("sip_from_host"); if (domain_uuid == nil) then local domain_uuid = params:getHeader("domain_uuid"); end @@ -723,111 +715,117 @@ table.insert(xml, [[]]); table.insert(xml, [[
]]); table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); if (number_alias) then if (cidr) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); else - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end else if (cidr) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); else - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end end - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); if (string.len(vm_mailto) > 0) then - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(mwi_account) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(auth_acl) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); if (string.len(call_group) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(hold_music) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(toll_allow) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(accountcode) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); if (string.len(effective_caller_id_name) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(effective_caller_id_number) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(outbound_caller_id_name) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(outbound_caller_id_number) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(emergency_caller_id_number) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(directory_full_name) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(directory_visible) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(directory_exten_visible) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(limit_max) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); else - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(limit_destination) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(sip_force_contact) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(sip_force_expires) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (string.len(nibble_account) > 0) then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (sip_bypass_media == "bypass-media") then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (sip_bypass_media == "bypass-media-after-bridge") then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end if (sip_bypass_media == "proxy-media") then - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); end - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]); table.insert(xml, [[ ]]); table.insert(xml, [[
]]); table.insert(xml, [[
]]); @@ -1132,4 +1130,4 @@ end --close the database connection - --dbh:release(); + dbh:release();