Hi Group, I have one more problem regarding a SIP subscribe packet. When my phone registers first time, it gets OK for SUBSCRIBE sent from phone. But after couple of hours it(phone) keeps on sending subsequent SUBSCRIBE requests but the response from Kamailio is 481 Subscription does not exist.
Here are my packets,
=======================> For first SUBSCRIBE 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
=======================> For subsequent SUBSCRIBEs
SUBSCRIBE sip:ABC.com SIP/2.0 Via: SIP/2.0/UDP 172.18.100.89:5060;branch=z9hG4bK-69712d2e From: DEF sip:307@ABC.com;tag=5d3bd6c2989f0839 To: DEF sip:307@ABC.com;tag=0cca86077d334bd53b00d2c8eab3d5fb.dfeb Call-ID: 7f6d2c36-97569155@172.18.100.89 CSeq: 55947 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 481 Subscription does not exist Via: SIP/2.0/UDP 172.18.100.89:5060;branch=z9hG4bK-69712d2e;rport=5060;received=220.224.237.54 From: DEF sip:307@ABC.com;tag=5d3bd6c2989f0839 To: DEF sip:307@ABC.com;tag=0cca86077d334bd53b00d2c8eab3d5fb.dfeb Call-ID: 7f6d2c36-97569155@172.18.100.89 CSeq: 55947 SUBSCRIBE Server: Kamailio (1.5.0-notls (i386/linux)) Content-Length: 0
----------------------------------------------------------------------------------------------------------------------------------------------
===>The error which I get on kamailio is, ERROR:presence:get_database_info: No matching subscription dialog found in database
===>Have already loaded the module presence.so
modparam("presence", "db_url", "mysql://XYZ:XYZ@192.168.90.12/openser") modparam("presence", "max_expires", 3600) modparam("presence", "presentity_table", "presentity") modparam("presence", "active_watchers_table", "active_watchers") modparam("presence", "watchers_table", "watchers") modparam("presence", "clean_period", 100) modparam("presence", "db_update_period", 100) modparam("presence", "to_tag_pref", 'pres') modparam("presence", "expires_offset", 10) modparam("presence", "server_address", "sip:192.168.94.30:5060") modparam("presence", "fallback2db", 1) modparam("presence", "subs_htable_size", 11) modparam("presence", "pres_htable_size", 11)
loadmodule "presence_mwi.so" loadmodule "presence_xml.so" modparam("presence_xml", "force_active", 1) modparam("presence_xml", "db_url", "mysql://XYZ:XYZ@192.168.90.12/openser")
---------------------------------------------------------------------------------------------------------------------------------------------
Please help me on this.
--SM
El Miércoles, 17 de Febrero de 2010, Asterisk User escribió:
Hi Group, I have one more problem regarding a SIP subscribe packet. When my phone registers first time, it gets OK for SUBSCRIBE sent from phone. But after couple of hours it(phone) keeps on sending subsequent SUBSCRIBE requests but the response from Kamailio is 481 Subscription does not exist.
Here are my packets,
=======================> For first SUBSCRIBE 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.5 4 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
=======================> For subsequent SUBSCRIBEs
SUBSCRIBE sip:ABC.com SIP/2.0 Via: SIP/2.0/UDP 172.18.100.89:5060;branch=z9hG4bK-69712d2e From: DEF sip:307@ABC.com;tag=5d3bd6c2989f0839 To: DEF sip:307@ABC.com;tag=0cca86077d334bd53b00d2c8eab3d5fb.dfeb Call-ID: 7f6d2c36-97569155@172.18.100.89 CSeq: 55947 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 481 Subscription does not exist Via: SIP/2.0/UDP 172.18.100.89:5060;branch=z9hG4bK-69712d2e;rport=5060;received=220.224.237. 54 From: DEF sip:307@ABC.com;tag=5d3bd6c2989f0839 To: DEF sip:307@ABC.com;tag=0cca86077d334bd53b00d2c8eab3d5fb.dfeb Call-ID: 7f6d2c36-97569155@172.18.100.89 CSeq: 55947 SUBSCRIBE Server: Kamailio (1.5.0-notls (i386/linux)) Content-Length: 0
Check that the refresh SUBSCRIBE is sent within the expires time (3600 seconds), is it?
Yes Baz, It looks so.
how can i set it to infinite? Will setting 0 for it work?
Thanks for your pointer.
--SM
On Wed, Feb 17, 2010 at 3:38 PM, Iñaki Baz Castillo ibc@aliax.net wrote:
El Miércoles, 17 de Febrero de 2010, Asterisk User escribió:
Hi Group, I have one more problem regarding a SIP subscribe packet. When my phone registers first time, it gets OK for SUBSCRIBE sent from phone. But after couple of hours it(phone) keeps on sending subsequent SUBSCRIBE requests but the response from Kamailio is 481 Subscription does not exist.
Here are my packets,
=======================> For first SUBSCRIBE 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.5 4 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
=======================> For subsequent SUBSCRIBEs
SUBSCRIBE sip:ABC.com SIP/2.0 Via: SIP/2.0/UDP 172.18.100.89:5060;branch=z9hG4bK-69712d2e From: DEF sip:307@ABC.com;tag=5d3bd6c2989f0839 To: DEF sip:307@ABC.com;tag=0cca86077d334bd53b00d2c8eab3d5fb.dfeb Call-ID: 7f6d2c36-97569155@172.18.100.89 CSeq: 55947 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 481 Subscription does not exist Via: SIP/2.0/UDP 172.18.100.89:5060;branch=z9hG4bK-69712d2e;rport=5060;received=220.224.237. 54 From: DEF sip:307@ABC.com;tag=5d3bd6c2989f0839 To: DEF sip:307@ABC.com;tag=0cca86077d334bd53b00d2c8eab3d5fb.dfeb Call-ID: 7f6d2c36-97569155@172.18.100.89 CSeq: 55947 SUBSCRIBE Server: Kamailio (1.5.0-notls (i386/linux)) Content-Length: 0
Check that the refresh SUBSCRIBE is sent within the expires time (3600 seconds), is it?
-- 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
El Miércoles, 17 de Febrero de 2010, Asterisk User escribió:
Yes Baz, It looks so.
how can i set it to infinite? Will setting 0 for it work?
"infinite" is not a valid value for SIP subscription mechanism.
When you send the first SUBSCRIBE you get a 200 containing a "Expires: 3600" and also a NOTIFY (for that dialog) containing "Expires: 3600" o "Expires: 35XX", right? which exact value?
Oh I see,
Here is my notify packet,
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
So now what should I do to get rid of my error on kamailio?
Thanks again,
--SM
On Wed, Feb 17, 2010 at 4:19 PM, Iñaki Baz Castillo ibc@aliax.net wrote:
El Miércoles, 17 de Febrero de 2010, Asterisk User escribió:
Yes Baz, It looks so.
how can i set it to infinite? Will setting 0 for it work?
"infinite" is not a valid value for SIP subscription mechanism.
When you send the first SUBSCRIBE you get a 200 containing a "Expires: 3600" and also a NOTIFY (for that dialog) containing "Expires: 3600" o "Expires: 35XX", right? which exact value?
-- 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
I think Iñaki is more interested in 2xx replies to your SUBSCRIBE request message.
On 02/17/2010 05:56 AM, Asterisk User wrote:
Oh I see,
Here is my notify packet,
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
So now what should I do to get rid of my error on kamailio?
Thanks again,
--SM
On Wed, Feb 17, 2010 at 4:19 PM, Iñaki Baz Castilloibc@aliax.net wrote:
El Miércoles, 17 de Febrero de 2010, Asterisk User escribió:
Yes Baz, It looks so.
how can i set it to infinite? Will setting 0 for it work?
"infinite" is not a valid value for SIP subscription mechanism.
When you send the first SUBSCRIBE you get a 200 containing a "Expires: 3600" and also a NOTIFY (for that dialog) containing "Expires: 3600" o "Expires: 35XX", right? which exact value?
-- Iñaki Baz Castilloibc@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
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
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.
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
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
El Jueves, 18 de Febrero de 2010, Asterisk User escribió:
Please shed some light on this.
The problem is the following:
After the first re-SUBSCRIBE with "CSeq: 2002 SUBSCRIBE" it seems that the client doesn't receive the 202 responses from the server, neither the NOTIFY. Note that subsequent re-SUBSCRIBE's are *retransmissions* (same branch, same CSeq...).
The problem is that the client doesn't receive the second NOTIFY sent by the kamailio (with "CSeq: 2 NOTIFY") so it doesn't reply the 200 for the NOTIFY and Kamailio ends the subscription dialog. However I don't see retransmissions of the NOFIFY from Kamailio, very strange...
So I think you have some kind of network problem since the client doesn't receive subsequent requests (NOTIFY) or responses (202 to re-SUBSCRIBE's). Are you in a local wired LAN? Well, I see that the client and server are in different subnets so I suspect there is a IP routing problem, or perhaps you have a NAT router between both networks, I don't know.
Sorry for the trouble, but for the sake of simplicity I just removed those subsequent NOTIFY packets from my previous mail. Kamailio does keep on sending NOTIFY to the client but doesn't get OK.
You are right, phone is behind NAT. I just want to know if phone sends OK to NOTIFY for the first time (SUBSCRIBE) then why not on subsequent SUBSCRIBEs?
I appreciate your efforts, Iñaki
--SM
On Thu, Feb 18, 2010 at 3:43 PM, Iñaki Baz Castillo ibc@aliax.net wrote:
El Jueves, 18 de Febrero de 2010, Asterisk User escribió:
Please shed some light on this.
The problem is the following:
After the first re-SUBSCRIBE with "CSeq: 2002 SUBSCRIBE" it seems that the client doesn't receive the 202 responses from the server, neither the NOTIFY. Note that subsequent re-SUBSCRIBE's are *retransmissions* (same branch, same CSeq...).
The problem is that the client doesn't receive the second NOTIFY sent by the kamailio (with "CSeq: 2 NOTIFY") so it doesn't reply the 200 for the NOTIFY and Kamailio ends the subscription dialog. However I don't see retransmissions of the NOFIFY from Kamailio, very strange...
So I think you have some kind of network problem since the client doesn't receive subsequent requests (NOTIFY) or responses (202 to re-SUBSCRIBE's). Are you in a local wired LAN? Well, I see that the client and server are in different subnets so I suspect there is a IP routing problem, or perhaps you have a NAT router between both networks, I don't know.
-- 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
El Jueves, 18 de Febrero de 2010, Asterisk User escribió:
Sorry for the trouble, but for the sake of simplicity I just removed those subsequent NOTIFY packets from my previous mail. Kamailio does keep on sending NOTIFY to the client but doesn't get OK.
ok, so no problem in kamailio's side.
You are right, phone is behind NAT. I just want to know if phone sends OK to NOTIFY for the first time (SUBSCRIBE) then why not on subsequent SUBSCRIBEs?
Not sure why could be the reason. Sometime it occurs that some routers close the UDP "connection" mapping after 40-50 seconds, not enough time to receive a SIP keepalive from the server (kamailio can send a SIP request as OPTIONS to ensure the NAT mapping keeps open in the router). This is not the cause since the client sends a re-SUSBCRIBE and it that moment the router should re-create the UDP mapping (if it was terminated before by router timeout). So sincerelly no idea, but the problem is there, sure :(