sipvoipprovider/src/svpsessionbase.cpp
branchRCL_3
changeset 6 fc8c25e5a2e8
parent 0 a4daefaec16c
child 8 7117cbf1600a
--- a/sipvoipprovider/src/svpsessionbase.cpp	Tue Feb 02 00:05:57 2010 +0200
+++ b/sipvoipprovider/src/svpsessionbase.cpp	Fri Feb 19 22:44:34 2010 +0200
@@ -3099,6 +3099,43 @@
     delete iSession;
     iSession = aUpdatedSession;
 
+	// lets check should mic be muted 
+    const RPointerArray<CMceMediaStream>& streamsArray = iSession->Streams(); 
+    const TInt streamCount( streamsArray.Count() );
+    if ( streamCount && iMuted )
+        {
+        SVPDEBUG1( "CSVPSessionBase::SetUpdatedSession Mic should be muted" )
+        
+        if ( IsMobileOriginated() ) 
+            {
+            for ( TInt i = 0; i < streamCount; i++ )
+                {
+                if ( streamsArray[i]->Source()->IsEnabled() )
+                    {
+                    SVPDEBUG1( "CSVPSessionBase::SetUpdatedSession Mic is not muted" )
+                    SVPDEBUG1( " -> disable mic" )
+                    streamsArray[i]->Source()->DisableL();
+                    }
+                else 
+                    {
+                    SVPDEBUG1( "CSVPSessionBase::SetUpdatedSession Mic is already" )
+                    SVPDEBUG1( " muted -> no need to disable mic" )
+                    }
+                }
+            }
+        else
+            {
+            // mute mic source
+            for ( TInt i = 0; i < streamCount; i++ )
+                {
+                if ( streamsArray[i]->BoundStreamL().Source()->IsEnabled() )
+                    {
+                    streamsArray[i]->BoundStreamL().Source()->DisableL();
+                    }
+                }
+            }
+        }
+
     // Update changed session also to the transfercontroller
     if ( iTransferController )
         {