ngcp.utils is used in ngcp-prosody-modules and that is used in Lua5.4
lua-logging doesn't work with lua5.4
Change-Id: Id5e2f2afb7ab780d38b4b2ccdd388b0b5c2c4a27
Line KSR.dbg(msg:format(callid, key), callid) is wrong, callid is part of the arguments
used to feed msg:format anot not KSR.dbg
Change-Id: Ibd96b53ef1edf9aa8b6037cf6b72f3bfc9c9a998
New function del_pair() is a copy of del() but it does not delete call counters
on db central. Useful if we want to clean pair db without changing db central.
Change-Id: I936bbb99ce9d5698273d8f72e0f032358bd341cd
The following scenario disclouse an issue with "ngcp_clean" lua
function in case of callee peer:
- A is a local subscriber with Peer_auth set and
force_outbound_call_to_peer set;
- B is a local subscriber with Peer_auth set and
force_outbound_call_to_peer set;
A calls B.
We clean and load callee preferences of B.
Call is detected as forced to PSTN.
We clean and load peer preferences.
When we set outbound peer_auth* values, the $xavp(callee_prefs)
still contains values from B (instead of peering preferences).
When we clean preferences for the callee peer, we only
clean "callee_peer_prefs" and not "callee_prefs".
"callee_prefs" are clean only in case of 'usr' or 'dom'
preferences.
This patch try to fix this problem in order to fix this
scenario with outbound user authentication.
Change-Id: I76dfa6f9e074b3d83ac67bd818e59233ca50492c
Added a new list element named "joined", which store a value
of 1 when the app register after the push in order to record
that the app has joined. Otherwise it contain a value of 0.
lua-redis >= 2.0.5~git20141117.880dda9-7~ is needed
Change-Id: Ie8121eaa5c1ce4a82b1c086b4b34c25213e8d4e8
We were using a mix of .new() and :new() and
that lead us to errors when calling new with parameters
Just be consistent and choose one
Change-Id: Icc2078efb377b80942b2fb518db52df339ecda6a
Unify redis interaction in a class
* allow passing partial config via new()
config will be merged using defined defaults so
missing keys will be appended using values from defaults
Change-Id: I486637e99e0e36fbe1f5a06c703c6b7d2fa77d77
The new function behaves like NGCPDlgCounters:is_in_set but
it uses a regex match to see if the key is contained in the list
Additionally added the helper function 'contains_regex' in the
utils.lua
* ignore vscode files
Change-Id: Iee89f5298ced10c2a9cdf7ebc19a4c0945b8cc9d
* simple POST via request function
* interface to store/retrieve/delete values from a list
at central redis
Change-Id: Ibae0f9b5c04dec3004b6d33e271866c722da3182
* final value is fetched from provisioning using pref value as id
* config: list of preferences needed to be loaded by kamailio
so we wont load unnecessary data into shared memory
Change-Id: I92e4bbfbe7ba55a06e79384aaa0d792556a39e22
The 'duration' variable is a string but it was written as int,
causing kamailio to write error lines
Change-Id: I2df1524d331e9b1d54bb0bdb84c06f4280e14fae
> ngcp/fp.lua:30:121: line is too long (126 > 120)
> ngcp/pprof.lua:28:121: line is too long (158 > 120)
Change-Id: Icf87f29049b2cc4ce29e7c1f5c78d9f2a53572c0
We are going to use both modules app_lua and app_lua_sr until we
solve the missing pieces on KEMI:
* KSR.pvx.xavp_get() returns a string like '<<xavp:%p>>' not a table like
sr.xavp.get()
* KEMI lacks of something like sr.xavp.get_keys() funtion
So, migrate everything that we can to KEMI and keep using sr approach
for just that two cases
- mocks/sr.lua: use same objects for same behaviour
Change-Id: I475ff8f820586cdc94c75bff7466238215e05673
* xavp caller_fax_prefs and callee_fax_prefs is
added and automatically fetched as a part of
caller_usr_load and callee_usr_load
* fax_prefs are load all related subscriber's
NOT NULL fax preferences from
provisioning.voip_fax_preferences
Change-Id: I2dcedf30433b3d5b94efa9292437a4e7501588a3
* fix pv mock to align kamailio behavior with pv_unset() for avps.
It removes only the first value not all, only when using '[*]'
pv_unset("$avp(name)") != pv_unset("$(avp(name)[*])")
pv_unset("$avp(name)") == pv_unset("$(avp(name)[0])")
pv_unset("$(avp(name)[1])") == pv_unset("$(avp(name)[0])")
Change-Id: I1aab2150d288da546b144388adb7b2f87ecfb069
* rename set_by_uuid to set_by_key as key can be anything now
* save uuid as an additional parameter inside the key entry
Change-Id: Ic63e11855d96931b2676b991d012197c35d8ca2f
Support for detecting SIP loops for kamailio.
Count on redis the combination of $fu;$tu;$ru in a period
of time
Change-Id: I3a34e3086490a26bbd4a6db8e4efc86145bfb017
The count argument influences the operation in the following ways:
* count > 0: Remove elements equal to value moving from head to tail.
* count < 0: Remove elements equal to value moving from tail to head.
* count = 0: Remove all elements equal to value.
Change-Id: Ia77b760fcada0027fe58a48f4b335d5c264e8917