[OpenSIPS-Devel] SF.net SVN: opensips:[5942] trunk/modules/presence_xml/xcap_auth.c

Iñaki Baz Castillo ibc at aliax.net
Tue Aug 11 01:37:43 CEST 2009


2009/8/7 Iñaki Baz Castillo <ibc at aliax.net>:
> After bob dissapears in alice's pres-rules, the entry in
> active_watchers is removed, but a new one is created for the new
> subscription coming from bob (after receiving the NOTIFY
> terminated;reason=deactivated).
>
> The problem is that the new entry in active_watcher has status 1 while
> it should be 3 (pending).


The following illustrates the issue:


- bob is allowed by alice. An entry with status "1" (active) is
present in active_watchers.

- Now alice removes bob from the pres-rules so OpenSIPS generates this
correct NOFITY:

U 2009/08/11 01:26:01.033525 99.221.79.216:5065 -> 99.221.79.216:5060
NOTIFY sip:bob at 85.84.170.107:6060 SIP/2.0'
Via: SIP/2.0/UDP 99.221.79.216:5065;branch=z9hG4bK44c2.36fba581.0'
To: <sip:bob at example.net>;tag=ipwps'
From: <sip:alice at example.net>;tag=5e49c2c8b7a2795ddc4f373ff7fed527-925a'
CSeq: 3 NOTIFY'
Call-ID: zdaljrilplvtphe at barakaldo'
Route: <sip:99.221.79.216;lr=on;ftag=ipwps>'
Content-Length: 0'
User-Agent: OpenSIPS (1.6.0dev0-notls (x86_64/linux))'
Max-Forwards: 70'
Event: presence'
Contact: <sip:presence at 99.221.79.216:5065>'
Subscription-State: terminated;reason=deactivated'
'


- Inmediatelly bob subscribes again:

##
U 2009/08/11 01:26:01.210697 99.221.79.216:5060 -> 99.221.79.216:5065
SUBSCRIBE sip:alice at example.net SIP/2.0'
Record-Route: <sip:99.221.79.216;lr=on;ftag=qoqsj>'
Via: SIP/2.0/UDP 99.221.79.216;branch=z9hG4bK2aa.b16f23c.0'
Via: SIP/2.0/UDP
85.84.170.107:6060;received=85.84.170.107;rport=6060;branch=z9hG4bKdittkcfb'
Max-Forwards: 70'
To: <sip:alice at example.net>'
From: "Bob" <sip:bob at example.net>;tag=qoqsj'
Call-ID: gqddceauwnfqajj at barakaldo'
CSeq: 111 SUBSCRIBE'
Contact: <sip:bob at 85.84.170.107:6060>'
Accept: application/pidf+xml'
Event: presence'
Expires: 3600'
User-Agent: Twinkle/1.3.2'
Content-Length: 0'
'


- ERROR: OpenSIPS sends a NOTIFY with "active" status:

##
U 2009/08/11 01:26:01.214601 99.221.79.216:5065 -> 99.221.79.216:5060
NOTIFY sip:bob at 85.84.170.107:6060 SIP/2.0'
Via: SIP/2.0/UDP 99.221.79.216:5065;branch=z9hG4bK72be.aaa09473.0'
To: <sip:bob at example.net>;tag=qoqsj'
From: <sip:alice at example.net>;tag=5e49c2c8b7a2795ddc4f373ff7fed527-3cda'
CSeq: 1 NOTIFY'
Call-ID: gqddceauwnfqajj at barakaldo'
Route: <sip:99.221.79.216;lr=on;ftag=qoqsj>'
Content-Length: 215'
User-Agent: OpenSIPS (1.6.0dev0-notls (x86_64/linux))'
Max-Forwards: 70'
Event: presence'
Contact: <sip:presence at 99.221.79.216:5065>'
Subscription-State: active;expires=3590'
Content-Type: application/pidf+xml'
'
<?xml version="1.0" encoding="UTF-8"?>
<presence xmlns="urn:ietf:params:xml:ns:pidf" entity="sip:alice at example.net">
  <tuple id="njfsvs">
    <status>
      <basic>open</basic>
    </status>
  </tuple>
</presence>


- At this point, the previous entry in active_watchers has been
deleted, but the new one (originated by the new SUBSCRIBE) exists with
status 1 (while it should be "pending" as bob doesn't appear in the
pres-rules document).


Note that it doesn't matter if the new subscription (After
"deactivated") is instant or not. The issue occurs in both cases (I've
also tryed with sip_subscribe_presence command line utility (AG) to
repeat the subscription long time ago (2 minutes) after receiving the
"deactivated".

-- 
Iñaki Baz Castillo
<ibc at aliax.net>



More information about the Devel mailing list