<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.2.3">
</HEAD>
<BODY>
Hi,<BR>
<BR>
There are lots of CSeq race conditions when subs_db_mode is DB only.&nbsp; I am working on adding separate notifier processes to presence which, amongst other things, will fix this.<BR>
<BR>
I had intended to get this into master last week, but other stuff came up and the development has been a bit more complicated than I'd hoped.&nbsp; I expect to commit these changes (which should fix your problem) sometime over the next week.<BR>
<BR>
Peter<BR>
<BR>
On Wed, 2012-05-02 at 09:20 +0300, Juha Heinanen wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
while doing some presence tests with master i noticed that when presence
server sends notify that terminates subscription due to change in xcap
authorization rules, cseq in the notify is same as in previous one.

rfc3261 says in 12.2.1 UAC Behavior:

   Requests within a dialog MUST contain strictly monotonically
   increasing and contiguous CSeq sequence numbers (increasing-by-one)
   in each direction (excepting ACK and CANCEL of course, whose numbers
   equal the requests being acknowledged or cancelled).

so this looks like a bug to twinkle (and me).  below is sip debug from
twinkle (subscriber).

-- juha

+++ 2-5-2012 08:50:41.158705 INFO SIP ::process_sip_msg
Received from: tcp:192.98.103.10:5060
NOTIFY <A HREF="sip:jh@192.98.103.10:5074">sip:jh@192.98.103.10:5074</A>;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 192.98.103.10;branch=z9hG4bK4da2.6447f6ae08e84f0c0fbec6f7090757cc.0;i=c1
Via: SIP/2.0/TCP 127.0.0.1:5082;branch=z9hG4bK4da2.4e788af3000000000000000000000000.0
To: <A HREF="sip:jh@test.fi">sip:jh@test.fi</A>;tag=pqazy
From: <A HREF="sip:test@test.fi">sip:test@test.fi</A>;tag=4a664ec84c547b2d0bc0fe8965f834e4-8a4b
CSeq: 2 NOTIFY
Call-ID: <A HREF="mailto:byxobtomskpzmos@siika.tutpro.com">byxobtomskpzmos@siika.tutpro.com</A>
Content-Length: 210
User-Agent: OpenXg Presence/XCAP Server  (3.3.0-dev8 (x86_64/linux))
Max-Forwards: 69
Event: presence
Contact: &lt;<A HREF="sip:127.0.0.1:5082">sip:127.0.0.1:5082</A>;alias=127.0.0.1~35306~2;transport=tcp&gt;
Subscription-State: active;expires=3670
Content-Type: application/pidf+xml

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;presence xmlns=&quot;urn:ietf:params:xml:ns:pidf&quot; entity=&quot;<A HREF="sip:test@test.fi">sip:test@test.fi</A>&quot;&gt;
  &lt;tuple id=&quot;gxsdoz&quot;&gt;
    &lt;status&gt;
      &lt;basic&gt;open&lt;/basic&gt;
    &lt;/status&gt;
  &lt;/tuple&gt;
&lt;/presence&gt;

---

+++ 2-5-2012 08:50:41.161169 INFO SIP ::send_sip_tcp
Send to: tcp:192.98.103.10:5060
SIP/2.0 200 OK
Via: SIP/2.0/TCP 192.98.103.10;branch=z9hG4bK4da2.6447f6ae08e84f0c0fbec6f7090757cc.0;i=c1,SIP/2.0/TCP 127.0.0.1:5082;branch=z9hG4bK4da2.4e788af3000000000000000000000000.0
To: &lt;<A HREF="sip:jh@test.fi">sip:jh@test.fi</A>&gt;;tag=pqazy
From: &lt;<A HREF="sip:test@test.fi">sip:test@test.fi</A>&gt;;tag=4a664ec84c547b2d0bc0fe8965f834e4-8a4b
Call-ID: <A HREF="mailto:byxobtomskpzmos@siika.tutpro.com">byxobtomskpzmos@siika.tutpro.com</A>
CSeq: 2 NOTIFY
Server: Twinkle/1.4.2
Content-Length: 0


---

+++ 2-5-2012 08:51:00.381465 INFO SIP ::process_sip_msg
Received from: tcp:192.98.103.10:5060
NOTIFY <A HREF="sip:jh@192.98.103.10:5074">sip:jh@192.98.103.10:5074</A>;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 192.98.103.10;branch=z9hG4bK4da2.fd70b43b9da3c3b488208a61595b1112.0;i=c1
Via: SIP/2.0/TCP 127.0.0.1:5082;branch=z9hG4bK4da2.444a74e2000000000000000000000000.0
To: <A HREF="sip:jh@test.fi">sip:jh@test.fi</A>;tag=pqazy
From: <A HREF="sip:test@test.fi">sip:test@test.fi</A>;tag=4a664ec84c547b2d0bc0fe8965f834e4-8a4b
CSeq: 2 NOTIFY
Call-ID: <A HREF="mailto:byxobtomskpzmos@siika.tutpro.com">byxobtomskpzmos@siika.tutpro.com</A>
Content-Length: 0
User-Agent: OpenXg Presence/XCAP Server  (3.3.0-dev8 (x86_64/linux))
Max-Forwards: 69
Event: presence
Contact: &lt;<A HREF="sip:127.0.0.1:5082">sip:127.0.0.1:5082</A>;alias=127.0.0.1~35306~2;transport=tcp&gt;
Subscription-State: terminated;reason=terminated

---

+++ 2-5-2012 08:51:00.381794 WARNING NORMAL t_subscription_dialog::recvd_request
CSeq seqnr is out of sequence.
Reveived seqnr: 2
Remote seqnr: 2

_______________________________________________
sr-dev mailing list
<A HREF="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</A>
<A HREF="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</A>
</PRE>
</BLOCKQUOTE>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>