Revision: 201015 RCL_3 PDK_3.0.i
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 27 Apr 2010 17:02:55 +0300
branchRCL_3
changeset 14 5bf83dc720b3
parent 11 2a28ef775f15
child 17 a5ac35ca6d81
Revision: 201015 Kit: 201017
multimediacommscontroller/mmccinterface/src/mmcccodecdtmf.cpp
multimediacommscontroller/mmccinterface/tsrc/ut_interface/src/UT_CMccCodecDTMF.cpp
multimediacommsengine/mmcesrv/mmcemediamanager/src/mcemediasdpcodec.cpp
multimediacommsengine/mmcesrv/mmcemediamanager/tsrc/ut_mediamanager/src/UT_cmcemediasdpcodec.cpp
multimediacommsengine/mmcesrv/mmceserver/src/mcenatstatewait.cpp
multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/src/UT_CMceNatStateWait.cpp
--- a/multimediacommscontroller/mmccinterface/src/mmcccodecdtmf.cpp	Wed Apr 14 16:21:36 2010 +0300
+++ b/multimediacommscontroller/mmccinterface/src/mmcccodecdtmf.cpp	Tue Apr 27 17:02:55 2010 +0300
@@ -36,6 +36,7 @@
 const TText8 KCharComma = ',';
 const TText8 KCharHyphen = '-';
 const TText8 KCharSpace = ' ';
+const TText8 KCharSemicolon = ';';
 
 
 
@@ -384,13 +385,20 @@
     
     if ( aFmtp.Length() > 0 )
         {
+		//the firt, process semicolon and get its left data
+		TBufC8<256> value(aFmtp);
+		TInt match = value.Locate( KCharSemicolon );
+		if( KErrNotFound != match )
+			{
+			value = value.Left( match );
+			}
         // white space is not allowed 
-        if ( aFmtp.Locate( KCharSpace ) >= 0 )
+        if ( value.Locate( KCharSpace ) >= 0 )
             {
             User::Leave( KErrArgument );  
             }
            
-        CPtrC8Array* tokens = TokenizeL( aFmtp, KCharComma );
+        CPtrC8Array* tokens = TokenizeL( value, KCharComma );
         CleanupStack::PushL( tokens );
         
         // Mask will be updated while parsing
--- a/multimediacommscontroller/mmccinterface/tsrc/ut_interface/src/UT_CMccCodecDTMF.cpp	Wed Apr 14 16:21:36 2010 +0300
+++ b/multimediacommscontroller/mmccinterface/tsrc/ut_interface/src/UT_CMccCodecDTMF.cpp	Tue Apr 27 17:02:55 2010 +0300
@@ -610,6 +610,12 @@
     EUNIT_ASSERT( iCodec->iBitrateMask == 0 ); 
     iCodec->iBitrateMask = 0;
    
+    // multiple fmtp
+    retValue = EFalse;
+    MCC_EUNIT_ASSERT_SPECIFIC_LEAVE( retValue = iCodec->ParseFmtpAttrL(_L8("0-15;0-15")), KErrArgument); 
+    EUNIT_ASSERT( !retValue );
+    EUNIT_ASSERT( iCodec->iBitrateMask == 0 ); 
+    iCodec->iBitrateMask = 0;
     }
 
 void UT_CMccCodecDTMF::UT_CMccCodecDTMF_GetFmtpL()
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcemediasdpcodec.cpp	Wed Apr 14 16:21:36 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcemediasdpcodec.cpp	Tue Apr 27 17:02:55 2010 +0300
@@ -1121,17 +1121,31 @@
 	   		// did we try old school hold?
 	    	if ( oldSchool )           
 	      	    {
-	      	    if ( !isNullAddress )
-	      	      	{
-	      	  		// ignore that other party didn't understand us
-	      	        // and full cancel of old school process
-	         	    sSession.iOOldSchool = 0;
-	            	sSession.iOOldSchoolProceeding = 0;
-	                sSession.iOOldSchoolCompleted = 0;
-	      	      	}
+          	    if ( loc_direction == SdpCodecStringConstants::EAttributeSendrecv )
+          	        {
+          	        if ( !isNullAddress )
+          	            {
+          	            rmt_direction = SdpCodecStringConstants::EAttributeSendrecv;
+          	            }
+          	        else
+	      	            {
+          	            rmt_direction = SdpCodecStringConstants::EAttributeRecvonly;
+          	            }
+          	        }
+          	    else
+         	        {
+          	        if ( !isNullAddress )
+    				    {
+                        // ignore that other party didn't understand us
+                        // and full cancel of old school process
+                        sSession.iOOldSchool = 0;
+                        sSession.iOOldSchoolProceeding = 0;
+                        sSession.iOOldSchoolCompleted = 0;
+                        }
 	       		
-	       		rmt_direction = SdpCodecStringConstants::EAttributeRecvonly;
-	       		oldSchool = 0;
+                    rmt_direction = SdpCodecStringConstants::EAttributeRecvonly;
+          	        }
+                oldSchool = 0;
 	      	    }    
             else  //  didn't try old school yet
                 {
--- a/multimediacommsengine/mmcesrv/mmcemediamanager/tsrc/ut_mediamanager/src/UT_cmcemediasdpcodec.cpp	Wed Apr 14 16:21:36 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmcemediamanager/tsrc/ut_mediamanager/src/UT_cmcemediasdpcodec.cpp	Tue Apr 27 17:02:55 2010 +0300
@@ -1433,9 +1433,26 @@
 			
 	// Ensure old school to be used next		
 	EUNIT_ASSERT( iSession->SdpSession().iOOldSchool == 1 );
-	
-	CleanupStack::PopAndDestroy( sdp );
-	
+
+    CleanupStack::PopAndDestroy( sdp );
+
+    sdp = CSdpDocument::DecodeL( KMceTestSdpAMRWithOutDirection );
+    CleanupStack::PushL( sdp );
+    iSession->SdpSession().iOOldSchool = 1; // OldSchool Tried Already
+    audioLine = sdp->MediaFields()[ 0 ];
+    mediaStream = iSession->Streams()[ 0 ];
+    mediaStream->SetDirection( SdpCodecStringConstants::EAttributeSendrecv );
+
+    aRole = EMceRoleOfferer;
+
+    // Check if we offer Sendrecv to unhold the call and the other party
+    // is just only accept oldschool hold.
+    iSdpCodec->DecodeDirectionL(*audioLine, *mediaStream, *sdp, aRole );
+
+    EUNIT_ASSERT( iSession->SdpSession().iOOldSchool == 1 );
+    EUNIT_ASSERT( mediaStream->Direction() == SdpCodecStringConstants::EAttributeSendrecv );
+    CleanupStack::PopAndDestroy( sdp );
+    
 	}
 	
 
--- a/multimediacommsengine/mmcesrv/mmceserver/src/mcenatstatewait.cpp	Wed Apr 14 16:21:36 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmceserver/src/mcenatstatewait.cpp	Tue Apr 27 17:02:55 2010 +0300
@@ -52,6 +52,7 @@
 	         EMceProvisionalResponse == aEvent.Code() ) &&
 	     	 MceSip::HasContent( aEvent.Session().Response() ) ) ||
 	     	 EMceNatError == aEvent.NatCode() ||
+	     	 EMceNatUpdated == aEvent.NatCode() ||
 	         ( EMceAck == aEvent.Code() &&  
             	    	MceSip::HasContent( aEvent.Session().Request())) ||
 	     	 EMceNatICMPError == aEvent.NatCode())
@@ -135,6 +136,7 @@
 void CMceNatStateWait::ExitDefaultL( TMceNatStateTransitionEvent& aEvent )
     {
     CMceSipSession& session = aEvent.Session();
+    TMceStateIndex sipState = aEvent.Session().CurrentState().Id();
     
     if ( EMceAck == aEvent.Code() &&  
           MceSip::HasContent( aEvent.Session().Request()))
@@ -143,6 +145,11 @@
         aEvent.NatActions().UpdateL();
     	aEvent.NatActions().StateChangedL( aEvent, KMceNatStateDecodeAnswer );		
     	}
+    else if( EMceNatUpdated == aEvent.NatCode() && 
+    		 KMceStateOffering == sipState )                //for prack
+    	{
+		aEvent.NatActions().StateChangedL( aEvent, KMceNatStateCreateOffer );	
+    	}
     else
     	{
     	User::LeaveIfError( session.Actions().CreateSDP( session.Response() ) );
--- a/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/src/UT_CMceNatStateWait.cpp	Wed Apr 14 16:21:36 2010 +0300
+++ b/multimediacommsengine/mmcesrv/mmceserver/tsrc/ut_server/src/UT_CMceNatStateWait.cpp	Tue Apr 27 17:02:55 2010 +0300
@@ -142,13 +142,13 @@
         
     EUNIT_ASSERT( DoesAccept( EMceNatError ) );
     EUNIT_ASSERT( DoesAccept( EMceNatICMPError ) );
+    EUNIT_ASSERT( DoesAccept( EMceNatUpdated ) );
   
   	EUNIT_ASSERT( !DoesAccept( EMceNatHandleSIP ) );  
     EUNIT_ASSERT( !DoesAccept( EMceNatInitialized ) );
     EUNIT_ASSERT( !DoesAccept( EMceNatOffer ) );
     EUNIT_ASSERT( !DoesAccept( EMceNatAnswer ) );
     EUNIT_ASSERT( !DoesAccept( EMceNatUpdateSdp ) );
-    EUNIT_ASSERT( !DoesAccept( EMceNatUpdated ) );
     EUNIT_ASSERT( !DoesAccept( EMceNatSync ) );
         
     }
@@ -193,6 +193,12 @@
     								   *iNatSession, EMceInvite );
     EUNIT_ASSERT_LEAVE( iState->TransitionHandler().ExitL( event2 ));
 
+    iNatSession->iNatDisabled = EFalse;
+    eventcode = EMceNatUpdated;
+    iNatSession->NextState( KMceStateOffering ); 
+    TMceNatStateTransitionEvent event3( NULL, *iNatSession,eventcode,
+        								   *iNatSession, EMcePrack );
+    EUNIT_ASSERT_NO_LEAVE( iState->TransitionHandler().ExitL( event3 ));
 	}
 
 TBool