Hi,
Here are the packets I have captured on Kamailio side for asked scenario,
====================================================== # U 2010/02/18 17:28:21.913801 172.19.100.42:5062 -> 172.16.0.10:5060 SUBSCRIBE sip:9999999@XYZ.COM SIP/2.0 Via: SIP/2.0/UDP 172.19.100.42:5062;branch=z9hG4bKcf1418f3a844632a From: "9999999" sip:9999999@XYZ.COM;tag=0b507223e323c792 To: sip:9999999@XYZ.COM Contact: sip:9999999@172.19.100.42:5062;transport=udp Supported: eventlist, path Call-ID: 95ff21ffceaaedaa@172.19.100.42 CSeq: 2001 SUBSCRIBE User-Agent: Grandstream GXP2000 1.1.4.14 Max-Forwards: 70 Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE Event: message-summary Expires: 3600 Accept: application/simple-message-summary Content-Length: 0
# U 2010/02/18 17:28:22.019983 172.16.0.10:5060 -> 172.19.100.42:5062 SIP/2.0 202 OK Via: SIP/2.0/UDP 172.19.100.42:5062;branch=z9hG4bKcf1418f3a844632a;rport=5062;received=172.19.100.42 From: "9999999" sip:9999999@XYZ.COM;tag=0b507223e323c792 To: sip:9999999@XYZ.COM;tag=c7e52fec396ce86303dfff942ce907e8-3a6c Call-ID: 95ff21ffceaaedaa@172.19.100.42 CSeq: 2001 SUBSCRIBE Expires: 60 Contact: sip:172.16.0.10:5060 Server: Kamailio (1.5.2-notls (i386/linux)) Content-Length: 0
# U 2010/02/18 17:28:22.068679 172.16.0.10:5060 -> 172.19.100.42:5062 NOTIFY sip:9999999@172.19.100.42:5062;transport=udp SIP/2.0 Via: SIP/2.0/UDP 172.16.0.10;branch=z9hG4bK034f.35e8d536.0 To: sip:9999999@XYZ.COM;tag=0b507223e323c792 From: sip:9999999@XYZ.COM;tag=c7e52fec396ce86303dfff942ce907e8-3a6c CSeq: 1 NOTIFY Call-ID: 95ff21ffceaaedaa@172.19.100.42 Content-Length: 0 User-Agent: Kamailio (1.5.2-notls (i386/linux)) Max-Forwards: 70 Event: message-summary Contact: sip:172.16.0.10:5060 Subscription-State: active;expires=70
# U 2010/02/18 17:28:22.180911 172.19.100.42:5062 -> 172.16.0.10:5060 SIP/2.0 200 OK Via: SIP/2.0/UDP 172.16.0.10;branch=z9hG4bK034f.35e8d536.0 From: sip:9999999@XYZ.COM;tag=c7e52fec396ce86303dfff942ce907e8-3a6c To: sip:9999999@XYZ.COM;tag=0b507223e323c792 Call-ID: 95ff21ffceaaedaa@172.19.100.42 CSeq: 1 NOTIFY User-Agent: Grandstream GXP2000 1.1.4.14 Contact: sip:9999999@172.19.100.42:5062;transport=udp Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE Supported: replaces, timer Content-Length: 0
# U 2010/02/18 17:29:07.107207 172.19.100.42:5062 -> 172.16.0.10:5060 SUBSCRIBE sip:9999999@XYZ.COM SIP/2.0 Via: SIP/2.0/UDP 172.19.100.42:5062;branch=z9hG4bK498bfff4555df384 From: "9999999" sip:9999999@XYZ.COM;tag=0b507223e323c792 To: sip:9999999@XYZ.COM;tag=c7e52fec396ce86303dfff942ce907e8-3a6c Contact: sip:9999999@172.19.100.42:5062;transport=udp Supported: eventlist, path Call-ID: 95ff21ffceaaedaa@172.19.100.42 CSeq: 2002 SUBSCRIBE User-Agent: Grandstream GXP2000 1.1.4.14 Max-Forwards: 70 Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE Event: message-summary Expires: 3600 Accept: application/simple-message-summary Content-Length: 0
# U 2010/02/18 17:29:07.214039 172.16.0.10:5060 -> 172.19.100.42:5062 SIP/2.0 202 OK Via: SIP/2.0/UDP 172.19.100.42:5062;branch=z9hG4bK498bfff4555df384;rport=5062;received=172.19.100.42 From: "9999999" sip:9999999@XYZ.COM;tag=0b507223e323c792 To: sip:9999999@XYZ.COM;tag=c7e52fec396ce86303dfff942ce907e8-3a6c Call-ID: 95ff21ffceaaedaa@172.19.100.42 CSeq: 2002 SUBSCRIBE Expires: 60 Contact: sip:172.16.0.10:5060 Server: Kamailio (1.5.2-notls (i386/linux)) Content-Length: 0
# U 2010/02/18 17:29:07.347783 172.16.0.10:5060 -> 172.19.100.42:5062 NOTIFY sip:9999999@172.19.100.42:5062;transport=udp SIP/2.0 Via: SIP/2.0/UDP 172.16.0.10;branch=z9hG4bKd24f.ef72ec05.0 To: sip:9999999@XYZ.COM;tag=0b507223e323c792 From: sip:9999999@XYZ.COM;tag=c7e52fec396ce86303dfff942ce907e8-3a6c CSeq: 2 NOTIFY Call-ID: 95ff21ffceaaedaa@172.19.100.42 Content-Length: 0 User-Agent: Kamailio (1.5.2-notls (i386/linux)) Max-Forwards: 70 Event: message-summary Contact: sip:172.16.0.10:5060 Subscription-State: active;expires=70
# U 2010/02/18 17:29:09.107395 172.19.100.42:5062 -> 172.16.0.10:5060 SUBSCRIBE sip:9999999@XYZ.COM SIP/2.0 Via: SIP/2.0/UDP 172.19.100.42:5062;branch=z9hG4bK498bfff4555df384 From: "9999999" sip:9999999@XYZ.COM;tag=0b507223e323c792 To: sip:9999999@XYZ.COM;tag=c7e52fec396ce86303dfff942ce907e8-3a6c Contact: sip:9999999@172.19.100.42:5062;transport=udp Supported: eventlist, path Call-ID: 95ff21ffceaaedaa@172.19.100.42 CSeq: 2002 SUBSCRIBE User-Agent: Grandstream GXP2000 1.1.4.14 Max-Forwards: 70 Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE Event: message-summary Expires: 3600 Accept: application/simple-message-summary Content-Length: 0
# U 2010/02/18 17:29:09.161435 172.16.0.10:5060 -> 172.19.100.42:5062 SIP/2.0 202 OK Via: SIP/2.0/UDP 172.19.100.42:5062;branch=z9hG4bK498bfff4555df384;rport=5062;received=172.19.100.42 From: "9999999" sip:9999999@XYZ.COM;tag=0b507223e323c792 To: sip:9999999@XYZ.COM;tag=c7e52fec396ce86303dfff942ce907e8-3a6c Call-ID: 95ff21ffceaaedaa@172.19.100.42 CSeq: 2002 SUBSCRIBE Expires: 60 Contact: sip:172.16.0.10:5060 Server: Kamailio (1.5.2-notls (i386/linux)) Content-Length: 0
# U 2010/02/18 17:29:13.160133 172.19.100.42:5062 -> 172.16.0.10:5060 SUBSCRIBE sip:9999999@XYZ.COM SIP/2.0 Via: SIP/2.0/UDP 172.19.100.42:5062;branch=z9hG4bK498bfff4555df384 From: "9999999" sip:9999999@XYZ.COM;tag=0b507223e323c792 To: sip:9999999@XYZ.COM;tag=c7e52fec396ce86303dfff942ce907e8-3a6c Contact: sip:9999999@172.19.100.42:5062;transport=udp Supported: eventlist, path Call-ID: 95ff21ffceaaedaa@172.19.100.42 CSeq: 2002 SUBSCRIBE User-Agent: Grandstream GXP2000 1.1.4.14 Max-Forwards: 70 Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE Event: message-summary Expires: 3600 Accept: application/simple-message-summary Content-Length: 0
# U 2010/02/18 17:29:13.280056 172.16.0.10:5060 -> 172.19.100.42:5062 SIP/2.0 481 Subscription does not exist Via: SIP/2.0/UDP 172.19.100.42:5062;branch=z9hG4bK498bfff4555df384;rport=5062;received=172.19.100.42 From: "9999999" sip:9999999@XYZ.COM;tag=0b507223e323c792 To: sip:9999999@XYZ.COM;tag=c7e52fec396ce86303dfff942ce907e8-3a6c Call-ID: 95ff21ffceaaedaa@172.19.100.42 CSeq: 2002 SUBSCRIBE Server: Kamailio (1.5.2-notls (i386/linux)) Content-Length: 0
======================================================
Please shed some light on this.
Thanking you,
----SM
On Wed, Feb 17, 2010 at 5:29 PM, Asterisk User asteriskeasy@gmail.com wrote:
Thanks Iñaki,
I 'll give it a try and come back to the group.
--SM
On Wed, Feb 17, 2010 at 5:17 PM, Iñaki Baz Castillo ibc@aliax.net wrote:
El Miércoles, 17 de Febrero de 2010, Asterisk User escribió:
Oh I see,
Here is my notify packet,
There is something weird here:
SUBSCRIBE sip:ABC.com SIP/2.0 Via: SIP/2.0/UDP 172.18.100.89:5060;branch=z9hG4bK-4082dbb From: DEF sip:307@ABC.com;tag=802bf23e23f4741 To: DEF sip:307@ABC.com Call-ID: 9f465e4b-2207f239@172.18.100.89 CSeq: 30004 SUBSCRIBE Max-Forwards: 70 Contact: DEF sip:307@172.18.100.89:5060 Accept: application/simple-message-summary Expires: 2147483647 Event: message-summary User-Agent: Linksys/PAP2T-3.1.15(LS) Content-Length: 0
SIP/2.0 202 OK Via: SIP/2.0/UDP 172.18.100.89:5060;branch=z9hG4bK-4082dbb;rport=5060;received=220.224.237.54 From: DEF sip:307@ABC.com;tag=802bf23e23f4741 To: DEF sip:307@ABC.com;tag=0cca86077d334bd53b00d2c8eab3d5fb.dfeb Call-ID: 9f465e4b-2207f239@172.18.100.89 CSeq: 30004 SUBSCRIBE Expires: 3600 Contact: sip:192.168.94.30:5060 Server: Kamailio (1.5.0-notls (i386/linux)) Content-Length: 0
(of course this NOTIFY is for other flow but it doesn't matter now):
NOTIFY sip:307@172.18.100.89:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.94.30;branch=z9hG4bK4e33.2f3848c3.0 To: sip:307@XYZ.com;tag=6341960e5fa2e56f From: sip:307@XYZ.com;tag=0cca86077d334bd53b00d2c8eab3d5fb.118f CSeq: 1 NOTIFY Call-ID: fd0e6dba-442e11b3@172.18.100.89 Content-Length: 0 User-Agent: Kamailio (1.5.0-notls (i386/linux)) Max-Forwards: 70 Event: message-summary Contact: sip:192.168.94.30:5060 Subscription-State: active;expires=3670
As you see the client is proposing a Expires value of 2147483647 but the server decreases it to 3600 in the 200 Ok. But in the instant NOTIFY the server sets Expires: 3670 (greater than 3600!!!).
This causes that the client to send the re-SUBSCRIBE after ~3670 seconds but I suspect that the server terminates the subscription dialog after the original value of 3600.
Some months ago I reported a similar bug for OpenSIPs. It was a bug in the code generating the Expires value so some NOTIFY's contain a weird value. AFAIK this bug has not been fixed in Kamailio.
Anyhow, when does you client send the first re-SUBSCRIBE? how long after the initial SUBSCRIBE?
To make tests I suggest to decrease the max-expires value of the presence module to something as 60-120 seconds, then capture an *entire* SIP trace for the subscription dialog (SUBSICRIBE/200/NOTIFY/200/re-SUBSCRIBE...) until you get the 481 response, and paste it here.
-- Iñaki Baz Castillo ibc@aliax.net
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users