aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2013-12-04 09:32:32 +0200
committerDamian Minkov <damencho@jitsi.org>2013-12-04 09:34:32 +0200
commitff1d0e1107490213fe55a265f726b87a3806b44a (patch)
tree17f45c5d14e6186573a7dc7578e7f581338934d2 /src/net/java/sip
parentbc46b056b098825aa3c311a173ba99b49ad5c9b7 (diff)
downloadjitsi-ff1d0e1107490213fe55a265f726b87a3806b44a.zip
jitsi-ff1d0e1107490213fe55a265f726b87a3806b44a.tar.gz
jitsi-ff1d0e1107490213fe55a265f726b87a3806b44a.tar.bz2
Fixes discovering cusax linked providers from source contacts when preferred providers are not set.
Diffstat (limited to 'src/net/java/sip')
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/CallManager.java32
1 files changed, 25 insertions, 7 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java
index 514a67c..9a95226 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java
@@ -1419,7 +1419,7 @@ public class CallManager
{
// if it is source contact (history record)
// search for cusax contact match
- Contact contact = getPeerCusaxContact(peer.getAddress(),
+ Contact contact = getPeerCusaxContact(peer,
(SourceContact)uiContact.getDescriptor());
if(contact != null)
displayName = contact.getDisplayName();
@@ -1524,7 +1524,7 @@ public class CallManager
{
// if it is source contact (history record)
// search for cusax contact match
- Contact contact = getPeerCusaxContact(peer.getAddress(),
+ Contact contact = getPeerCusaxContact(peer,
(SourceContact)uiContact.getDescriptor());
if(contact != null)
@@ -1615,7 +1615,7 @@ public class CallManager
{
// if it is source contact (history record)
// search for cusax contact match
- Contact contact = getPeerCusaxContact(peer.getAddress(),
+ Contact contact = getPeerCusaxContact(peer,
(SourceContact)uiContact.getDescriptor());
if(contact != null
&& contact.getProtocolProvider().getOperationSet(
@@ -1665,12 +1665,12 @@ public class CallManager
* Find is there a linked cusax protocol provider for this source contact,
* if it exist we try to resolve current peer to one of its contacts
* or details of a contact (numbers).
- * @param peerAddress the address of the peer to check
+ * @param peer the peer to check
* @param sourceContact the currently selected source contact.
* @return matching cusax contact.
*/
private static Contact getPeerCusaxContact(
- String peerAddress, SourceContact sourceContact)
+ CallPeer peer, SourceContact sourceContact)
{
ProtocolProviderService linkedCusaxProvider = null;
for(ContactDetail detail : sourceContact.getContactDetails())
@@ -1693,6 +1693,22 @@ public class CallManager
}
}
+ // if we do not have preferred protocol, lets check the one
+ // used to dial the peer
+ if(linkedCusaxProvider == null)
+ {
+ ProtocolProviderService pps = peer.getProtocolProvider();
+
+ OperationSetCusaxUtils cusaxOpSet =
+ pps.getOperationSet(OperationSetCusaxUtils.class);
+
+ if(cusaxOpSet != null)
+ {
+ linkedCusaxProvider
+ = cusaxOpSet.getLinkedCusaxProvider();
+ }
+ }
+
if(linkedCusaxProvider != null)
{
OperationSetPersistentPresence opSetPersistentPresence
@@ -1701,6 +1717,8 @@ public class CallManager
if(opSetPersistentPresence != null)
{
+ String peerAddress = peer.getAddress();
+
// will strip the @server-address part, as the regular expression
// will match it
int index = peerAddress.indexOf("@");
@@ -1854,7 +1872,7 @@ public class CallManager
else if(uiContact.getDescriptor() instanceof SourceContact)
{
// if it is a source contact check for matching cusax contact
- Contact contact = getPeerCusaxContact(peer.getAddress(),
+ Contact contact = getPeerCusaxContact(peer,
(SourceContact)uiContact.getDescriptor());
if(contact != null)
return GuiActivator.getContactListService()
@@ -4173,4 +4191,4 @@ public class CallManager
return displayName;
}
-}
+} \ No newline at end of file