Changes XMPP attended transfer to behave like SIP.

cusax-fix
Vincent Lucas 13 years ago
parent 296e39ad9b
commit 9dfae46328

@ -1264,6 +1264,7 @@ protected void transfer(String to, String sid)
TransferPacketExtension transfer = new TransferPacketExtension();
// Attended transfer.
if (sid != null)
{
/*
@ -1273,6 +1274,25 @@ protected void transfer(String to, String sid)
*/
transfer.setFrom(protocolProvider.getOurJID());
transfer.setSID(sid);
// Puts on hold the 2 calls before making the attended transfer.
OperationSetBasicTelephonyJabberImpl basicTelephony
= (OperationSetBasicTelephonyJabberImpl)
protocolProvider.getOperationSet(
OperationSetBasicTelephony.class);
CallPeerJabberImpl callPeer = basicTelephony.getActiveCallPeer(sid);
if(callPeer != null)
{
if(!CallPeerState.isOnHold(callPeer.getState()))
{
callPeer.putOnHold(true);
}
}
if(!CallPeerState.isOnHold(this.getState()))
{
this.putOnHold(true);
}
}
transfer.setTo(to);

@ -560,6 +560,36 @@ public Iterator<CallGTalkImpl> getGTalkActiveCalls()
return activeGTalkCallsRepository.getActiveCalls();
}
/**
* Returns the active call peer corresponding to the given sid.
*
* @param sid the Jingle session ID of the active <tt>Call</tt> between the
* local peer and the callee in the case of attended transfer; <tt>null</tt>
* in the case of unattended transfer
*
* @return The active call peer corresponding to the given sid. "null" if
* there is no such call.
*/
public CallPeerJabberImpl getActiveCallPeer(String sid)
{
return activeCallsRepository.findCallPeer(sid);
}
/**
* Returns the active call peer corresponding to the given sid.
*
* @param sid the Jingle session ID of the active <tt>Call</tt> between the
* local peer and the callee in the case of attended transfer; <tt>null</tt>
* in the case of unattended transfer
*
* @return The active call peer corresponding to the given sid. "null" if
* there is no such call.
*/
public CallPeerGTalkImpl getGTalkActiveCallPeer(String sid)
{
return activeGTalkCallsRepository.findCallPeer(sid);
}
/**
* Resumes communication with a call peer previously put on hold.
*

Loading…
Cancel
Save