Hello,
``` kamailio -v version: kamailio 4.4.0-pre0 (i386/linux) f39d14-dirty flags: STATS: Off, EXTRA_DEBUG, 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: f39d14 -dirty compiled on 17:01:22 Feb 12 2016 with gcc 4.9.3 ```
If I read well the RFC 3261 section 20.19 [https://tools.ietf.org/html/rfc3261#section-20.19] a SUBSCRIBE or a PUBLISH may have an Expires value of 2**32-1 = (4294967295).
But it appears to me that this value is not supported in Kamailio even if I allow it as a max_expires option in configuration (modparam("presence", "max_expires", 4294967295)).
Kamailio answers with the following:
``` 2016/02/29 09:02:59.343750 192.168.100.1:5060 -> 192.168.2.2:5062 SIP/2.0 423 Interval Too Brief via: SIP/2.0/UDP 192.168.2.2:5062;branch=z9hG4bK-11535-1-9;rport=5062 From: "User1" sip:user1@example.com;tag=11535-1 To: "User1" sip:user1@example.com;tag=dfba6eee28f067076993264b7e466d4e.151a Call-ID: 1-11545@192.168.1.1-user1 CSeq: 3 PUBLISH Expires: -2147483648 SIP-ETag: a.1456732971.11285.1.0 Server: kamailio (4.4.0-pre0 (i386/linux)) Content-Length: 0 ```
Which is not compliant with the RFC, the Expires value should not be signed.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/521
I pushed some changes to presence module in master branch to use unsigned int for expires. Can you test and report the results?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/521#issuecomment-191811871
Hi Daniel,
``` version: kamailio 4.4.0-pre1 (i386/linux) c5289e-dirty flags: STATS: Off, EXTRA_DEBUG, 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: c5289e -dirty compiled on 16:23:17 Mar 3 2016 with gcc 4.9.3 ```
I don't see negative values anymore, so this is better.
But if I use Expires: 4294967295 in my subscribe (and presence max_expires fixed to 4294967295) here is what I get:
``` 2016/03/03 16:36:39.625775 192.168.2.2:5062 -> 192.168.100.1:5060 SUBSCRIBE sip:user1@example.com SIP/2.0 via: SIP/2.0/UDP 192.168.2.2:5062;branch=z9hG4bK-9586-1-5 From: "user1" sip:user1@example.com;tag=9586-1 To: "user1" sip:user1@example.com Call-ID: 1-9596@192.168.1.1-user1 CSeq: 2 SUBSCRIBE Contact: sip:user1@192.168.2.2:5062 Max-Forwards: 70 Expires: 4294967295 Event: presence User-Agent: TESTING Content-Length: 0 ```
``` 2016/03/03 16:36:39.630956 192.168.100.1:5060 -> 192.168.2.2:5062 SIP/2.0 202 OK via: SIP/2.0/UDP 192.168.2.2:5062;branch=z9hG4bK-9586-1-5;rport=5062 From: "user1" sip:user1@example.com;tag=9586-1 To: "user1" sip:user1@example.com;tag=cf07c8ffb98dc22e80bb9fddf106b1f6-ca34 Call-ID: 1-9596@192.168.1.1-user1 CSeq: 2 SUBSCRIBE Expires: 2147483647 Contact: sip:presence@example.com Server: kamailio (4.4.0-pre1 (i386/linux)) Content-Length: 0 ```
``` 2016/03/03 16:36:39.631069 192.168.100.1:5060 -> 192.168.2.2:5062 NOTIFY sip:user1@192.168.2.2:5062 SIP/2.0 Via: SIP/2.0/UDP 192.168.100.1;branch=z9hG4bKdb1e.fa29e892000000000000000000000000.0 To: sip:user1@example.com;tag=9586-1 From: sip:user1@example.com;tag=cf07c8ffb98dc22e80bb9fddf106b1f6-ca34 CSeq: 2 NOTIFY Call-ID: 1-9596@192.168.1.1-user1 Content-Length: 0 User-Agent: kamailio (4.4.0-pre1 (i386/linux)) Max-Forwards: 70 Event: presence Contact: sip:presence@example.com Subscription-State: active;expires=2147483647 ```
Looks like the Expires value is divided by 2 or one bit is disappearing.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/521#issuecomment-191820572
Seems that this issue was forgotten for quite some time. I just did a review of the code and the expires value should be printed as unsigned int in the reply. Anyhow, I did a bit of cleanup in the master branch to the code related to it. Can you test with master branch having debug=3 and attach/send the log messages for processing the SUBSCRIBE?
Re-open if the master is exposing the issue, attaching the log as in the above comment.
Closed #521.