[sip-comm-dev] SIP subscribtions


#1

Hi Ben,

I was looking at the OperationSetPresenceSipImpl.
When we want to subscribe a new contact its always added to the contact list.
So I made some changes so the contact is added to the contact list
only if we receive ok from server
otherwise if some error is received a subscription failed event is fired.
I'm attaching the diff can you take a look, do you agree with my changes :slight_smile:

Thanks
damencho

OpSetPresenceSIP.diff (13.9 KB)


#2

Hi Damian,

I'm sorry but I couldn't apply your patch against the latest version in the trunk so I didn't clearly see all your changes. However it seems that you are delaying the SUBSCRIPTION_CREATED event until an answer is received. Isn't it the role of the SUBSCRIPTION_RESOLVED event to notify that a contact is reachable? So if the wanted behavior is to create the contact on the list only when it is resolved, isn't it better to change the behavior of the GUI with these events?

What do you think :slight_smile: ?

Cheers,
Ben

Damian Minkov a 锟絚rit :

路路路

Hi Ben,

I was looking at the OperationSetPresenceSipImpl.
When we want to subscribe a new contact its always added to the contact list.
So I made some changes so the contact is added to the contact list
only if we receive ok from server
otherwise if some error is received a subscription failed event is fired.
I'm attaching the diff can you take a look, do you agree with my changes :slight_smile:

Thanks
damencho
聽聽------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hi Ben, Damian,

Well actually we are supposed to fire SUBSCRIPTION_RESOLVED events only
in the case where a contact has been created through the
createUnresolvedContact() method. At this point this method is only used
by the MetaContactList when reloading stored contacts. The idea is that
using the subscribe method in such cases would be ambiguous as it would
be difficult to determine whether we are creating a new contact or
trying to restore one that existed last time we ran the application.

Calling the subscribe() method should therefore result in either a
SUBSCRIPTION_CREATED event in case the contact has been successfully
created by the server or a SUBSCRIPTION_FAILED event in case of failure.

Calling the createUnresolvedContact() method would immediately return a
Contact instance and could be followed by either a SUBSCRIPTION_RESOLVED
if the contact is still on the server, or a SUBSCRIPTION_REMOVED event
in case the contact has been removed from the server stored contact list
since the last time we ran the application. The latter could happen in
case a user has logged with the same account from a different location
or using a different application.

Hope this clarifies things a bit.

Cheers
Emil

Benoit Pradelle 薪邪锌懈褋邪:

路路路

Hi Damian,

I'm sorry but I couldn't apply your patch against the latest version in
the trunk so I didn't clearly see all your changes. However it seems
that you are delaying the SUBSCRIPTION_CREATED event until an answer is
received. Isn't it the role of the SUBSCRIPTION_RESOLVED event to notify
that a contact is reachable? So if the wanted behavior is to create the
contact on the list only when it is resolved, isn't it better to change
the behavior of the GUI with these events?

What do you think :slight_smile: ?

Cheers,
Ben

Damian Minkov a 茅crit :

Hi Ben,

I was looking at the OperationSetPresenceSipImpl.
When we want to subscribe a new contact its always added to the contact list.
So I made some changes so the contact is added to the contact list
only if we receive ok from server
otherwise if some error is received a subscription failed event is fired.
I'm attaching the diff can you take a look, do you agree with my changes :slight_smile:

Thanks
damencho
聽聽
------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Hi again,

here is another diff I hope it works.
I had a little change after Emil's mail. Here are the changes:

1. When a contact is subscribed no event.
2. When we receive a OK as a response of Subscribe there are two options :
聽聽聽聽- a contact is NOT in the contact list - add it fire subscription created event, then we are in the next option and another event is
聽聽聽聽fired for the resolve of the contact
聽聽聽聽- a contact is in the contact list, so we just fire resolved
3. no change in the createUnresolvedContact as when it creates contact fires subscription created event.
4. In case where some error is received for the subscribe, subscription failed event is fired.

Thanks
damencho

Benoit Pradelle wrote:

OperationSetPresenceSipImpl.java.diff (17 KB)

路路路

Hi Damian,

I'm sorry but I couldn't apply your patch against the latest version in the trunk so I didn't clearly see all your changes. However it seems that you are delaying the SUBSCRIPTION_CREATED event until an answer is received. Isn't it the role of the SUBSCRIPTION_RESOLVED event to notify that a contact is reachable? So if the wanted behavior is to create the contact on the list only when it is resolved, isn't it better to change the behavior of the GUI with these events?

What do you think :slight_smile: ?

Cheers,
Ben

Damian Minkov a 锟絚rit :

Hi Ben,

I was looking at the OperationSetPresenceSipImpl.
When we want to subscribe a new contact its always added to the contact list.
So I made some changes so the contact is added to the contact list
only if we receive ok from server
otherwise if some error is received a subscription failed event is fired.
I'm attaching the diff can you take a look, do you agree with my changes :slight_smile:

Thanks
damencho
聽聽------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net