rls_handle_subscribe() return code when list is not found

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

rls_handle_subscribe() return code when list is not found

Juha Heinanen
from rls tutorial document:

http://www.opensips.org/Resources/Rls

i get impression that rls_handle_subscribe() should return
to_presence_code, if resource list document is not found in xcap server.

however, when i read the code, it has:

                if(doc== NULL|| service_node==NULL)
                {
                        LM_DBG("list not found - search for uri = %.*s\n",subs.pres_uri.len,
                                subs.pres_uri.s);
                        reply_code = 404;
                        reply_str = pu_404_rpl;
                        goto error;
                }

is this a bug?  if not, i don't see how a normal handle_subscribe()
can be tried if rls document doesn't exit.

-- juha

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: rls_handle_subscribe() return code when list is not found

Iñaki Baz Castillo
2009/8/28 Juha Heinanen <[hidden email]>:

> from rls tutorial document:
>
> http://www.opensips.org/Resources/Rls
>
> i get impression that rls_handle_subscribe() should return
> to_presence_code, if resource list document is not found in xcap server.
>
> however, when i read the code, it has:
>
>                if(doc== NULL|| service_node==NULL)
>                {
>                        LM_DBG("list not found - search for uri = %.*s\n",subs.pres_uri.len,
>                                subs.pres_uri.s);
>                        reply_code = 404;
>                        reply_str = pu_404_rpl;
>                        goto error;
>                }
>
> is this a bug?  if not, i don't see how a normal handle_subscribe()
> can be tried if rls document doesn't exit.

I haven't inspected the code, but  rls_handle_subscribe() does what
it's supposed to do (return the preconfigured to $rc when no RL doc is
found).


--
Iñaki Baz Castillo
<[hidden email]>

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: rls_handle_subscribe() return code when list is not found

Juha Heinanen
Iñaki Baz Castillo writes:

 > I haven't inspected the code, but  rls_handle_subscribe() does what
 > it's supposed to do (return the preconfigured to $rc when no RL doc is
 > found).

inaki,

are you sure that it returns pre-configured $rc even when Supported:
header includes 'eventlist', but there is no presence list document in
xcap server?  

if there is no 'eventlist' in Supported header, then pre-configured $rc
is returned as it should.  my understand from reading the code and from
doing some tests is that in the above mentioned combination things, -1
is incorrectly returned.

-- juha

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: rls_handle_subscribe() return code when list is not found

Iñaki Baz Castillo
2009/8/28 Juha Heinanen <[hidden email]>:

> Iñaki Baz Castillo writes:
>
>  > I haven't inspected the code, but  rls_handle_subscribe() does what
>  > it's supposed to do (return the preconfigured to $rc when no RL doc is
>  > found).
>
> inaki,
>
> are you sure that it returns pre-configured $rc even when Supported:
> header includes 'eventlist', but there is no presence list document in
> xcap server?

ok, I didn't try it.





--
Iñaki Baz Castillo
<[hidden email]>

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: rls_handle_subscribe() return code when list is not found

Anca Vamanu-2
In reply to this post by Juha Heinanen
Hi Juha,

You are right, a Subscribe that contains Supported:eventlist header but
for which a list definition is not found, is replied with 404 and not
sent to the presence server. It has been the way described in the
documentation but changed in a commit on 12 November last year:
http://opensips.svn.sourceforge.net/viewvc/opensips?view=rev&revision=4944.

I have now looked through the RFC and to be honest, I think that I
shouldn't have done the change and still let the Subscribe go to the
presence server. I don't remember which was the reason to change it at
that moment, but I remember it came after a discussion with Dan Pascu
when he gave me a strong argument to do so.  I am willing to change it
back, but will first wait for Dan's input on this.

Thanks and regards,
Anca

Juha Heinanen wrote:

> Iñaki Baz Castillo writes:
>
>  > I haven't inspected the code, but  rls_handle_subscribe() does what
>  > it's supposed to do (return the preconfigured to $rc when no RL doc is
>  > found).
>
> inaki,
>
> are you sure that it returns pre-configured $rc even when Supported:
> header includes 'eventlist', but there is no presence list document in
> xcap server?  
>
> if there is no 'eventlist' in Supported header, then pre-configured $rc
> is returned as it should.  my understand from reading the code and from
> doing some tests is that in the above mentioned combination things, -1
> is incorrectly returned.
>
> -- juha
>
> _______________________________________________
> Devel mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>
>  


_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: rls_handle_subscribe() return code when list is not found

Juha Heinanen
Anca Vamanu writes:

 > I have now looked through the RFC and to be honest, I think that I
 > shouldn't have done the change and still let the Subscribe go to the
 > presence server. I don't remember which was the reason to change it at
 > that moment, but I remember it came after a discussion with Dan Pascu
 > when he gave me a strong argument to do so.  I am willing to change it
 > back, but will first wait for Dan's input on this.

anca,

i noticed this problem with real commercial sip ua that sends subscribe
with eventlist in supported header even when subscribe is not for a
list.

in fact, i don't see any chance how ua would know beforehand if target
of subscription is a list or not.  in supported header it just tells
that it can handle eventlist.

-- juha

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: rls_handle_subscribe() return code when list is not found

Iñaki Baz Castillo
2009/8/28 Juha Heinanen <[hidden email]>:

> supported header it just tells that it can handle eventlist.

I agree. "Supported" doesn't mean "this request uses it".


--
Iñaki Baz Castillo
<[hidden email]>

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: rls_handle_subscribe() return code when list is not found

Anca Vamanu-2
Iñaki Baz Castillo wrote:

> 2009/8/28 Juha Heinanen <[hidden email]>:
>
>  
>> supported header it just tells that it can handle eventlist.
>>    
>
> I agree. "Supported" doesn't mean "this request uses it".
>
>
>  
Yes, Support: eventlist means only that the ua can process RLS Notifies.
I will change it now both in trunk and 1.5 branch.

regards,
Anca

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: rls_handle_subscribe() return code when list is not found

Dan Pascu
In reply to this post by Anca Vamanu-2

On 28 Aug 2009, at 13:32, Anca Vamanu wrote:

> Hi Juha,
>
> You are right, a Subscribe that contains Supported:eventlist header  
> but
> for which a list definition is not found, is replied with 404 and not
> sent to the presence server. It has been the way described in the
> documentation but changed in a commit on 12 November last year:
> http://opensips.svn.sourceforge.net/viewvc/opensips?view=rev&revision=4944 
> .
>
> I have now looked through the RFC and to be honest, I think that I
> shouldn't have done the change and still let the Subscribe go to the
> presence server. I don't remember which was the reason to change it at
> that moment, but I remember it came after a discussion with Dan Pascu
> when he gave me a strong argument to do so.  I am willing to change it
> back, but will first wait for Dan's input on this.

The discussion we had back then was not related to this issue, but to  
the fact that in certain cases no reply was sent at all by rls/
presence. So when the control was returned to the script, I could not  
know if a reply was sent or not, even though the return code would  
indicate me that the condition was final and I need to stop  
processing. My argument was that in such a case a reply should have  
always be sent.

However what Juha says here is correct. If the Supported: eventlist is  
present but the uri doesn't point to a rls uri (there is no rls  
document associated with it), it should fallback to presence. This  
case is not a final condition for rls (since the uri is not actually  
rls related), so it should not give a reply, but allow you to fallback  
to presence.

I recall I asked you about this a few weeks ago and you confirmed that  
if the Supported: eventlist header is present but the uri doesn't  
point to a rls uri it still fallbacks to presence. Apparently this is  
not the case it seems.

> Thanks and regards,
> Anca
>
> Juha Heinanen wrote:
>> Iñaki Baz Castillo writes:
>>
>>> I haven't inspected the code, but  rls_handle_subscribe() does what
>>> it's supposed to do (return the preconfigured to $rc when no RL  
>>> doc is
>>> found).
>>
>> inaki,
>>
>> are you sure that it returns pre-configured $rc even when Supported:
>> header includes 'eventlist', but there is no presence list document  
>> in
>> xcap server?
>>
>> if there is no 'eventlist' in Supported header, then pre-configured  
>> $rc
>> is returned as it should.  my understand from reading the code and  
>> from
>> doing some tests is that in the above mentioned combination things,  
>> -1
>> is incorrectly returned.
>>
>> -- juha
>>
>> _______________________________________________
>> Devel mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>>
>>
>
>
> _______________________________________________
> Devel mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


--
Dan




_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel