### Description
If I set notifier_processes = 0 then BLF (subscribe/notify) works as expected.
if I set notifier_processes to anything other than 0 then the initial subscribe works fine but when the device Re-Subscribes due to expiry of the timer I see errors in the kamailio log, the subsequent susbcribe fails and BLF no longer works.
### Troubleshooting
#### Reproduction
This issue can be easily reproduced just by setting notifier_processes to 1.
#### 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
```
ERROR: db_postgres [km_dbase.c:480]: db_postgres_query_lock(): transaction not in progress
ERROR: presence [subscribe.c:1708]: get_database_info(): querying subscription dialog
INFO: presence [subscribe.c:1129]: handle_subscribe(): getting stored info
```
#### 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).
-->
```
[11:28:02.095] TX to x.x.x.x:5060:
SUBSCRIBE sip:1005@example.com;transport=udp SIP/2.0
Via: SIP/2.0/UDP y.y.y.y:51761;branch=z9hG4bK271d65c640 661e;rport
Contact: <sip:10004@y.y.y.y:51761>
Max-Forwards: 70
Route: <sip:x.x.x.x;lr>
To: <sip:1005@example.com;transport=udp>
From: <sip:10004@example.com>;tag=602c0c864ab45075
Call-ID: 181910a72dc93418
CSeq: 26762 SUBSCRIBE
User-Agent: polycomVVX-VVX_400-UA/5.8.5.1256
Event: dialog
Accept: application/dialog-info+xml
Expires: 600
Supported:
Content-Length: 0
[11:28:02.184] RX from x.x.x.x:5060:
SIP/2.0 202 OK
Via: SIP/2.0/UDP y.y.y.y:51761;branch=z9hG4bK271d65c640 661e;rport=51761;received=y.y.y.y
To: <sip:1005@example.com;transport=udp>;tag=f055057275da74fa400fb8f3e0bfdfcf-718a1cd7
From: <sip:10004@example.com>;tag=602c0c864ab45075
Call-ID: 181910a72dc93418
CSeq: 26762 SUBSCRIBE
Expires: 600
Contact: <sip:x.x.x.x:5060;transport=udp>
Content-Length: 0
[11:28:02.1 ] RX from x.x.x.x:5060:
NOTIFY sip:10004@y.y.y.y:51761 SIP/2.0
Record-Route: <sip:x.x.x.x;lr=on;ftag=f055057275da74fa400fb8f3e0bfdfcf-718a1cd7>
Via: SIP/2.0/UDP x.x.x.x;branch=z9hG4bK54.4071b642000000000000000000000000.0
To: <sip:10004@example.com>;tag=602c0c864ab45075
From: <sip:1005@example.com>;tag=f055057275da74fa400fb8f3e0bfdfcf-718a1cd7
CSeq: 1 NOTIFY
Call-ID: 181910a72dc93418
Content-Length: 266
Max-Forwards: 70
Event: dialog
Contact: <sip:x.x.x.x:5060;transport=udp>
Subscription-State: active;expires=600
Content-Type: application/dialog-info+xml
<?xml version="1.0"?>
<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="1" state="full" entity="sip:1005@example.com">
<dialog id="615293b33c62dec073e05d9421e9f48b" direction="recipient"> <state>terminated</state> </dialog>
</dialog-info>
[11:28:02.1 ] TX to x.x.x.x:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP x.x.x.x;branch=z9hG4bK54.4071b642000000000000000000000000.0
To: <sip:10004@example.com>;tag=602c0c864ab45075
From: <sip:1005@example.com>;tag=f055057275da74fa400fb8f3e0bfdfcf-718a1cd7
CSeq: 1 NOTIFY
Call-ID: 181910a72dc93418
Server: polycomVVX-VVX_400-UA/5.8.5.1256
Content-Length: 0
...time...time...time...
[11:37:02.190] TX to x.x.x.x:5060:
SUBSCRIBE sip:x.x.x.x:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP y.y.y.y:51761;branch=z9hG4bK496e53396451225a;rport
Contact: <sip:10004@y.y.y.y:51761>
Max-Forwards: 70
To: <sip:1005@example.com;transport=udp>;tag=f055057275da74fa400fb8f3e0bfdfcf-718a1cd7
From: <sip:10004@example.com>;tag=602c0c864ab45075
Call-ID: 181910a72dc93418
CSeq: 26763 SUBSCRIBE
User-Agent: polycomVVX-VVX_400-UA/5.8.5.1256
Event: dialog
Accept: application/dialog-info+xml
Expires: 600
Supported:
Content-Length: 0
[11:37:02.276] RX from x.x.x.x:5060:
SIP/2.0 500 Server Internal Error
Via: SIP/2.0/UDP y.y.y.y:51761;branch=z9hG4bK496e53396451225a;rport=51761;received=y.y.y.y
To: <sip:1005@example.com;transport=udp>;tag=f055057275da74fa400fb8f3e0bfdfcf-718a1cd7
From: <sip:10004@example.com>;tag=602c0c864ab45075
Call-ID: 181910a72dc93418
CSeq: 26763 SUBSCRIBE
Content-Length: 0
```
### 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`
```
kamailio version: 5.5.0 (x86_64/linux) d4c1a1
postgres version: 12.7
```
Presence configuration:
```
modparam("presence_dialoginfo", "force_dummy_dialog", 1)
modparam("presence_dialoginfo", "force_single_dialog", 1)
modparam("presence_xml", "force_dummy_presence", 1)
modparam("presence_xml", "force_active", 1)
modparam("presence_xml", "disable_winfo", 1)
modparam("presence_xml", "disable_bla", 1)
modparam("presence", "subs_db_mode", 3)
modparam("presence", "expires_offset", 0)
modparam("presence", "send_fast_notify", 1)
modparam("presence", "clean_period", 0)
modparam("presence", "db_update_period", 0)
modparam("presence", "publ_cache", 0)
modparam("presence", "min_expires_action", 1)
modparam("presence", "min_expires", 300)
modparam("presence", "max_expires", 3600)
modparam("presence", "sip_uri_match", 1)
modparam("presence", "waitn_time", 1)
modparam("presence", "notifier_processes", 1)
modparam("presence", "db_url", "postgres://kamailio:***********@127.0.0.1/kamailio")
modparam("presence", "xavp_cfg", "pres")
modparam("presence", "local_log_level", 6)
modparam("presence", "startup_mode", 0)
modparam("presence", "force_delete", 1)
modparam("presence", "timeout_rm_subs", 0)
modparam("presence", "cseq_offset", 2)
```
db_postgres configuration:
All defaults just loading the module
```
loadmodule "db_postgres.so"
```
* **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 ********** 3.10.0-1062.4.3.el7.x86_64 #1 SMP Wed Nov 13 23:58:53 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/2739
### Description
<!--
-->
```
As you can see in the picture, via_host and received_host are different when sending registration data from outside of NAT. However, in the pcscf_unregister function, via_host and received_host are the same value.The pcontact structure in memory could not be found
```
#### 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).
-->
```
![image](https://user-images.githubusercontent.com/38756641/117534145-d0990d00-b022-11eb-9fd5-0c52437db2ad.png)
![image](https://user-images.githubusercontent.com/38756641/117534235-1fdf3d80-b023-11eb-973e-d7ae3787e875.png)
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
```
change the pcscf_unregister function, and add Two parameters
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.4.4 (x86_64/linux) 8d6c2b
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
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: 8d6c2b
compiled on 14:04:08 Apr 26 2021 with gcc 4.8.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 `uname -a`)
-->
```
Linux iZhp329ygro5y3v090vnwpZ 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 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/2729
### Description
When LIS server failed, then LIS send message like
```
The error response to the request is an error document. The
following response shows an example error response.
HTTP/1.1 200 OK
Server: Example LIS
Expires: Tue, 10 Jan 2006 03:49:20 GMT
Cache-control: private
Content-Type: application/held+xml;charset=utf-8
Content-Length: 182
<?xml version="1.0"?>
<error xmlns="urn:ietf:params:xml:ns:geopriv:held"
code="locationUnknown">
<message xml:lang="en">Unable to determine location
</message>
</error>
```
Here is HTTP code is 200.
lost_held_dereference now simply check HTTP code and do not check XML body.
Expected XML content check for:
1. XML HELD error message
2. check `findServiceResponse` or `presence` element check like it done for `lost_query`.
This check is important because PIDF-LO object may be added to the multipart body. And HELD XML error handling prevents error message addition as PDF-LO object.
--
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/2724
### Description
As far as I know there is currently no support for [RFC-8760](https://tools.ietf.org/html/rfc8760) yet. It modifies the Digest Access Authentication scheme to add support for more secure digest algorithms, e.g., SHA-256 and SHA-512/256, to replace the obsolete MD5 algorithm. Are there any plans to implement this?
### Possible Solutions
Extending the auth module to accept these algorithms as a function parameter would be nice to have since older clients may not support them.
--
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/2668
### Description
TLSF mem manager accounting for wrong values
was trying to debug a crash and this popped up.
using a lot of small allocs until pkg_alloc returns NULL (when exhausted)
when NULL is returned the memory **used+overhead** exceeds the heap allocated.
<!--
-->
### Troubleshooting
#### Reproduction
use frequent small memory allocs until pool is exausted (returns NULL) , check tlsf status.
static void do_test_mem()
{
void* chunk;
tlsf_t pool = NULL;
size_t total = 16 * 1024 * 1024;
size_t half = 8 * 1024 * 1024;
size_t sz = 6;
int x;
void* mem = malloc(total);
char* mem2 = tlsf_cast(char*, tlsf_cast(ptrdiff_t, mem) + half);
memset(mem2, 'X', half);
assert(*mem2 == 'X');
pool = tlsf_create_with_pool(mem, half);
do { chunk = tlsf_malloc(pool, sz); } while(chunk != NULL);
tlsf_status(pool);
for(x=0; x < half; x++) {
assert(*mem2 == 'X');
mem2++;
}
free(mem);
}
<!--
If the issue can be reproduced, describe how it can be done.
-->
<!--
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.
-->
```
heap size= **8388592**
used= **6285144**, used+overhead=**12578696**, free=**18446744073705361512**, fragments=0
max used (+overhead)=12578696, max fragments=1
Free blocks matrix ('.': none, 'X': between 2^X and (2^(X+1)-1) free blocks, X=A..Z, A=0, B=1, ...)
> first-level: 32 block list arrays between 2^fl and 2^(fl+1) bytes (fl=8..39)
v second-level: 32 block lists between 2^fl+sl*2^(fl-5) and 2^fl+(sl+1)*2^(fl-5)-1 bytes (sl=0..31)
0|................................|
1|................................|
2|................................|
3|................................|
4|................................|
5|................................|
6|................................|
7|................................|
8|................................|
9|................................|
10|................................|
11|................................|
12|................................|
13|................................|
14|................................|
15|................................|
16|................................|
17|................................|
18|................................|
19|................................|
20|................................|
21|................................|
22|................................|
23|................................|
24|................................|
25|................................|
26|................................|
27|................................|
28|................................|
29|................................|
30|................................|
31|................................|
```
#### 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).
-->
```
identical to reproduce step when calling mem debug on a running instance
```
### 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** - built from master
```
* **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`)
-->
```
CentOS7 and alpine
```
## comments
heap size= **8388592** shouldn't it be **8388608** ?
used+overhead=**12578696** misleading
free=**18446744073705361512** misleading, looks like it has a negative value
the map doesn't look ok (or i'm not understanding what it should show), its the same output before the alloc and after.
--
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/2628
Hello
I configure my kamailio.cfg to handle SLA using (SCA module) and shared presence is working but still facing some issue in case of hold invite and BYE and the reason behind of that issue is following error
Nov 26 07:38:40 SBC-4-1 /usr/local/sbin/kamailio[104107]: ERROR: sca [sca_call_info.c:1008]: sca_call_info_invite_request_handler(): Failed to update sip:4569@test.sip.abcd.com appearance-index 0 to active
actually, in Kamailio appearances, I can see the entry for this call but the index is 1 instead of 0, and Kamailio going to update with a 0 index
[root@SBC-4-1 ntcarfte-kamailio]# kamcmd sca.all_appearances
sip:4569@test.sip.abcd.com 1 active 1606376289 sip:4569@10.xx.xx.xx:5070;transport=udp sip:2003@test.sip.abcd.com 186161_mobile-rel120MTQ5OTcyZjFhMjMyNmI1ZGE1MWY4ODc2M2RkN2VmZmQ 45dc18d8 H6cS9vecZ248B
if I manually update appearances using RPC command with index 1 then the phone started blinking as I change state to held
# kamcmd sca.update_appearance sip:4569@sc4test.sip.teledge.com 1 held
# kamcmd sca.all_appearances
sip:4569@test.sip.abcd.com 1 held 1606376516 sip:4569@10.xx.xx.xx:5070;transport=udp sip:2003@test.sip.abcd.com 186161_mobile-rel120NzE5MDgyZDc1NjJiYjcwMWFlYmI3NzM3NjE2OTRhZjU 08f005cb eK9ratm83g92e
kamailio.cfg
route[SCA] {
if(is_method("SUBSCRIBE")) {
if ($hdr(Event) == "call-info" || $hdr(Event) == "line-seize") {
xlog("L_INFO","(MAIN) :HELLO ($avp(uuid)) : $avp(rsi) $sp $hdr(Event)");
xdbg("SCA: $hdr(Event) SUBSCRIBE $ru from $si:$sp");
sca_handle_subscribe();
exit;
}
return;
}
if (!is_method("BYE|CANCEL|INVITE|PRACK|REFER")) {
return;
}
sca_call_info_update();
}
route[RELAY_OUTBOUND_FS] {
xlog("L_INFO","(RELAY_OUTBOUND_FS) : ($avp(uuid)) : INSIDE ROUTE ");
if (!has_totag()){
$avp(set_h) = 1;
}
t_on_reply("REPLY_OUTBOUND_FS");
route(SCA);
if (!t_relay()) {
sl_reply_error();
}
exit;
}
route[RELAY_INBOUND_FS] {
if(is_method("INVITE|BYE|UPDATE|CANCEL|ACK")) {
$avp(s:puburis_caller) = $fu;
setflag(8);
dlg_manage();
}
if(is_method("REGISTER")) {
t_on_reply("REPLY_REGISTER");
} else {
t_on_reply("REPLY_INBOUND_FS");
}
route(SCA);
if (!t_relay()) {
sl_reply_error();
}
exit;
}
onreply_route[REPLY_INBOUND_FS] {
xdbg("incoming reply\n");
if (status =~ "[456][0-9][0-9]") {
# don't update SCA state here, since there may be
# failure route processing (e.g., call forwarding).
# update state in failure route instead.
return;
}
route(SCA);
}
onreply_route[REPLY_OUTBOUND_FS] {
xdbg("incoming reply\n");
if (status =~ "[456][0-9][0-9]") {
# don't update SCA state here, since there may be
# failure route processing (e.g., call forwarding).
# update state in failure route instead.
return;
}
route(SCA);
}
--
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/2583
With the dialog and acc modules configured to generate CDRs to syslog, sometimes a CDR is not generated when a call ends. It appears that this is because some callers are closing the websocket just after sending the BYE. That means that when the 200 response to the BYE arrives it can't be relayed as the websocket has closed. It does seem to be timing related.
We use the websocket close event to shorten the dialog timeout to 1 second.
We also don't get a CDR if we close the websocket while a call is active. The dialog times out and sends a BYE to the callee (it fails to send to the caller, not because the websocket is closed but because the *.invalid contact address can't be resolved!) and then destroys the dialog.
[kamailio.log](https://github.com/kamailio/kamailio/files/5702715/kamailio.l…
[kamailio-sipdump-2020-12-16--11-13-52.data.log](https://github.com/kamailio…
* **Kamailio Version** - output of `kamailio -v`
version: kamailio 5.3.6 (x86_64/linux) fb26c8
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
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: fb26c8
compiled on 11:51:56 Nov 17 2020 with gcc 4.8.5
* **Operating System**:
Linux ip-172-30-0-66 4.14.114-83.126.amzn1.x86_64 #1 SMP Tue May 7 02:26:58 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/2587
### Description
When I try to load kamailio schema into MySQL database I get an error "Duplicate entry 'dialog_vars' for key 'PRIMARY'".
I have checked the duplicated `dialog_vars` table definition at
1. [dialog-create.sql#L32-L38](https://github.com/kamailio/kamailio/blob/master…
2. [ims_dialog-create.sql#L41-L49](https://github.com/kamailio/kamailio/blob/ma…
#### Reproduction
Load schemas from dialog-create.sql and from ims_dialog-create.sql.
### Possible Solutions
Remove `dialog_vars` table definition from `ims_dialog-create.sql` shema file.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
@safarov-dell:/usr/share/kamailio$ kamailio -v
version: kamailio 5.5.0-dev3 (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 on 12:51:16 Dec 4 2020 with gcc 10.2.1
```
* **Operating System**:
```
@safarov-dell:/usr/share/kamailio$ cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.13.0_alpha20200917
PRETTY_NAME="Alpine Linux edge"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
```
--
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/2575