### Description
Kamailio server has two legs that are connected to different networks.
I'm using Kamailio v.5.2.3 and the "enable_double_rr" is implicitly set to "1".
The leg "A" IP address is 10.28.80.1
The leg "B" IP address is 192.168.9.103
The call is initiated from 10.28.80.47
According to the "rr" module documentation, function record_route()
should insert two "Record_Route" header fields when a request is
accepted on one leg is should go out via the second leg. This works as
expected in case of UDP protocol:
INVITE sip:2601@192.168.0.178:49162;transport=udp SIP/2.0
Record-Route: <sip:192.168.9.103;r2=on;lr;did=e2c.a191>
Record-Route: <sip:10.28.80.1;r2=on;lr;did=e2c.a191>
Via: SIP/2.0/UDP 192.168.9.103;branch=z9hG4bKcfa5.d64ecbd87d5315b5993c4ccf16f86537.0
Via: SIP/2.0/UDP 10.28.80.47:5060;rport=5060;branch=z9hG4bK3a9e9a4d
But when the TCP protocol is used AND "listen" parameters are defined:
listen=udp:10.28.80.1:5060
listen=tcp:10.28.80.1:5060
listen=udp:192.168.9.103:5060
listen=tcp:192.168.9.103:5060
then the outbound message looks like this:
INVITE sip:2601@192.168.0.178:48758;transport=tcp SIP/2.0
Record-Route: <sip:10.28.80.1;transport=tcp;lr;did=bcd.72f>
Via: SIP/2.0/TCP 10.28.80.1;branch=z9hG4bKb9ca.26ea08654c9dbc32bb0dc6e3b6f92d45.0;i=3
Via: SIP/2.0/TCP 10.28.80.47:5060;rport=33976;branch=z9hG4bK5291fab1
There are two problems there:
a) only one Record-Route with leg "A" is inserted
b) the added "Via" header field contains the leg "A" IP address instead of expected leg "B" IP address (192.168.9.103). In the LAN trace, I see that in reality the message was sent from leg "B".
IMPORTANT: The problem occurs only when the "listen" parameters are defined in the Kamailio configuration. When the "listens" are not configured then everything works correctly.
### Troubleshooting
#### Reproduction
#### Debugging Data
#### Log Messages
http://updates.xorcom.com/~xorcom/kam-tcp-problem.tar.gz
The archive contains the following files:
* syslog-bad.log and bad.cap - Kamailio log and tcpdump trace of a call when the problem occurs
* syslog-good.log and good.cap - Kamailio log and tcpdump trace of a call when the problem doesn't occur
#### SIP Traffic
### Possible Solutions
### Additional Information
kamailio -v
version: kamailio 5.2.3 (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 7.3.0
***Operating System**:
Ubuntu 18.0.4
--
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/2033
Dear all
i think i have noticed a wrong behaviour with xflags. When they are set in
a failure_route and a t_relay is done after that to a destination, its
state is lost in the next on_reply route.
This doesn't happen with regular transaction flags, and it doesn't happen
with xflags either when xflag is set inside an onreply_route.
We have seen it on versions 5.3 and 5.4
Could you please confirm this?
thanks a lot
regards
david escartin
--
[image: Logo]
David Escartín Almudévar
VoIP/Switch Engineer
descartin(a)sonoc.io
*SONOC*
C/ Josefa Amar y Borbón, 10, 4ª · 50001 Zaragoza, España
Tlf: +34 917019888 · www.sonoc.io
### Description
It doesn't look like the "pua_dialoginfo" module has support for the "display" attribute in the identity tag. This tag is used by some phones to update the phone display with caller/callee information for the respective key. I'm wondering how difficult it would be to add this feature. Thanks in advance for anyone who reads this!
### Expected behavior
Kamailio includes display attribute in identity tags in generated publish messages.
<pre>
<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="1" state="full">
<dialog id="as7d900as8" call-id="a84b4c76e66710" local-tag="1928301774" remote-tag="456887766" direction="initiator">
<state>early</state>
<local>
<identity <b><i>display="Alice"</i></b>>sip:alice@example.com</identity>
<target uri="sip:alice@phone11.example.com"/>
</local>
<remote>
<identity <b><i>display="Bob"</i></b>>sip:bob@example.org</identity>
<target uri="sip:bobster@phone21.example.org"/>
</remote>
</dialog>
</dialog-info>
</pre>
#### Actual observed behavior
Kamailio generates a publish request for dialog events similar to the one below. The display attribute is not included in the "identity" tags. This means that when a notify message is sent to a watcher for this publish, the name is not rendered on the phone display.
<pre>
<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="1" state="full">
<dialog id="as7d900as8" call-id="a84b4c76e66710" local-tag="1928301774" remote-tag="456887766" direction="initiator">
<state>early</state>
<local>
<b><identity>sip:alice@example.com</identity></b>
<target uri="sip:alice@phone11.example.com"/>
</local>
<remote>
<b><identity>sip:bob@example.org</identity></b>
<target uri="sip:bobster@phone21.example.org"/>
</remote>
</dialog>
</dialog-info>
</pre>
### Possible Solutions
I added a small modification to the module as a POC and it works as expected. With the following modification, the phone display is updated with the string in the “display” attribute. I added line 191-193 below, between lines 190 & 191 on the current master branch. The example below shows the “remote” tag, I also did the same thing for the local tag a few more lines down.
<pre>
184 tag_node = xmlNewChild(remote_node, NULL, BAD_CAST "identity",
185 BAD_CAST buf) ;
186 if( tag_node ==NULL)
187 {
188 LM_ERR("while adding childn");
189 goto error;
190 }
191 /* Testing - adding display attribute to the identity tag */
192 xmlNewProp(tag_node, BAD_CAST "display", BAD_CAST "RemoteCallerName");
193 /* */
195
196 tag_node = xmlNewChild(remote_node, NULL, BAD_CAST "target", NULL);
197 if( tag_node ==NULL)
</pre>
Here is a link to the file in the module I’m referring to:
https://github.com/kamailio/kamailio/blob/master/src/modules/pua_dialoginfo…
I don’t really have any professional experience writing C code, and I was unable to identify a way to grab this string from the “From” header. Unfortunately, because I would have really loved to give this feature back to the community!
### Additional Information
Thank you so much for this amazing software. I absolutely adore Kamailio! If someone is interested in this, please let me know if there is anything I can do to help.
--
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/2615
### Description
Carrierroute module takes now 16 minutes to load about 50'000 entries from postgres-db.
In version 5.0.3 it was 10 seconds from the same db.
### Troubleshooting
#### Reproduction
Install kamailio 5.0.3 and fill your carrierroute table with thousands of entries. See how fast its loaded.
Then install 5.0.4 and see how long it takes now.
You can observe the query "SELECT * FROM carrierroute WHERE carrier=1 and domain=1 and prob>0" multiple times in the postgres-db log.
#### Debugging Data
none.
#### Log Messages
not needed.
#### SIP Traffic
not needed.
### Possible Solutions
Perhaps try to do the check "in-memory" instead generate a new sql-query.
### Additional Information
This bug exists in Kamilio versions >=5.0.4 and is (potentially) introduced by:
commit 9800aba65146b72623bb512049300d1beb8c8ec4
Author: Huseyin Dikme <hueseyin.dikme(a)1und1.de>
Date: Tue Sep 12 15:37:17 2017 +0200
carrierroute: warning for the same carrier/domain having routes with only 0 probability
- While starting kamailio or reloading the routes, if the same carrier/domain pairs do not have
any route with a probability other than 0 (zero) then an error log will be printed on the screen.
Besides, the log "invalid dice_max value" in the cr_func.c has been made more clear.
(cherry picked from commit 9741bee7af8136b35af8e6279e530aa0ad54f574)
* **Operating System**:
Ubuntu 20.04.2 LTS
Linux 5.4.0-66-generic #74-Ubuntu SMP Wed Jan 27 22:54:38 UTC 2021 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/2653
### Description
Could you extend `import_file` directive to support wildcards like
```
import_file "/run/kamailio/cfg/*"
```
This will allow place runtime config files with public IP of VM. Useful for cloud installation.
```
listen=udp:eth0 advertise 52.24.72.57:5060
listen=tcp:eth0 advertise 52.24.72.57:5060
```
### Expected behavior
All files matched to wildcard included into config
#### Actual observed behavior
wildcard ignored
--
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/2125
### Description
We have some JS code looping over all P-Asserted-Identity headers removing some of the entries:
```
let headerIndex = 0;
const telUriMatcher = new RegExp("tel:");
let paiValue = ksr.pv
.gete("$(hdr(P-Asserted-Identity)[" + headerIndex + "])")
.toString();
while (paiValue.length > 0) {
ksr.info(
`${ksr.pv.getw("$ci")}: Found P-A-I header with content <${ksr.pv.getw(
"$(hdr(P-Asserted-Identity)[" + headerIndex + "])"
)}> at index ${headerIndex}\n`
);
if (telUriMatcher.test(paiValue)) {
ksr.info(
`${ksr.pv.getw("$ci")}: Removed P-A-I header ${ksr.pv.getw(
"$(hdr(P-Asserted-Identity)[" + headerIndex + "])"
)}\n`
);
ksr.textopsx.remove_hf_value(
"P-Asserted-Identity[" + headerIndex + "]"
);
}
headerIndex++;
paiValue = ksr.pv
.gete("$(hdr(P-Asserted-Identity)[" + headerIndex + "])")
.toString();
}
```
In our tests, we wanted to remove the second header, but the first one got removed instead. The pseudovars docs say, the index of a header is 0-based. In textopsx docs it doesn't explicitly say, it's 1-based, but the first example shows it actually is.
### Possible Solutions
Right now, we replaced the line
```
ksr.textopsx.remove_hf_value("P-Asserted-Identity[" + headerIndex + "]");
```
with this one:
```
ksr.textopsx.remove_hf_value("P-Asserted-Identity[" + (headerIndex + 1) + "]");
```
This solves the problem, but it is not what we would expect. Both header access methods should use the same index base.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.3.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_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 8.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 hostname 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) 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/2387
Is it possible to specify a specific server name/server id for dispatcher to use to send pings with (and in outgoing requests)
It seems I can't (or haven't noticed in the docs) an event route I could use to set the xavp, as tm:local-request happens to late to use there. As an aside why isn't there a "last chance before send" event route?
This is probably a feature request more than a bug, as the ideal solution from my point of view would be an additional dispatcher attrs value to be able to set it per destination in the underlying dispatcher data
Judging by the output from tls module dbg the tls xavps are checked, before the ping is sent..
I've had a cursery glance at dispatch.c and it seems easy enough to add an extra attr parameter but I'm ata loss as to how I would preset the server name/id xavp... (I'm no c dev, but can Google quick enough to follow along mostly, and happy to fiddle away if anyone can be kind enough to give me some pointers in the right direction)
--
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/2591
### Description
I'm using dispatcher module like:
```
loadmodule "dispatcher.so"
modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_ping_interval", 60)
```
With records like:
```
1 sip:sip.host.com;transport=tls 0 1 socket=tls:111.222.233.10:5061;ping_from=sip:my-domain-01.com
2 sip:sip.host.com;transport=tls 0 1 socket=tls:111.222.233.20:5061;ping_from=sip:my-domain-02.com
```
In event_route[tm:local-request] I'm modifying 'Contact' and would like to specify what client TLS profile to use via server name or server id.
```
event_route[tm:local-request] {
if(is_method("OPTIONS")) {
append_hf("Contact: <sip:some-host.com;transport=tls>\r\n");
$xavp(tls=>server_name)=$fd;
$xavp(tls[0]=>server_id)=$fd;
}
}
```
Setting 'tls' xavp doesn't make any difference and default client TLS profile is being used.
It happens because in src/modules/tm/uac.c there is a code:
```
t_run_local_req()
...
tm_xdata_swap(new_cell, &backup_xd, 0);
...
/* restore original environment */
tm_xdata_swap(new_cell, &backup_xd, 1);
```
which resets any xavp changes done in event_route[tm:local-request].
Expected behaviour: ability to use xavp in tm:local-request route. That would allow to choose TLS client profile for dispatcher initiated requests.
### Possible Solutions
As a hack, in tm_xdata_swap() for mode=1, don't restore xavp list if it was NULL.
```
if (x->xavps_list != NULL && *x->xavps_list==NULL) {
// .... don't restore empty list...
} else {
xavp_set_list(x->xavps_list);
}
```
This change allows to select required TLS profile for dispatcher requests.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.3.5 (x86_64/linux) ff2f8c-dirty
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: ff2f8c -dirty
compiled on 10:19:05 Jul 28 2020 with gcc 7.5.0
```
* **Operating System**:
```
Linux xx 4.15.0-111-generic #112-Ubuntu SMP Thu Jul 9 20:32:34 UTC 2020 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/2413
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
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 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).
-->
### Description
topos_redis sets TTL on dialogs including presence SUBSCRIPTIONs. Once the TTL expires on those SUBSCRIBEs the topos module fails to route the in-dialog NOTIFYs & subsequent SUBSCRIBEs. That causes presence to break.
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
```
loadmodule "topos_redis.so"
modparam("topos_redis", "serverid", "srv1")
loadmodule "topos.so"
modparam("topos", "storage", "redis")
```
#### Reproduction
load up topos and topos_redis module, set expiration in topos_redis to 600 (just to reproduce this) create a dialog, either INVITE or SUBSCRIBE anything is fine. Once the TTL is expired the in-dialog routing of packets fail in route[WITHINDLG] with 404 Not here.
The route[WITHINGDLG] is just the standard one for us(can be pasted when needed)
I can set the TTL to few days, but doing that brought the problem back for SUBSCRIBEs since the desk phone stay alive for weeks at a stretch.
<!--
If the issue can be reproduced, describe how it can be done.
-->
### Possible Solutions
I could only think about renewing/refreshing the TTL for dialogs whenever they're loaded, so I modified the topos and topos_redis module for this and tested it. so far it works well and SUBSCRIBEs/NOTIFYs have been getting routed perfectly fine over the course of a week+
<!--
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 5.4.3 (x86_64/linux) a96451-dirty
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: a96451 -dirty
compiled on 23:44:16 Feb 20 2021 with gcc 8.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`)
-->
```
Debian GNU/Linux 10 (buster)
Linux sbc-va-2 4.19.0-13-cloud-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux
```
* **Suggested Fix/Patch**:
https://github.com/kamailio/kamailio/compare/master...goharahmed:master
--
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/2652