## Description
Hello all, I'm migrating my Kamailio logics from legacy .cfg file to KEMI script.
I began with Python but switched then to Lua, but there are some subclass / functions described in KEMI documentation that seem not to be present in Lua KSR object.
In this case, I am having trouble with the subclass "kx" described [here](https://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/mod… which is used in the default Lua script example [here](https://github.com/kamailio/kamailio/blob/ca49dc0344f2ca4eae1999f6b46…
The error in the logs:
```bash
app_lua [app_lua_api.c:726]: app_lua_run_ex(): error from Lua: /etc/kamailio/kamailio.lua:196: attempt to index field 'kx' (a nil value)
```
Referring to the following line in my Lua script:
```lua
function ksr_route_reqinit()
if not KSR.is_myself_srcip() then
local srcip = KSR.kx.get_srcip();
if KSR.htable.sht_match_name("ipban", "eq", srcip) > 0 then
-- ip is already blocked
KSR.dbg("request from blocked IP - " .. KSR.pv.get("$rm")
.. " from " .. KSR.kex.gete_furi() .. " (IP:"
.. srcip .. ":" .. KSR.kex.get_srcport() .. ")\n");
KSR.x.exit();
end
if KSR.pike.pike_check_req() < 0 then
KSR.err("ALERT: pike blocking " .. KSR.pv.get("$rm")
.. " from " .. KSR.kex.gete_furi() .. " (IP:"
.. srcip .. ":" .. KSR.kex.get_srcport() .. ")\n");
KSR.htable.sht_seti("ipban", srcip, 1);
KSR.x.exit();
end
end
end
```
- Should this function be available through KSR object ? If yes we're talking about an issue
Or
- Is this function not supported anymore / not with app_lua ? In this case we should fix the documentation + the example script
### Troubleshooting
Debian Jessie
Kamailio 5.3
Lua 5.2
#### Reproduction
I tried different versions, all KO (Kamailio 5.2, 5.3, and last commit on master: kamailio 5.4.0-dev3 (x86_64/linux) 5afe1e)
1. Install Debian Jessie
2. Clone Kamilio GIT
3. Build from source with make (enabling the desired modules before)
4. Insert Lua script (demo one is fine to reproduce my issue)
#### Debugging Data
```bash
aaaa@bbbbb:/# kamailio -V
version: kamailio 5.4.0-dev3 (x86_64/linux) 5afe1e
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 5afe1e
compiled on 14:27:15 Jan 14 2020 with gcc 6.3.0
```
#### Log Messages
```bash
app_lua [app_lua_api.c:726]: app_lua_run_ex(): error from Lua: /etc/kamailio/kamailio.lua:196: attempt to index field 'kx' (a nil value)
```
#### SIP Traffic
Any message going through ksr_route_reqinit() function is triggering the error
Thanks !
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2196
- fixed a defect reported from Coverity Scan - Concurrent data access
violations in spi_gen.c for spi_data->spi_val.
- added a new conf param - ipsec_reuse_server_port - reuse or not
PCSCF server port for UA Re-registration.
- added description for the new parameter in ims_ipsec_pcscf_admin.xml.
- in fill_contact() for Request messages set received host, port and
proto fro request uri if alias is presented.
- A new server port is used for Re-registration, depending on the new
parameter ipsec_reuse_server_port.
- in create_ipsec_tunnel() return -1 when unable to convert ip address.
- in ipsec_forward() add supported and require secagree headers only
for Register reply with code 200. Set SND_F_FORCE_SOCKET for
request messages.
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [ ] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2148
-- Commit Summary --
* ims_ipsec_pcscf: fixed warnings, added a new config param
-- File Changes --
M src/modules/ims_ipsec_pcscf/cmd.c (209)
M src/modules/ims_ipsec_pcscf/doc/ims_ipsec_pcscf_admin.xml (22)
M src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c (2)
M src/modules/ims_ipsec_pcscf/spi_gen.c (14)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2148.patchhttps://github.com/kamailio/kamailio/pull/2148.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2148
- fixed dynamic sources loading
- fixed match_mode in check_whitelist function
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [X] Commit message has the format required by CONTRIBUTING guide
- [X] Commits are split per component (core, individual modules, libs, utils, ...)
- [X] Each component has a single commit (if not, squash them into one commit)
- [X] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [X] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [X] PR should be backported to stable branches
- [X] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2190
-- Commit Summary --
* Added missing KEMI functions, fixed sources loading and match_mode in
-- File Changes --
M src/modules/userblacklist/userblacklist.c (173)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2190.patchhttps://github.com/kamailio/kamailio/pull/2190.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2190
- added a new config param - ipsec_reuse_server_port - reuse or not
PCSCF server port for UA Re-registration.
- added description for the new parameter in ims_ipsec_pcscf_admin.xml.
parameter ipsec_reuse_server_port.
- in ipsec_forward() add supported and require secagree headers only
for Register reply with code 200.
- in fill_contact() for Request messages set received host, port and
proto from request uri if alias is presented.
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [ ] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2164
-- Commit Summary --
* ims_ipsec_pcscf: new config param for ipsec
-- File Changes --
M src/modules/ims_ipsec_pcscf/cmd.c (192)
M src/modules/ims_ipsec_pcscf/doc/ims_ipsec_pcscf_admin.xml (22)
M src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2164.patchhttps://github.com/kamailio/kamailio/pull/2164.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2164
Module: kamailio
Branch: master
Commit: 1fb8c88db4e307ad6981ccdf3e68fe91704341f1
URL: https://github.com/kamailio/kamailio/commit/1fb8c88db4e307ad6981ccdf3e68fe9…
Author: Aleksandar Yosifov <alexyosifov(a)gmail.com>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2020-01-13T21:14:10+01:00
ims_ipsec_pcscf: new config param for ipsec
- added a new config param - ipsec_reuse_server_port - reuse or not
PCSCF server port for UA Re-registration.
- added description for the new parameter in ims_ipsec_pcscf_admin.xml.
parameter ipsec_reuse_server_port.
- in ipsec_forward() add supported and require secagree headers only
for Register reply with code 200.
- in fill_contact() for Request messages set received host, port and
proto from request uri if alias is presented.
---
Modified: src/modules/ims_ipsec_pcscf/cmd.c
Modified: src/modules/ims_ipsec_pcscf/doc/ims_ipsec_pcscf_admin.xml
Modified: src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/1fb8c88db4e307ad6981ccdf3e68fe9…
Patch: https://github.com/kamailio/kamailio/commit/1fb8c88db4e307ad6981ccdf3e68fe9…