diff options
author | Ingo Bauersachs <ingo@jitsi.org> | 2014-11-24 15:48:30 +0100 |
---|---|---|
committer | Ingo Bauersachs <ingo@jitsi.org> | 2014-11-24 15:50:29 +0100 |
commit | 9ba5e88ade54dd3170655f96210aa5285caecbba (patch) | |
tree | cfedb9a7159ee54b5721caac0b469a28e7a13519 | |
parent | f303edb58ce3127f09e7bbc708bbf22ad45edaf7 (diff) | |
download | jitsi-9ba5e88ade54dd3170655f96210aa5285caecbba.zip jitsi-9ba5e88ade54dd3170655f96210aa5285caecbba.tar.gz jitsi-9ba5e88ade54dd3170655f96210aa5285caecbba.tar.bz2 |
Make SIP handle tel: URIs as well
4 files changed, 34 insertions, 16 deletions
diff --git a/src/net/java/sip/communicator/impl/argdelegation/ArgDelegationPeerImpl.java b/src/net/java/sip/communicator/impl/argdelegation/ArgDelegationPeerImpl.java index 568eb65..890a978 100644 --- a/src/net/java/sip/communicator/impl/argdelegation/ArgDelegationPeerImpl.java +++ b/src/net/java/sip/communicator/impl/argdelegation/ArgDelegationPeerImpl.java @@ -63,7 +63,10 @@ public class ArgDelegationPeerImpl UriHandler uriHandler = bundleContext.getService(uriHandlerRef); - uriHandlers.put(uriHandler.getProtocol(), uriHandler); + for (String protocol : uriHandler.getProtocol()) + { + uriHandlers.put(protocol, uriHandler); + } } } } @@ -104,14 +107,19 @@ public class ArgDelegationPeerImpl { case ServiceEvent.MODIFIED: case ServiceEvent.REGISTERED: - uriHandlers.put(uriHandler.getProtocol(), uriHandler); + for (String protocol : uriHandler.getProtocol()) + { + uriHandlers.put(protocol, uriHandler); + } break; case ServiceEvent.UNREGISTERING: - String protocol = uriHandler.getProtocol(); + for (String protocol : uriHandler.getProtocol()) + { + if(uriHandlers.get(protocol) == uriHandler) + uriHandlers.remove(protocol); + } - if(uriHandlers.get(protocol) == uriHandler) - uriHandlers.remove(protocol); break; } } diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/UriHandlerJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/UriHandlerJabberImpl.java index cd975ba..e248b5c 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/UriHandlerJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/UriHandlerJabberImpl.java @@ -221,8 +221,11 @@ public class UriHandlerJabberImpl Hashtable<String, String> registrationProperties = new Hashtable<String, String>(); - registrationProperties.put(UriHandler.PROTOCOL_PROPERTY, - getProtocol()); + for (String protocol : getProtocol()) + { + registrationProperties.put(UriHandler.PROTOCOL_PROPERTY, + protocol); + } ourServiceRegistration = JabberActivator.bundleContext.registerService(UriHandler.class @@ -253,9 +256,11 @@ public class UriHandlerJabberImpl * @return the "xmpp" string to indicate that this handler is * responsible for handling "xmpp" uris. */ - public String getProtocol() + @Override + public String[] getProtocol() { - return "xmpp"; + return new String[] + { "xmpp" }; } /** diff --git a/src/net/java/sip/communicator/impl/protocol/sip/UriHandlerSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/UriHandlerSipImpl.java index 89feea7..7cc85b2 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/UriHandlerSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/UriHandlerSipImpl.java @@ -230,8 +230,11 @@ public class UriHandlerSipImpl Hashtable<String, String> registrationProperties = new Hashtable<String, String>(); - registrationProperties.put(UriHandler.PROTOCOL_PROPERTY, - getProtocol()); + for (String protocol : getProtocol()) + { + registrationProperties.put(UriHandler.PROTOCOL_PROPERTY, + protocol); + } ourServiceRegistration = SipActivator.bundleContext.registerService(UriHandler.class @@ -262,9 +265,11 @@ public class UriHandlerSipImpl * @return the "sip" string to indicate that this handler is responsible for * handling "sip" uris. */ - public String getProtocol() + @Override + public String[] getProtocol() { - return "sip"; + return new String[] + { "sip", "tel" }; } /** diff --git a/src/net/java/sip/communicator/service/argdelegation/UriHandler.java b/src/net/java/sip/communicator/service/argdelegation/UriHandler.java index a0dbd39..91fcd79 100644 --- a/src/net/java/sip/communicator/service/argdelegation/UriHandler.java +++ b/src/net/java/sip/communicator/service/argdelegation/UriHandler.java @@ -22,11 +22,11 @@ public interface UriHandler public static final String PROTOCOL_PROPERTY = "ProtocolName"; /** - * Returns the protocol that this handler is responsible for. + * Returns the protocols that this handler is responsible for. * - * @return protocol that this handler is responsible for + * @return protocols that this handler is responsible for */ - public String getProtocol(); + public String[] getProtocol(); /** * Handles/opens the URI. |