From bc2286d5d263b66410880decbcf58f6a30065ba4 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Tue, 16 Apr 2013 14:15:22 +0200 Subject: [PATCH] prefs.lua is now in templates. --- copy_templates.sh | 2 +- prefs.lua.tt2 | 60 ----------------------------------------------- 2 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 prefs.lua.tt2 diff --git a/copy_templates.sh b/copy_templates.sh index a00d24d..636fc0e 100755 --- a/copy_templates.sh +++ b/copy_templates.sh @@ -1,5 +1,5 @@ #!/bin/sh -cp prefs.lua.tt2 /etc/ngcp-config/templates/etc/kamailio/proxy/ +tpage --define PRO=true templates/proxy/prefs.lua > /etc/ngcp-config/templates/etc/kamailio/proxy/prefs.lua.tt2 tpage --define PRO=true templates/proxy/kamailio.cfg > /etc/ngcp-config/templates/etc/kamailio/proxy/kamailio.cfg.customtt.tt2 tpage --define PRO=true templates/proxy/proxy.cfg > /etc/ngcp-config/templates/etc/kamailio/proxy/proxy.cfg.customtt.tt2 ngcpcfg build /etc/kamailio/proxy diff --git a/prefs.lua.tt2 b/prefs.lua.tt2 deleted file mode 100644 index cbd4072..0000000 --- a/prefs.lua.tt2 +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env lua5.1 --- Kamailio Lua Config -require 'ngcp.ngcp' - -ngcp = NGCP:new() -loaded_keys = {caller={}, callee={}} - --- set config -ngcp.config.db_user = "[% kamailio.proxy.dbrwuser %]" -ngcp.config.db_pass = "[% kamailio.proxy.dbrwpw %]" -ngcp.config.db_host = "[% database.dbhost %]" -ngcp.config.db_database = "[% kamailio.proxy.dbname %]" - -function ngcp_test() - print = function(msg) - sr.log("info", msg) - end - require('tests.test_kamailio') -end - -function ngcp_init() - ngcp = NGCP:new() - loaded_keys = {caller={}, callee={}} -end - -function ngcp_clean(vtype) - ngcp:clean(vtype) - if #loaded_keys[vtype] > 0 then - sr.log("info", string.format("callee-> real: %s", table.tostring(loaded_keys[vtype]))) - end -end - -function print_loaded_prefs(vtype) - local _,v - local xavp = NGCPRealPrefs:xavp(vtype) - for _,v in pairs(loaded_keys[vtype]) do - sr.log("info", string.format("real key:%s value:%s\n", v, xavp(v))) - end -end - -function ngcp_caller_peer_load(peer) - loaded_keys["caller"] = ngcp:caller_peer_load(peer) - sr.log("info", string.format("real: %s", table.tostring(loaded_keys["caller"]))) -end - -function ngcp_callee_peer_load(peer) - loaded_keys["callee"] = ngcp:callee_peer_load(peer) - sr.log("info", string.format("real: %s", table.tostring(loaded_keys["callee"]))) -end - -function ngcp_caller_usr_load(uuid, dom) - loaded_keys["caller"] = ngcp:caller_usr_load(uuid, dom) - sr.log("info", string.format("real: %s", table.tostring(loaded_keys["caller"]))) -end - -function ngcp_callee_usr_load(uuid, dom) - loaded_keys["callee"] = ngcp:callee_usr_load(uuid, dom) - sr.log("info", string.format("real: %s", table.tostring(loaded_keys["callee"]))) -end ---EOF