Merge branch '1.0-local' into trunk-local

* 1.0-local:
  Fixes Issue #696 : Wrong VIA in INVITE when hold/unhold calls. Fixes Issue #694 : Disable DirectSound. Contributes to Issue #637 by removing use of raw types. Removes CallParticipantChangeListener from CallSessionImpl since it doesn't seem to serve any purpose.
cusax-fix
scmerger 17 years ago
parent 26c28dfbda
commit 2b421442c1

@ -73,14 +73,12 @@
*/
public class CallSessionImpl
extends PropertyChangeNotifier
implements CallSession
, CallParticipantListener
, CallChangeListener
, ReceiveStreamListener
, SendStreamListener
, SessionListener
, ControllerListener
// , SecureEventListener
implements CallSession,
CallChangeListener,
ReceiveStreamListener,
SendStreamListener,
SessionListener,
ControllerListener
{
private static final Logger logger
= Logger.getLogger(CallSessionImpl.class);
@ -1207,18 +1205,24 @@ private String processSdpStr(CallParticipant participant,
}
else
{
//create an sdp answer.
//create the SDP answer.
CallParticipantState participantState = participant.getState();
if (CallParticipantState.CONNECTED.equals(participantState)
|| CallParticipantState.isOnHold(participantState))
{
//if the call is already connected then this is a
//reinitialization (e.g. placing the call on/off hold)
sdpAnswer =
createSessionDescriptionForHold(
sdpStr,
(getSdpOfferMediaFlags(sdpStr)
& CallSession.ON_HOLD_REMOTELY) != 0);
}
else
{
sdpAnswer = createSessionDescription(sdp, null);
}
}
//extract media descriptions
@ -1237,7 +1241,6 @@ private String processSdpStr(CallParticipant participant,
//add the RTP targets
initStreamTargets(sdp.getConnection(), mediaDescriptions);
/*
* The media descriptions of the offer may list encodings which are not
* in our answer i.e. we may end up streaming in an encoding disabled by
@ -1609,7 +1612,7 @@ private SessionDescription createSessionDescription(
/*
* Only allocate ports if this is a call establishing event. The
* opposite could happen for example, when issuing a Request.INVITE
* opposite could happen for example, when issuing a reINVITE
* that would put a CallParticipant on hold.
*/
boolean allocateMediaPorts = false;
@ -2596,19 +2599,6 @@ private void disposePlayer(Player player)
VideoEvent.REMOTE);
}
/**
* Indicates that a change has occurred in the status of the source
* CallParticipant.
*
* @param evt The <tt>CallParticipantChangeEvent</tt> instance containing
* the source event as well as its previous and its new status.
*/
public void participantStateChanged(CallParticipantChangeEvent evt)
{
/** @todo implement participantStateChanged() */
/** @todo remove target for participant. */
}
/**
* Indicates that a new call participant has joined the source call.
* @param evt the <tt>CallParticipantEvent</tt> containing the source call
@ -2616,8 +2606,6 @@ public void participantStateChanged(CallParticipantChangeEvent evt)
*/
public synchronized void callParticipantAdded(CallParticipantEvent evt)
{
CallParticipant sourceParticipant = evt.getSourceCallParticipant();
sourceParticipant.addCallParticipantListener(this);
}
/**
@ -2630,45 +2618,6 @@ public void callParticipantRemoved(CallParticipantEvent evt)
}
//-------- dummy implementations of listener methods that we don't need
/**
* Ignore - we're not concerned by this event inside a call session.
*
* @param evt ignore.
*/
public void participantImageChanged(CallParticipantChangeEvent evt)
{
}
/**
* Ignore - we're not concerned by this event inside a call session.
*
* @param evt ignore.
*/
public void participantDisplayNameChanged(CallParticipantChangeEvent evt)
{
}
/**
* Ignore - we're not concerned by this event inside a call session.
*
* @param evt ignore.
*/
public void participantTransportAddressChanged(
CallParticipantChangeEvent evt)
{
/** @todo i am not sure we should be ignoring this one ... */
}
/**
* Ignore - we're not concerned by this event inside a call session.
*
* @param evt ignore.
*/
public void participantAddressChanged(CallParticipantChangeEvent evt)
{
}
//implementation of jmf listener methods
/**
* Method called back in the SessionListener to notify

@ -114,8 +114,11 @@ private void initialize()
}
}
detectDirectAudio();
detectS8DirectAudio();
// Issues #693 and #524:
// Disable DirectSound since it fails on multiple installations
//
// detectDirectAudio();
// detectS8DirectAudio();
detectCaptureDevices();
}
@ -127,15 +130,19 @@ private void detectCaptureDevices()
{
logger.info("Looking for Audio capturer");
//First check if DirectSound capture is available
try
{
new DirectSoundAuto();
}
catch (Throwable exc)
{
logger.debug("No direct sound detected: " + exc.getMessage());
}
// Issues #693 and #524:
// Disable DirectSound since it fails on multiple installations
//
// //First check if DirectSound capture is available
// try
// {
//
// new DirectSoundAuto();
// }
// catch (Throwable exc)
// {
// logger.debug("No direct sound detected: " + exc.getMessage());
// }
// check if JavaSound capture is available
try

@ -1555,10 +1555,12 @@ private void processInvite(SipProvider sourceProvider,
if (replacesHeader == null)
{
//this is not a transfered call so start ringing
statusCode = Response.RINGING;
}
else
{
//this is a transfered call
List<CallParticipantSipImpl> callParticipantsToReplace =
activeCallsRepository.findCallParticipants(
replacesHeader.getCallId(), replacesHeader.getToTag(),
@ -1582,6 +1584,7 @@ private void processInvite(SipProvider sourceProvider,
}
else
{
//this is a reINVITE - so we'll OK it without ringing
statusCode = Response.OK;
}
@ -1662,9 +1665,8 @@ private void processInvite(SipProvider sourceProvider,
logger.debug("Invite seems ok, we'll say " + statusCodeString + ".");
try
{
response =
protocolProvider.getMessageFactory().createResponse(statusCode,
invite);
response = protocolProvider.getMessageFactory()
.createResponse(statusCode, invite);
protocolProvider.attachToTag(response, dialog);
response.setHeader(protocolProvider.getSipCommUserAgentHeader());
@ -2568,6 +2570,18 @@ private Request createRequest(Dialog dialog, String method)
+ " request.", OperationFailedException.INTERNAL_ERROR, ex);
}
//override the via header as jain-sip is generating one from the
//listening point which is 0.0.0.0 or ::0
ArrayList<ViaHeader> viaHeaders
= protocolProvider.getLocalViaHeaders(dialog.getRemoteParty());
request.setHeader(viaHeaders.get(0));
// User Agent
UserAgentHeader userAgentHeader =
protocolProvider.getSipCommUserAgentHeader();
if (userAgentHeader != null)
request.addHeader(userAgentHeader);
/*
* The authorization-related headers are the responsibility of the
* application (according to the Javadoc of JAIN-SIP).

@ -78,9 +78,9 @@ public void testInstallAccount()
//Prepare the properties of the first sip account.
Hashtable sipAccount1Properties = getAccountProperties(
Hashtable<String,String> sipAccount1Properties = getAccountProperties(
SipProtocolProviderServiceLick.ACCOUNT_1_PREFIX);
Hashtable sipAccount2Properties = getAccountProperties(
Hashtable<String, String> sipAccount2Properties = getAccountProperties(
SipProtocolProviderServiceLick.ACCOUNT_2_PREFIX);
//try to install an account with a null account id
@ -166,9 +166,9 @@ public void testInstallAccount()
* @return a Hashtable that can be used when creating the account in a
* protocol provider factory.
*/
private Hashtable getAccountProperties(String accountPrefix)
private Hashtable<String, String> getAccountProperties(String accountPrefix)
{
Hashtable table = new Hashtable();
Hashtable<String, String> table = new Hashtable<String, String>();
String userID = System.getProperty(
accountPrefix + ProtocolProviderFactory.USER_ID, null);

Loading…
Cancel
Save