Am Montag, 1. April 2019, 19:22:13 CEST schrieb Spencer Thomason:
> I’m interested in extending the ENUM module to add support for
> draft-ietf-enum-cnam-08 CNAM queries using ENUM. I’m looking for high
> level guidance as to the best way to implement this and any feedback on
> naming of exported functions and parameters. Maybe something like
> enum_cnam_query("pvar", "destination", [,"suffix" [,"service"]]) ?
Hello Spencer,
(added sr-dev)
thank you for your interesting in contribution to Kamailio.
I am not the author of the enum module - but your suggestion:
enum_cnam_query("pvar", "destination", [,"suffix" [,"service"]])
sounds fine for me. This fits to the existing function naming.
If you have specific questions regarding coding topics please use our
developer mailing list (sr-dev). We integrate new code usually with github,
you find a guide here:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
Best regards,
Henning
--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services
#### Pre-Submission Checklist
- [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
- [X] Related to issue #1917
#### Description
Changed default db_redis location schema type of expires and last_modified from int to timestamp.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1918
-- Commit Summary --
* Changed default db_redis location schema type for timestamps. Fixes issue reported by Joan Salvatella #1917
-- File Changes --
M utils/kamctl/db_redis/kamailio/location (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1918.patchhttps://github.com/kamailio/kamailio/pull/1918.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/1918
### Description
Configured the location module to load the expires column as a datetime instead of an integer but db_redis ignored the parameter and loaded the data with the default schema. As of today, the default schema has last_modified and expires columns as integers but stores them as timestamps.
```
id/int,ruid/string,username/string,domain/string,contact/string,received/string,path/string,expires/**int**,q/double,callid/string,cseq/int,last_modified/**int**,flags/int,cflags/int,user_agent/string,socket/string,methods/int,instance/string,reg_id/int,server_id/int,connection_id/int,keepalive/int,partition/int,
9
```
### Troubleshooting
#### Reproduction
Use db_redis as backend and use the location module.
While handling INVITE:
if (!lookup("location")) {
sl_send_reply("404", "User Not Found");
return;
}
While handling REGISTER:
if (!save("location"))
sl_reply_error();
#### Debugging Data
#### Log Messages
```
8(34) ERROR: <core> [db_ut.c:92]: db_str2int(): Unexpected characters: [-04-01 07:17:14]
8(34) ERROR: <core> [db_val.c:76]: db_str2val(): error while converting integer value from string
8(34) ERROR: db_redis [redis_dbase.c:1062]: db_redis_convert_row(): Failed to convert redis column 'expires' to db value
8(34) ERROR: db_redis [redis_dbase.c:1231]: db_redis_perform_query(): Failed to convert redis reply for row
8(34) ERROR: db_redis [redis_dbase.c:1243]: db_redis_perform_query(): failed to perform the query
8(34) ERROR: db_redis [redis_dbase.c:1829]: db_redis_query(): failed to do the query
8(34) ERROR: usrloc [udomain.c:641]: db_load_urecord(): db_query failed
```
#### SIP Traffic
<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your sip traffic here)
```
### Possible Solutions
I patched the default schema with the following and it worked.
```
id/int,ruid/string,username/string,domain/string,contact/string,received/string,path/string,expires/**timestamp**,q/double,callid/string,cseq/int,last_modified/**timestamp**,flags/int,cflags/int,user_agent/string,socket/string,methods/int,instance/string,reg_id/int,server_id/int,connection_id/int,keepalive/int,partition/int,
9
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.2.2 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, 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
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: unknown
compiled with gcc 6.3.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 gke-production-cluster-default-pool-fb621121-qz3r 4.14.65+ #1 SMP Thu Oct 25 10:42:50 PDT 2018 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/1917
manual schema changes introduced at c9f2aa71b2e0d4a4f71b3da92f97306e86f93eea were lost by regeneration at 5e0440aa27154c263fc883f3a7cb9680805af6c3
This change sets the types changes at location for db_redis
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1919
-- Commit Summary --
* lib/srdb1: update location types for db_redis
* kamctl: regenerated db schema files
-- File Changes --
M src/lib/srdb1/schema/location.xml (2)
M utils/kamctl/db_redis/kamailio/location (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1919.patchhttps://github.com/kamailio/kamailio/pull/1919.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/1919