#### 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 …
[View More]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)
- [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 -->
Hi there!
So my case, and why I did not use the existing code:
- incoming INVITE to a user with 2 records in usrloc (1st - UDP, 2nd - TLS)
- some time before lookup, TLS connect of 2nd device is closed, but usrloc record still exists (it going to be removed in the next iteration of timer)
- after lookup(location) - 2 branches are created
- send to 1st - UDP succeed
- send to 2nd - TLS failed. And here is my headache.
-- I want to send push notification to this device
-- I set t_on_branch_failure
-- if I try failure_exec_mode=1 - I get control, and I am able to send push, but I need to wait until fr_timer fire (I wanted not to wait, and send immediately)
The idea of changes:
- usrloc -> get_urecord: if t_contact has tcpcon_id & connection is not alive => mark record as expired
- as a result, in the registrar, while lookup, this contact will fail VALID_CONTACT - and will not be returned to the scriptwriter.
All of this is wrapped by handle_lost_tcp parameter (that is 0 by default), so changes are extending of handle_lost_tcp parameter of usrloc. Checked doc for usrloc, and seems to me that current description of this parameter should be untouched.
Marked as expired contact will be removed by timer as usual.
Open for discussion, and thanks in advance.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1365
-- Commit Summary --
* pua_reginfo: use outbound proxy for PUBLISHes
* pua_reginfo: correct docs
* Merge branch 'master' of https://github.com/kamailio/kamailio
* usrloc: extend handle_lost_tcp use for get_urecord
-- File Changes --
M src/modules/usrloc/udomain.c (15)
M src/modules/usrloc/urecord.c (4)
M src/modules/usrloc/urecord.h (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1365.patchhttps://github.com/kamailio/kamailio/pull/1365.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/1365
[View Less]
### Description
When using cfg_get in async_workers, the values cannot be retrieved. You either get a 'soft' fail with kamailio failing to assign the value, or you get a 'hard' fail and kamailio core dumps. The difference in behaviour appears to be determined by where the cfg variable is defined. If its defined in kamailio.cfg, you get a soft failure. If its defined in a cfg file which you included, you get a hard failure.
### Troubleshooting
Tried MANY combinations of setting the …
[View More]variable in different places, different length of variable names, including different characters.
#### Reproduction
test_crash.cfg
```
#!KAMAILIO
debug=8
fork=yes
children=1
async_workers=1
listen=udp:127.0.0.1:12345
loadmodule "kex.so"
loadmodule "mi_fifo.so"
loadmodule "tm.so"
loadmodule "tmx.so"
loadmodule "sl.so"
loadmodule "uac.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "async.so"
loadmodule "xlog.so"
modparam("mi_fifo", "fifo_name", "./kamailio.fifo")
include_file "test_crash_included.cfg"
info.var = 1 desc "Info Variable"
request_route {
if((a)cfg_get.info.var == 1) {
# This gets printed
xlog("Variable is 1 in request route\n");
}
if((a)cfg_get.info.var_from_other_file == 1) {
# This gets printed
xlog("Variable from other file is 1 in request route\n");
}
if(t_newtran()) {
async_task_route("ASYNC_REQUEST_ROUTE");
}
exit;
}
route[ASYNC_REQUEST_ROUTE] {
if((a)cfg_get.info.var == 1) {
# This doesn't get printed
xlog("Variable is 1 in async route\n");
} else {
# This assignment fails with error:
# 5(19705) ERROR: <core> [lvalue.c:405]: lval_assign(): assignment failed at pos: (48,39-48,39)
$var(test) = @cfg_get.info.var;
xlog("Variable is $var(test)\n");
}
# Crash occurs on this line
if((a)cfg_get.info.var_from_other_file == 1) {
xlog("Variable from other file is 1 in async route\n");
}
t_reply("200", "OK");
}
```
test_crash_included.cfg
```
#!KAMAILIO
info.var_from_other_file = 1 desc "Var from other file"
```
#### Debugging Data
<!--
If you got a core dump, use gdb to extract troubleshooting data - full backtrace,
local variables and the list of the code at the issue location.
gdb /path/to/kamailio /path/to/corefile
bt full
info locals
list
If you are familiar with gdb, feel free to attach more of what you consider to
be relevant.
-->
```
(paste your debugging data here)
```
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your log messages here)
```
#### 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
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 4.4.2 (x86_64/linux) 892ad6
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_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 892ad6
compiled on 18:41:47 Dec 4 2017 with x86_64-unknown-linux-gnu-gcc 4.9.4
```
* **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-172-31-126-249 4.4.23-31.54.amzn1.x86_64 #1 SMP Tue Oct 18 22:02:09 UTC 2016 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/1362
[View Less]
<!-- 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 …
[View More]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 -->
- [ ] 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 -->
ims_registar_pcscf has functionality which parses sec-agree parameters from REGISTER and saves them in usrloc contact. However the memory allocated for the security_t data structure was allocated in the private memory, instead on the shared memory.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1360
-- Commit Summary --
* ims_usrloc_pcscf: Add new function free_security() which deallocates security_t parameter from a contact
* ims_registrar_pcscf: Fix memory allocation for security_t parameters in contact
-- File Changes --
M src/modules/ims_registrar_pcscf/save.c (12)
M src/modules/ims_registrar_pcscf/sec_agree.c (114)
M src/modules/ims_registrar_pcscf/sec_agree.h (2)
M src/modules/ims_usrloc_pcscf/pcontact.c (36)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1360.patchhttps://github.com/kamailio/kamailio/pull/1360.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/1360
[View Less]