<!-- 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
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] 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
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
New Module to consume messages from NATS messaging system.
Initial Features:
- automatic reconnect with connected/disconnected event routes
- connect to up to 10 NATS URLs
- subscribe to any number of subjects
- receive messages via event route
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2790
-- Commit Summary --
* nats: new nats message consumer module
-- File Changes --
A src/modules/nats/Makefile (16)
A src/modules/nats/doc/Makefile (4)
A src/modules/nats/doc/nats.xml (42)
A src/modules/nats/doc/nats_admin.xml (207)
A src/modules/nats/nats_mod.c (569)
A src/modules/nats/nats_mod.h (99)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2790.patchhttps://github.com/kamailio/kamailio/pull/2790.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/2790
**defined but not used**
```
rtpproxy.c:943:1: warning: ‘rp_extract_mediaip’ defined but not used [-Wunused-function]
rp_extract_mediaip(str *body, str *mediaip, int *pf, char *line)
^~~~~~~~~~~~~~~~~~
CC (gcc) [M rtpproxy.so] rtpproxy_db.o
make[3]: 'libsrdb1.so.1.0' is up to date.
```
--
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/2787
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for feature requests.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If you submit a feature request (or enhancement) add the description of what you would like to be added.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
Hello everyone, is module pua_json going to be implemented for KEMI framework?
I've tried to use KSR.x.modf("pua_json_publish", "json_here") and I'm getting error
### python code
```
def ksr_xhttp_event(self, evmsg, evname):
if evname == "xhttp:request":
try:
KSR.err("===== xhttp module triggered event: " + evname + "\n")
if "/presence" in KSR.pv.get("$hu"):
rb = json.loads(KSR.kx.get_body())
if rb["Event-Package"] == "message-summary":
KSR.info("request received- " + rb["Call-ID"] + "update for: " + rb[
"From"] + "request body: " + json.dumps(rb) + "\n")
KSR.x.modf("pua_json_publish", json.dumps(rb));
KSR.xhttp.xhttp_reply(200, "OK", "text/html", "<html><body>Entity state updated</body></html>")
return 1
if "/RCP" in KSR.pv.get("$hu"):
KSR.jsonrpcs.dispatch()
return 1
else:
KSR.xhttp.xhttp_reply(200, "OK", "text/html", "<html><body>Wrong URL</body></html>")
return 1
except:
KSR.err("===== unsupported " + evname + "\n")
return -255
```
#### Debugging Data
```
app_python [python_support.c:154]: python_handle_exception(): apy_exec: ksr_xhttp_event(xhttp:request): Unhandled exception in the Python code:
RuntimeError: self is NULL
```
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.4.5 (x86_64/linux) c46342
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: c46342
compiled on 14:37:00 Apr 27 2021 with gcc 7.5.0
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `uname -a`)
-->
```
Linux ip-10-199-240-110 4.15.0-1057-aws #59-Ubuntu SMP Wed Dec 4 10:02:00 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
```
--
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/2783