@ -27,9 +27,9 @@ public class CallSipImpl
private static final Logger logger = Logger . getLogger ( CallSipImpl . class ) ;
/ * *
* A list containing all < tt > CallP articipant < / tt > s of this call .
* A list containing all < tt > CallP eer < / tt > s of this call .
* /
private final List < CallPeerSipImpl > callP articipant s =
private final List < CallPeerSipImpl > callP eer s =
new Vector < CallPeerSipImpl > ( ) ;
/ * *
@ -51,81 +51,81 @@ protected CallSipImpl(ProtocolProviderServiceSipImpl sourceProvider)
}
/ * *
* Adds < tt > callP articipant < / tt > to the list of p articipant s in this call .
* If the call p articipant is already included in the call , the method has
* Adds < tt > callP eer < / tt > to the list of p eer s in this call .
* If the call p eer is already included in the call , the method has
* no effect .
*
* @param callP articipant the new < tt > CallParticipant < / tt >
* @param callP eer the new < tt > CallPeer < / tt >
* /
public void addCallPeer ( CallPeerSipImpl callP articipant )
public void addCallPeer ( CallPeerSipImpl callP eer )
{
if ( callP articipants. contains ( callParticipant ) )
if ( callP eers. contains ( callPeer ) )
return ;
callP articipant . addCallPeerListener ( this ) ;
callP eer . addCallPeerListener ( this ) ;
this . callP articipants. add ( callParticipant ) ;
fireCallPeerEvent ( callP articipant ,
this . callP eers. add ( callPeer ) ;
fireCallPeerEvent ( callP eer ,
CallPeerEvent . CALL_PEER_ADDED ) ;
}
/ * *
* Removes < tt > callP articipant < / tt > from the list of p articipant s in this
* call . The method has no effect if there was no such p articipant in the
* Removes < tt > callP eer < / tt > from the list of p eer s in this
* call . The method has no effect if there was no such p eer in the
* call .
*
* @param callP articipant the < tt > CallParticipant < / tt > leaving the call ;
* @param callP eer the < tt > CallPeer < / tt > leaving the call ;
* /
public void removeCallP articipant( CallPeerSipImpl callParticipant )
public void removeCallP eer( CallPeerSipImpl callPeer )
{
if ( ! callP articipants. contains ( callParticipant ) )
if ( ! callP eers. contains ( callPeer ) )
return ;
this . callP articipants. remove ( callParticipant ) ;
callP articipant . removeCallPeerListener ( this ) ;
this . callP eers. remove ( callPeer ) ;
callP eer . removeCallPeerListener ( this ) ;
try
{
fireCallPeerEvent ( callP articipant ,
fireCallPeerEvent ( callP eer ,
CallPeerEvent . CALL_PEER_REMVOVED ) ;
}
finally
{
/ *
* The p articipant should loose its state once it has finished
* The p eer should loose its state once it has finished
* firing its events in order to allow the listeners to undo .
* /
callP articipant . setCall ( null ) ;
callP eer . setCall ( null ) ;
}
if ( callP articipant s. size ( ) = = 0 )
if ( callP eer s. size ( ) = = 0 )
setCallState ( CallState . CALL_ENDED ) ;
}
/ * *
* Returns an iterator over all call p articipant s.
* Returns an iterator over all call p eer s.
*
* @return an Iterator over all p articipant s currently involved in the call .
* @return an Iterator over all p eer s currently involved in the call .
* /
public Iterator < CallPeer > getCallPeers ( )
{
return new LinkedList < CallPeer > ( callP articipant s) . iterator ( ) ;
return new LinkedList < CallPeer > ( callP eer s) . iterator ( ) ;
}
/ * *
* Returns the number of p articipant s currently associated with this call .
* Returns the number of p eer s currently associated with this call .
*
* @return an < tt > int < / tt > indicating the number of p articipant s currently
* @return an < tt > int < / tt > indicating the number of p eer s currently
* associated with this call .
* /
public int getCallPeerCount ( )
{
return callP articipant s. size ( ) ;
return callP eer s. size ( ) ;
}
/ * *
* Dummy implementation of a method ( inherited from CallP articipant Listener)
* Dummy implementation of a method ( inherited from CallP eer Listener)
* that we don ' t need .
*
* @param evt unused .
@ -135,7 +135,7 @@ public void peerImageChanged(CallPeerChangeEvent evt)
}
/ * *
* Dummy implementation of a method ( inherited from CallP articipant Listener)
* Dummy implementation of a method ( inherited from CallP eer Listener)
* that we don ' t need .
*
* @param evt unused .
@ -145,7 +145,7 @@ public void peerAddressChanged(CallPeerChangeEvent evt)
}
/ * *
* Dummy implementation of a method ( inherited from CallP articipant Listener)
* Dummy implementation of a method ( inherited from CallP eer Listener)
* that we don ' t need .
*
* @param evt unused .
@ -156,7 +156,7 @@ public void peerTransportAddressChanged(
}
/ * *
* Dummy implementation of a method ( inherited from CallP articipant Listener)
* Dummy implementation of a method ( inherited from CallP eer Listener)
* that we don ' t need .
*
* @param evt unused .
@ -166,9 +166,9 @@ public void peerDisplayNameChanged(CallPeerChangeEvent evt)
}
/ * *
* Verifies whether the call p articipant has entered a state .
* Verifies whether the call p eer has entered a state .
*
* @param evt The < tt > CallP articipant ChangeEvent< / tt > instance containing
* @param evt The < tt > CallP eer ChangeEvent< / tt > instance containing
* the source event as well as its previous and its new status .
* /
public void peerStateChanged ( CallPeerChangeEvent evt )
@ -178,7 +178,7 @@ public void peerStateChanged(CallPeerChangeEvent evt)
if ( newState = = CallPeerState . DISCONNECTED
| | newState = = CallPeerState . FAILED )
{
removeCallP articipant ( ( CallPeerSipImpl ) evt
removeCallP eer ( ( CallPeerSipImpl ) evt
. getSourceCallPeer ( ) ) ;
}
else if ( ( newState = = CallPeerState . CONNECTED
@ -190,41 +190,41 @@ else if ((newState == CallPeerState.CONNECTED
/ * *
* Returns < tt > true < / tt > if < tt > dialog < / tt > matches the jain sip dialog
* established with one of the p articipant s in this call .
* established with one of the p eer s in this call .
*
* @param dialog the dialog whose corresponding p articipant we ' re looking
* @param dialog the dialog whose corresponding p eer we ' re looking
* for .
* @return true if this call contains a call p articipant whose jain sip
* @return true if this call contains a call p eer whose jain sip
* dialog is the same as the specified and false otherwise .
* /
public boolean contains ( Dialog dialog )
{
return findCallP articipant ( dialog ) ! = null ;
return findCallP eer ( dialog ) ! = null ;
}
/ * *
* Returns the call p articipant whose associated jain sip dialog matches
* Returns the call p eer whose associated jain sip dialog matches
* < tt > dialog < / tt > .
*
* @param dialog the jain sip dialog whose corresponding p articipant we ' re
* @param dialog the jain sip dialog whose corresponding p eer we ' re
* looking for .
* @return the call p articipant whose jain sip dialog is the same as the
* specified or null if no such call p articipant was found .
* @return the call p eer whose jain sip dialog is the same as the
* specified or null if no such call p eer was found .
* /
public CallPeerSipImpl findCallP articipant ( Dialog dialog )
public CallPeerSipImpl findCallP eer ( Dialog dialog )
{
Iterator < CallPeer > callP articipant s = this . getCallPeers ( ) ;
Iterator < CallPeer > callP eer s = this . getCallPeers ( ) ;
if ( logger . isTraceEnabled ( ) )
{
logger . trace ( "Looking for p articipant with dialog: " + dialog
+ "among " + this . callP articipant s. size ( ) + " calls" ) ;
logger . trace ( "Looking for p eer with dialog: " + dialog
+ "among " + this . callP eer s. size ( ) + " calls" ) ;
}
while ( callP articipant s. hasNext ( ) )
while ( callP eer s. hasNext ( ) )
{
CallPeerSipImpl cp =
( CallPeerSipImpl ) callP articipant s. next ( ) ;
( CallPeerSipImpl ) callP eer s. next ( ) ;
if ( cp . getDialog ( ) = = dialog )
{