taksan / skype-java-api

Skype API for Java, based on Skype4Java library
128 stars 60 forks source link

setSendVideoEnabled error? #64

Open rayuthebest opened 8 years ago

rayuthebest commented 8 years ago

Hi,

I am trying to use the skype-java-api-1.6.jar file that I have downloaded from the link "https://github.com/taksan/skype-java-api".

The library works fine (you have done a great job) but I have found a problem that I was unable to resolve. I am trying to develop a java APP that when a user press a key, it accept a video call and start to send/receive the video of a webcam. I have implement the next procedure:

1º Add a listener to capture the incomming call ID

... Skype.setDaemon(false); Skype.addCallListener(new CallAdapter() { @Override public void callReceived(Call receivedCall) throws SkypeException { incommingCall = receivedCall;
} }); ...

2º Implement a method to listen the keyboard events (I omitted this part as it is not related with the problem) that trigger the function that answer the incoming call.

3º The incoming call is processed as follow: … try { if (incommingCall != null) { if (incommingCall.getStatus() == Call.Status.RINGING) { incommingCall.answer(); while (incommingCall.getStatus() != Call.Status.INPROGRESS) { try { Thread.sleep(1000); } catch (InterruptedException ex) { Logger.getLogger(JFrameMain.class.getName()).log(Level.SEVERE, null, ex); } } System.out.println(incommingCall.getStatus() + " " + incommingCall.getId()); incommingCall.setSendVideoEnabled(true); } …

The call is answered by skype, but when the java execute the line “incommingCall.setSendVideoEnabled(true);” it reports the next message:

jul 19, 2015 1:11:08 PM skypetv.JFrameMain answer_cancel_call SEVERE: null com.skype.CommandFailedException: CALL: Action failed at com.skype.Utils.checkError(Utils.java:77) at com.skype.Call.setSendVideoEnabled(Call.java:540) at skypetv.JFrameMain.answer(JFrameMain.java:179) at skypetv.JFrameMain.formKeyTyped(JFrameMain.java:97) …

Can someone tell me what I am doing wrong?

I am using the last version of Skype (7.6.64.105) and I believe that this method is invalid in this version. I tried to fix it, but I have not found any information related with Call.java implementation that could help me to identify and fix the problem (https://developer.skype.com/wiki/Java_API is no longer available).

Thanks