diff options
author | hristoterezov <hristo@jitsi.org> | 2014-05-22 16:18:11 +0300 |
---|---|---|
committer | hristoterezov <hristo@jitsi.org> | 2014-05-22 16:18:11 +0300 |
commit | 482d7b7b07dbfca58420bcdfc012ca3030eec68d (patch) | |
tree | 171ee097069c00a43fc1b7ba18370539ddb4ef75 /src | |
parent | 97f27d1391f94d7d026e3dda4f4f855693259606 (diff) | |
download | jitsi-482d7b7b07dbfca58420bcdfc012ca3030eec68d.zip jitsi-482d7b7b07dbfca58420bcdfc012ca3030eec68d.tar.gz jitsi-482d7b7b07dbfca58420bcdfc012ca3030eec68d.tar.bz2 |
Adds support for NOTIFICATION messages that are not synchronised with the SUBSCRIBE request.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/sip/OperationSetMessageWaitingSipImpl.java | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetMessageWaitingSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetMessageWaitingSipImpl.java index 70230bb..3b149d4 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetMessageWaitingSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetMessageWaitingSipImpl.java @@ -194,6 +194,19 @@ public class OperationSetMessageWaitingSipImpl { if (evt.getNewState().equals(RegistrationState.REGISTERED)) { + Address subscribeAddress = null; + try + { + subscribeAddress = getSubscribeAddress(); + } + catch (ParseException e) + { + logger.error("Failed to parse mailbox subscribe address.", e); + } + + final MessageSummarySubscriber defaultSubscriber + = new MessageSummarySubscriber(subscribeAddress); + messageWaitingSubscriber = new EventPackageSubscriber( provider, @@ -231,23 +244,26 @@ public class OperationSetMessageWaitingSipImpl if(s instanceof MessageSummarySubscriber) return (MessageSummarySubscriber)s; - return null; + // We are returning default subscriber because of early + // NOTIFICATION messages and NOTIFICATION messages that + // are not from the same dialog. That way we also handle + // some NOTIFICATIONS that are send regardless of + // subscription failure. We noticed this behavior from + // some SIP servers. + return defaultSubscriber; } }; - try + if(subscribeAddress != null) { - final Address subscribeAddress = getSubscribeAddress(); - - if(subscribeAddress != null) + try { - messageWaitingSubscriber.subscribe( - new MessageSummarySubscriber(subscribeAddress)); + messageWaitingSubscriber.subscribe(defaultSubscriber); + } + catch(Throwable e) + { + logger.error("Error subscribing for mailbox", e); } - } - catch(Throwable e) - { - logger.error("Error subscribing for mailbox", e); } } else if (evt.getNewState().equals(RegistrationState.UNREGISTERING)) |