<!-- 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
I faced an issue with memory leak in case drop NOTIFY messages in the "local-request" event route in `mem_copy_subs` and `build_uac_req`
analysis of mem leak:
kamcmd corex.shm_summary
<code>...
Mar 23 12:00:28 pbx kamailio[72308]: NOTICE: fm_status: fm_sums(): count= 11 size= 7520 bytes from presence: hash.c: mem_copy_subs(141)<br>
Mar 23 12:00:28 pbx kamailio[72308]: NOTICE: fm_status: fm_sums(): count= 23 size= 22536 bytes from tm: t_msgbuilder.c: build_uac_req(1618)
...</code>
a lot of dropped messages in local-request event route
<code>...
Mar 23 12:01:09 pbx kamailio[72308]: NOTICE: fm_status: fm_sums(): count= 83 size= 51256 bytes from presence: hash.c: mem_copy_subs(141)
Mar 23 12:01:09 pbx kamailio[72308]: NOTICE: fm_status: fm_sums(): count= 98 size= 116864 bytes from tm: t_msgbuilder.c: build_uac_req(1618)
...</code>
no messages, no activities
<code>...
Mar 23 12:02:34 pbx kamailio[72308]: NOTICE: fm_status: fm_sums(): count= 83 size= 51256 bytes from presence: hash.c: mem_copy_subs(141)
Mar 23 12:02:34 pbx kamailio[72308]: NOTICE: fm_status: fm_sums(): count= 96 size= 115432 bytes from tm: t_msgbuilder.c: build_uac_req(1618)
...</code>
In the code, we have a comment like "never free cbp here because if t_uac_prepare fails, cbp is not freed and thus caller has no chance to discover if it is freed or not", but we'll free the cbp in two cases:
1. in case of error, but we have if (ret == E_DROP) then ret = 0; (so, no error result)
2. in case call insert_tmcb for cbp, but we don't do it for E_DROP
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3403
-- Commit Summary --
* tm: memory leak in case dropping messages in local-request event route
-- File Changes --
M src/modules/tm/uac.c (8)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3403.patchhttps://github.com/kamailio/kamailio/pull/3403.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3403
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3403(a)github.com>
### Description
We are using Kamailio as a 'mid-registrar', and saving the location record (i.e calling registrar.save()) in the reply-route depending on received status code from other registrar.
We noticed the saved location record had the contact URI (incl. instance id) and UA from response message; instead we would like to use the contact and UA from the original request.
This feature change is similar to what was added for `tcpconn_id` in PR: https://github.com/kamailio/kamailio/pull/3430. i.e. we would set the request's contact URI and UA in `xavp_cfg` variable. Then `registrar.save.c` would use the contact and UA from `xavp_cfg`.
Thanks.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3753
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3753(a)github.com>
### Description
Hello. Probably I'm doing something wrong but I can't get rid of **received** parameter in the **Via** header in responses from kamailio by websocket transport.
According [RFC 7118](https://datatracker.ietf.org/doc/rfc7118/):
``
When a SIP WebSocket Server receives a request, it MAY decide not
to add a "received" parameter to the top Via header. Therefore,
SIP WebSocket Clients MUST accept responses without such a
parameter in the top Via header regardless of whether the **Via**
"sent-by" field contains a domain name.
``
### Expected behavior
For responses to websocket transport have a way to not add **received** parameter in **Via** header
#### Actual observed behavior
Responses to OPTION or REGISTER methods trough websocket got **received** containing IP we want to not show to the end users.
### Possible Solutions
maybe add a param in **tm** module or something
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.2.1 (x86_64/linux)
```
and
```
kamailio 5.6.1 (x86_64/linux) b36a13
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3515
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3515(a)github.com>
### Description
After installing kamailio on Ubuntu (20.04 and 22.04) using normal kamailio.org instructions, things work fine. However, a developer is working on a large project as root, and occasionally restarts kamailio with the command "kamctl <start|stop|restart>", rather than the OS command "systemctl <stop|start|restart> kamailio". After that, any attempt to restart or check status using systmectl fails, and rebooting the server occasionally fails to restart kamailio.
### Troubleshooting
#### Reproduction
Install ubuntu 22.04 or 20.04. When up and running, try this:
`systemctl status kamailio` (everything looks good)
`ps -C kamailio -o comm,uid,euid,pid,ppid` (all happy, Kamailio running as user kamailio)
`kamctl restart`
`ps -C kamailio -o comm,uid,euid,pid,ppid` (Yes it's running, but as root, not kamailio)
`systemctl status kamailio` (FAILS, 20.04 reports "Failed to start", 22.04 reports "kamailio.service: Deactivated successfully")
`systemctl restart kamailio` (FAILS - same reports as preceding "status" command)
#### 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.
-->
#### 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).
-->
After command systemctl restart kamailio:
```
Feb 9 18:30:02 usdc2-lab-drproxy02 kamailio: INFO: <core> [core/sctp_core.c:74]: sctp_core_check_support(): SCTP API not enabled - if you want to use it, load sctp module
Feb 9 18:30:02 usdc2-lab-drproxy02 kamailio: INFO: <core> [core/tcp_main.c:5042]: init_tcp(): using epoll_lt as the io watch method (auto detected)
Feb 9 18:30:02 usdc2-lab-drproxy02 /usr/sbin/kamailio[2388]: INFO: rr [../outbound/api.h:52]: ob_load_api(): unable to import bind_ob - maybe module is not loaded
Feb 9 18:30:02 usdc2-lab-drproxy02 /usr/sbin/kamailio[2388]: INFO: rr [rr_mod.c:177]: mod_init(): outbound module not available
Feb 9 18:30:02 usdc2-lab-drproxy02 /usr/sbin/kamailio[2388]: INFO: auth [auth_mod.c:345]: mod_init(): qop set, but nonce-count (nc_enabled) support disabled
Feb 9 18:30:02 usdc2-lab-drproxy02 /usr/sbin/kamailio[2388]: INFO: <core> [main.c:2779]: main(): processes (at least): 32 - shm size: 67108864 - pkg size: 8388608
Feb 9 18:30:02 usdc2-lab-drproxy02 /usr/sbin/kamailio[2388]: INFO: <core> [core/udp_server.c:154]: probe_max_receive_buffer(): SO_RCVBUF is initially 212992
Feb 9 18:30:02 usdc2-lab-drproxy02 /usr/sbin/kamailio[2388]: INFO: <core> [core/udp_server.c:206]: probe_max_receive_buffer(): SO_RCVBUF is finally 425984
Feb 9 18:30:02 usdc2-lab-drproxy02 /usr/sbin/kamailio[2388]: INFO: <core> [core/udp_server.c:154]: probe_max_receive_buffer(): SO_RCVBUF is initially 212992
Feb 9 18:30:02 usdc2-lab-drproxy02 /usr/sbin/kamailio[2388]: INFO: <core> [core/udp_server.c:206]: probe_max_receive_buffer(): SO_RCVBUF is finally 425984
Feb 9 18:30:02 usdc2-lab-drproxy02 /usr/sbin/kamailio[2388]: ERROR: <core> [core/tcp_main.c:3162]: tcp_init(): bind(c, 0x7f49b0475c74, 16) on 127.0.0.1:5060 : Address already in use
Feb 9 18:30:02 usdc2-lab-drproxy02 /usr/sbin/kamailio[2388]: INFO: <core> [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized
```
#### 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
Modify kamctl et. al. to call systemctl for start, stop, restart commands. Alternatively have kamctl call setuid() before start, restart, stop commands.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
On ubuntu 20.04:
```
version: kamailio 5.3.2 (x86_64/linux)
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: unknown
compiled with gcc 9.2.1
```
For ubuntu 22.04:
```
version: kamailio 5.6.5 (x86_64/linux)
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_BLOCKLIST, 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: unknown
compiled with gcc 11.4.0
```
* **Operating System**:
For ubuntu 22.04:
```
root@my_22.04_ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
root@my_22.04_ubuntu:~# uname -a
Linux my_22.04_ubuntu 5.15.0-94-generic #104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
root@my_22.04_ubuntu:~#
```
For ubuntu 20.04
```
root@my_20.04_ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal
root@my_20.04_ubuntu:~# uname -a
Linux my_20.04_ubuntu 5.4.0-171-generic #189-Ubuntu SMP Fri Jan 5 14:23:02 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
root@my_20.04_ubuntu:~#
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3752
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3752(a)github.com>
### Description
Kamailio segfaults when KEMI functions are invoked from app_python script
### Troubleshooting
The same code was running ok with the 5.6 branch.
It seems that the function sr_apy_kemi_exec_func_ex has been re-written in 5.7 with the following main changes :
- The long IF/ELSE statement was replace by a FOR loop
- The call to PyArg_ParseTuple function was replaced by the call to PyList_GetItem ==> **This seems to be the cause. The value returned by this function is alway NULL**
#### Reproduction
Any call to KSR.pv.seti function from a PYTHON 2 script would cause this error.
#### Log Messages
```
sbin/kamailio[18449]: ERROR: app_python [apy_kemi.c:280]: sr_apy_kemi_exec_func_ex(): null parameter - func: seti idx: 0 argc:
2
Feb 6 11:34:16 .../sbin/kamailio[18509]: CRITICAL: <core> [core/pass_fd.c:281]: receive_fd(): EOF on 37
Feb 6 11:34:16 .../sbin/kamailio[18380]: ALERT: <core> [main.c:793]: handle_sigs(): child process 18449 exited by a signal 11
Feb 6 11:34:16 .../sbin/kamailio[18380]: ALERT: <core> [main.c:796]: handle_sigs(): core was not generated
Feb 6 11:34:16 .../sbin/kamailio[18380]: INFO: <core> [main.c:818]: handle_sigs(): terminating due to SIGCHLD
Feb 6 11:34:16 .../sbin/kamailio[18509]: INFO: <core> [main.c:874]: sig_usr(): signal 15 received
Feb 6 11:34:16 .../sbin/kamailio[18502]: INFO: <core> [main.c:874]: sig_usr(): signal 15 received
Feb 6 11:34:16 .../sbin/kamailio[18495]: INFO: <core> [main.c:874]: sig_usr(): signal 15 received
Feb 6 11:34:16 .../sbin/kamailio[18482]: INFO: <core> [main.c:874]: sig_usr(): signal 15 received
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3746
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3746(a)github.com>
### Description
All kamailio versions on the 5.7.x train and additionally point release 5.6.5 break early dialog transactions, at least when the following conditions are (cumulatively) met:
* topos-redis is enabled (haven't tested other storage backends yet, let me know if needed)
* kamailio is multihomed
* enable_double_rr is enabled (the default)
### Troubleshooting
#### SIP Traffic
Here's an exchange demonstrating the problem:
```
kamailio instance
──────────┬──────────────────┬─────────
internal external peer
172.30.154.1:5060 185.73.43.241:5060 195.167.21.66:5060
──────────┬──────────────────┬───────── ──────────┬─────────
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ INVITE (SDP) │
│ │ ──────────────────────────> │
│ │ 100 Trying │
│ │ <────────────────────────── │
│ │ 183 Session Progress (SDP) │
│ │ <────────────────────────── │
│ │ PRACK │
│ │ ──────────────────────────> │
│ │ 200 OK │
│ │ <────────────────────────── │
│ │ UPDATE (SDP) │
UPDATE (SDP) │ │
<─────────────────────────── │ │
```
Whereas the expected behaviour should be:
```
│ │ UPDATE (SDP) │
| <────────────────────────── │
UPDATE (SDP)│ │ │
<───────── │ │ │
```
This is also exemplified by examining the Via headers as rewritten by kamailio.
Not working (>= 5.6.5, 5.7.x):
* Inbound Via: `Via: SIP/2.0/UDP 195.167.21.66:5060;branch=z9hG4bKtjlwcpvfh03epe0thhtjhq3qg;Role=3;Hpt=8e58_16`
* Oubound Via: `Via: SIP/2.0/UDP 185.73.43.241;branch=z9hG4bK66c4.3453dd9a219858819d528b9da671e39e.0`
Working (5.6.4):
* Inbound Via: `Via: SIP/2.0/UDP 195.167.21.66:5060;branch=z9hG4bK8lj1ahz6npz65khd8jkzl1ohh;Role=3;Hpt=8e68_16`
* Oubound Via: `Via: SIP/2.0/UDP 172.30.154.1;branch=z9hG4bK4dce.4f5448efd64465fa5dbaf5eef0dc35b7.0`
### Possible Solutions
Only solution I have found so far is to downgrade to kamailio 5.6.4
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
### Additional Information
```
version: kamailio 5.7.4 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, 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_BLOCKLIST, 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: unknown
compiled with gcc 10.2.1
```
But I have also tested all 5.7.x versions, which are all affected, as well 5.6.5.
* **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 `lsb_release -a` and `uname -a`)
-->
```
Linux host 5.10.0-27-amd64 #1 SMP Debian 5.10.205-2 (2023-12-31) x86_64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3757
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3757(a)github.com>
<!-- 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
- [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 -->
When we use DNS failover in case of timeout kamailio executes the branch_failure route. In the case of the 503 - on_reply route. This commit is to equate behavior in both cases. So if there are more candidates we will always execute branch_failure route and on_reply route only if this is the last candidate.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3138
-- Commit Summary --
* branch_failure route in case 503 and dns failover
-- File Changes --
M src/modules/tm/t_reply.c (52)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3138.patchhttps://github.com/kamailio/kamailio/pull/3138.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3138
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3138(a)github.com>
<!--
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:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio…
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.o…
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.
Note that a feature request may be closed automatically after about 2 months
if there is no interest from developers or community users to implement it, being
considered expired. In such case can be reopened by writing a comment that includes
the token `/notexpired`. About two weeks before considered expired, the item is
marked with the label `stale`, trying to notify the submitter and everyone else
that might be interested in it. To remove the label `stale`, write a comment that
includes the token `/notstale`. Also, any comment postpone the `expire` timeline,
being considered that there is interest in the proposed feature request.
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).
-->
### Description
Consider adding socket options SO_BINDTODEVICE when the interface name is given for listening in the config file. This will be useful in listening to linux VRF interfaces, especially when there are two different VRFs and it is required to proxy SIP messages between the VRFs
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3716
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3716(a)github.com>
### Description
Kamailio v5.5.6 with topos module and postgres DB.
UAC (A) -> Kamailio Registrar (B) -> Kamailio PSTN GW (C) -> PSTN (D)
Call goes from A to D, PSTN sends UPDATE, UPDATE is routed from C to A instead to B and then to A.
#### Reproduction
Caller calls callee and receives an UPDATE from callee.
In my case it was when the call was routed to voicemail.
#### Log Messages
```
Kamailio takes the wrong route in UPDATE (upstream) case.
May 3 15:23:12 sipproxy /usr/sbin/kamailio[263013]: DEBUG: topos [tps_msg.c:882]: tps_request_received(): r-uri updated to: [sip:1234@<UAC-IP>;uniq=B0EB9A84A278626DA07219E2AE01C]
May 3 15:23:12 sipproxy /usr/sbin/kamailio[263013]: DEBUG: topos [tps_msg.c:187]: tps_add_headers(): adding to headers(0) - [Route: sip:<<KamailioPSTNgwIP>>;lr=on;ftag=9945501E2B94B883;did=1fc.42f;nat=yes#015#012]
May 3 15:23:12 sipproxy /usr/sbin/kamailio[263013]: DEBUG: topos [tps_msg.c:187]: tps_add_headers(): adding to headers(0) - [P-SR-XUID: atpsh-64527b0a-40362-1#015#012]
The right one would be the x_rr (a_rr), but it takes only the s_rr:
May 3 15:23:12 sipproxy /usr/sbin/kamailio[263013]: DEBUG: db_postgres [km_res.c:234]: db_postgres_convert_rows(): PQgetvalue(0x7fcb4893db50,0,7)=[sip:<KamailioRegistrarIP>;lr=on;ftag=9945501E2B94B883;did=1fc.7b92]
May 3 15:23:12 sipproxy /usr/sbin/kamailio[263013]: DEBUG: db_postgres [km_res.c:242]: db_postgres_convert_rows(): [0][7] Column[x_rr]=[sip:<KamailioRegistrarIP>;lr=on;ftag=9945501E2B94B883;did=1fc.7b92]
May 3 15:23:12 sipproxy /usr/sbin/kamailio[263013]: DEBUG: db_postgres [km_res.c:234]: db_postgres_convert_rows(): PQgetvalue(0x7fcb4893db50,0,8)=[sip:<PSTNgw>:5060;transport=udp;lr;Hpt=8ef8_116;CxtId=3;TRC=ffffffff-ffffffff;X-HwB2bUaCookie=18614]
May 3 15:23:12 sipproxy /usr/sbin/kamailio[263013]: DEBUG: db_postgres [km_res.c:242]: db_postgres_convert_rows(): [0][8] Column[y_rr]=[sip:<PSTNgw>:5060;transport=udp;lr;Hpt=8ef8_116;CxtId=3;TRC=ffffffff-ffffffff;X-HwB2bUaCookie=18614]
May 3 15:23:12 sipproxy /usr/sbin/kamailio[263013]: DEBUG: db_postgres [km_res.c:234]: db_postgres_convert_rows(): PQgetvalue(0x7fcb4893db50,0,9)=[sip:<<KamailioPSTNgwIP>>;lr=on;ftag=9945501E2B94B883;did=1fc.42f;nat=yes]
May 3 15:23:12 sipproxy /usr/sbin/kamailio[263013]: DEBUG: db_postgres [km_res.c:242]: db_postgres_convert_rows(): [0][9] Column[s_rr]=[sip:<<KamailioPSTNgwIP>>;lr=on;ftag=9945501E2B94B883;did=1fc.42f;nat=yes]
May 3 15:23:12 sipproxy /usr/sbin/kamailio[263019]: DEBUG: db_postgres [km_res.c:242]: db_postgres_convert_rows(): [0][10] Column[a_rr]=[sip:<KamailioRegistrarIP>;lr=on;ftag=9945501E2B94B883;did=1fc.7b92]
May 3 15:23:12 sipproxy /usr/sbin/kamailio[263019]: DEBUG: db_postgres [km_res.c:234]: db_postgres_convert_rows(): PQgetvalue(0x7fcb4893dbd8,0,11)=[]
```
### Possible Solutions
Respect Route headers for UPDATE messages.
### Additional Information
Current running kamailio 5.5.6 but tried also latest 5.6.4 with same behavior.
```
version: kamailio 5.5.6 (x86_64/linux) 72dbb0
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_BLOCKLIST, 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: 72dbb0
compiled on 05:48:21 Apr 27 2023 with gcc 11.3.0
```
* **Operating System**:
```
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
Linux sipproxy 5.15.0-70-generic #77-Ubuntu SMP Tue Mar 21 14:02:37 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
```
Possibly related bug: https://github.com/kamailio/kamailio/issues/3090
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3437
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3437(a)github.com>