From 8c6029af9e0b1c485c50d41f86d93a33f900555f Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Fri, 5 Apr 2013 13:31:33 +0200 Subject: [PATCH] Added helper functions to kamailio_conf.lua template --- kamailio_conf.lua.tt2 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/kamailio_conf.lua.tt2 b/kamailio_conf.lua.tt2 index cc12e85..8394ebc 100644 --- a/kamailio_conf.lua.tt2 +++ b/kamailio_conf.lua.tt2 @@ -19,7 +19,15 @@ function ngcp_test() end function ngcp_clean(vtype) + if #loaded_keys > 0 then + sr.log('loaded_keys has values\n') + end ngcp:clean(vtype) + local keys = loaded_keys["caller"] + sr.log("info", string.format("caller-> real: %s peer: %s", table.tostring(keys.real), table.tostring(keys.peer))) + keys = loaded_keys["callee"] + sr.log("info", string.format("callee-> real: %s peer: %s", table.tostring(keys.real), table.tostring(keys.peer))) + loaded_keys = {} end function print_loaded_prefs(vtype) @@ -34,6 +42,14 @@ function print_loaded_prefs(vtype) end end +function ngcp_load_caller_peer(peer) + ngcp_load_caller(nil, nil, peer) +end + +function ngcp_load_callee_peer(peer) + ngcp_load_callee(nil, nil, peer) +end + function ngcp_load_caller(uuid, domain, peer) loaded_keys["caller"] = ngcp:caller_load(uuid, domain, peer) local keys = loaded_keys["caller"]