aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorДамян Минков <damencho@jitsi.org>2016-06-11 06:04:05 -0500
committerIngo Bauersachs <ingo@jitsi.org>2016-06-11 13:04:05 +0200
commit005efc59c547adc56d0f8a6f192dc3b796407807 (patch)
tree10b035c7c541faf47305e7b26b76b8099b785211 /src
parent45554a7a2ec4f20eb6905d6aba98ffb861bb0cef (diff)
downloadjitsi-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.java27
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)
{