Adds a MediaAwareCallPeer.getEntity() method in order to preserve previous behaviour

cusax-fix
Boris Grozev 13 years ago
parent 97821cffa3
commit 3aff758cf6

@ -658,4 +658,12 @@ protected void sendCandidates(
protocolProvider.getConnection().sendPacket(candidatesIQ);
}
/**
* {@inheritDoc}
*/
public String getEntity()
{
return getAddress();
}
}

@ -1480,4 +1480,12 @@ public void setCoinScheduled(boolean coinScheduled)
this.coinScheduled = coinScheduled;
}
}
/**
* {@inheritDoc}
*/
public String getEntity()
{
return getAddress();
}
}

@ -167,7 +167,7 @@ public void run()
}
ConferenceInfoDocument currentConfInfo
= getCurrentConferenceInfo(callPeer);
= getCurrentConferenceInfo(callPeerJabber);
ConferenceInfoDocument lastSentConfInfo
= callPeerJabber.getLastConferenceInfoSent();
@ -419,7 +419,8 @@ private void handleCoin(CallPeerJabberImpl callPeer, CoinIQ coinIQ)
* temporary and should be removed once we choose a better way to pass the
* SID.
*/
protected ConferenceInfoDocument getCurrentConferenceInfo(CallPeer callPeer)
protected ConferenceInfoDocument getCurrentConferenceInfo(
MediaAwareCallPeer<?,?,?> callPeer)
{
ConferenceInfoDocument confInfo
= super.getCurrentConferenceInfo(callPeer);

@ -1681,4 +1681,14 @@ private void setDisconnectedState(boolean failed, String reason)
else
setState(CallPeerState.DISCONNECTED, reason);
}
/**
* {@inheritDoc}
*/
public String getEntity()
{
return AbstractOperationSetTelephonyConferencing
.stripParametersFromAddress(getURI());
}
}

@ -1003,7 +1003,7 @@ else if (documentState == ConferenceInfoDocument.State.PARTIAL)
* @return a <tt>String</tt> representing the specified <tt>address</tt>
* without any parameters
*/
protected static String stripParametersFromAddress(String address)
public static String stripParametersFromAddress(String address)
{
if (address != null)
{
@ -1024,7 +1024,8 @@ protected static String stripParametersFromAddress(String address)
* @return a <tt>ConferenceInfoDocument</tt> which describes the current
* state of the conference in which this <tt>CallPeer</tt> participates.
*/
protected ConferenceInfoDocument getCurrentConferenceInfo(CallPeer callPeer)
protected ConferenceInfoDocument getCurrentConferenceInfo(
MediaAwareCallPeer<?,?,?> callPeer)
{
ConferenceInfoDocument confInfo;
try
@ -1048,7 +1049,13 @@ protected ConferenceInfoDocument getCurrentConferenceInfo(CallPeer callPeer)
/* Remote users */
for (CallPeer conferenceCallPeer : conferenceCallPeers)
addPeerToConferenceInfo(confInfo, conferenceCallPeer, true);
{
if (conferenceCallPeer instanceof MediaAwareCallPeer<?,?,?>)
addPeerToConferenceInfo(
confInfo,
(MediaAwareCallPeer<?,?,?>)conferenceCallPeer,
true);
}
return confInfo;
}
@ -1065,12 +1072,12 @@ protected ConferenceInfoDocument getCurrentConferenceInfo(CallPeer callPeer)
*/
private void addPeerToConferenceInfo(
ConferenceInfoDocument confInfo,
CallPeer callPeer,
MediaAwareCallPeer<?,?,?> callPeer,
boolean remote)
{
String entity
= remote
? callPeer.getURI()
? callPeer.getEntity()
: getLocalEntity(callPeer);
ConferenceInfoDocument.User user = confInfo.addNewUser(entity);
@ -1088,40 +1095,35 @@ private void addPeerToConferenceInfo(
? getEndpointStatus(callPeer)
: ConferenceInfoDocument.EndpointStatusType.connected);
if (callPeer instanceof MediaAwareCallPeer<?,?,?>)
{
MediaAwareCallPeer<?,?,?> mediaAwarePeer
= (MediaAwareCallPeer<?,?,?>) callPeer;
CallPeerMediaHandler<?> mediaHandler
= mediaAwarePeer.getMediaHandler();
CallPeerMediaHandler<?> mediaHandler
= callPeer.getMediaHandler();
for (MediaType mediaType : MediaType.values())
for (MediaType mediaType : MediaType.values())
{
MediaStream stream = mediaHandler.getStream(mediaType);
if (stream != null)
{
MediaStream stream = mediaHandler.getStream(mediaType);
if (stream != null)
{
ConferenceInfoDocument.Media media
= endpoint.addNewMedia(mediaType.toString());
long srcId
= remote
? getRemoteSourceID(mediaAwarePeer, mediaType)
: stream.getLocalSourceID();
ConferenceInfoDocument.Media media
= endpoint.addNewMedia(mediaType.toString());
long srcId
= remote
? getRemoteSourceID(callPeer, mediaType)
: stream.getLocalSourceID();
if (srcId != -1)
media.setSrcId(Long.toString(srcId));
if (srcId != -1)
media.setSrcId(Long.toString(srcId));
media.setType(mediaType.toString());
media.setType(mediaType.toString());
MediaDirection direction
= remote
? getRemoteDirection(mediaAwarePeer, mediaType)
: stream.getDirection();
MediaDirection direction
= remote
? getRemoteDirection(callPeer, mediaType)
: stream.getDirection();
if (direction == null)
direction = MediaDirection.INACTIVE;
if (direction == null)
direction = MediaDirection.INACTIVE;
media.setStatus(direction.toString());
}
media.setStatus(direction.toString());
}
}
}

@ -1106,4 +1106,17 @@ public int getLastConferenceInfoReceivedVersion()
? -1
: lastConferenceInfoReceived.getVersion();
}
/**
* Gets the <tt>String</tt> to be used for this <tt>CallPeer</tt> when
* we describe it in a <tt>ConferenceInfoDocument</tt> (e.g. the
* <tt>entity</tt> key attribute which to use for the <tt>user</tt>
* element corresponding to this <tt>CallPeer</tt>)
*
* @return the <tt>String</tt> to be used for this <tt>CallPeer</tt> when
* we describe it in a <tt>ConferenceInfoDocument</tt> (e.g. the
* <tt>entity</tt> key attribute which to use for the <tt>user</tt>
* element corresponding to this <tt>CallPeer</tt>)
*/
public abstract String getEntity();
}

Loading…
Cancel
Save