diff options
author | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2012-09-25 08:02:51 +0000 |
---|---|---|
committer | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2012-09-25 08:02:51 +0000 |
commit | 5f8c5a906307d082198f8253626288a03df66818 (patch) | |
tree | 2f458945cb43b15e80ef028010d38fbfae2d4111 /src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java | |
parent | c4bab78e1e28d672ff954573ac5704369827a5b7 (diff) | |
download | jitsi-5f8c5a906307d082198f8253626288a03df66818.zip jitsi-5f8c5a906307d082198f8253626288a03df66818.tar.gz jitsi-5f8c5a906307d082198f8253626288a03df66818.tar.bz2 |
Refactors the cross-protocol conference support.
Diffstat (limited to 'src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java')
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java | 102 |
1 files changed, 20 insertions, 82 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java index 19cec3e..f5298d6 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java @@ -131,22 +131,24 @@ public class OperationSetBasicTelephonyJabberImpl * * @param callee the address of the callee who we should invite to a new * <tt>Call</tt> - * @param group <tt>CallGroup</tt> from which the <tt>Call</tt> will belong + * @param conference the <tt>CallConference</tt> in which the newly-created + * <tt>Call</tt> is to participate * @return a newly created <tt>Call</tt>. The specified <tt>callee</tt> is * available in the <tt>Call</tt> as a <tt>CallPeer</tt> * @throws OperationFailedException with the corresponding code if we fail * to create the call * @see OperationSetBasicTelephony#createCall(String) */ - public Call createCall(String callee, CallGroup group) + public Call createCall(String callee, CallConference conference) throws OperationFailedException { CallJabberImpl call = new CallJabberImpl(this); - CallPeer callPeer = null; - call.setCallGroup(group); + if (conference != null) + call.setConference(conference); + + CallPeer callPeer = createOutgoingCall(call, callee); - callPeer = createOutgoingCall(call, callee); if (callPeer == null) { throw new OperationFailedException( @@ -154,69 +156,18 @@ public class OperationSetBasicTelephonyJabberImpl + " because no peer was created", OperationFailedException.INTERNAL_ERROR); } - if(callPeer.getCall() != call) - { - // We may have a Google Talk call here - callPeer.getCall().setCallGroup(group); - return callPeer.getCall(); - } - return call; - } + Call callOfCallPeer = callPeer.getCall(); - /** - * Creates a new <tt>Call</tt> and invites a specific <tt>CallPeer</tt> - * to it given by her <tt>Contact</tt>. - * - * @param callee the address of the callee who we should invite to a new - * call - * @param group <tt>CallGroup</tt> from which the <tt>Call</tt> will belong - * @return a newly created <tt>Call</tt>. The specified <tt>callee</tt> is - * available in the <tt>Call</tt> as a <tt>CallPeer</tt> - * @throws OperationFailedException with the corresponding code if we fail - * to create the call - * @see OperationSetBasicTelephony#createCall(Contact) - */ - public Call createCall(Contact callee, CallGroup group) - throws OperationFailedException - { - return createCall(callee.getAddress(), group); - } - - /** - * Creates a new <tt>Call</tt> and invites a specific <tt>CallPeer</tt> to - * it given by her <tt>String</tt> URI. - * - * @param callee the address of the callee who we should invite to a new - * <tt>Call</tt> - * @return a newly created <tt>Call</tt>. The specified <tt>callee</tt> is - * available in the <tt>Call</tt> as a <tt>CallPeer</tt> - * @throws OperationFailedException with the corresponding code if we fail - * to create the call - * @see OperationSetBasicTelephony#createCall(String) - */ - public Call createCall(String callee) - throws OperationFailedException - { - return createCall(callee, null); - } - - /** - * Creates a new <tt>Call</tt> and invites a specific <tt>CallPeer</tt> - * to it given by her <tt>Contact</tt>. - * - * @param callee the address of the callee who we should invite to a new - * call - * @return a newly created <tt>Call</tt>. The specified <tt>callee</tt> is - * available in the <tt>Call</tt> as a <tt>CallPeer</tt> - * @throws OperationFailedException with the corresponding code if we fail - * to create the call - * @see OperationSetBasicTelephony#createCall(Contact) - */ - public Call createCall(Contact callee) - throws OperationFailedException - { - return createCall(callee.getAddress(), null); + if (callOfCallPeer == call) + return call; + else + { + // We may have a Google Talk call here. + if (conference != null) + callOfCallPeer.setConference(conference); + return callOfCallPeer; + } } /** @@ -484,7 +435,7 @@ public class OperationSetBasicTelephonyJabberImpl MediaUseCase useCase = call.getMediaUseCase(); boolean isVideo = call.isLocalVideoAllowed(useCase); - callGTalk.setCallGroup(call.getCallGroup()); + callGTalk.setConference(call.getConference()); callGTalk.setLocalVideoAllowed(isVideo, useCase); peer = callGTalk.initiateGTalkSession( @@ -633,19 +584,6 @@ public class OperationSetBasicTelephonyJabberImpl } /** - * Sets the mute state of the <tt>CallJabberImpl</tt>. - * - * @param call the <tt>CallJabberImpl</tt> whose mute state is set - * @param mute <tt>true</tt> to mute the call streams being sent to - * <tt>peers</tt>; otherwise, <tt>false</tt> - */ - @Override - public void setMute(Call call, boolean mute) - { - ((MediaAwareCall<?, ?, ?>) call).setMute(mute); - } - - /** * Ends the call with the specified <tt>peer</tt>. * * @param peer the peer that we'd like to hang up on. @@ -1366,8 +1304,8 @@ public class OperationSetBasicTelephonyJabberImpl public void transfer(CallPeer peer, CallPeer target) throws OperationFailedException { - AbstractCallPeerJabberGTalkImpl targetJabberGTalkImpl - = (AbstractCallPeerJabberGTalkImpl) target; + AbstractCallPeerJabberGTalkImpl<?,?,?> targetJabberGTalkImpl + = (AbstractCallPeerJabberGTalkImpl<?,?,?>) target; String to = getFullCalleeURI(targetJabberGTalkImpl.getAddress()); /* |