Issue: Command line param to call trough Jingle (XMPP, voice or video call with jabber protocol)


#1

What I have to do to use Call Manager from /jitsi/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java in net.java.sip.communicator.impl.protocol.jabber?
I want to add some params to answer a call from command line as it was mentioned here https://desktop.jitsi.org/GSOC2009/GeekCommunicator.
I’ve managed to create a call from command line, but can not answer or hangup a call.


#2

These functionality does not exist at the moment.
The page you refer to is a Google Summer of Code project, and at the moment I cannot remember what was its status and how much of its code got into jitsi.


#3

I searched the code for param names - so I found nothing. But I want to implement answering the call. My problem now I can not use CallManager from net.java.sip.communicator.impl.protocol.jabber.
Can you help with this problem?

What I already tried: added to jabber protocol manifest net.java.sip.communicator.impl.gui, added Import to file tried to call CallManager.answerCall() at UriHandlerJabberImpl.java method handleUri. During start I receive an error: Unable to resolve net.java.sip.communicator.protocol.jabber [142](R 142.0): missing requirement [net.java.sip.communicator.protocol.jabber [142](R 142.0)] osgi.wiring.package; (osgi.wiring.package=net.java.sip.communicator.impl.gui) Unresolved requirements: [[net.java.sip.communicator.protocol.jabber [142](R 142.0)] osgi.wiring.package; (osgi.wiring.package=net.java.sip.communicator.impl.gui)]


#4

Yes, this is correct, you cannot use CallManager inside impl.protocol.jabber.

The project is using OSGi, so you can use in bundle only classes from packages that are imported: https://github.com/jitsi/jitsi/blob/32308fc05f7b103f583b3603b55869affab48817/src/net/java/sip/communicator/impl/protocol/jabber/jabber.provider.manifest.mf#L7

To add a package to the import section, that package needs to be exported from another bundle.

The CallManager is in a bundle which implements UI service and doesn’t export anything. To quickly hack it you can export that package and import it in jabber protocol, but that solution is not an option for PR and inclusion in the source code.


#5

The solution you provided should satisfy me as a don’t know any other )

But you say the solution is hacky. What do you propose to make it right way?

Here https://desktop.jitsi.org/GSOC2009/GeekCommunicator Linus Wallgren and Emil Ivov stated the cli interface commands. But I didn’t find any realizations or ideas how they planned to implement this.


#6

Well the right way is to move those CallManager functions in some utility in the service.protocol package, or the whole class and make sure appropriate events a fired so the gui specific stuff is still executed and do not change the current execution flow.
Basically, reorganize the code so this methods can be used from different bundles is right approach.


#7

I tried to Export CallManager package and import into impl.protocol.jabber. Comiled well but during execution I faced another problem - CallManager tied to AWT event thread, the call to CallManager.answerCall from impl.protocol.jabber fired the guard in openCallContainerIfNecessary() and throws
RuntimeException(
“The methon can be called only on the AWT event dispatching”
+ " thread.");

I can comment this guard out but it possibly break something in GUI.
So should I somehow put CallManager in AWT event dispatching thread?


#8

Yep, stuff like that needs to be decided when doing the re-organizing the code and exposing some events. Another solution maybe is exposing the CallManager functions through the UIService (service.gui) and leave the implementation inside the impl.gui code.
I have no good solution about this problem, I need to start playing with the code and basically start implementing it to have a good answer for you.


#9

For me playing with the code is not easy because I have started to work with the code base not long ago.
I will try your proposal:

exposing the CallManager functions through the UIService (service.gui) and leave the implementation inside the impl.gui code.