diff options
author | Дамян Минков <damencho@jitsi.org> | 2016-06-11 06:04:05 -0500 |
---|---|---|
committer | Ingo Bauersachs <ingo@jitsi.org> | 2016-06-11 13:04:05 +0200 |
commit | 005efc59c547adc56d0f8a6f192dc3b796407807 (patch) | |
tree | 10b035c7c541faf47305e7b26b76b8099b785211 /src | |
parent | 45554a7a2ec4f20eb6905d6aba98ffb861bb0cef (diff) | |
download | jitsi-005efc59c547adc56d0f8a6f192dc3b796407807.zip jitsi-005efc59c547adc56d0f8a6f192dc3b796407807.tar.gz jitsi-005efc59c547adc56d0f8a6f192dc3b796407807.tar.bz2 |
Adds parameter to sip command line calling. (#270)
Adds a parameter to enable video on sip calling. You can call $jitsi sip:someaddr@domain.org?video=true.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/sip/UriHandlerSipImpl.java | 27 |
1 files changed, 26 insertions, 1 deletions
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 f62677e..ecec5c5 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/UriHandlerSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/UriHandlerSipImpl.java @@ -405,9 +405,34 @@ public class UriHandlerSipImpl OperationSetBasicTelephony<?> telephonyOpSet = provider.getOperationSet(OperationSetBasicTelephony.class); + OperationSetVideoTelephony videoTelephonyOpSet + = provider.getOperationSet(OperationSetVideoTelephony.class); + + boolean videoCall = false; + if(videoTelephonyOpSet != null + && uri.contains("?")) + { + String params = uri.substring(uri.indexOf('?') + 1); + uri = uri.substring(0, uri.indexOf('?')); + + StringTokenizer paramTokens = new StringTokenizer(params, "&"); + while(paramTokens.hasMoreTokens()) + { + String tok = paramTokens.nextToken(); + String[] keyValue = tok.split("\\="); + if (keyValue.length == 2 + && keyValue[0].equalsIgnoreCase("video") + && keyValue[1].equalsIgnoreCase("true")) + videoCall = true; + } + } + try { - telephonyOpSet.createCall(uri); + if(videoCall) + videoTelephonyOpSet.createVideoCall(uri); + else + telephonyOpSet.createCall(uri); } catch (OperationFailedException exc) { |