Revision: 201025 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 15 Jul 2010 19:13:36 +0300
branchRCL_3
changeset 17 60e492b28869
parent 15 ab526b8cacfb
child 18 a36789189b53
Revision: 201025 Kit: 2010127
mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/ProgDLSource.cpp
mmmw_plat/audio_metadata_reader_api/audio_metadata_reader_api.metaxml
mmmw_plat/audio_output_control_utility_api/audio_output_control_utility_api.metaxml
mmmw_plat/audio_output_control_utility_proxy_api/audio_output_control_utility_proxy_api.metaxml
mmmw_plat/call_audio_control_api/call_audio_control_api.metaxml
mmmw_plat/call_audio_control_api/call_audiocontrol_api.metaxml
mmmw_plat/configuration_components_factory_api/configuration_components_factory_api.metaxml
mmmw_plat/emc_audio_effects_api/emc_audio_effects_api.metaxml
mmmw_plat/emc_balance_effect_api/emc_balance_effect_api.metaxml
mmmw_plat/emc_buffer_source_api/emc_buffer_source_api.metaxml
mmmw_plat/emc_descriptor_source_api/emc_descriptor_source_api.metaxml
mmmw_plat/emc_drm_config_intfc_api/emc_drm_config_intfc_api.metaxml
mmmw_plat/emc_file_source_api/emc_file_source_api.metaxml
mmmw_plat/emc_volume_effect_api/emc_volume_effect_api.metaxml
mmmw_plat/enhanced_media_client_api/enhanced_media_client_api.metaxml
mmmw_plat/multimedia_data_source_api/multimedia_data_source_api.metaxml
mmmw_plat/radio_monitor_api/radio_monitor_api.metaxml
mmmw_plat/radio_preset_utilities_api/radio_preset_utilities_api.metaxml
mmmw_plat/radio_utilities_api/radio_utilities_api.metaxml
mmmw_plat/stream_control_custom_command_api/stream_control_custom_command_api.metaxml
mmmw_plat/telephony_multimedia_service_api/telephony_multimedia_service_api.metaxml
mmmw_plat/thumbnail_engine_api/thumbnail_engine_api.metaxml
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/sis/create_sis.bat
mmmw_plat/voip_audio_services_api/voip_audio_services_api.metaxml
mmserv/metadatautility/Conf/metadatautility.confml
mmserv/metadatautility/Data/metadata_stub.SIS
mmserv/tms/inc/tmsclientsinkimpl.h
mmserv/tms/inc/tmsclientsourceimpl.h
mmserv/tms/inc/tmsmembuffer.h
mmserv/tms/inc/tmsproxy.h
mmserv/tms/inc/tmsqueuehandler.h
mmserv/tms/inc/tmsutility.h
mmserv/tms/tmscallserver/inc/tmscalladpt.h
mmserv/tms/tmscallserver/inc/tmscallcsadpt.h
mmserv/tms/tmscallserver/inc/tmscallipadpt.h
mmserv/tms/tmscallserver/inc/tmscsdevsound.h
mmserv/tms/tmscallserver/inc/tmscsdevsoundobserver.h
mmserv/tms/tmscallserver/inc/tmscsdownlink.h
mmserv/tms/tmscallserver/inc/tmscsuplink.h
mmserv/tms/tmscallserver/inc/tmsipcallstream.h
mmserv/tms/tmscallserver/src/tmscalladpt.cpp
mmserv/tms/tmscallserver/src/tmscallcsadpt.cpp
mmserv/tms/tmscallserver/src/tmscallipadpt.cpp
mmserv/tms/tmscallserver/src/tmscsdevsound.cpp
mmserv/tms/tmscallserver/src/tmscsdownlink.cpp
mmserv/tms/tmscallserver/src/tmscsuplink.cpp
mmserv/tms/tmscallserver/src/tmsipcalldownlinkds.cpp
mmserv/tms/tmscallserver/src/tmsipcallstreambase.cpp
mmserv/tms/tmscallserver/src/tmsipcalluplinkds.cpp
mmserv/tms/tmsimpl/inc/tmsclientsinkbodyimpl.h
mmserv/tms/tmsimpl/inc/tmsclientsourcebodyimpl.h
mmserv/tms/tmsimpl/src/tmsclientsinkbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsclientsinkimpl.cpp
mmserv/tms/tmsimpl/src/tmsclientsourcebodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsclientsourceimpl.cpp
mmserv/tms/tmsimpl/src/tmsmembuffer.cpp
mmserv/tms/tmsimpl/src/tmsqueuehandler.cpp
mmserv/tms/tmsimpl/src/tmsstreambodyimpl.cpp
mmserv/tms/tmsserver/inc/tmscenrepaudiohandler.h
mmserv/tms/tmsserver/inc/tmspubsublistener.h
mmserv/tms/tmsserver/src/tmscenrepaudiohandler.cpp
mmserv/tms/tmsserver/src/tmsglobaleffectssettings.cpp
mmserv/tms/tmsserver/src/tmspubsublistener.cpp
mmserv/tms/tmsserver/src/tmsserver.cpp
mmserv/voipaudioservices/VoIPClient/src/VoIPAudioSession.cpp
mmserv/voipaudioservices/VoIPServer/inc/VoIPServerSession.h
mmserv/voipaudioservices/VoIPServer/src/VoIPServerSession.cpp
--- a/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/ProgDLSource.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmfenh/enhancedmediaclient/Plugins/ProgDLSource/src/ProgDLSource.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -1114,11 +1114,11 @@
             {
             TInt pos = 0;
             CancelRequests();
+			// we should not delete the iFile, it causes the CAF to delete the rights if they are expired.
+
             // Since the requests will not be deleted if it is still inside RunL() (iState is EProcessing), 
             // iReadRequestPending should not be initialized to 0 always
             iReadRequestPending = iRequests.Count();
-            delete iFile;
-            iFile = NULL;
             //iDLFileSize = -1;
             iSnkBytes=pos;
             iBufferedDataSize = 0;
@@ -1623,7 +1623,8 @@
     if(aStatus != KErrNone)
         {
         TMMFEvent event(KMMFErrorCategoryControllerGeneralError, aStatus.Int());
-        iEventHandler->SendEventToClient(event);
+        //TODO: Need to send this error back to client. Currently removing this as iEventHandler is never set.
+        //iEventHandler->SendEventToClient(event);
         return KErrNone;
         }
     else
--- a/mmmw_plat/audio_metadata_reader_api/audio_metadata_reader_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/audio_metadata_reader_api/audio_metadata_reader_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,15 +1,16 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="f5a65440f33b24667dc3ea04f489cfa1" dataversion="2.0">
-<name>Audio MetaData Reader API</name>
-<description>An API to support metadata (ID3v1, ID3v2, 3GPP-udta) extraction from MP3, AAC, and 3GPP files. A separate API from the Symbian API that is tied to MMFController Framework, Meta Data Utility is more efficient in that it does need to launch audio controllers to retrieve metadata.</description>
-<type>c++</type>
-<collection>metadatautility</collection>
-<libs><lib name="MetaDataUtility.lib"/>
-<lib name="3GPExtParser.lib"/>
-</libs>
-<release category="platform" sinceversion=""/>
-<attributes>
-<htmldocprovided>no</htmldocprovided>
-<adaptation>no</adaptation>
-</attributes>
+  <name>Audio MetaData Reader API</name>
+  <description>An API to support metadata (ID3v1, ID3v2, 3GPP-udta) extraction from MP3, AAC, and 3GPP files. A separate API from the Symbian API that is tied to MMFController Framework, Meta Data Utility is more efficient in that it does need to launch audio controllers to retrieve metadata.</description>
+  <type>c++</type>
+  <collection>mmserv</collection>
+  <libs>
+    <lib name="MetaDataUtility.lib"/>
+    <lib name="3GPExtParser.lib"/>
+  </libs>
+  <release category="platform" sinceversion="3.0"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
 </api>
--- a/mmmw_plat/audio_output_control_utility_api/audio_output_control_utility_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/audio_output_control_utility_api/audio_output_control_utility_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,14 +1,15 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="5d5c3be5a52c2e8adda2712f28a986d6" dataversion="2.0">
-<name>Audio Output Control Utility API</name>
-<description>Audio Output Control Utility</description>
-<type>c++</type>
-<collection>audioenhancements</collection>
-<libs><lib name="AudioOutputControlUtility.lib"/>
-</libs>
-<release category="platform" sinceversion="0"/>
-<attributes>
-<htmldocprovided>no</htmldocprovided>
-<adaptation>no</adaptation>
-</attributes>
+  <name>Audio Output Control Utility API</name>
+  <description>API that provides basic controls for controlling how audio is routed.</description>
+  <type>c++</type>
+  <collection>mmfenh</collection>
+  <libs>
+    <lib name="AudioOutputControlUtility.lib"/>
+  </libs>
+  <release category="platform" sinceversion="3.1"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
 </api>
--- a/mmmw_plat/audio_output_control_utility_proxy_api/audio_output_control_utility_proxy_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/audio_output_control_utility_proxy_api/audio_output_control_utility_proxy_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,14 +1,15 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="ea24a39657207b38eb80699f6e79056b" dataversion="2.0">
-<name>Audio Output Control Utility Proxy API</name>
-<description>AudioOutputControlUtilityProxy</description>
-<type>c++</type>
-<collection>audioenhancements</collection>
-<libs><lib name="AudioOutputControlUtilityProxy.lib"/>
-</libs>
-<release category="platform" sinceversion="0"/>
-<attributes>
-<htmldocprovided>no</htmldocprovided>
-<adaptation>no</adaptation>
-</attributes>
+  <name>Audio Output Control Utility Proxy API</name>
+  <description>API for internal library associated with the Audio Output Control API.  This API is not meant to be used directly.</description>
+  <type>c++</type>
+  <collection>mmfenh</collection>
+  <libs>
+    <lib name="AudioOutputControlUtilityProxy.lib"/>
+  </libs>
+  <release category="platform" sinceversion="3.1"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
 </api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/call_audio_control_api/call_audio_control_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="64481ad6d77f2f35acf280ac96e35472" dataversion="2.0">
+  <name>Call Audio Control API</name>
+  <description>An API that provides basic controls for call audio.</description>
+  <type>c++</type>
+  <collection>mmserv</collection>
+  <libs>
+    <lib name="CallAudioControl.lib"/>
+  </libs>
+  <release category="platform" sinceversion="5.1"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- a/mmmw_plat/call_audio_control_api/call_audiocontrol_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" ?>
-<api id="64481ad6d77f2f35acf280ac96e35472" dataversion="2.0">
-<name>Call AudioControl API</name>
-<description>Call Audio Control API</description>
-<type>c++</type>
-<collection>audioenhancements</collection>
-<libs><lib name="CallAudioControl.lib"/>
-</libs>
-<release category="platform" sinceversion="0"/>
-<attributes>
-<htmldocprovided>no</htmldocprovided>
-<adaptation>no</adaptation>
-</attributes>
-</api>
--- a/mmmw_plat/configuration_components_factory_api/configuration_components_factory_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/configuration_components_factory_api/configuration_components_factory_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,14 +1,15 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="0100a16c42f978b201b8ab27f7d4f94a" dataversion="2.0">
-<name>Configuration Components Factory API</name>
-<description>Configuration Components Factory API</description>
-<type>c++</type>
-<collection>audioenhancements</collection>
-<libs><lib name="ConfigurationComponentsFactory.lib"/>
-</libs>
-<release category="platform" sinceversion="0"/>
-<attributes>
-<htmldocprovided>no</htmldocprovided>
-<adaptation>no</adaptation>
-</attributes>
+  <name>Configuration Components Factory API</name>
+  <description>API for a factory that will be used for creating new MMF Enhancements.</description>
+  <type>c++</type>
+  <collection>mmfenh</collection>
+  <libs>
+    <lib name="ConfigurationComponentsFactory.lib"/>
+  </libs>
+  <release category="platform" sinceversion="5.1"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
 </api>
--- a/mmmw_plat/emc_audio_effects_api/emc_audio_effects_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/emc_audio_effects_api/emc_audio_effects_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,14 +1,15 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="fab871be362a466ed241e6168fa181ac" dataversion="2.0">
-<name>EMC Audio Effects API</name>
-<description>This API defines an how to use S60 effects from EMC</description>
-<type>c++</type>
-<collection>audioenhancements</collection>
-<libs><lib name="enhancedmediaclient.lib"/>
-</libs>
-<release category="platform" sinceversion="0"/>
-<attributes>
-<htmldocprovided>no</htmldocprovided>
-<adaptation>no</adaptation>
-</attributes>
+  <name>EMC Audio Effects API</name>
+  <description>This API defines an how to use S60 effects from EMC</description>
+  <type>c++</type>
+  <collection>mmfenh</collection>
+  <libs>
+    <lib name="EnhancedMediaClient.lib"/>
+  </libs>
+  <release category="platform" sinceversion="3.2"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
 </api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/emc_balance_effect_api/emc_balance_effect_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="2e973d1422b06fd4fc780bc219404dca" dataversion="2.0">
+  <name>EMC Balance Effect API</name>
+  <description>This API defines an how to control audio balance from EMC</description>
+  <type>c++</type>
+  <collection>mmfenh</collection>
+  <libs>
+    <lib name="EnhancedMediaClient.lib"/>
+  </libs>
+  <release category="platform" sinceversion="3.2"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- a/mmmw_plat/emc_buffer_source_api/emc_buffer_source_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/emc_buffer_source_api/emc_buffer_source_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,18 +1,18 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="b1b252c2f0cc56d58aa808d2095d8cc7" dataversion="2.0">
   <name>EMC Buffer Source API</name>
   <description>This API defines a Buffer Source API for playing buffer data on the S60 platform using Enhanced Audio Playback API.</description>
   <type>c++</type>
-  <collection>audioenhancements</collection>
+  <collection>mmfenh</collection>
   <libs>
-    <lib name="EnhancedMediaClient.lib" />
+    <lib name="EnhancedMediaClient.lib"/>
   </libs>
-  <release category="platform"/>
+  <release category="platform" sinceversion="3.2"/>
   <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
+    <!-- This indicates wether the api provedes separate html documentation -->
+    <!-- or is the additional documentation generated from headers. -->
+    <!-- If you are unsuere then the value is "no" -->
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
   </attributes>
 </api>
--- a/mmmw_plat/emc_descriptor_source_api/emc_descriptor_source_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/emc_descriptor_source_api/emc_descriptor_source_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,18 +1,18 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="701522427712381e65a41e7edd32cb20" dataversion="2.0">
   <name>EMC Descriptor Source API</name>
   <description>This API defines a Descriptor Source API for playing back media content from memory on the S60 platform using Enhanced Audio Playback API.</description>
   <type>c++</type>
-  <collection>audioenhancements</collection>
+  <collection>mmfenh</collection>
   <libs>
-    <lib name="EnhancedMediaClient.lib" />
+    <lib name="EnhancedMediaClient.lib"/>
   </libs>
-  <release category="platform"/>
+  <release category="platform" sinceversion="3.2"/>
   <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
+    <!-- This indicates wether the api provedes separate html documentation -->
+    <!-- or is the additional documentation generated from headers. -->
+    <!-- If you are unsuere then the value is "no" -->
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
   </attributes>
 </api>
--- a/mmmw_plat/emc_drm_config_intfc_api/emc_drm_config_intfc_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/emc_drm_config_intfc_api/emc_drm_config_intfc_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,15 +1,15 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="c1135c6f0792b58ac85910f8cab5db21" dataversion="2.0">
-<name>EMC DRM Config Intfc API</name>
-<description>Interface for configuring and querying DRM Configuration information</description>
-<type>c++</type>
-<collection>audioenhancements</collection>
-<libs>
-    <lib name="EnhancedMediaClient.lib" />
-</libs>
-<release category="platform" sinceversion="0"/>
-<attributes>
-<htmldocprovided>no</htmldocprovided>
-<adaptation>no</adaptation>
-</attributes>
+  <name>EMC DRM Config Intfc API</name>
+  <description>Interface for configuring and querying DRM Configuration information</description>
+  <type>c++</type>
+  <collection>mmfenh</collection>
+  <libs>
+    <lib name="EnhancedMediaClient.lib"/>
+  </libs>
+  <release category="platform" sinceversion="3.2"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
 </api>
--- a/mmmw_plat/emc_file_source_api/emc_file_source_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/emc_file_source_api/emc_file_source_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,18 +1,18 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="121a798e5c9769cd3527668afda64527" dataversion="2.0">
   <name>EMC File Source API</name>
   <description>This API defines a File Source API for playing back a local media file on the S60 platform using Enhanced Audio Playback API.</description>
   <type>c++</type>
-  <collection>audioenhancements</collection>
+  <collection>mmfenh</collection>
   <libs>
-    <lib name="EnhancedMediaClient.lib" />
+    <lib name="EnhancedMediaClient.lib"/>
   </libs>
-  <release category="platform"/>
+  <release category="platform" sinceversion="3.2"/>
   <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
+    <!-- This indicates wether the api provedes separate html documentation -->
+    <!-- or is the additional documentation generated from headers. -->
+    <!-- If you are unsuere then the value is "no" -->
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
   </attributes>
 </api>
--- a/mmmw_plat/emc_volume_effect_api/emc_volume_effect_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/emc_volume_effect_api/emc_volume_effect_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,18 +1,18 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="b532842d5f6e40af5e361c66dd10645c" dataversion="2.0">
   <name>EMC Volume Effect API</name>
   <description>This API defines a Volume Effect API for controlling play back volume on the S60 platform using Enhanced Audio Playback API.</description>
   <type>c++</type>
-  <collection>audioenhancements</collection>
+  <collection>mmfenh</collection>
   <libs>
-    <lib name="EnhancedMediaClient.lib" />
+    <lib name="EnhancedMediaClient.lib"/>
   </libs>
-  <release category="platform"/>
+  <release category="platform" sinceversion="3.2"/>
   <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
+    <!-- This indicates wether the api provedes separate html documentation -->
+    <!-- or is the additional documentation generated from headers. -->
+    <!-- If you are unsuere then the value is "no" -->
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
   </attributes>
 </api>
--- a/mmmw_plat/enhanced_media_client_api/enhanced_media_client_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/enhanced_media_client_api/enhanced_media_client_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,18 +1,18 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="0d622a168fdb30d5960fba6bb551b47d" dataversion="2.0">
   <name>Enhanced Media Client API</name>
   <description>This API defines an enhanced API for playing audio on the S60 platform.</description>
   <type>c++</type>
   <collection>audioenhancements</collection>
   <libs>
-    <lib name="enhancedmediaclient.lib" />
+    <lib name="EnhancedMediaClient.lib"/>
   </libs>
-  <release category="platform"/>
+  <release category="platform" sinceversion="3.2"/>
   <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
+    <!-- This indicates wether the api provedes separate html documentation -->
+    <!-- or is the additional documentation generated from headers. -->
+    <!-- If you are unsuere then the value is "no" -->
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
   </attributes>
 </api>
--- a/mmmw_plat/multimedia_data_source_api/multimedia_data_source_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/multimedia_data_source_api/multimedia_data_source_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,18 +1,18 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="64bf0142d2c308636d6aeb14bce7f0e1" dataversion="2.0">
   <name>Multimedia Data Source API</name>
   <description>This API defines a generic multimedia data source API that will be implemented by data source objects.</description>
   <type>c++</type>
-  <collection>audioenhancements</collection>
+  <collection>mmfenh</collection>
   <libs>
-    <lib name="MMDataSourceFactory.lib" />
+    <lib name="MMDataSourceFactory.lib"/>
   </libs>
-  <release category="platform"/>
+  <release category="platform" sinceversion="3.2"/>
   <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
+    <!-- This indicates wether the api provedes separate html documentation -->
+    <!-- or is the additional documentation generated from headers. -->
+    <!-- If you are unsuere then the value is "no" -->
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
   </attributes>
 </api>
--- a/mmmw_plat/radio_monitor_api/radio_monitor_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/radio_monitor_api/radio_monitor_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,18 +1,18 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="a06201c136e52a4a009a5d31effb6e9b" dataversion="2.0">
   <name>Radio Monitor API</name>
   <description>An API for monitoring the radio state.</description>
   <type>c++</type>
-  <collection>radioutility</collection>
+  <collection>mmserv</collection>
   <libs>
-    <lib name="Radio_Utility.lib" />
+    <lib name="Radio_Utility.lib"/>
   </libs>
-  <release category="platform"/>
+  <release category="platform" sinceversion="3.2"/>
   <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
+    <!-- This indicates wether the api provedes separate html documentation -->
+    <!-- or is the additional documentation generated from headers. -->
+    <!-- If you are unsuere then the value is "no" -->
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
   </attributes>
 </api>
--- a/mmmw_plat/radio_preset_utilities_api/radio_preset_utilities_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/radio_preset_utilities_api/radio_preset_utilities_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,18 +1,19 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="e75020a4654d3fa30e533cf100bb65ca" dataversion="2.0">
   <name>Radio Preset Utilities API</name>
   <description>An API for applications to access radio preset functionality.</description>
   <type>c++</type>
-  <collection>radioutility</collection>
+  <collection>mmserv</collection>
   <libs>
-    <lib name="FmPresetUtility.lib" />
+    <lib name="FmPresetUtility.lib"/>
+    <lib name="presetutility.lib"/>
   </libs>
-  <release category="platform"/>
+  <release category="platform" sinceversion="3.2"/>
   <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
+    <!-- This indicates wether the api provedes separate html documentation -->
+    <!-- or is the additional documentation generated from headers. -->
+    <!-- If you are unsuere then the value is "no" -->
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
   </attributes>
 </api>
--- a/mmmw_plat/radio_utilities_api/radio_utilities_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/radio_utilities_api/radio_utilities_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,18 +1,18 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="05ffa7fd35eea873eb1484a4a7fb2b80" dataversion="2.0">
   <name>Radio Utilities API</name>
   <description>API for applications to access common radio functionality</description>
   <type>c++</type>
-  <collection>radioutility</collection>
+  <collection>mmserv</collection>
   <libs>
-    <lib name="Radio_Utility.lib" />
+    <lib name="Radio_Utility.lib"/>
   </libs>
-  <release category="platform"/>
+  <release category="platform" sinceversion=""/>
   <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
+    <!-- This indicates wether the api provedes separate html documentation -->
+    <!-- or is the additional documentation generated from headers. -->
+    <!-- If you are unsuere then the value is "no" -->
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
   </attributes>
 </api>
--- a/mmmw_plat/stream_control_custom_command_api/stream_control_custom_command_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/stream_control_custom_command_api/stream_control_custom_command_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,18 +1,18 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="5e8fa668e3a6f487ae28d8d0a8726089" dataversion="2.0">
   <name>Stream Control Custom Command API</name>
   <description>This API defines custom commands need to be implemented by components to be able to work with Enhanced Media Client API.</description>
   <type>c++</type>
-  <collection>audioenhancements</collection>
+  <collection>mmfenh</collection>
   <libs>
-    <lib name="StreamControlCustomCommands.lib" />
+    <lib name="StreamControlCustomCommands.lib"/>
   </libs>
-  <release category="platform"/>
+  <release category="platform" sinceversion="3.2"/>
   <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
+    <!-- This indicates wether the api provedes separate html documentation -->
+    <!-- or is the additional documentation generated from headers. -->
+    <!-- If you are unsuere then the value is "no" -->
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
   </attributes>
 </api>
--- a/mmmw_plat/telephony_multimedia_service_api/telephony_multimedia_service_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/telephony_multimedia_service_api/telephony_multimedia_service_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<api id="e1fff71a33909022430461d13e338a8f" dataversion="2.0">
-  <name>telephony_multimedia_service_api</name>
-  <description>API to Telephony Multimedia Server</description>
+<api id="669ee9af541c05ed4c1e0db47234d819" dataversion="2.0">
+  <name>Telephony Multimedia Service API</name>
+  <description>API for controlling both CS and IP based telephony streams on the device.  Specifically this API allows for the control of capturing the uplink data and playing out the downlink data.</description>
   <type>c++</type>
   <collection>mmserv</collection>
   <libs>
     <lib name="tmsapi.lib"/>
     <lib name="tmsfactory.lib"/>
   </libs>
-  <release category="platform" sinceversion="0"/>
+  <release category="platform" sinceversion="5.2"/>
   <attributes>
     <htmldocprovided>no</htmldocprovided>
     <adaptation>no</adaptation>
--- a/mmmw_plat/thumbnail_engine_api/thumbnail_engine_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/thumbnail_engine_api/thumbnail_engine_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,18 +1,18 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="2f5bdfb86150f848ab2fceed34e8f3e6" dataversion="2.0">
   <name>Thumbnail Engine API</name>
   <description>Provides the means to read a frame from a video content file and return it as an RGB bitmap.</description>
   <type>c++</type>
-  <collection>thumbnailengine</collection>
-  <libs> 
-  <lib name="TNEEngine.lib" />
+  <collection>mmserv</collection>
+  <libs>
+    <lib name="TNEEngine.lib"/>
   </libs>
-  <release category="platform"/>
+  <release category="platform" sinceversion="3.0"/>
   <attributes>
-     <!-- This indicates wether the api provedes separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsuere then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
+    <!-- This indicates wether the api provedes separate html documentation -->
+    <!-- or is the additional documentation generated from headers. -->
+    <!-- If you are unsuere then the value is "no" -->
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
   </attributes>
 </api>
--- a/mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/sis/create_sis.bat	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/sis/create_sis.bat	Thu Jul 15 19:13:36 2010 +0300
@@ -1,3 +1,22 @@
+cls
+@echo off
+echo.
+
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of the "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+echo Description:  VAS Stif test package creation utility
+rem
+
 del VoIPAudioServicesTestClass.sis*
 makesis VoIPAudioServicesTestClass.pkg VoIPAudioServicesTestClass.sis
 signsis VoIPAudioServicesTestClass.sis VoIPAudioServicesTestClass.sisx rd.crt rd.key
--- a/mmmw_plat/voip_audio_services_api/voip_audio_services_api.metaxml	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmmw_plat/voip_audio_services_api/voip_audio_services_api.metaxml	Thu Jul 15 19:13:36 2010 +0300
@@ -1,18 +1,18 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <api id="a64676b70c8d53ee8ec52d588c43fda4" dataversion="2.0">
-  <name>VoIPAudioServices</name>
-  <description>API to VoIP audio services</description>
+  <name>VoIP Audio Services API</name>
+  <description>API for VoIP applications to capture uplink data and playout downlink data.</description>
   <type>c++</type>
-  <collection>audioenhancements</collection>
+  <collection>mmserv</collection>
   <libs>
     <lib name="VoIPAudioIntfc.lib"/>
   </libs>
-  <release category="platform" sinceversion="0"/>
+  <release category="platform" sinceversion="5.1"/>
   <attributes>
-     <!-- This indicates wether the api provides separate html documentation -->
-     <!-- or is the additional documentation generated from headers. -->
-     <!-- If you are unsure then the value is "no" -->
-     <htmldocprovided>no</htmldocprovided>
-     <adaptation>no</adaptation>
+    <!-- This indicates wether the api provides separate html documentation -->
+    <!-- or is the additional documentation generated from headers. -->
+    <!-- If you are unsure then the value is "no" -->
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
   </attributes>
 </api>
Binary file mmserv/metadatautility/Conf/metadatautility.confml has changed
Binary file mmserv/metadatautility/Data/metadata_stub.SIS has changed
--- a/mmserv/tms/inc/tmsclientsinkimpl.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/inc/tmsclientsinkimpl.h	Thu Jul 15 19:13:36 2010 +0300
@@ -24,7 +24,7 @@
 namespace TMS {
 
 // FORWARD DECLARATIONS
-class TMSCallProxy;
+class TMSGlobalContext;
 
 // TMSClientSinkImpl class
 class TMSClientSinkImpl : public TMSClientSink
@@ -32,7 +32,7 @@
 public:
     virtual ~TMSClientSinkImpl();
     static gint Create(TMSSink*& tmssink);
-    gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
+    gint SetProxy(TMSGlobalContext* context, gpointer queuehandler);
 
 private:
     TMSClientSinkImpl();
--- a/mmserv/tms/inc/tmsclientsourceimpl.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/inc/tmsclientsourceimpl.h	Thu Jul 15 19:13:36 2010 +0300
@@ -24,6 +24,7 @@
 namespace TMS {
 
 // FORWARD DECLARATIONS
+class TMSGlobalContext;
 class TMSCallProxy;
 
 // TMSClientSourceImpl class
@@ -32,7 +33,7 @@
 public:
     virtual ~TMSClientSourceImpl();
     static gint Create(TMSSource*& tmssource);
-    gint SetProxy(TMSCallProxy* aProxy, gint strmid, gpointer queuehandler);
+    gint SetProxy(TMSGlobalContext* context, gpointer queuehandler);
 
 private:
     TMSClientSourceImpl();
--- a/mmserv/tms/inc/tmsmembuffer.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/inc/tmsmembuffer.h	Thu Jul 15 19:13:36 2010 +0300
@@ -93,7 +93,7 @@
 
 private:
     guint iBufferSize;
-    guint iTimeStamp;
+    guint64 iTimeStamp;
     guint8* iDataPtr;
     gboolean iOwnsBuffer;
     };
@@ -101,3 +101,4 @@
 } //namespace TMS
 
 #endif //TMS_MEM_BUFFER_H
+
--- a/mmserv/tms/inc/tmsproxy.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/inc/tmsproxy.h	Thu Jul 15 19:13:36 2010 +0300
@@ -47,7 +47,7 @@
     IMPORT_C gint Connect();
 
     /**
-     * @return The server version this session can connct to
+     * @return The server version this session can connect to
      */
     IMPORT_C TVersion Version() const;
 
@@ -114,6 +114,7 @@
 
 private:
     TRoutingMsgBufPckg ipckg;
+
     RPointerArray<TMSEffectObserver> iEffectsObsrvrList;
     RPointerArray<TMSGlobalRoutingObserver> iRoutingObsrvrList;
     RPointerArray<TMSEffect> iEffectsParentList;
--- a/mmserv/tms/inc/tmsqueuehandler.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/inc/tmsqueuehandler.h	Thu Jul 15 19:13:36 2010 +0300
@@ -27,7 +27,7 @@
 namespace TMS {
 
 // FORWARD DECLARATIONS
-class TMSBuffer; //TMSDataBuffer
+class TMSBuffer;
 class TMSGlobalContext;
 
 /**
@@ -73,24 +73,28 @@
      */
     TRequestStatus* Status();
 
+    /*
+     * Add and remove observer to buffer events
+     */
     gint AddObserver(MQueueHandlerObserver& obsvr, gint aClientId);
     gint RemoveObserver(MQueueHandlerObserver& obsvr);
 
 private:
 
     /**
-     * constructor
+     * Constructors
      */
     TMSQueueHandler(RMsgQueue<TmsMsgBuf>* aMsgQueue,
             TMSGlobalContext* glblCtx);
 
     void ConstructL();
 
-    // from CActive
+    // From CActive
     void DoCancel();
     void RunL();
     TInt RunError(TInt aError);
 
+    // For buffer processing upon handler events
     void DoFillBuffer(gint aBufLen, gint aStatus, gboolean flag, guint32 key);
     void DoEmptyBuffer(gint aBufLen, gint aStatus, gboolean flag, guint32 key);
     gint FindStreamInList();
@@ -99,7 +103,6 @@
     TMSStreamState ConvertToStreamState(gint request);
 
 private:
-    // data
 
     RPointerArray<MQueueHandlerObserver> iObserversList; // (not owned)
     MQueueHandlerObserver* iObserver; //not owned
@@ -109,7 +112,7 @@
     RChunk iChunk;
     TPtr8 iChunkDataPtr;
     TMSBuffer* iBuffer;
-    TMSGlobalContext *iTMSGlobalContext;
+    TMSGlobalContext* iTMSGlobalContext;
     };
 
 } //namespace TMS
--- a/mmserv/tms/inc/tmsutility.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/inc/tmsutility.h	Thu Jul 15 19:13:36 2010 +0300
@@ -15,8 +15,8 @@
  *
  */
 
-#ifndef __TMSUTILITY_H__
-#define __TMSUTILITY_H__
+#ifndef TMSUTILITY_H
+#define TMSUTILITY_H
 
 #include <e32std.h>
 #include <tms.h>
@@ -40,7 +40,9 @@
 #define TRACE_PRN_N(str)              RDebug::Print(str)
 #define TRACE_PRN_N1(str, val1)       RDebug::Print(str, val1)
 #define TRACE_PRN_N2(str, val1, val2) RDebug::Print(str, val1, val2)
+
 #else
+
 #define TRACE_PRN_FN_ENT
 #define TRACE_PRN_FN_EXT
 #define TRACE_PRN_IF_ERR(err)
@@ -50,11 +52,11 @@
 #define TRACE_PRN_N(str)
 #define TRACE_PRN_N1(str, val1)
 #define TRACE_PRN_N2(str, val1, val2)
+
 #endif //_DEBUG
 
-
 // MACRO DEFINITIONS
-#define RET_ERR_IF_ERR(err) if ( err != 0) return err;
+#define RET_ERR_IF_ERR(err) if (err != 0) return err;
 #define RET_REASON_IF_ERR(s) if(s!=0) return s
 
 #define TMSRESULT(result) TMSUtility::TMSResult(result)
@@ -82,5 +84,5 @@
 
 } //namespace TMS
 
-#endif //__TMSUTILITY_H__
+#endif //TMSUTILITY_H
 
--- a/mmserv/tms/tmscallserver/inc/tmscalladpt.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/inc/tmscalladpt.h	Thu Jul 15 19:13:36 2010 +0300
@@ -31,24 +31,26 @@
     virtual ~TMSCallAdpt();
 
     // From TMSStream
-    virtual gint CreateStream(TMSCallType callType,
-            TMSStreamType strmType, gint& outStrmId) = 0;
-    virtual gint InitStream(TMSCallType callType, TMSStreamType strmType,
-            gint strmId, TMSFormatType frmtType, const RMessage2& aMessage) = 0;
-    virtual gint StartStream(TMSCallType callType,
-            TMSStreamType strmType, gint strmId) = 0;
-    virtual gint PauseStream(TMSCallType callType,
-            TMSStreamType strmType, gint strmId) = 0;
-    virtual gint StopStream(TMSCallType callType, TMSStreamType strmType,
-            gint strmId) = 0;
-    virtual gint DeinitStream(TMSCallType callType,
-            TMSStreamType strmType, gint strmId) = 0;
-    virtual gint DeleteStream(TMSCallType callType,
-            TMSStreamType strmType, gint strmId) = 0;
-    virtual gint DataXferBufferEmptied(TMSCallType callType,
-            TMSStreamType strmType, gint strmId) = 0;
-    virtual gint DataXferBufferFilled(TMSCallType callType,
-            TMSStreamType strmType, gint strmId, guint datasize) = 0;
+    virtual gint CreateStream(const TMSCallType callType,
+            const TMSStreamType strmType, gint& outStrmId) = 0;
+    virtual gint InitStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId,
+            const TMSFormatType frmtType, const RMessage2& aMessage) = 0;
+    virtual gint StartStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId) = 0;
+    virtual gint PauseStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId) = 0;
+    virtual gint StopStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId) = 0;
+    virtual gint DeinitStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId) = 0;
+    virtual gint DeleteStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId) = 0;
+    virtual gint DataXferBufferEmptied(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId) = 0;
+    virtual gint DataXferBufferFilled(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId,
+            const guint datasize) = 0;
     virtual gint GetDataXferBufferHndl(const TMSCallType callType,
             const TMSStreamType strmType, const gint strmId,
             const guint32 key, RChunk& chunk) = 0;
@@ -84,15 +86,14 @@
     virtual gint SetPlc(const TMSFormatType fmttype, const gboolean plc) = 0;
 
     // From TMS routing
-    virtual gint SetOutput(TMSAudioOutput output) = 0;
+    virtual gint SetOutput(const TMSAudioOutput output) = 0;
     virtual gint GetOutput(TMSAudioOutput& output) = 0;
     virtual gint GetPreviousOutput(TMSAudioOutput& output) = 0;
-    virtual gint GetAvailableOutputsL(gint& count,
-            CBufFlat*& outputsbuffer) = 0;
+    virtual gint GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuf) = 0;
 
 protected:
     TMSCallAdpt();
-    virtual gint PostConstruct();
+    virtual gint PostConstruct() = 0;
 
 protected:
     gint iGlobalVol;
--- a/mmserv/tms/tmscallserver/inc/tmscallcsadpt.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/inc/tmscallcsadpt.h	Thu Jul 15 19:13:36 2010 +0300
@@ -18,6 +18,7 @@
 #ifndef CALLCSADPT_H
 #define CALLCSADPT_H
 
+// INCLUDES
 #include <TelephonyAudioRouting.h>
 #include <MTelephonyAudioRoutingObserver.h>
 #include <e32msgqueue.h>
@@ -33,35 +34,38 @@
 class TMSTarSettings;
 
 /*
- * CallCSAdapt class
+ * TMSCallCSAdpt class
  */
 class TMSCallCSAdpt : public TMSCallAdpt,
-                      public TMSCSPDevSoundObserver,
+                      public TMSCSDevSoundObserver,
                       public MTelephonyAudioRoutingObserver
     {
 public:
-    TMSCallCSAdpt();
+	static TMSCallCSAdpt* NewL();
     virtual ~TMSCallCSAdpt();
     virtual gint PostConstruct();
 
-    virtual gint CreateStream(TMSCallType callType, TMSStreamType strmType,
-            gint& outStrmId);
-    virtual gint InitStream(TMSCallType callType, TMSStreamType strmType,
-            gint strmId, TMSFormatType frmtType, const RMessage2& message);
-    virtual gint StartStream(TMSCallType callType, TMSStreamType strmType,
-            gint strmId);
-    virtual gint PauseStream(TMSCallType callType, TMSStreamType strmType,
-            gint strmId);
-    virtual gint StopStream(TMSCallType callType, TMSStreamType strmType,
-            gint strmId);
-    virtual gint DeinitStream(TMSCallType callType, TMSStreamType strmType,
-            gint strmId);
-    virtual gint DeleteStream(TMSCallType callType, TMSStreamType strmType,
-            gint strmId);
-    virtual gint DataXferBufferEmptied(TMSCallType callType,
-            TMSStreamType strmType, gint strmId);
-    virtual gint DataXferBufferFilled(TMSCallType callType,
-            TMSStreamType strmType, gint strmId, guint datasize);
+    // From TMSStream
+    virtual gint CreateStream(const TMSCallType callType,
+            const TMSStreamType strmType, gint& outStrmId);
+    virtual gint InitStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId,
+            const TMSFormatType frmtType, const RMessage2& message);
+    virtual gint StartStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId);
+    virtual gint PauseStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId);
+    virtual gint StopStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId);
+    virtual gint DeinitStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId);
+    virtual gint DeleteStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId);
+    virtual gint DataXferBufferEmptied(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId);
+    virtual gint DataXferBufferFilled(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId,
+            const guint datasize);
     virtual gint GetDataXferBufferHndl(const TMSCallType callType,
             const TMSStreamType strmType, const gint strmId,
             const guint32 key, RChunk& chunk);
@@ -97,38 +101,40 @@
     virtual gint SetPlc(const TMSFormatType fmttype, const gboolean plc);
 
     // From TMS audio routing
-    virtual gint SetOutput(TMSAudioOutput output);
+    virtual gint SetOutput(const TMSAudioOutput output);
     virtual gint GetOutput(TMSAudioOutput& output);
     virtual gint GetPreviousOutput(TMSAudioOutput& output);
-    virtual gint GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuffer);
+    virtual gint GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuf);
 
-    //From TMSCSPDevSoundObserver
-    void DownlinkInitCompleted(TInt status);
-    void UplinkInitCompleted(TInt status);
-    void UplinkActivatedSuccessfully();
-    void DownlinkActivatedSuccessfully();
-    void UplinkActivationFailed();
-    void DownlinkActivationFailed();
+    //From TMSCSDevSoundObserver
+    void DownlinkInitCompleted(gint status);
+    void UplinkInitCompleted(gint status);
+    void DownlinkActivationCompleted(gint status);
+    void UplinkActivationCompleted(gint status);
 
 private:
+    TMSCallCSAdpt();
+    void ConstructL();
+
+    gint InitUplink();
+    gint InitDownlink();
     void AvailableOutputsChanged(
             CTelephonyAudioRouting& aTelephonyAudioRouting);
     void OutputChanged(CTelephonyAudioRouting& aTelephonyAudioRouting);
     void SetOutputComplete(CTelephonyAudioRouting& aTelephonyAudioRouting,
-            gint aError);
+            gint status);
     void GetSupportedBitRatesL(CBufFlat*& brbuffer);
     void NotifyClient(const gint strmId, const gint command,
             const gint status = KErrNone, const gint64 int64 = TInt64(0));
 
 private:
     gint iNextStreamId;
-
     TMSCSUplink* iCSUplink;
     TMSCSDownlink* iCSDownlink;
     CTelephonyAudioRouting* iRouting;
     TMSTarSettings* iTarSettings;
-    TMSStreamType iStrmtype;
 
+    // Message queues for communication and data transfer back to the client
     RMsgQueue<TmsMsgBuf> iMsgQueueUp;
     RMsgQueue<TmsMsgBuf> iMsgQueueDn;
     TmsMsgBuf iMsgBuffer;
--- a/mmserv/tms/tmscallserver/inc/tmscallipadpt.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/inc/tmscallipadpt.h	Thu Jul 15 19:13:36 2010 +0300
@@ -15,8 +15,8 @@
  *
  */
 
-#ifndef __CALLIPADAPT_H
-#define __CALLIPADAPT_H
+#ifndef CALLIPADAPT_H
+#define CALLIPADAPT_H
 
 // INCLUDES
 #include <e32msgqueue.h>
@@ -24,6 +24,7 @@
 #include "tmsclientserver.h"
 #include "tmsshared.h"
 #include "tmscalladpt.h"
+#include "tmsipcallstream.h"
 
 namespace TMS {
 
@@ -31,34 +32,38 @@
 class TMSIPDownlink;
 class TMSIPUplink;
 
-// TMSCallIPAdpt class
-class TMSCallIPAdpt : public TMSCallAdpt
+/*
+ * TMSCallIPAdpt class
+ */
+class TMSCallIPAdpt : public TMSCallAdpt,
+                      public TMSIPDevSoundObserver
     {
 public:
-    // Constractor
     static TMSCallIPAdpt* NewL();
     virtual ~TMSCallIPAdpt();
     virtual gint PostConstruct();
 
     // From TMSStream
-    virtual gint CreateStream(TMSCallType callType, TMSStreamType strmType,
-            gint& outStrmId);
-    virtual gint InitStream(TMSCallType callType, TMSStreamType strmType,
-            gint strmId, TMSFormatType frmtType, const RMessage2& message);
-    virtual gint StartStream(TMSCallType callType, TMSStreamType strmType,
-            gint strmId);
-    virtual gint PauseStream(TMSCallType callType, TMSStreamType strmType,
-            gint strmId);
-    virtual gint StopStream(TMSCallType callType, TMSStreamType strmType,
-            gint strmId);
-    virtual gint DeinitStream(TMSCallType callType, TMSStreamType strmType,
-            gint strmId);
-    virtual gint DeleteStream(TMSCallType callType, TMSStreamType strmType,
-            gint strmId);
-    virtual gint DataXferBufferEmptied(TMSCallType callType,
-            TMSStreamType strmType, gint strmId);
-    virtual gint DataXferBufferFilled(TMSCallType callType,
-            TMSStreamType strmType, gint strmId, guint datasize);
+    virtual gint CreateStream(const TMSCallType callType,
+            const TMSStreamType strmType, gint& outStrmId);
+    virtual gint InitStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId,
+            const TMSFormatType frmtType, const RMessage2& message);
+    virtual gint StartStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId);
+    virtual gint PauseStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId);
+    virtual gint StopStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId);
+    virtual gint DeinitStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId);
+    virtual gint DeleteStream(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId);
+    virtual gint DataXferBufferEmptied(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId);
+    virtual gint DataXferBufferFilled(const TMSCallType callType,
+            const TMSStreamType strmType, const gint strmId,
+            const guint datasize);
     virtual gint GetDataXferBufferHndl(const TMSCallType callType,
             const TMSStreamType strmType, const gint strmId,
             const guint32 key, RChunk& chunk);
@@ -93,11 +98,11 @@
     virtual gint GetPlc(const TMSFormatType fmttype, gboolean& plc);
     virtual gint SetPlc(const TMSFormatType fmttype, const gboolean plc);
 
-    // From TMS audio output
-    virtual gint SetOutput(TMSAudioOutput output);
+    // From TMS audio routing
+    virtual gint SetOutput(const TMSAudioOutput output);
     virtual gint GetOutput(TMSAudioOutput& output);
     virtual gint GetPreviousOutput(TMSAudioOutput& output);
-    virtual gint GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuffer);
+    virtual gint GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuf);
 
     // From TMS codec formats
     gint SetIlbcCodecMode(const gint mode, const TMSStreamType strmtype);
@@ -110,8 +115,6 @@
     gint ConcealErrorForNextBuffer();
     gint BadLsfNextBuffer();
 
-    gint OpenDownlinkL(const RMessage2& message);
-    gint OpenUplinkL(const RMessage2& message);
     void SetFormat(const gint strmId, const guint32 aFormat);
 
     void BufferFilledL(guint dataSize);
@@ -119,29 +122,39 @@
     gint GetDataXferChunkHndl(const TMSStreamType strmType,
             const guint32 key, RChunk& chunk);
 
-private:
-    void ConstructL();
-    TMSCallIPAdpt();
+    //From TMSIPDevSoundObserver
+    void DownlinkInitCompleted(gint status);
+    void UplinkInitCompleted(gint status);
+    void DownlinkStarted(gint status);
+    void UplinkStarted(gint status);
 
-    void NotifyClient(const gint strmId, const gint aCommand,
-            const gint aStatus = KErrNone, const gint64 aInt64 = gint64(0));
+private:
+    TMSCallIPAdpt();
+    void ConstructL();
+
+    gint OpenDownlink(const RMessage2& message);
+    gint OpenUplink(const RMessage2& message);
+
+    gint InitDTMF(TMSStreamType strmtype);
     void GetSupportedBitRatesL(CBufFlat*& brbuffer);
+    void NotifyClient(const gint strmId, const gint command,
+            const gint status = KErrNone, const gint64 int64 = TInt64(0));
 
 private:
     gint iNextStreamId;
+    TMSIPUplink* iIPUplink;
+    TMSIPDownlink* iIPDownlink;
+
+    // Message queues for communication and data transfer back to the client
+    RMsgQueue<TmsMsgBuf> iMsgQueueUp;
+    RMsgQueue<TmsMsgBuf> iMsgQueueDn;
+    TmsMsgBuf iMsgBuffer;
+
     gboolean iUplinkInitialized;
     gint iUplinkStreamId;
     gboolean iDnlinkInitialized;
     gint iDnlinkStreamId;
 
-    TMSIPDownlink* iIPDownlink;
-    TMSIPUplink* iIPUplink;
-
-    // Message queues for communication and data transfer back to the client
-    RMsgQueue<TmsMsgBuf> iMsgQueueUp;
-    RMsgQueue<TmsMsgBuf> iMsgQueueDn;
-
-    TmsMsgBuf iMsgBuffer;
     TMMFPrioritySettings iPriority;
     guint32 iUpFourCC;
     guint32 iDnFourCC;
@@ -150,11 +163,10 @@
     RArray<guint> iArrBitrates;
     RArray<TFourCC> iCodecs;
     gint iCodecsCount;
-
     };
 
 } //namespace TMS
 
-#endif //__CALLIPADAPT_H
+#endif //CALLIPADPT_H
 
 // End of file
--- a/mmserv/tms/tmscallserver/inc/tmscsdevsound.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/inc/tmscsdevsound.h	Thu Jul 15 19:13:36 2010 +0300
@@ -19,58 +19,48 @@
 #define TMSCSDEVSOUND_H
 
 #include <sounddevice.h>
+#include <tms.h>
 
 namespace TMS {
 
-class TMSCSPDevSoundObserver;
+// FORWARD DECLARATIONS
+class TMSCSDevSoundObserver;
 
 /**
  *  Wrapper for CMMFDevSound
  *
  */
-NONSHARABLE_CLASS(TMSCSPDevSound) : public CBase,
-                                    public MDevSoundObserver
+NONSHARABLE_CLASS(TMSCSDevSound) : public CBase,
+                                   public MDevSoundObserver
     {
 public:
 
     /**
      * Destructor.
      */
-    virtual ~TMSCSPDevSound();
+    virtual ~TMSCSDevSound();
 
     /**
-     * Activates the dev sound stream. TMSCSPDevSoundObserver methods are called
-     * when activation goes ok or fails. If the stream is already active or
-     * activating then nothing is done.
+     * Activates the DevSound stream.
+     * Stream activation status is indicated by TMSCSDevSoundObserver callback
+     * methods. If the stream is already active or being activated, call to
+     * this will result in no action.
      */
     virtual void Activate();
 
     /**
-     * Deactivates the devsound stream. If stream is not active or
-     * activation is not ongoing then nothing is done.
+     * Deactivates an active DevSound stream.
      */
     virtual void Deactivate();
 
-    /**
-     * Indicates that activation is ongoing,
-     * but the result of the activation is still unknown.
-     * @return ETrue - activation ongoing, EFalse - activation not ongoing.
+    /*
+     * Returns DevSound instance associated with the stream.
      */
-    TBool IsActivationOngoing() const;
-
-    /**
-     * Determines wether the devsound stream is active or not.
-     * @return ETrue - Stream is active, EFalse - Stream not active.
-     */
-    TBool IsActive() const;
-
     CMMFDevSound& DevSound();
 
-    // from base class MDevSoundObserver
-
     /**
      * From MDevSoundObserver
-     * Empty implementation
+     * Indicates DevSound initialization status.
      */
     void InitializeComplete(TInt aError);
 
@@ -78,50 +68,50 @@
      * From MDevSoundObserver
      * Empty implementation
      */
-    void BufferToBeFilled(CMMFBuffer* aBuffer);
+    void BufferToBeFilled(CMMFBuffer* /*aBuffer*/) {}
 
     /**
      * From MDevSoundObserver
      * Empty implementation
      */
-    void PlayError(TInt aError);
+    void PlayError(TInt /*aError*/) {}
 
     /**
      * From MDevSoundObserver
      * Empty implementation
      */
-    void ToneFinished(TInt aError);
+    void ToneFinished(TInt /*aError*/) {}
 
     /**
      * From MDevSoundObserver
      * Empty implementation
      */
-    void BufferToBeEmptied(CMMFBuffer* aBuffer);
+    void BufferToBeEmptied(CMMFBuffer* /*aBuffer*/) {}
 
     /**
      * From MDevSoundObserver
      * Empty implementation
      */
-    void RecordError(TInt aError);
+    void RecordError(TInt /*aError*/) {}
 
     /**
      * From MDevSoundObserver
      * Empty implementation
      */
-    void ConvertError(TInt aError);
+    void ConvertError(TInt /*aError*/) {}
 
     /**
      * From MDevSoundObserver
      * Empty implementation
      */
-    void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
+    void DeviceMessage(TUid /*aMessageType*/, const TDesC8& /*aMsg*/) {}
 
 protected:
 
-    TMSCSPDevSound(TMSCSPDevSoundObserver& aObserver);
-
-    void ConstructL(TMMFState aMode, gint aAudioPreference,
-            gint aAudioPriority);
+    TMSCSDevSound(TMSCSDevSoundObserver& observer);
+    void ConstructL(const TMSStreamType strmtype);
+    void InitializeL();
+    void NotifyEvent(gint error);
 
 private:
 
@@ -132,33 +122,34 @@
 
 protected:
 
-    TUint iStreamType;
-
     /**
-     * Indication if device is activated. Derived class has to update this.
+     * Indication of DevSound activated state. TRUE == stream activated.
+     * Derived class has to update this.
      */
-    TBool iActive;
+    gboolean iActive;
 
     /**
-     * Indication if activation is ongoing.
+     * Indication of an ongoing DevSound activation.
      * Derived class has to update this.
      */
-    TBool iActivationOngoing;
+    gboolean iActivationOngoing;
 
     /**
-     * Devsound instance
-     * Own.
+     * Devsound instance associated with the stream.
      */
     CMMFDevSound* iDevSound;
 
     /**
-     * Observer for successfull activation.
-     * Not own.
+     * An observer subscribing to TMSCSDevSound notifications.
      */
-    TMSCSPDevSoundObserver& iObserver;
+    TMSCSDevSoundObserver& iObserver;
 
+    TMSStreamType iStreamType;
+    gint iPreference;
+    gint iPriority;
+    TMMFState iMode;
     };
 
 } //namespace TMS
 
-#endif // TMSCSDEVSOUND_H
+#endif //TMSCSDEVSOUND_H
--- a/mmserv/tms/tmscallserver/inc/tmscsdevsoundobserver.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/inc/tmscsdevsoundobserver.h	Thu Jul 15 19:13:36 2010 +0300
@@ -21,39 +21,16 @@
 namespace TMS {
 
 /**
- *  Observer interface for knowing when audio streams have been
- *  successfully ramped up.
- *
+ *  TMSCSDevSoundObserver
+  * An observer interface providing TMSCSDevSound event notifications.
  */
-class TMSCSPDevSoundObserver
+class TMSCSDevSoundObserver
     {
 public:
-    virtual void DownlinkInitCompleted(TInt status) = 0;
-    virtual void UplinkInitCompleted(TInt status) = 0;
-
-    /**
-     * Notification that Mic has been activated successfully
-     *
-     */
-    virtual void UplinkActivatedSuccessfully() = 0;
-
-    /**
-     * Notification that speaker has been activated successfully
-     *
-     */
-    virtual void DownlinkActivatedSuccessfully() = 0;
-
-    /**
-     * Notification that Mic initialisation failed.
-     *
-     */
-    virtual void UplinkActivationFailed() = 0;
-
-    /**
-     * Notification that Speaker activation failed.
-     *
-     */
-    virtual void DownlinkActivationFailed() = 0;
+    virtual void DownlinkInitCompleted(gint status) = 0;
+    virtual void UplinkInitCompleted(gint status) = 0;
+    virtual void UplinkActivationCompleted(gint status) = 0;
+    virtual void DownlinkActivationCompleted(gint status) = 0;
     };
 
 } //namespace TMS
--- a/mmserv/tms/tmscallserver/inc/tmscsdownlink.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/inc/tmscsdownlink.h	Thu Jul 15 19:13:36 2010 +0300
@@ -23,26 +23,23 @@
 
 namespace TMS {
 
-//
-class TMSCSPDevSoundObserver;
-
 /**
- *  Provides Downlink functionality.
+ *  Provides Downlink stream functionality.
  *
  */
-NONSHARABLE_CLASS(TMSCSDownlink) : public TMSCSPDevSound
+NONSHARABLE_CLASS(TMSCSDownlink) : public TMSCSDevSound
     {
 public:
 
-    static TMSCSDownlink* NewL(TMSCSPDevSoundObserver& aObserver);
+    static TMSCSDownlink* NewL(TMSCSDevSoundObserver& observer);
 
     virtual ~TMSCSDownlink();
 
     /**
      * Sets volume.
-     * @param aVolume Volume.
+     * @param volume Volume.
      */
-    void SetVolume(gint aVolume);
+    void SetVolume(gint volume);
 
     /**
      * Gets volume.
@@ -60,30 +57,28 @@
 
     /**
      * From MDevSoundObserver.
-     * Indication from devsound that stream (Downlink) has been activated
+     * Indication from the devsound that Downlink has been activated
      * successfully.
      */
     void BufferToBeFilled(CMMFBuffer* /*aBuffer*/);
 
     /**
      * From MDevSoundObserver.
-     * Indication from devsound that activation of stream( Downlink)
-     * failed.
+     * Indication from devsound that Downlink activation has failed.
      */
     void PlayError(TInt aErrorCode);
 
 private:
 
     /**
-     * From CSPDevSound.
+     * From TMSCSDevSound.
      * Tries to activate the mic stream.
      */
     void DoActivateL();
 
 protected:
 
-    TMSCSDownlink(TMSCSPDevSoundObserver& aObserver);
-
+    TMSCSDownlink(TMSCSDevSoundObserver& observer);
     void ConstructL();
     };
 
--- a/mmserv/tms/tmscallserver/inc/tmscsuplink.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/inc/tmscsuplink.h	Thu Jul 15 19:13:36 2010 +0300
@@ -24,14 +24,14 @@
 namespace TMS {
 
 /**
- *  Provides uplink functionality.
+ *  Provides Uplink stream functionality.
  *
  */
-NONSHARABLE_CLASS(TMSCSUplink) : public TMSCSPDevSound
+NONSHARABLE_CLASS(TMSCSUplink) : public TMSCSDevSound
     {
 public:
 
-    static TMSCSUplink* NewL(TMSCSPDevSoundObserver& aObserver);
+    static TMSCSUplink* NewL(TMSCSDevSoundObserver& observer);
 
     virtual ~TMSCSUplink();
 
@@ -40,22 +40,12 @@
      *
      * @return ETrue - mic is muted, EFalse - mic is not muted.
      */
-    TBool IsMuted();
-
-    /**
-     * Set mic muted.
-     */
-    void SetMuted();
-
-    /**
-     * Set mic unmuted.
-     */
-    void SetUnmuted();
+    gboolean IsMuted();
 
     /**
      * Set mic gain.
      */
-    void SetGain(gint aGain);
+    void SetGain(gint gain);
 
     /**
      * Get mic muted.
@@ -70,32 +60,29 @@
     // from base class MDevSoundObserver
 
     /**
-     * From MDevSoundObserver
-     * Notification from Devsound that stream (mic) is
-     * activated successfully.
+     * From MDevSoundObserver.
+     * Indication from the devsound that Uplink has been activated
+     * successfully.
      */
     void BufferToBeEmptied(CMMFBuffer* aBuffer);
 
     /**
      * From MDevSoundObserver
-     * Notification from devsound that downstream(mic) activation
-     * feiled.
+     * Indication from devsound that Uplink activation has failed.
      */
     void RecordError(TInt aError);
 
 private:
 
-    // from base class MCSPDevSound
-
     /**
-     * From MCSPDevSound.
+     * From TMSCSDevSound.
      * Tries to activate the mic stream.
      */
     void DoActivateL();
 
 protected:
 
-    TMSCSUplink(TMSCSPDevSoundObserver& aObserver);
+    TMSCSUplink(TMSCSDevSoundObserver& aObserver);
     void ConstructL();
     };
 
--- a/mmserv/tms/tmscallserver/inc/tmsipcallstream.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/inc/tmsipcallstream.h	Thu Jul 15 19:13:36 2010 +0300
@@ -56,6 +56,19 @@
 
 namespace TMS {
 
+/**
+ *  TMSIPDevSoundObserver
+  * An observer interface providing TMSIPCallStreamBase event notifications.
+ */
+class TMSIPDevSoundObserver
+    {
+public:
+    virtual void DownlinkInitCompleted(gint status) = 0;
+    virtual void UplinkInitCompleted(gint status) = 0;
+    virtual void UplinkStarted(gint status) = 0;
+    virtual void DownlinkStarted(gint status) = 0;
+    };
+
 // -----------------------------------------------------------------------------
 //  Class Name:  TMSIPCallStreamBase
 //
@@ -91,6 +104,8 @@
     gint ConfigureMedia(const guint32 aCodecID);
 
 protected:
+    TMSIPCallStreamBase(TMSIPDevSoundObserver& observer);
+
 #ifndef __USE_GSTREAMER__
     // From MDevSoundObserver
     virtual void InitializeComplete(TInt aError) = 0;
@@ -105,7 +120,7 @@
 #endif //__USE_GSTREAMER__
 
 protected:
-
+    TMSIPDevSoundObserver& iObserver;
     CActiveScheduler* iActiveScheduler;
     TStreamState iStatus;
 
@@ -145,11 +160,9 @@
     static void cb_raw_playback_handoff(GstElement* appsrc, guint size);
     static gboolean bus_call(GstBus* bus, GstMessage* msg, gpointer data);
 #endif //__USE_GSTREAMER__
-    static TMSIPDownlink* NewL(const guint32 codecID,
-            const TMMFPrioritySettings priority);
-    TMSIPDownlink();
-    void ConstructL(const guint32 codecID,
-            const TMMFPrioritySettings priority);
+
+    static TMSIPDownlink* NewL(TMSIPDevSoundObserver& observer,
+            const guint32 codecID, const TMMFPrioritySettings priority);
 
     gint SetCodecCi();
     void Start();
@@ -178,6 +191,11 @@
     void SetAudioDeviceL(TMSAudioOutput output);
     void GetAudioDeviceL(TMSAudioOutput& output);
 
+protected:
+    TMSIPDownlink(TMSIPDevSoundObserver& observer);
+    void ConstructL(const guint32 codecID,
+            const TMMFPrioritySettings priority);
+
 private:
     void SetCodecCiL();
 
@@ -214,9 +232,6 @@
     GstElement* iSink;
     GstBus* iBusPlay;
 #endif //__USE_GSTREAMER__
-#ifdef _DEBUG
-    gint iSamplesPlayedCount;
-#endif
 
 #ifdef __PLAY_WAV_FROM_FILE__
     RFile iFile;
@@ -242,11 +257,9 @@
     static void cb_record_raw_handoff(GstElement *sink);
     static gboolean bus_call(GstBus* bus, GstMessage* msg, gpointer data);
 #endif //__USE_GSTREAMER__
-    static TMSIPUplink* NewL(const guint32 codecID,
-            const TMMFPrioritySettings priority);
-    TMSIPUplink();
-    void ConstructL(const guint32 codecID,
-            const TMMFPrioritySettings priority);
+
+    static TMSIPUplink* NewL(TMSIPDevSoundObserver& observer,
+            const guint32 codecID, const TMMFPrioritySettings priority);
 
     gint SetCodecCi();
     void Start();
@@ -268,6 +281,11 @@
     gint SetVad(const TMSFormatType fmttype, const gboolean vad);
     gint GetVad(const TMSFormatType fmttype, gboolean& vad);
 
+protected:
+    TMSIPUplink(TMSIPDevSoundObserver& observer);
+    void ConstructL(const guint32 codecID,
+            const TMMFPrioritySettings priority);
+
 private:
     void SetCodecCiL();
 
@@ -300,9 +318,6 @@
     GstElement* iAppSink;
     GstBus* iBusRec;
 #endif //__USE_GSTREAMER__
-#ifdef _DEBUG
-    gint iSamplesRecCount;
-#endif
     };
 
 } //namespace TMS
--- a/mmserv/tms/tmscallserver/src/tmscalladpt.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/src/tmscalladpt.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -73,7 +73,7 @@
 
         case TMS_CALL_CS:
             retVal = TMS_RESULT_INSUFFICIENT_MEMORY;
-            self = new TMSCallCSAdpt();
+            self = TMSCallCSAdpt::NewL();
             if (self)
                 {
                 retVal = self->PostConstruct();
@@ -93,14 +93,4 @@
     return retVal;
     }
 
-// -----------------------------------------------------------------------------
-// TMSCallAdpt::PostConstruct
-//
-// -----------------------------------------------------------------------------
-//
-gint TMSCallAdpt::PostConstruct()
-    {
-    return TMS_RESULT_SUCCESS;
-    }
-
 // End of file
--- a/mmserv/tms/tmscallserver/src/tmscallcsadpt.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/src/tmscallcsadpt.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -30,20 +30,41 @@
 using namespace TMS;
 
 // -----------------------------------------------------------------------------
+// TMSCallCSAdpt::NewL
+// Symbian constructor.
+// -----------------------------------------------------------------------------
+//
+TMSCallCSAdpt* TMSCallCSAdpt::NewL()
+    {
+    TMSCallCSAdpt* self = new (ELeave) TMSCallCSAdpt();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCallCSAdpt::ConstructL
+// 2-nd phase constructor.
+// -----------------------------------------------------------------------------
+//
+void TMSCallCSAdpt::ConstructL()
+    {
+    TRACE_PRN_FN_ENT;
+    iCSDownlink = NULL;
+    iCSUplink = NULL;
+    iRouting = NULL;
+    iTarSettings = NULL;
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
 // TMSCallCSAdpt::TMSCallCSAdpt
 //
 // -----------------------------------------------------------------------------
 //
 TMSCallCSAdpt::TMSCallCSAdpt()
     {
-    TRACE_PRN_FN_ENT;
-
-    iCSDownlink = NULL;
-    iCSUplink = NULL;
-    iRouting = NULL;
-    iTarSettings = NULL;
-
-    TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
@@ -54,16 +75,16 @@
 TMSCallCSAdpt::~TMSCallCSAdpt()
     {
     TRACE_PRN_FN_ENT;
-    delete iCSDownlink;
-    delete iCSUplink;
+
     delete iRouting;
     delete iTarSettings;
+    delete iCSUplink;
+    delete iCSDownlink;
 
     if (iMsgQueueUp.Handle() > 0)
         {
         iMsgQueueUp.Close();
         }
-
     if (iMsgQueueDn.Handle() > 0)
         {
         iMsgQueueDn.Close();
@@ -84,7 +105,6 @@
     iNextStreamId = 1;
     iUplinkInitialized = FALSE;
     iDnlinkInitialized = FALSE;
-
     TRACE_PRN_FN_EXT;
     return status;
     }
@@ -94,40 +114,44 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallCSAdpt::CreateStream(TMSCallType /*callType*/,
-        TMSStreamType strmType, gint& outStrmId)
+gint TMSCallCSAdpt::CreateStream(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, gint& outStrmId)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_SUCCESS);
     switch (strmType)
         {
         case TMS_STREAM_UPLINK:
+            {
             status = TMS_RESULT_ALREADY_EXIST;
             if (!iUplinkInitialized)
                 {
-                iUplinkInitialized = TRUE;
                 iUplinkStreamId = iNextStreamId;
                 outStrmId = iUplinkStreamId;
                 iNextStreamId++;
-                iUplinkInitialized = TRUE;
+                //iUplinkInitialized = TRUE; //not initialized yet!
                 status = TMS_RESULT_SUCCESS;
                 }
             break;
+            }
         case TMS_STREAM_DOWNLINK:
+            {
             status = TMS_RESULT_ALREADY_EXIST;
             if (!iDnlinkInitialized)
                 {
-                iDnlinkInitialized = TRUE;
                 iDnlinkStreamId = iNextStreamId;
                 outStrmId = iDnlinkStreamId;
                 iNextStreamId++;
-                iDnlinkInitialized = TRUE;
+                //iDnlinkInitialized = TRUE; //not initialized yet!
                 status = TMS_RESULT_SUCCESS;
                 }
             break;
+            }
         default:
+            {
             status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED;
             break;
+            }
         }
     TRACE_PRN_FN_EXT;
     return status;
@@ -138,8 +162,9 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallCSAdpt::InitStream(TMSCallType /*callType*/, TMSStreamType strmType,
-        gint strmId, TMSFormatType /*frmtType*/, const RMessage2& message)
+gint TMSCallCSAdpt::InitStream(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, const gint strmId,
+        const TMSFormatType /*frmtType*/, const RMessage2& message)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_SUCCESS);
@@ -148,6 +173,7 @@
         {
         case TMS_STREAM_UPLINK:
             {
+            status = TMS_RESULT_DOES_NOT_EXIST;
             if (strmId == iUplinkStreamId)
                 {
                 // Open message queue handling client-server communication
@@ -158,18 +184,14 @@
                     }
                 if (status == TMS_RESULT_SUCCESS)
                     {
-                    TRAP(status, iCSUplink = TMSCSUplink::NewL(*this));
+                    status = InitUplink();
                     }
-                iStrmtype = TMS_STREAM_UPLINK;
-                }
-            else
-                {
-                status = TMS_RESULT_DOES_NOT_EXIST;
                 }
             break;
             }
         case TMS_STREAM_DOWNLINK:
             {
+            status = TMS_RESULT_DOES_NOT_EXIST;
             if (strmId == iDnlinkStreamId)
                 {
                 // Open message queue handling client-server communication
@@ -180,22 +202,8 @@
                     }
                 if (status == TMS_RESULT_SUCCESS)
                     {
-                    TRAP(status, iCSDownlink = TMSCSDownlink::NewL(*this));
-                    if (status == TMS_RESULT_SUCCESS)
-                        {
-                        TRAP(status, iRouting =
-                                CTelephonyAudioRouting::NewL(*this));
-                        if (status == TMS_RESULT_SUCCESS)
-                            {
-                            TRAP(status, iTarSettings = TMSTarSettings::NewL());
-                            }
-                        }
+                    status = InitDownlink();
                     }
-                iStrmtype = TMS_STREAM_DOWNLINK;
-                }
-            else
-                {
-                status = TMS_RESULT_DOES_NOT_EXIST;
                 }
             break;
             }
@@ -212,32 +220,79 @@
     }
 
 // -----------------------------------------------------------------------------
+// TMSCallCSAdpt::InitUplink
+//
+// -----------------------------------------------------------------------------
+//
+gint TMSCallCSAdpt::InitUplink()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+    if (!iCSUplink)
+        {
+        TRAP(status, iCSUplink = TMSCSUplink::NewL(*this));
+        }
+    return status;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCallCSAdpt::InitDownlink
+//
+// -----------------------------------------------------------------------------
+//
+gint TMSCallCSAdpt::InitDownlink()
+    {
+    gint status(TMS_RESULT_SUCCESS);
+
+    if (!iCSDownlink)
+        {
+        TRAP(status, iCSDownlink = TMSCSDownlink::NewL(*this));
+        }
+    if (!iRouting && status == TMS_RESULT_SUCCESS)
+        {
+        TRAP(status, iRouting = CTelephonyAudioRouting::NewL(*this));
+        }
+    if (!iTarSettings && status == TMS_RESULT_SUCCESS)
+        {
+        TRAP(status, iTarSettings = TMSTarSettings::NewL());
+        }
+    return status;
+    }
+
+// -----------------------------------------------------------------------------
 // TMSCallCSAdpt::StartStream
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallCSAdpt::StartStream(TMSCallType /*callType*/,
-        TMSStreamType strmType, gint strmId)
+gint TMSCallCSAdpt::StartStream(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, const gint strmId)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_SUCCESS);
+    gint status(TMS_RESULT_INVALID_STATE);
     switch (strmType)
         {
         case TMS_STREAM_UPLINK:
+            {
             if (iCSUplink && strmId == iUplinkStreamId)
                 {
                 iCSUplink->Activate();
+                status = TMS_RESULT_SUCCESS;
                 }
             break;
+            }
         case TMS_STREAM_DOWNLINK:
+            {
             if (iCSDownlink && strmId == iDnlinkStreamId)
                 {
                 iCSDownlink->Activate();
+                status = TMS_RESULT_SUCCESS;
                 }
             break;
+            }
         default:
+            {
             status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED;
             break;
+            }
         }
     TRACE_PRN_FN_EXT;
     return status;
@@ -248,11 +303,11 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallCSAdpt::PauseStream(TMSCallType /*callType*/,
-        TMSStreamType /*strmType*/, gint /*strmId*/)
+gint TMSCallCSAdpt::PauseStream(const TMSCallType /*callType*/,
+        const TMSStreamType /*strmType*/, const gint /*strmId*/)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_SUCCESS);
+    gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED);
     TRACE_PRN_FN_EXT;
     return status;
     }
@@ -262,32 +317,39 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallCSAdpt::StopStream(TMSCallType /*callType*/, TMSStreamType strmType,
-        gint strmId)
+gint TMSCallCSAdpt::StopStream(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, const gint strmId)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_SUCCESS);
+    gint status(TMS_RESULT_INVALID_STATE);
+
     switch (strmType)
         {
         case TMS_STREAM_UPLINK:
+            {
             if (iCSUplink && strmId == iUplinkStreamId)
                 {
                 iCSUplink->Deactivate();
-                NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete,
-                        status, 0);
+                status = TMS_RESULT_SUCCESS;
+                NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status);
                 }
             break;
+            }
         case TMS_STREAM_DOWNLINK:
+            {
             if (iCSDownlink && strmId == iDnlinkStreamId)
                 {
                 iCSDownlink->Deactivate();
-                NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete,
-                        status, 0);
+                status = TMS_RESULT_SUCCESS;
+                NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status);
                 }
             break;
+            }
         default:
+            {
             status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED;
             break;
+            }
         }
     TRACE_PRN_FN_EXT;
     return status;
@@ -298,20 +360,22 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallCSAdpt::DeinitStream(TMSCallType /*callType*/,
-        TMSStreamType strmType, gint strmId)
+gint TMSCallCSAdpt::DeinitStream(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, const gint strmId)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_SUCCESS);
+    gint status(TMS_RESULT_INVALID_STATE);
+
     switch (strmType)
         {
         case TMS_STREAM_UPLINK:
+            {
             if (iCSUplink && strmId == iUplinkStreamId)
                 {
                 iCSUplink->Deactivate();
                 iUplinkInitialized = FALSE;
-                NotifyClient(iUplinkStreamId, ECmdUplinkDeInitComplete,
-                        status, 0);
+                status = TMS_RESULT_SUCCESS;
+                NotifyClient(iUplinkStreamId, ECmdUplinkDeInitComplete, status);
                 }
             break;
         case TMS_STREAM_DOWNLINK:
@@ -319,13 +383,17 @@
                 {
                 iCSDownlink->Deactivate();
                 iDnlinkInitialized = FALSE;
+                status = TMS_RESULT_SUCCESS;
                 NotifyClient(iDnlinkStreamId, ECmdDownlinkDeInitComplete,
-                        status, 0);
+                        status);
                 }
             break;
+            }
         default:
+            {
             status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED;
             break;
+            }
         }
     TRACE_PRN_FN_EXT;
     return status;
@@ -336,30 +404,36 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallCSAdpt::DeleteStream(TMSCallType /*callType*/,
-        TMSStreamType strmType, gint strmId)
+gint TMSCallCSAdpt::DeleteStream(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, const gint strmId)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_SUCCESS);
     switch (strmType)
         {
         case TMS_STREAM_UPLINK:
+            {
             if (strmId == iUplinkStreamId)
                 {
                 iUplinkStreamId = -1;
                 iUplinkInitialized = FALSE;
                 }
             break;
+            }
         case TMS_STREAM_DOWNLINK:
+            {
             if (strmId == iDnlinkStreamId)
                 {
                 iDnlinkStreamId = -1;
                 iDnlinkInitialized = FALSE;
                 }
             break;
+            }
         default:
+            {
             status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED;
             break;
+            }
         }
     TRACE_PRN_FN_EXT;
     return status;
@@ -370,8 +444,8 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallCSAdpt::DataXferBufferEmptied(TMSCallType /*callType*/,
-        TMSStreamType /*strmType*/, gint /*strmId*/)
+gint TMSCallCSAdpt::DataXferBufferEmptied(const TMSCallType /*callType*/,
+        const TMSStreamType /*strmType*/, const gint /*strmId*/)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED);
@@ -384,8 +458,9 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallCSAdpt::DataXferBufferFilled(TMSCallType /*callType*/,
-        TMSStreamType /*strmType*/, gint /*strmId*/, guint /*datasize*/)
+gint TMSCallCSAdpt::DataXferBufferFilled(const TMSCallType /*callType*/,
+        const TMSStreamType /*strmType*/, const gint /*strmId*/,
+        const guint /*datasize*/)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED);
@@ -416,11 +491,12 @@
 gint TMSCallCSAdpt::GetMaxVolume(guint& volume)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_ILLEGAL_OPERATION);
+    gint status(TMS_RESULT_INVALID_STATE);
     if (iCSDownlink && iDnlinkInitialized)
         {
         volume = iCSDownlink->MaxVolume();
         status = TMS_RESULT_SUCCESS;
+        TRACE_PRN_N1(_L("TMS->TMSCallCSAdpt: GetMaxVolume [%d]"), volume);
         }
     TRACE_PRN_FN_EXT;
     return status;
@@ -434,12 +510,12 @@
 gint TMSCallCSAdpt::SetVolume(const guint volume)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_ILLEGAL_OPERATION);
+    gint status(TMS_RESULT_INVALID_STATE);
     if (iCSDownlink && iDnlinkInitialized)
         {
         iCSDownlink->SetVolume(volume);
         status = TMS_RESULT_SUCCESS;
-        NotifyClient(iDnlinkStreamId, ECmdSetVolume, status, 0);
+        NotifyClient(iDnlinkStreamId, ECmdSetVolume, status);
         }
     TRACE_PRN_FN_EXT;
     return status;
@@ -453,13 +529,12 @@
 gint TMSCallCSAdpt::GetVolume(guint& volume)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_ILLEGAL_OPERATION);
+    gint status(TMS_RESULT_INVALID_STATE);
     if (iCSDownlink && iDnlinkInitialized)
         {
         volume = iCSDownlink->Volume();
         status = TMS_RESULT_SUCCESS;
         }
-
     TRACE_PRN_FN_EXT;
     return status;
     }
@@ -472,11 +547,12 @@
 gint TMSCallCSAdpt::GetMaxGain(guint& gain)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_ILLEGAL_OPERATION);
+    gint status(TMS_RESULT_INVALID_STATE);
     if (iCSUplink && iUplinkInitialized)
         {
         gain = iCSUplink->MaxGain();
         status = TMS_RESULT_SUCCESS;
+        TRACE_PRN_N1(_L("TMS->TMSCallCSAdpt::GetMaxGain [%d]"), gain);
         }
     TRACE_PRN_FN_EXT;
     return status;
@@ -490,12 +566,12 @@
 gint TMSCallCSAdpt::SetGain(const guint gain)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_ILLEGAL_OPERATION);
-    if (iUplinkInitialized)
+    gint status(TMS_RESULT_INVALID_STATE);
+    if (iCSUplink && iUplinkInitialized)
         {
         iCSUplink->SetGain(gain);
         status = TMS_RESULT_SUCCESS;
-        NotifyClient(iUplinkInitialized, ECmdSetGain, status, 0);
+        NotifyClient(iUplinkStreamId, ECmdSetGain, status);
         }
     TRACE_PRN_FN_EXT;
     return status;
@@ -509,7 +585,7 @@
 gint TMSCallCSAdpt::GetGain(guint& gain)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_ILLEGAL_OPERATION);
+    gint status(TMS_RESULT_INVALID_STATE);
     if (iCSUplink && iUplinkInitialized)
         {
         gain = iCSUplink->Gain();
@@ -527,11 +603,12 @@
 gint TMSCallCSAdpt::GetGlobalMaxVolume(guint& volume)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_ILLEGAL_OPERATION);
+    gint status(TMS_RESULT_INVALID_STATE);
     if (iCSDownlink && iDnlinkInitialized)
         {
         volume = iCSDownlink->MaxVolume();
         status = TMS_RESULT_SUCCESS;
+        TRACE_PRN_N1(_L("TMS->TMSCallCSAdpt::GetGlobalMaxVolume [%d]"), volume);
         }
     TRACE_PRN_FN_EXT;
     return status;
@@ -545,8 +622,7 @@
 gint TMSCallCSAdpt::SetGlobalVolume(const guint volume)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_SUCCESS);
-
+    gint status(TMS_RESULT_INVALID_STATE);
     iGlobalVol = volume;
     if (iCSDownlink && iDnlinkInitialized)
         {
@@ -565,13 +641,12 @@
 gint TMSCallCSAdpt::GetGlobalVolume(guint& volume)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_ILLEGAL_OPERATION);
+    gint status(TMS_RESULT_INVALID_STATE);
     if (iCSDownlink && iDnlinkInitialized)
         {
         volume = iCSDownlink->Volume();
         status = TMS_RESULT_SUCCESS;
         }
-
     TRACE_PRN_FN_EXT;
     return status;
     }
@@ -584,11 +659,12 @@
 gint TMSCallCSAdpt::GetGlobalMaxGain(guint& gain)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_ILLEGAL_OPERATION);
+    gint status(TMS_RESULT_INVALID_STATE);
     if (iCSUplink && iUplinkInitialized)
         {
         gain = iCSUplink->MaxGain();
         status = TMS_RESULT_SUCCESS;
+        TRACE_PRN_N1(_L("TMS->TMSCallCSAdpt::GetGlobalMaxGain [%d]"), gain);
         }
     TRACE_PRN_FN_EXT;
     return status;
@@ -602,8 +678,7 @@
 gint TMSCallCSAdpt::SetGlobalGain(const guint gain)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_SUCCESS);
-
+    gint status(TMS_RESULT_INVALID_STATE);
     iGlobalGain = gain;
     if (iCSUplink && iUplinkInitialized)
         {
@@ -622,7 +697,7 @@
 gint TMSCallCSAdpt::GetGlobalGain(guint& gain)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_ILLEGAL_OPERATION);
+    gint status(TMS_RESULT_INVALID_STATE);
     if (iCSUplink && iUplinkInitialized)
         {
         gain = iCSUplink->Gain();
@@ -634,7 +709,7 @@
 
 // -----------------------------------------------------------------------------
 // TMSCallCSAdpt::GetCodecMode
-//
+// No codec format in CS call
 // -----------------------------------------------------------------------------
 //
 gint TMSCallCSAdpt::GetCodecMode(const TMSFormatType /*fmttype*/,
@@ -648,7 +723,7 @@
 
 // -----------------------------------------------------------------------------
 // TMSCallCSAdpt::SetCodecMode
-//
+// No codec format in CS call
 // -----------------------------------------------------------------------------
 //
 gint TMSCallCSAdpt::SetCodecMode(const TMSFormatType /*fmttype*/,
@@ -662,7 +737,7 @@
 
 // -----------------------------------------------------------------------------
 // TMSCallCSAdpt::GetSupportedBitRatesCount
-//
+// No codec format in CS call
 // -----------------------------------------------------------------------------
 //
 gint TMSCallCSAdpt::GetSupportedBitRatesCount(guint& /*count*/)
@@ -678,26 +753,15 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallCSAdpt::GetSupportedBitRates(CBufFlat*& brbuffer)
+gint TMSCallCSAdpt::GetSupportedBitRates(CBufFlat*& /*brbuffer*/)
     {
     TRACE_PRN_FN_ENT;
-    TRAPD(status, GetSupportedBitRatesL(brbuffer));
+    gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED);
     TRACE_PRN_FN_EXT;
     return status;
     }
 
 // -----------------------------------------------------------------------------
-// TMSCallCSAdpt::GetSupportedBitRatesL
-//
-// GetSupportedBitRates implementation which can leave.
-// -----------------------------------------------------------------------------
-//
-void TMSCallCSAdpt::GetSupportedBitRatesL(CBufFlat*& /*brbuffer*/)
-    {
-    User::Leave(TMS_RESULT_FEATURE_NOT_SUPPORTED);
-    }
-
-// -----------------------------------------------------------------------------
 // TMSCallCSAdpt::GetBitRate
 //
 // -----------------------------------------------------------------------------
@@ -741,7 +805,8 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallCSAdpt::SetVAD(const TMSFormatType /*fmttype*/, const gboolean /*vad*/)
+gint TMSCallCSAdpt::SetVAD(const TMSFormatType /*fmttype*/,
+        const gboolean /*vad*/)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_FEATURE_NOT_SUPPORTED);
@@ -808,7 +873,7 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallCSAdpt::SetOutput(TMSAudioOutput output)
+gint TMSCallCSAdpt::SetOutput(const TMSAudioOutput output)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
@@ -879,7 +944,7 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallCSAdpt::GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuffer)
+gint TMSCallCSAdpt::GetAvailableOutputsL(gint& count, CBufFlat*& outputsbuf)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
@@ -888,11 +953,11 @@
     if (iRouting)
         {
         RBufWriteStream stream;
-        stream.Open(*outputsbuffer);
+        stream.Open(*outputsbuf);
         CleanupClosePushL(stream);
 
-        TArray<CTelephonyAudioRouting::TAudioOutput> availableOutputs =
-                iRouting->AvailableOutputs();
+        TArray<CTelephonyAudioRouting::TAudioOutput>
+                availableOutputs = iRouting->AvailableOutputs();
 
         guint numOfItems = availableOutputs.Count();
         count = numOfItems;
@@ -915,74 +980,57 @@
 
 // -----------------------------------------------------------------------------
 // TMSCallCSAdpt::DownlinkInitCompleted
-//
+// From TMSCSDevSoundObserver
 // -----------------------------------------------------------------------------
 //
 void TMSCallCSAdpt::DownlinkInitCompleted(gint status)
     {
     TRACE_PRN_FN_ENT;
-    NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status, 0);
+    if (status == TMS_RESULT_SUCCESS)
+        {
+        iDnlinkInitialized = TRUE;
+        }
+    NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status);
     TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
 // TMSCallCSAdpt::UplinkInitCompleted
-//
+// From TMSCSDevSoundObserver
 // -----------------------------------------------------------------------------
 //
 void TMSCallCSAdpt::UplinkInitCompleted(gint status)
     {
     TRACE_PRN_FN_ENT;
-    NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status, 0);
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSCallCSAdpt::UplinkActivatedSuccessfully
-//
-// -----------------------------------------------------------------------------
-//
-void TMSCallCSAdpt::UplinkActivatedSuccessfully()
-    {
-    TRACE_PRN_FN_ENT;
-    NotifyClient(iUplinkStreamId, ECmdUplinkStarted, KErrNone, 0);
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSCallCSAdpt::DownlinkActivatedSuccessfully
-//
-// -----------------------------------------------------------------------------
-//
-void TMSCallCSAdpt::DownlinkActivatedSuccessfully()
-    {
-    TRACE_PRN_FN_ENT;
-    NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, KErrNone, 0);
+    if (status == TMS_RESULT_SUCCESS)
+        {
+        iUplinkInitialized = TRUE;
+        }
+    NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status);
     TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
 // TMSCallCSAdpt::UplinkActivationFailed
-//
+// From TMSCSDevSoundObserver
 // -----------------------------------------------------------------------------
 //
-void TMSCallCSAdpt::UplinkActivationFailed()
+void TMSCallCSAdpt::UplinkActivationCompleted(gint status)
     {
     TRACE_PRN_FN_ENT;
-    NotifyClient(iUplinkStreamId, ECmdUplinkStarted, TMS_RESULT_FATAL_ERROR, 0);
+    NotifyClient(iUplinkStreamId, ECmdUplinkStarted, status);
     TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
 // TMSCallCSAdpt::DownlinkActivationFailed
-//
+// From TMSCSDevSoundObserver
 // -----------------------------------------------------------------------------
 //
-void TMSCallCSAdpt::DownlinkActivationFailed()
+void TMSCallCSAdpt::DownlinkActivationCompleted(gint status)
     {
     TRACE_PRN_FN_ENT;
-    NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted,
-            TMS_RESULT_FATAL_ERROR, 0);
+    NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, status);
     TRACE_PRN_FN_EXT;
     }
 
@@ -1023,7 +1071,7 @@
 // -----------------------------------------------------------------------------
 //
 void TMSCallCSAdpt::SetOutputComplete(
-        CTelephonyAudioRouting& aTelephonyAudioRouting, gint /*aError*/)
+        CTelephonyAudioRouting& aTelephonyAudioRouting, gint /*status*/)
     {
     TRACE_PRN_FN_ENT;
     TRoutingMsgBufPckg pckg;
--- a/mmserv/tms/tmscallserver/src/tmscallipadpt.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/src/tmscallipadpt.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -19,7 +19,6 @@
 #include "tmsutility.h"
 #include "tmsclientserver.h"
 #include "tmsshared.h"
-#include "tmsipcallstream.h"
 #include "tmscallipadpt.h"
 
 using namespace TMS;
@@ -46,8 +45,8 @@
 void TMSCallIPAdpt::ConstructL()
     {
     TRACE_PRN_FN_ENT;
+    iIPDownlink = NULL;
     iIPUplink = NULL;
-    iIPDownlink = NULL;
     TRACE_PRN_FN_EXT;
     }
 
@@ -72,7 +71,6 @@
     iCodecs.Reset();
     iCodecs.Close();
     iArrBitrates.Reset();
-
     delete iIPUplink;
     delete iIPDownlink;
 
@@ -109,8 +107,8 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallIPAdpt::CreateStream(TMSCallType /*callType*/,
-        TMSStreamType strmType, gint& outStrmId)
+gint TMSCallIPAdpt::CreateStream(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, gint& outStrmId)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_SUCCESS);
@@ -121,10 +119,10 @@
             status = TMS_RESULT_ALREADY_EXIST;
             if (!iUplinkInitialized)
                 {
-                iUplinkInitialized = TRUE;
                 iUplinkStreamId = iNextStreamId;
                 outStrmId = iUplinkStreamId;
                 iNextStreamId++;
+                //iUplinkInitialized = TRUE; //not initialized yet!
                 status = TMS_RESULT_SUCCESS;
                 }
             break;
@@ -134,10 +132,10 @@
             status = TMS_RESULT_ALREADY_EXIST;
             if (!iDnlinkInitialized)
                 {
-                iDnlinkInitialized = TRUE;
                 iDnlinkStreamId = iNextStreamId;
                 outStrmId = iDnlinkStreamId;
                 iNextStreamId++;
+                //iDnlinkInitialized = TRUE; //not initialized yet!
                 status = TMS_RESULT_SUCCESS;
                 }
             break;
@@ -157,12 +155,12 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallIPAdpt::InitStream(TMSCallType /*callType*/, TMSStreamType strmType,
-        gint strmId, TMSFormatType frmtType, const RMessage2& message)
+gint TMSCallIPAdpt::InitStream(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, const gint strmId,
+        const TMSFormatType frmtType, const RMessage2& message)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_SUCCESS);
-
     guint32 fourCC = TOFOURCC(frmtType);
     if (fourCC == NULL)
         {
@@ -177,8 +175,7 @@
             if (strmId == iUplinkStreamId)
                 {
                 SetFormat(iUplinkStreamId, fourCC);
-                status = OpenUplinkL(message);
-                NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status);
+                status = OpenUplink(message);
                 }
             break;
             }
@@ -188,8 +185,7 @@
             if (strmId == iDnlinkStreamId)
                 {
                 SetFormat(iDnlinkStreamId, fourCC);
-                status = OpenDownlinkL(message);
-                NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status);
+                status = OpenDownlink(message);
                 }
             break;
             }
@@ -210,8 +206,8 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallIPAdpt::StartStream(TMSCallType /*callType*/,
-        TMSStreamType strmType, gint strmId)
+gint TMSCallIPAdpt::StartStream(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, const gint strmId)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
@@ -219,7 +215,7 @@
         {
         case TMS_STREAM_UPLINK:
             {
-            if (strmId == iUplinkStreamId && iIPUplink)
+            if (iIPUplink && strmId == iUplinkStreamId)
                 {
                 iIPUplink->Start();
                 status = TMS_RESULT_SUCCESS;
@@ -229,7 +225,7 @@
             }
         case TMS_STREAM_DOWNLINK:
             {
-            if (strmId == iDnlinkStreamId && iIPDownlink)
+            if (iIPDownlink && strmId == iDnlinkStreamId)
                 {
                 iIPDownlink->Start();
                 status = TMS_RESULT_SUCCESS;
@@ -252,8 +248,8 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallIPAdpt::PauseStream(TMSCallType /*callType*/,
-        TMSStreamType strmType, gint strmId)
+gint TMSCallIPAdpt::PauseStream(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, const gint strmId)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
@@ -294,8 +290,8 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallIPAdpt::StopStream(TMSCallType /*callType*/, TMSStreamType strmType,
-        gint strmId)
+gint TMSCallIPAdpt::StopStream(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, const gint strmId)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
@@ -304,7 +300,7 @@
         {
         case TMS_STREAM_UPLINK:
             {
-            if (strmId == iUplinkStreamId && iIPUplink)
+            if (iIPUplink && strmId == iUplinkStreamId)
                 {
                 iIPUplink->Stop();
                 status = TMS_RESULT_SUCCESS;
@@ -314,7 +310,7 @@
             }
         case TMS_STREAM_DOWNLINK:
             {
-            if (strmId == iDnlinkStreamId && iIPDownlink)
+            if (iIPDownlink && strmId == iDnlinkStreamId)
                 {
                 iIPDownlink->Stop();
                 status = TMS_RESULT_SUCCESS;
@@ -337,8 +333,8 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallIPAdpt::DeinitStream(TMSCallType /*callType*/,
-        TMSStreamType strmType, gint strmId)
+gint TMSCallIPAdpt::DeinitStream(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, const gint strmId)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
@@ -347,20 +343,19 @@
         {
         case TMS_STREAM_UPLINK:
             {
-            if (strmId == iUplinkStreamId && iIPUplink)
+            if (iIPUplink && strmId == iUplinkStreamId)
                 {
                 iIPUplink->Stop();
                 //iUplinkStreamId = -1;
                 iUplinkInitialized = FALSE;
                 status = TMS_RESULT_SUCCESS;
-                NotifyClient(iUplinkStreamId, ECmdDownlinkDeInitComplete,
-                        status);
+                NotifyClient(iUplinkStreamId, ECmdUplinkDeInitComplete, status);
                 }
             break;
             }
         case TMS_STREAM_DOWNLINK:
             {
-            if (strmId == iDnlinkStreamId && iIPDownlink)
+            if (iIPDownlink && strmId == iDnlinkStreamId)
                 {
                 iIPDownlink->Stop();
                 //iDnlinkStreamId = -1;
@@ -387,8 +382,8 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallIPAdpt::DeleteStream(TMSCallType /*callType*/,
-        TMSStreamType strmType, gint strmId)
+gint TMSCallIPAdpt::DeleteStream(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, const gint strmId)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_SUCCESS);
@@ -396,7 +391,6 @@
         {
         case TMS_STREAM_UPLINK:
             {
-            // This is additional error checking
             if (strmId == iUplinkStreamId)
                 {
                 iUplinkStreamId = -1;
@@ -406,7 +400,6 @@
             }
         case TMS_STREAM_DOWNLINK:
             {
-            // This is additional error checking
             if (strmId == iDnlinkStreamId)
                 {
                 iDnlinkStreamId = -1;
@@ -429,8 +422,8 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallIPAdpt::DataXferBufferEmptied(TMSCallType /*callType*/,
-        TMSStreamType strmType, gint strmId)
+gint TMSCallIPAdpt::DataXferBufferEmptied(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, const gint strmId)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_SUCCESS);
@@ -460,8 +453,8 @@
 //
 // -----------------------------------------------------------------------------
 //
-gint TMSCallIPAdpt::DataXferBufferFilled(TMSCallType /*callType*/,
-        TMSStreamType strmType, gint strmId, guint datasize)
+gint TMSCallIPAdpt::DataXferBufferFilled(const TMSCallType /*callType*/,
+        const TMSStreamType strmType, const gint strmId, const guint datasize)
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_SUCCESS);
@@ -530,14 +523,12 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-
     if (iDnlinkInitialized && iIPDownlink)
         {
         status = iIPDownlink->GetMaxVolume(volume);
         iMaxVolume = volume;
         TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: GetMaxVolume [%d]"), iMaxVolume);
         }
-
     TRACE_PRN_FN_EXT;
     return status;
     }
@@ -644,7 +635,7 @@
         {
         status = iIPDownlink->GetMaxVolume(volume);
         iMaxVolume = volume;
-        TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: GetMaxVolume [%d]"), iMaxVolume);
+        TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetGlobalMaxVolume [%d]"), volume);
         }
     TRACE_PRN_FN_EXT;
     return status;
@@ -659,6 +650,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
+    //iGlobalVol = volume;
     if (iDnlinkInitialized && iIPDownlink)
         {
         status = iIPDownlink->SetVolume(volume);
@@ -697,7 +689,7 @@
         {
         status = iIPUplink->GetMaxGain(gain);
         iMaxGain = gain;
-        TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetMaxGain [%d]"), iMaxGain);
+        TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetGlobalMaxGain [%d]"), gain);
         }
     TRACE_PRN_FN_EXT;
     return status;
@@ -712,6 +704,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
+    //iGlobalGain = gain;
     if (iUplinkInitialized && iIPUplink)
         {
         status = iIPUplink->SetGain(gain);
@@ -982,14 +975,14 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSCallIPAdpt::OpenDownlinkL
+// TMSCallIPAdpt::OpenDownlink
 // Method for player initialization.
 // -----------------------------------------------------------------------------
 //
-gint TMSCallIPAdpt::OpenDownlinkL(const RMessage2& message)
+gint TMSCallIPAdpt::OpenDownlink(const RMessage2& message)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    gint status(TMS_RESULT_SUCCESS);
 
     // Clients must have MultimediaDD capability to use this priority/pref.
     // TODO: Also, TMS will monitor for emergency call and if detected it
@@ -1004,12 +997,12 @@
     iPriority.iPref = KAudioPrefVoipAudioDownlink;
     iPriority.iPriority = KAudioPriorityVoipAudioDownlink;
 
-    if (!iIPDownlink)
-        {
-        iIPDownlink = TMSIPDownlink::NewL(iDnFourCC, iPriority);
-        }
+    delete iIPDownlink;
+    iIPDownlink = NULL;
+    TRAP(status, iIPDownlink = TMSIPDownlink::NewL(*this, iDnFourCC,
+            iPriority));
 
-    if (iIPDownlink)
+    if (iIPDownlink && status == TMS_RESULT_SUCCESS)
         {
         // Open message queue for handling server notifications to the client
         if (iMsgQueueDn.Handle() <= 0)
@@ -1030,14 +1023,14 @@
     }
 
 // -----------------------------------------------------------------------------
-// TMSCallIPAdpt::OpenUplinkL
+// TMSCallIPAdpt::OpenUplink
 // Method for recorder initialization.
 // -----------------------------------------------------------------------------
 //
-gint TMSCallIPAdpt::OpenUplinkL(const RMessage2& message)
+gint TMSCallIPAdpt::OpenUplink(const RMessage2& message)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
+    gint status(TMS_RESULT_SUCCESS);
 
     // Clients must have MultimediaDD capability to use this priority/pref
 
@@ -1050,12 +1043,11 @@
     iPriority.iPref = KAudioPrefVoipAudioUplink;
     iPriority.iPriority = KAudioPriorityVoipAudioUplink;
 
-    if (!iIPUplink)
-        {
-        iIPUplink = TMSIPUplink::NewL(iUpFourCC, iPriority);
-        }
+    delete iIPUplink;
+    iIPUplink = NULL;
+    TRAP(status, iIPUplink = TMSIPUplink::NewL(*this, iUpFourCC, iPriority));
 
-    if (iIPUplink)
+    if (iIPUplink && status == TMS_RESULT_SUCCESS)
         {
         // Open message queue for handling server notifications to the client
         if (iMsgQueueUp.Handle() <= 0)
@@ -1070,7 +1062,6 @@
             iIPUplink->SetMsgQueue(iMsgQueueUp);
             }
         }
-
     TRACE_PRN_IF_ERR(status);
     TRACE_PRN_FN_EXT;
     return status;
@@ -1348,11 +1339,13 @@
 //
 gint TMSCallIPAdpt::SetOutput(TMSAudioOutput output)
     {
+    TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
     if (iDnlinkInitialized && iIPDownlink)
         {
         TRAP(status, iIPDownlink->SetAudioDeviceL(output));
         }
+    TRACE_PRN_FN_EXT;
     return status;
     }
 // -----------------------------------------------------------------------------
@@ -1362,13 +1355,16 @@
 //
 gint TMSCallIPAdpt::GetOutput(TMSAudioOutput& output)
     {
+    TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
     if (iDnlinkInitialized && iIPDownlink)
         {
         TRAP(status, iIPDownlink->GetAudioDeviceL(output));
         }
+    TRACE_PRN_FN_EXT;
     return status;
     }
+
 // -----------------------------------------------------------------------------
 // TMSCallIPAdpt::GetPreviousOutput
 //
@@ -1385,20 +1381,77 @@
 // -----------------------------------------------------------------------------
 //
 gint TMSCallIPAdpt::GetAvailableOutputsL(gint& /*count*/,
-        CBufFlat*& /*outputsbuffer*/)
+        CBufFlat*& /*outputsbuf*/)
     {
     return TMS_RESULT_FEATURE_NOT_SUPPORTED;
     }
 
 // -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+// TMSCallIPAdpt::DownlinkInitCompleted
+// From TMSIPDevSoundObserver
+// -----------------------------------------------------------------------------
+//
+void TMSCallIPAdpt::DownlinkInitCompleted(gint status)
+    {
+    TRACE_PRN_FN_ENT;
+    if (status == TMS_RESULT_SUCCESS)
+        {
+        iDnlinkInitialized = TRUE;
+        }
+    NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status);
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCallIPAdpt::UplinkInitCompleted
+// From TMSIPDevSoundObserver
+// -----------------------------------------------------------------------------
+//
+void TMSCallIPAdpt::UplinkInitCompleted(gint status)
+    {
+    TRACE_PRN_FN_ENT;
+    if (status == TMS_RESULT_SUCCESS)
+        {
+        iUplinkInitialized = TRUE;
+        }
+    NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status);
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCallIPAdpt::UplinkStarted
+// From TMSIPDevSoundObserver
+// -----------------------------------------------------------------------------
+//
+void TMSCallIPAdpt::UplinkStarted(gint status)
+    {
+    TRACE_PRN_FN_ENT;
+    NotifyClient(iUplinkStreamId, ECmdUplinkStarted, status);
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCallIPAdpt::DownlinkStarted
+// From TMSIPDevSoundObserver
+// -----------------------------------------------------------------------------
+//
+void TMSCallIPAdpt::DownlinkStarted(gint status)
+    {
+    TRACE_PRN_FN_ENT;
+    NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, status);
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
 // TMSCallIPAdpt::NotifyClient
 // -----------------------------------------------------------------------------
 //
-void TMSCallIPAdpt::NotifyClient(const gint strmId, const gint aCommand,
-        const gint aStatus, const gint64 /*aInt64*/)
+void TMSCallIPAdpt::NotifyClient(const gint strmId, const gint command,
+        const gint status, const gint64 /*int64*/)
     {
-    iMsgBuffer.iRequest = aCommand;
-    iMsgBuffer.iStatus = aStatus;
+    iMsgBuffer.iRequest = command;
+    iMsgBuffer.iStatus = status;
 
     if (strmId == iUplinkStreamId)
         {
--- a/mmserv/tms/tmscallserver/src/tmscsdevsound.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/src/tmscsdevsound.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -16,8 +16,8 @@
  */
 
 #include <AudioPreference.h>
-#include <glib.h>
 #include <S60FourCC.h>
+#include "tmsutility.h"
 #include "tmscsdevsound.h"
 #include "tmscsdevsoundobserver.h"
 
@@ -27,8 +27,8 @@
 // TMSCSPDevSound
 // -----------------------------------------------------------------------------
 //
-TMSCSPDevSound::TMSCSPDevSound(TMSCSPDevSoundObserver& aObserver) :
-    iObserver(aObserver)
+TMSCSDevSound::TMSCSDevSound(TMSCSDevSoundObserver& observer) :
+    iObserver(observer)
     {
     }
 
@@ -36,26 +36,55 @@
 // ConstructL
 // -----------------------------------------------------------------------------
 //
-void TMSCSPDevSound::ConstructL(TMMFState aMode, gint aAudioPreference,
-        gint aAudioPriority)
+void TMSCSDevSound::ConstructL(const TMSStreamType strmtype)
     {
+    TRACE_PRN_FN_ENT;
+    iStreamType = strmtype;
+
+    if (strmtype == TMS_STREAM_UPLINK)
+        {
+        iMode = EMMFStateRecording;
+        iPriority = KAudioPriorityCSCallUplink;
+        iPreference = KAudioPrefCSCallUplink;
+        }
+    else if (strmtype == TMS_STREAM_DOWNLINK)
+        {
+        iMode = EMMFStatePlaying;
+        iPriority = KAudioPriorityCSCallDownlink;
+        iPreference = KAudioPrefCSCallDownlink;
+        }
+    InitializeL();
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// InitializeL
+// -----------------------------------------------------------------------------
+//
+void TMSCSDevSound::InitializeL()
+    {
+    TRACE_PRN_FN_ENT;
     TMMFPrioritySettings audioPriority;
     TFourCC modemFourCC;
     modemFourCC.Set(KS60FourCCCodeModem);
+
+    delete iDevSound;
+    iDevSound = NULL;
     iDevSound = CMMFDevSound::NewL();
     if (iDevSound)
         {
 #ifndef __WINSCW__
-        iDevSound->InitializeL(*this, modemFourCC, aMode);
-#else //For testing TMS in WINSCW
-        iDevSound->InitializeL(*this, KMMFFourCCCodePCM16, aMode);
+        iDevSound->InitializeL(*this, modemFourCC, iMode);
+#else
+        //For testing TMS in WINSCW
+        iDevSound->InitializeL(*this, KMMFFourCCCodePCM16, iMode);
 #endif
-        iStreamType = aAudioPreference;
-        audioPriority.iPriority = aAudioPriority;
-        audioPriority.iPref = aAudioPreference;
-        audioPriority.iState = aMode;
+        audioPriority.iPriority = iPriority;
+        audioPriority.iPref = iPreference;
+        audioPriority.iState = iMode;
         iDevSound->SetPrioritySettings(audioPriority);
         }
+    TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
@@ -63,18 +92,18 @@
 // Not implemented
 // -----------------------------------------------------------------------------
 //
-TMSCSPDevSound::~TMSCSPDevSound()
+TMSCSDevSound::~TMSCSDevSound()
     {
     delete iDevSound;
     }
 
 // -----------------------------------------------------------------------------
-// Tries to activate the audio stream if not active or activating
+// Tries to activate the audio stream if not already active or activating
 // -----------------------------------------------------------------------------
 //
-void TMSCSPDevSound::Activate()
+void TMSCSDevSound::Activate()
     {
-    if (!IsActive() && !IsActivationOngoing())
+    if (!iActive && !iActivationOngoing)
         {
         iActivationOngoing = ETrue;
         TRAP_IGNORE(DoActivateL());
@@ -85,9 +114,9 @@
 // Deactivates the audio device.
 // -----------------------------------------------------------------------------
 //
-void TMSCSPDevSound::Deactivate()
+void TMSCSDevSound::Deactivate()
     {
-    if (iDevSound && (IsActive() || IsActivationOngoing()))
+    if (iDevSound && (iActive || iActivationOngoing))
         {
         iDevSound->Stop();
         iActive = EFalse;
@@ -96,111 +125,42 @@
     }
 
 // -----------------------------------------------------------------------------
-// ActivationOngoing
-// -----------------------------------------------------------------------------
-//
-TBool TMSCSPDevSound::IsActivationOngoing() const
-    {
-    return iActivationOngoing;
-    }
-
-// -----------------------------------------------------------------------------
-// IsActive
-// -----------------------------------------------------------------------------
-//
-TBool TMSCSPDevSound::IsActive() const
-    {
-    return iActive;
-    }
-
-// -----------------------------------------------------------------------------
 // DevSound
 // -----------------------------------------------------------------------------
 //
-CMMFDevSound& TMSCSPDevSound::DevSound()
+CMMFDevSound& TMSCSDevSound::DevSound()
     {
     return *iDevSound;
     }
 
 // -----------------------------------------------------------------------------
 // From class MDevSoundObserver
-// Not implemented
 // -----------------------------------------------------------------------------
 //
-void TMSCSPDevSound::InitializeComplete(TInt aError)
+void TMSCSDevSound::InitializeComplete(TInt aError)
     {
-    if (iStreamType == KAudioPrefCSCallDownlink)
+    TRACE_PRN_FN_ENT;
+    if (aError == TMS_RESULT_SUCCESS)
         {
-        iObserver.DownlinkInitCompleted(aError);
-        }
-    else
-        {
-        iObserver.UplinkInitCompleted(aError);
+        NotifyEvent(aError);
         }
-    }
-
-// -----------------------------------------------------------------------------
-// From class MDevSoundObserver
-// Not implemented
-// -----------------------------------------------------------------------------
-//
-void TMSCSPDevSound::BufferToBeFilled(CMMFBuffer* /*aBuffer*/)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// From class MDevSoundObserver
-// Not implemented
-// -----------------------------------------------------------------------------
-//
-void TMSCSPDevSound::PlayError(TInt /*aError*/)
-    {
+    TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
-// From class MDevSoundObserver
-// Not implemented
-// -----------------------------------------------------------------------------
-//
-void TMSCSPDevSound::ToneFinished(TInt /*aError*/)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// From class MDevSoundObserver
-// Not implemented
-// -----------------------------------------------------------------------------
-//
-void TMSCSPDevSound::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// From class MDevSoundObserver
-// Not implemented
+// TMSCSDevSound::NotifyEvent
 // -----------------------------------------------------------------------------
 //
-void TMSCSPDevSound::RecordError(TInt /*aError*/)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// From class MDevSoundObserver
-// Not implemented
-// -----------------------------------------------------------------------------
-//
-void TMSCSPDevSound::ConvertError(TInt /*aError*/)
+void TMSCSDevSound::NotifyEvent(gint error)
     {
-    }
-
-// -----------------------------------------------------------------------------
-// From class MDevSoundObserver
-// Not implemented
-// -----------------------------------------------------------------------------
-//
-void TMSCSPDevSound::DeviceMessage(TUid /*aMessageType*/,
-        const TDesC8& /*aMsg*/)
-    {
+    if (iStreamType == TMS_STREAM_DOWNLINK)
+        {
+        iObserver.DownlinkInitCompleted(error);
+        }
+    else if (iStreamType == TMS_STREAM_UPLINK)
+        {
+        iObserver.UplinkInitCompleted(error);
+        }
     }
 
 //  End of File
--- a/mmserv/tms/tmscallserver/src/tmscsdownlink.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/src/tmscsdownlink.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -25,12 +25,35 @@
 const gint KDefaultMaxVolume = 10;
 
 // -----------------------------------------------------------------------------
+// Constructor
+// -----------------------------------------------------------------------------
+//
+TMSCSDownlink::TMSCSDownlink(TMSCSDevSoundObserver& observer) :
+    TMSCSDevSound(observer)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// Second phase constructor
+// -----------------------------------------------------------------------------
+//
+void TMSCSDownlink::ConstructL()
+    {
+    TMSCSDevSound::ConstructL(TMS_STREAM_DOWNLINK);
+
+    if (iDevSound)
+        {
+        iDevSound->SetVolume(KDefaultVolume);
+        }
+    }
+
+// -----------------------------------------------------------------------------
 // Static constructor
 // -----------------------------------------------------------------------------
 //
-TMSCSDownlink* TMSCSDownlink::NewL(TMSCSPDevSoundObserver& aObserver)
+TMSCSDownlink* TMSCSDownlink::NewL(TMSCSDevSoundObserver& observer)
     {
-    TMSCSDownlink* self = new (ELeave) TMSCSDownlink(aObserver);
+    TMSCSDownlink* self = new (ELeave) TMSCSDownlink(observer);
     CleanupStack::PushL(self);
     self->ConstructL();
     CleanupStack::Pop(self);
@@ -38,7 +61,7 @@
     }
 
 // -----------------------------------------------------------------------------
-// Destructor.
+// Destructor
 // -----------------------------------------------------------------------------
 //
 TMSCSDownlink::~TMSCSDownlink()
@@ -49,19 +72,19 @@
 // Sets volume
 // -----------------------------------------------------------------------------
 //
-void TMSCSDownlink::SetVolume(gint aVolume)
+void TMSCSDownlink::SetVolume(gint volume)
     {
     if (iDevSound)
         {
         gint maxVolume(iDevSound->MaxVolume());
         maxVolume = (maxVolume > 0) ? maxVolume : KDefaultMaxVolume;
-        gint scaledVolume = (aVolume * maxVolume) / KDefaultMaxVolume;
+        gint scaledVolume = (volume * maxVolume) / KDefaultMaxVolume;
         iDevSound->SetVolume(scaledVolume);
         }
     }
 
 // -----------------------------------------------------------------------------
-// Gives volume
+// Returns volume
 // -----------------------------------------------------------------------------
 //
 gint TMSCSDownlink::Volume()
@@ -75,7 +98,7 @@
     }
 
 // -----------------------------------------------------------------------------
-// Gives max volume
+// Returns device's max volume
 // -----------------------------------------------------------------------------
 //
 gint TMSCSDownlink::MaxVolume()
@@ -95,13 +118,14 @@
 //
 void TMSCSDownlink::BufferToBeFilled(CMMFBuffer* /*aBuffer*/)
     {
-    //CSPLOGSTRING( CSPINT, "TMSCSDownlink:: activated" );
+    //TRACE_PRN_N(_L("TMSCSDownlink::BufferToBeFilled"));
+
     // We dont react to devsound messages unless we are activating.
-    if (IsActivationOngoing())
+    if (iActivationOngoing)
         {
         iActive = ETrue;
         iActivationOngoing = EFalse;
-        iObserver.DownlinkActivatedSuccessfully();
+        iObserver.DownlinkActivationCompleted(KErrNone);
         }
     }
 
@@ -112,23 +136,19 @@
 //
 void TMSCSDownlink::PlayError(TInt aError)
     {
-    //CSPLOGSTRING( CSPINT, "TMSCSDownlink::PlayError" );
+    //TRACE_PRN_N1(_L("TMSCSDownlink::PlayError[%d]"), aError);
 
-    // We dont react to devsound messages unless we are activating.
-    if (IsActivationOngoing())
+    // We don't react to devsound errors unless we are activating.
+    if (iActivationOngoing && aError == KErrAccessDenied)
         {
-        //CSPLOGSTRING( CSPINT, "TMSCSDownlink::PlayError activation failed" );
-        if (aError == KErrAccessDenied)
-            {
-            iActivationOngoing = EFalse;
-            iObserver.DownlinkActivationFailed();
-            }
+        iActivationOngoing = EFalse;
+        iObserver.DownlinkActivationCompleted(aError);
         }
     }
 
 // -----------------------------------------------------------------------------
-// From class CSPDevsound
-// Tries to activate Downlink stream.
+// From class TMSCSDevSound
+// Activates Downlink stream.
 // -----------------------------------------------------------------------------
 //
 void TMSCSDownlink::DoActivateL()
@@ -139,28 +159,4 @@
         }
     }
 
-// -----------------------------------------------------------------------------
-// Constructor
-// -----------------------------------------------------------------------------
-//
-TMSCSDownlink::TMSCSDownlink(TMSCSPDevSoundObserver& aObserver) :
-    TMSCSPDevSound(aObserver)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// Second phase constructor
-// -----------------------------------------------------------------------------
-//
-void TMSCSDownlink::ConstructL()
-    {
-    TMSCSPDevSound::ConstructL(EMMFStatePlaying, KAudioPrefCSCallDownlink,
-            KAudioPriorityCSCallDownlink);
-
-    if (iDevSound)
-        {
-        iDevSound->SetVolume(KDefaultVolume);
-        }
-    }
-
 //  End of File
--- a/mmserv/tms/tmscallserver/src/tmscsuplink.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/src/tmscsuplink.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -21,16 +21,31 @@
 
 using namespace TMS;
 
-// Mute value
-const gint KSetMuteToDevSound = 0;
+// -----------------------------------------------------------------------------
+// Constructor
+// -----------------------------------------------------------------------------
+//
+TMSCSUplink::TMSCSUplink(TMSCSDevSoundObserver& observer) :
+    TMSCSDevSound(observer)
+    {
+    }
 
 // -----------------------------------------------------------------------------
-// Static constructor.
+// Second phase constructor
 // -----------------------------------------------------------------------------
 //
-TMSCSUplink* TMSCSUplink::NewL(TMSCSPDevSoundObserver& aObserver)
+void TMSCSUplink::ConstructL()
     {
-    TMSCSUplink* self = new (ELeave) TMSCSUplink(aObserver);
+    TMSCSDevSound::ConstructL(TMS_STREAM_UPLINK);
+    }
+
+// -----------------------------------------------------------------------------
+// Static constructor
+// -----------------------------------------------------------------------------
+//
+TMSCSUplink* TMSCSUplink::NewL(TMSCSDevSoundObserver& observer)
+    {
+    TMSCSUplink* self = new (ELeave) TMSCSUplink(observer);
     CleanupStack::PushL(self);
     self->ConstructL();
     CleanupStack::Pop(self);
@@ -49,61 +64,31 @@
 // Gives mic mute state
 // -----------------------------------------------------------------------------
 //
-TBool TMSCSUplink::IsMuted()
+gboolean TMSCSUplink::IsMuted()
     {
-    TBool isMuted = EFalse;
-    gint gain = 0;
+    gint gain(0);
+
     if (iDevSound)
         {
         gain = iDevSound->Gain();
         }
-    if (!gain)
-        {
-        // Mute is on
-        isMuted = ETrue;
-        }
-    //   CSPLOGSTRING( CSPINT, "TMSCSUplink::IsMuted" );
-    return isMuted;
+    return ((!gain)? TRUE : FALSE);
     }
 
 // -----------------------------------------------------------------------------
-// Set mic muted.
+// Sets mic gain
 // -----------------------------------------------------------------------------
 //
-void TMSCSUplink::SetMuted()
+void TMSCSUplink::SetGain(gint gain)
     {
     if (iDevSound)
         {
-        iDevSound->SetGain(KSetMuteToDevSound);
+        iDevSound->SetGain(gain);
         }
     }
 
 // -----------------------------------------------------------------------------
-// Set mic unmuted
-// -----------------------------------------------------------------------------
-//
-void TMSCSUplink::SetUnmuted()
-    {
-    if (iDevSound)
-        {
-        iDevSound->SetGain(iDevSound->MaxGain());
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// Sets gain
-// -----------------------------------------------------------------------------
-//
-void TMSCSUplink::SetGain(gint aGain)
-    {
-    if (iDevSound)
-        {
-        iDevSound->SetGain(aGain);
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// Gives volume
+// Returns mic gain
 // -----------------------------------------------------------------------------
 //
 gint TMSCSUplink::Gain()
@@ -117,7 +102,7 @@
     }
 
 // -----------------------------------------------------------------------------
-// Gives max gain
+// Returns max mic gain
 // -----------------------------------------------------------------------------
 //
 gint TMSCSUplink::MaxGain()
@@ -132,46 +117,42 @@
 
 // -----------------------------------------------------------------------------
 // From class MDevSoundObserver
-// Activation was successfull.
+// Uplink stream has been activated successfully.
 // -----------------------------------------------------------------------------
 //
 void TMSCSUplink::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/)
     {
-    //  CSPLOGSTRING( CSPINT, "TMSCSUplink::BufferToBeEmptied" );
+    //TRACE_PRN_N(_L("TMSCSUplink::BufferToBeEmptied"));
 
     // We dont react to devsound messages unless we are activating.
-    if (IsActivationOngoing())
+    if (iActivationOngoing)
         {
         iActive = ETrue;
         iActivationOngoing = EFalse;
-        iObserver.UplinkActivatedSuccessfully();
+        iObserver.UplinkActivationCompleted(KErrNone);
         }
     }
 
 // -----------------------------------------------------------------------------
 // From class MDevSoundObserver
-// Activation feiled
+// Uplink stream activation failed
 // -----------------------------------------------------------------------------
 //
 void TMSCSUplink::RecordError(TInt aError)
     {
-    //  CSPLOGSTRING( CSPINT, "TMSCSUplink::RecordError" );
+    //TRACE_PRN_N1(_L("TMSCSUplink::RecordError[%d]"), aError);
 
     // We dont react to devsound messages unless we are activating.
-    if (IsActivationOngoing())
+    if (iActivationOngoing && aError == KErrAccessDenied)
         {
-        if (aError == KErrAccessDenied)
-            {
-            iActivationOngoing = EFalse;
-            iObserver.UplinkActivationFailed();
-            }
+        iActivationOngoing = EFalse;
+        iObserver.UplinkActivationCompleted(aError);
         }
     }
 
 // -----------------------------------------------------------------------------
-// From class TMSCSPDevSound
-// Tries to activate mic stream. Stream becomes active when BufferToBeFilled
-// gets called.
+// From class TMSCSDevSound
+// Activates Uplink stream.
 // -----------------------------------------------------------------------------
 //
 void TMSCSUplink::DoActivateL()
@@ -182,23 +163,4 @@
         }
     }
 
-// -----------------------------------------------------------------------------
-// Constructor
-// -----------------------------------------------------------------------------
-//
-TMSCSUplink::TMSCSUplink(TMSCSPDevSoundObserver& aObserver) :
-    TMSCSPDevSound(aObserver)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// Second phase constructor
-// -----------------------------------------------------------------------------
-//
-void TMSCSUplink::ConstructL()
-    {
-    TMSCSPDevSound::ConstructL(EMMFStateRecording, KAudioPrefCSCallUplink,
-            KAudioPriorityCSCallUplink);
-    }
-
 //  End of File
--- a/mmserv/tms/tmscallserver/src/tmsipcalldownlinkds.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/src/tmsipcalldownlinkds.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -32,7 +32,8 @@
 // Standard Constructor
 // -----------------------------------------------------------------------------
 //
-TMSIPDownlink::TMSIPDownlink()
+TMSIPDownlink::TMSIPDownlink(TMSIPDevSoundObserver& observer) :
+    TMSIPCallStreamBase(observer)
     {
     }
 
@@ -61,10 +62,10 @@
 // Symbian two-phase constructor
 // -----------------------------------------------------------------------------
 //
-TMSIPDownlink* TMSIPDownlink::NewL(const guint32 codecID,
-        const TMMFPrioritySettings priority)
+TMSIPDownlink* TMSIPDownlink::NewL(TMSIPDevSoundObserver& observer,
+        const guint32 codecID, const TMMFPrioritySettings priority)
     {
-    TMSIPDownlink* self = new (ELeave) TMSIPDownlink();
+    TMSIPDownlink* self = new (ELeave) TMSIPDownlink(observer);
     CleanupStack::PushL(self);
     self->ConstructL(codecID, priority);
     CleanupStack::Pop(self);
@@ -80,14 +81,12 @@
         const TMMFPrioritySettings priority)
     {
     TRACE_PRN_FN_ENT;
-
     iCodecID = codecID;
     iPriority = priority;
 
     // Client must set these before querying!
     iG711DecodeMode = TMS_G711_CODEC_MODE_ALAW;
     iILBCDecodeMode = TMS_ILBC_CODEC_MODE_20MS_FRAME;
-
     TRAPD(err, InitDevSoundL(EMMFStatePlaying, priority));
     if (err != TMS_RESULT_SUCCESS)
         {
@@ -95,7 +94,6 @@
         }
 
     iMaxBufLen = ConfigureMedia(iCodecID);
-
     TRACE_PRN_FN_EXT;
     }
 
@@ -107,23 +105,18 @@
 void TMSIPDownlink::Start()
     {
     TRACE_PRN_FN_ENT;
-
     gint err = TMS_RESULT_ILLEGAL_OPERATION;
 
     if (iStatus == EReady && iDevSound)
         {
         TRAP(err, iDevSound->PlayInitL());
         TRACE_PRN_IF_ERR(err);
-
-#ifdef _DEBUG
-        iSamplesPlayedCount = 0;
-#endif
         if (err != TMS_RESULT_SUCCESS)
             {
             iStatus = EReady;
+            iObserver.DownlinkStarted(err);
             }
         }
-
     TRACE_PRN_FN_EXT;
     }
 
@@ -141,7 +134,6 @@
         iDevSound->Stop();
         iStatus = EReady;
         }
-
     TRACE_PRN_FN_EXT;
     }
 
@@ -156,18 +148,19 @@
 void TMSIPDownlink::BufferToBeFilled(CMMFBuffer* aBuffer)
     {
     // Store pointer to the received buffer
-    iDevSoundBufPtr = static_cast<CMMFDataBuffer*>(aBuffer);
+    iDevSoundBufPtr = static_cast<CMMFDataBuffer*> (aBuffer);
     iBufLen = iDevSoundBufPtr->RequestSize();
     TRACE_PRN_N1(_L("TMS->DNL->BTBF: LEN[%d]"), iBufLen);
 
 #ifndef __WINSCW__
-    //TODO: revisit this!
+    //TODO: Is this still true?
     // The first AMR buffer returns 1 for no data frame.
     /*if (iCodecID == KMccFourCCIdAMRNB)
      {
      iBufLen = iMaxBufLen;
      }*/
 #endif //__WINSCW__
+
     // Create or adjust the chunk
     gint err = DoChunk(iBufLen, iMsgBuffer);
 
@@ -182,6 +175,7 @@
         iMsgBuffer.iStatus = err;
         iMsgBuffer.iInt = iBufLen;
         iStatus = EStreaming;
+
         // If chunk is opened, we will expect a call from the client to
         // get chunk handle. When we get a call to copy chunk handle,
         // check these variables and see if they match. This is not
@@ -195,7 +189,6 @@
 
     iMsgBuffer.iRequest = ECmdFillBuffer;
     err = iMsgQueue.Send(iMsgBuffer);
-
     TRACE_PRN_IF_ERR(err);
     }
 
@@ -210,7 +203,7 @@
 
     // Copy data over from chunk
     TPtr8 dataPtr(iChunk.Base(), buflen, iMaxBufLen);
-    //    RDebug::RawPrint(dataPtr);
+    //RDebug::RawPrint(dataPtr);
 
     if (iStatus == EStreaming && iDevSound && iDevSoundBufPtr)
         {
@@ -362,7 +355,6 @@
             status = TMS_RESULT_ILLEGAL_OPERATION;
             }
         }
-
     TRACE_PRN_IF_ERR(status);
     return status;
     }
@@ -396,7 +388,6 @@
                 }
             }
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -443,7 +434,6 @@
                 }
             }
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -478,7 +468,6 @@
             TRACE_PRN_N1(_L("TMS->DNL: FrameModeRqrdForEC [%d]"), frmodereq);
             }
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -502,7 +491,6 @@
             TRACE_PRN_N1(_L("TMS->DNL: SetFrameMode [%d]"), frmode);
             }
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -523,7 +511,6 @@
         TRACE_PRN_N1(_L("TMS->DNL: GetFrameMode [%d]"), frmode);
         err = TMS_RESULT_SUCCESS;
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -542,7 +529,6 @@
         err = iErrConcealmentIntfc->ConcealErrorForNextBuffer();
         TRACE_PRN_N(_L("TMS->DNL: ConcealErrorForNextBuffer"));
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -569,7 +555,6 @@
             TRACE_PRN_N1(_L("TMS->DNL: SetCng [%d]"), cng);
             }
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -596,7 +581,6 @@
             TRACE_PRN_N1(_L("TMS->DNL: GetCng [%d]"), cng);
             }
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -619,7 +603,6 @@
             TRACE_PRN_N1(_L("TMS->DNL: SetPlc [%d]"), plc);
             }
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -640,7 +623,6 @@
         err = TMS_RESULT_SUCCESS;
         TRACE_PRN_N1(_L("TMS->DNL: GetPlc [%d]"), plc);
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -662,7 +644,6 @@
             TRACE_PRN_N(_L("TMS->DNL: BadLsfNextBuffer"));
             }
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -759,37 +740,30 @@
 void TMSIPDownlink::InitializeComplete(TInt aError)
     {
     TRACE_PRN_FN_ENT;
+    gint status = aError;
 
-    gint err = aError;
-
-    if (err == TMS_RESULT_SUCCESS && iDevSound)
+    if (status == TMS_RESULT_SUCCESS && iDevSound)
         {
         TMMFCapabilities conf;
         conf = iDevSound->Config();
         conf.iRate = EMMFSampleRate8000Hz;
         conf.iChannels = EMMFMono;
-        TRAP(err, iDevSound->SetConfigL(conf));
-        if (err == TMS_RESULT_SUCCESS)
+        TRAP(status, iDevSound->SetConfigL(conf));
+        if (status == TMS_RESULT_SUCCESS)
             {
             // We are ready to stream even in case of later CI setting failure
             iStatus = EReady;
             iMaxVolume = iDevSound->MaxVolume();
             }
 
-        // Init Custom Interface API to the decoder
-        err = SetCodecCi();
-        if (err != TMS_RESULT_SUCCESS)
-            {
-            // DEBUG only
-            // Can ignore error - although decoder is not fully configured but
-            // it can still run in the default mode.
-            TRACE_PRN_IF_ERR(err);
-            }
+        // Init Custom Interface API to the Decoder. Any return error can
+        // be ignored as codec can still run in the default mode even if not
+        // fully configured.
+        SetCodecCi();
         }
 
-    // TODO: Notify client
-
-    TRACE_PRN_IF_ERR(err);
+    iObserver.DownlinkInitCompleted(status);
+    TRACE_PRN_IF_ERR(status);
     TRACE_PRN_FN_EXT;
     }
 
@@ -800,16 +774,11 @@
 // The state of recorder is rolled back to EReady.
 // -----------------------------------------------------------------------------
 //
-void TMSIPDownlink::PlayError(TInt /*aError*/)
+void TMSIPDownlink::PlayError(TInt aError)
     {
-    //TRACE_PRN_IF_ERR(aError);
-
-#ifdef _DEBUG
-    iSamplesPlayedCount = 0;
-#endif
     iStatus = EReady;
-
-    // TODO: Notify client
+    iObserver.DownlinkStarted(aError);
+    TRACE_PRN_IF_ERR(aError);
     }
 
 // End of file
--- a/mmserv/tms/tmscallserver/src/tmsipcallstreambase.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/src/tmsipcallstreambase.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -24,6 +24,16 @@
 using namespace TMS;
 
 // -----------------------------------------------------------------------------
+// TMSIPCallStreamBase::TMSIPCallStreamBase
+// Constructor
+// -----------------------------------------------------------------------------
+//
+TMSIPCallStreamBase::TMSIPCallStreamBase(TMSIPDevSoundObserver& observer) :
+    iObserver(observer)
+    {
+    }
+
+// -----------------------------------------------------------------------------
 // TMSIPCallStreamBase::~TMSIPCallStreamBase
 // Destructor
 // -----------------------------------------------------------------------------
--- a/mmserv/tms/tmscallserver/src/tmsipcalluplinkds.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmscallserver/src/tmsipcalluplinkds.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -31,7 +31,8 @@
 // Standard Constructor
 // -----------------------------------------------------------------------------
 //
-TMSIPUplink::TMSIPUplink()
+TMSIPUplink::TMSIPUplink(TMSIPDevSoundObserver& observer) :
+    TMSIPCallStreamBase(observer)
     {
     }
 
@@ -59,10 +60,10 @@
 // Symbian two-phase constructor
 // -----------------------------------------------------------------------------
 //
-TMSIPUplink* TMSIPUplink::NewL(const guint32 codecID,
-        const TMMFPrioritySettings priority)
+TMSIPUplink* TMSIPUplink::NewL(TMSIPDevSoundObserver& observer,
+        const guint32 codecID, const TMMFPrioritySettings priority)
     {
-    TMSIPUplink* self = new (ELeave) TMSIPUplink();
+    TMSIPUplink* self = new (ELeave) TMSIPUplink(observer);
     CleanupStack::PushL(self);
     self->ConstructL(codecID, priority);
     CleanupStack::Pop(self);
@@ -78,14 +79,12 @@
         const TMMFPrioritySettings priority)
     {
     TRACE_PRN_FN_ENT;
-
     iCodecID = codecID;
     iPriority = priority;
 
     // Client must set these before querying!
     iG711EncodeMode = TMS_G711_CODEC_MODE_ALAW;
     iILBCEncodeMode = TMS_ILBC_CODEC_MODE_20MS_FRAME;
-
     TRAPD(err, InitDevSoundL(EMMFStateRecording, priority));
     if (err != TMS_RESULT_SUCCESS)
         {
@@ -93,7 +92,6 @@
         }
 
     iMaxBufLen = ConfigureMedia(iCodecID);
-
     TRACE_PRN_FN_EXT;
     }
 
@@ -116,17 +114,10 @@
 
         if (err != TMS_RESULT_SUCCESS)
             {
-            //TODO: Notify main thread
             iStatus = EReady;
+            iObserver.UplinkStarted(err);
             }
-#ifdef _DEBUG
-        else
-            {
-            iSamplesRecCount = 0;
-            }
-#endif
         }
-
     TRACE_PRN_FN_EXT;
     }
 
@@ -144,10 +135,6 @@
         iDevSound->Stop();
         iStatus = EReady;
         }
-    else
-        {
-        //TODO: Notify main thread
-        }
     TRACE_PRN_FN_EXT;
     }
 
@@ -158,9 +145,8 @@
 //
 void TMSIPUplink::BufferToBeEmptied(CMMFBuffer* aBuffer)
     {
-    iDevSoundBufPtr = static_cast<CMMFDataBuffer*>(aBuffer);
+    iDevSoundBufPtr = static_cast<CMMFDataBuffer*> (aBuffer);
     TDes8& data = iDevSoundBufPtr->Data();
-
     iBufLen = iDevSoundBufPtr->BufferSize();
     TRACE_PRN_N1(_L("TMS->UPL: BTBE->LEN [%d]"), iBufLen);
 
@@ -353,7 +339,6 @@
             status = TMS_RESULT_ILLEGAL_OPERATION;
             }
         }
-
     return status;
     }
 
@@ -386,7 +371,6 @@
                 }
             }
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -433,7 +417,6 @@
                 }
             }
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -465,7 +448,6 @@
         {
         err = iSpeechEncoderConfig->GetSupportedBitrates(bitrates);
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -484,7 +466,6 @@
         err = iSpeechEncoderConfig->SetBitrate(bitrate);
         TRACE_PRN_N1(_L("TMS->UPL: SetBitrate [%d]"), bitrate);
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -503,7 +484,6 @@
         err = iSpeechEncoderConfig->GetBitrate(bitrate);
         TRACE_PRN_N1(_L("TMS->UPL: GetBitrate [%d]"), bitrate);
         }
-
     TRACE_PRN_IF_ERR(err);
     return err;
     }
@@ -634,36 +614,30 @@
     {
     TRACE_PRN_FN_ENT;
 
-    gint err = aError;
+    gint status = aError;
 
-    if (err == TMS_RESULT_SUCCESS && iDevSound)
+    if (status == TMS_RESULT_SUCCESS && iDevSound)
         {
         TMMFCapabilities conf;
         conf = iDevSound->Config();
         conf.iRate = EMMFSampleRate8000Hz;
         conf.iChannels = EMMFMono;
-        TRAP(err, iDevSound->SetConfigL(conf));
-        if (err == TMS_RESULT_SUCCESS)
+        TRAP(status, iDevSound->SetConfigL(conf));
+        if (status == TMS_RESULT_SUCCESS)
             {
             // We are ready to stream even in case of CI setting failure
             iStatus = EReady;
             iMaxGain = iDevSound->MaxGain();
             }
 
-        // Init Custom Interface API to the Encoder
-        err = SetCodecCi();
-        if (err != TMS_RESULT_SUCCESS)
-            {
-            // DEBUG only
-            // Can ignore error - although encoder is not fully configured but
-            // it can still run in the default mode.
-            TRACE_PRN_IF_ERR(err);
-            }
+        // Init Custom Interface API to the Encoder. Any return error can
+        // be ignored as codec can still run in the default mode even if not
+        // fully configured.
+        SetCodecCi();
         }
 
-    // TODO: Notify client
-
-    TRACE_PRN_IF_ERR(err);
+    iObserver.UplinkInitCompleted(status);
+    TRACE_PRN_IF_ERR(status);
     TRACE_PRN_FN_EXT;
     }
 
@@ -674,16 +648,11 @@
 // The state of recorder is rolled back to EReady.
 // -----------------------------------------------------------------------------
 //
-void TMSIPUplink::RecordError(TInt /*aError*/)
+void TMSIPUplink::RecordError(TInt aError)
     {
-    //TRACE_PRN_IF_ERR(aError);
-
-#ifdef _DEBUG
-    iSamplesRecCount = 0;
-#endif
     iStatus = EReady;
-
-    // TODO: Notify client
+    iObserver.UplinkStarted(aError);
+    TRACE_PRN_IF_ERR(aError);
     }
 
 // End of file
--- a/mmserv/tms/tmsimpl/inc/tmsclientsinkbodyimpl.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsimpl/inc/tmsclientsinkbodyimpl.h	Thu Jul 15 19:13:36 2010 +0300
@@ -27,6 +27,7 @@
 // FORWARD DECLARATIONS
 class TMSClientSinkObserver;
 class TMSBuffer;
+class TMSGlobalContext;
 class TMSCallProxy;
 
 // TMSClientSinkBodyImpl class
@@ -35,7 +36,6 @@
     {
 public:
     static gint Create(TMSClientSinkBody*& bodyimpl);
-    // From TMSClientSinkBody begins
 
     virtual ~TMSClientSinkBodyImpl();
 
@@ -49,13 +49,10 @@
 
     virtual gint GetType(TMSSinkType& sinktype);
 
-    // From TMSClientSinkBody ends
-
     // From MQueueHandlerObserver starts
     virtual void QueueEvent(TInt aEventType, TInt aError, void* user_data);
-    // From MQueueHandlerObserver ends
 
-    void SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
+    void SetProxy(TMSGlobalContext* context, gpointer queuehandler);
 
 private:
     TMSClientSinkBodyImpl();
@@ -64,6 +61,7 @@
 private:
     TMSClientSinkObserver* iObserver;
     gpointer iUserData;
+    TMSGlobalContext* iContext;
     TMSCallProxy* iProxy;
     };
 
--- a/mmserv/tms/tmsimpl/inc/tmsclientsourcebodyimpl.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsimpl/inc/tmsclientsourcebodyimpl.h	Thu Jul 15 19:13:36 2010 +0300
@@ -27,6 +27,7 @@
 // FORWARD DECLARATIONS
 class TMSClientSourceObserver;
 class TMSBuffer;
+class TMSGlobalContext;
 class TMSCallProxy;
 
 // TMSClientSourceBodyImpl class
@@ -35,13 +36,11 @@
     {
 public:
     static gint Create(TMSClientSourceBody*& bodyimpl);
-    // From TMSClientSourceBody begins
 
     virtual ~TMSClientSourceBodyImpl();
 
     virtual gint AddObserver(TMSClientSourceObserver& obsrvr,
             gpointer user_data);
-
     virtual gint RemoveObserver(TMSClientSourceObserver& obsrvr);
 
     // In pull mode, client calls this.??? How to identify last buffer.
@@ -60,13 +59,10 @@
 
     virtual gint GetType(TMSSourceType& sourcetype);
 
-    // From TMSClientSourceBody ends
-
-    // From MQueueHandlerObserver starts
+    // From MQueueHandlerObserver
     virtual void QueueEvent(TInt aEventType, TInt aError, void* user_data);
-    // From MQueueHandlerObserver ends
 
-    void SetProxy(TMSCallProxy* aProxy, gint strmid, gpointer queuehandler);
+    void SetProxy(TMSGlobalContext* context, gpointer queuehandler);
 
 private:
     TMSClientSourceBodyImpl();
@@ -75,9 +71,9 @@
 private:
     TMSClientSourceObserver* iObserver;
     gpointer iUserData;
+    TMSGlobalContext* iContext;
     TMSCallProxy* iProxy;
     gboolean iQueueMode;
-    gint iStreamId;
     };
 
 } //namespace TMS
--- a/mmserv/tms/tmsimpl/src/tmsclientsinkbodyimpl.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmsclientsinkbodyimpl.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -18,6 +18,7 @@
 #include <tms.h>
 #include <tmsclientsinkobsrvr.h>
 #include "tmscallproxy.h"
+#include "tmsglobalcontext.h"
 #include "tmsmembuffer.h"
 #include "tmsqueuehandler.h"
 #include "tmsclientsinkbodyimpl.h"
@@ -90,14 +91,11 @@
 // Push mode
 gint TMSClientSinkBodyImpl::BufferProcessed(TMSBuffer* buffer)
     {
-    // TODO send stream attributes here
     gint ret(TMS_RESULT_SUCCESS);
-
     if (iProxy)
         {
-        //TODO: must use strm_id instead of 1
-        ret = iProxy->BufferEmptied(TMS_CALL_IP, TMS_STREAM_UPLINK, 1,
-		        *buffer);
+        ret = iProxy->BufferEmptied(iContext->CallType, iContext->StreamType,
+                iContext->StreamId, *buffer);
         }
     else
         {
@@ -113,13 +111,14 @@
     return ret;
     }
 
-void TMSClientSinkBodyImpl::SetProxy(TMSCallProxy* aProxy,
+void TMSClientSinkBodyImpl::SetProxy(TMSGlobalContext* context,
         gpointer queuehandler)
     {
-    iProxy = aProxy;
+    iProxy = context->CallProxy;
+    iContext = context;
     if (queuehandler)
         {
-        static_cast<TMSQueueHandler*>(queuehandler)->AddObserver(*this,
+        static_cast<TMSQueueHandler*> (queuehandler)->AddObserver(*this,
                 TMS_SINK_CLIENT);
         }
     }
@@ -132,7 +131,7 @@
         switch (aEventType)
             {
             case TMS_EVENT_SINK_PROCESS_BUFFER:
-                iObserver->ProcessBuffer(static_cast<TMSBuffer*>(user_data));
+                iObserver->ProcessBuffer(static_cast<TMSBuffer*> (user_data));
                 break;
             default:
                 break;
--- a/mmserv/tms/tmsimpl/src/tmsclientsinkimpl.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmsclientsinkimpl.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -16,6 +16,7 @@
  */
 
 #include "tmsutility.h"
+#include "tmsglobalcontext.h"
 #include "tmsclientsinkimpl.h"
 #include "tmsclientsinkbodyimpl.h"
 
@@ -68,12 +69,13 @@
     return ret;
     }
 
-gint TMSClientSinkImpl::SetProxy(TMSCallProxy* aProxy, gpointer queuehandler)
+gint TMSClientSinkImpl::SetProxy(TMSGlobalContext* context,
+        gpointer queuehandler)
     {
     gint ret = TMS_RESULT_SUCCESS;
     if (this->iBody)
         {
-        static_cast<TMSClientSinkBodyImpl*>(this->iBody)->SetProxy(aProxy,
+        static_cast<TMSClientSinkBodyImpl*>(this->iBody)->SetProxy(context,
                 queuehandler);
         }
     else
--- a/mmserv/tms/tmsimpl/src/tmsclientsourcebodyimpl.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmsclientsourcebodyimpl.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -18,6 +18,7 @@
 #include <tms.h>
 #include <tmsclientsourceobsrvr.h>
 #include "tmscallproxy.h"
+#include "tmsglobalcontext.h"
 #include "tmsmembuffer.h"
 #include "tmsqueuehandler.h"
 #include "tmsclientsourcebodyimpl.h"
@@ -74,21 +75,6 @@
     return ret;
     }
 
-/**
- * Remove a stream observer from this stream.
- *
- * This function can be called at any time. It is recommended to remove
- * observer after calling Deinit() on stream. Else observer may receive
- * a callback that is alread dispatched.
- *
- * @param  obsrvr
- *      The listener to remove.
- *
- * @return
- *      TMS_RESULT_SUCCESS if the obsrvr is removed successfully from list.
- *      TMS_RESULT_DOES_NOT_EXIST if obsrvr is not already in the list.
- *
- */
 gint TMSClientSourceBodyImpl::RemoveObserver(TMSClientSourceObserver& obsrvr)
     {
     gint ret(TMS_RESULT_SUCCESS);
@@ -111,8 +97,8 @@
     {
     // TODO send stream attributes here
     gint ret(TMS_RESULT_SUCCESS);
-    ret = iProxy->BufferFilled(TMS_CALL_IP, TMS_STREAM_DOWNLINK, iStreamId,
-            buffer);
+    ret = iProxy->BufferFilled(iContext->CallType, iContext->StreamType,
+            iContext->StreamId, buffer);
     return ret;
     }
 
@@ -154,13 +140,16 @@
     return ret;
     }
 
-void TMSClientSourceBodyImpl::SetProxy(TMSCallProxy* aProxy, gint strmid,
+void TMSClientSourceBodyImpl::SetProxy(TMSGlobalContext* context,
         gpointer queuehandler)
     {
-    iProxy = aProxy;
-    iStreamId = strmid;
-    static_cast<TMSQueueHandler*>(queuehandler)->AddObserver(*this,
-            TMS_SOURCE_CLIENT);
+    iProxy = context->CallProxy;
+    iContext = context;
+    if (queuehandler)
+        {
+        static_cast<TMSQueueHandler*>(queuehandler)->AddObserver(*this,
+                TMS_SOURCE_CLIENT);
+        }
     }
 
 void TMSClientSourceBodyImpl::QueueEvent(TInt aEventType, TInt aError,
--- a/mmserv/tms/tmsimpl/src/tmsclientsourceimpl.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmsclientsourceimpl.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -68,12 +68,12 @@
     return ret;
     }
 
-gint TMSClientSourceImpl::SetProxy(TMSCallProxy* aProxy, gint strmid,
+gint TMSClientSourceImpl::SetProxy(TMSGlobalContext* context,
         gpointer queuehandler)
     {
     gint ret = TMS_RESULT_SUCCESS;
-    static_cast<TMSClientSourceBodyImpl*>(this->iBody)->SetProxy(aProxy,
-            strmid, queuehandler);
+    static_cast<TMSClientSourceBodyImpl*>(this->iBody)->SetProxy(context,
+            queuehandler);
     return ret;
     }
 
--- a/mmserv/tms/tmsimpl/src/tmsmembuffer.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmsmembuffer.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -61,10 +61,10 @@
     if (self)
         {
         self->iDataPtr = dataptr;
+        self->iOwnsBuffer = FALSE;
+        self->iBufferSize = size;
         ret = TMS_RESULT_SUCCESS;
         }
-    self->iOwnsBuffer = FALSE;
-    self->iBufferSize = size;
     tmsbuffer = self;
     TRACE_PRN_FN_EXT;
     return ret;
--- a/mmserv/tms/tmsimpl/src/tmsqueuehandler.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmsqueuehandler.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -316,10 +316,8 @@
             err = TMS_RESULT_DOES_NOT_EXIST;
             }
         }
-    else
-        {
-        // TODO handle error here
-        }
+
+    // TODO: handle error here
     }
 
 // -----------------------------------------------------------------------------
@@ -376,10 +374,8 @@
             err = TMS_RESULT_DOES_NOT_EXIST;
             }
         }
-    else
-        {
-        //iObserver->Event(MVoIPUplinkObserver::KUplinkError, aStatus);
-        }
+	//TODO: Handle error here
+    //iObserver->Event(MVoIPUplinkObserver::KUplinkError, aStatus);
     }
 
 // -----------------------------------------------------------------------------
--- a/mmserv/tms/tmsimpl/src/tmsstreambodyimpl.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmsstreambodyimpl.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -373,7 +373,7 @@
             switch (effecttype)
                 {
                 case TMS_EFFECT_GAIN:
-                    static_cast<TMSGainEffectImpl*>(iEffectsList[i])->SetProxy(
+                    static_cast<TMSGainEffectImpl*> (iEffectsList[i])->SetProxy(
                             iContext.CallProxy, iMsgQHandler);
                     break;
                 case TMS_EFFECT_VOLUME:
@@ -395,23 +395,23 @@
         switch (fmttype)
             {
             case TMS_FORMAT_PCM:
-                static_cast<TMSPCMFormatImpl*>(iFormat)->SetProxy(&iContext,
+                static_cast<TMSPCMFormatImpl*> (iFormat)->SetProxy(&iContext,
                         iMsgQHandler);
                 break;
             case TMS_FORMAT_AMR:
-                static_cast<TMSAMRFormatImpl*>(iFormat)->SetProxy(&iContext,
+                static_cast<TMSAMRFormatImpl*> (iFormat)->SetProxy(&iContext,
                         iMsgQHandler);
                 break;
             case TMS_FORMAT_G711:
-                static_cast<TMSG711FormatImpl*>(iFormat)->SetProxy(&iContext,
+                static_cast<TMSG711FormatImpl*> (iFormat)->SetProxy(&iContext,
                         iMsgQHandler);
                 break;
             case TMS_FORMAT_G729:
-                static_cast<TMSG729FormatImpl*>(iFormat)->SetProxy(&iContext,
+                static_cast<TMSG729FormatImpl*> (iFormat)->SetProxy(&iContext,
                         iMsgQHandler);
                 break;
             case TMS_FORMAT_ILBC:
-                static_cast<TMSILBCFormatImpl*>(iFormat)->SetProxy(&iContext,
+                static_cast<TMSILBCFormatImpl*> (iFormat)->SetProxy(&iContext,
                         iMsgQHandler);
                 break;
             default:
@@ -429,8 +429,8 @@
             switch (sinkType)
                 {
                 case TMS_SINK_CLIENT:
-                    static_cast<TMSClientSinkImpl*>(iSink)->SetProxy(
-                            iContext.CallProxy, iMsgQHandler);
+                    static_cast<TMSClientSinkImpl*> (iSink)->SetProxy(&iContext,
+                            iMsgQHandler);
                     break;
                 case TMS_SINK_MODEM:
                 case TMS_SINK_SPEAKER:
@@ -454,9 +454,8 @@
             switch (sourceType)
                 {
                 case TMS_SOURCE_CLIENT:
-                    static_cast<TMSClientSourceImpl*>(iSource)->SetProxy(
-                            iContext.CallProxy, iContext.StreamId,
-                            iMsgQHandler);
+                    static_cast<TMSClientSourceImpl*> (iSource)->SetProxy(
+                            &iContext, iMsgQHandler);
                     break;
                 case TMS_SOURCE_MODEM:
                 case TMS_SOURCE_MIC:
--- a/mmserv/tms/tmsserver/inc/tmscenrepaudiohandler.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsserver/inc/tmscenrepaudiohandler.h	Thu Jul 15 19:13:36 2010 +0300
@@ -53,6 +53,7 @@
 
     void SetLoudSpeakerVol(TInt vol);
     void SetEarPieceVol(TInt vol);
+    void SetMuteState(TInt mutestate);
 
     // from base class TMSPubSubObserver
     /**
--- a/mmserv/tms/tmsserver/inc/tmspubsublistener.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsserver/inc/tmspubsublistener.h	Thu Jul 15 19:13:36 2010 +0300
@@ -77,6 +77,13 @@
      */
     TInt Get(TDes16& aVal);
 
+    /**
+     * Sets integer value for P & S.
+     * @param aVal a value in return
+     * @return error code
+     */
+    TInt Set(TInt aVal);
+
 private:
     // New functions.
 
--- a/mmserv/tms/tmsserver/src/tmscenrepaudiohandler.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsserver/src/tmscenrepaudiohandler.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -33,7 +33,11 @@
 #include "tmspubsublistener.h"
 #include "tmsutility.h"
 
+#ifndef __WINS__
+const TInt KDefaultMaxGain = 1;
+#else
 const TInt KDefaultMaxGain = 64;
+#endif
 
 using namespace TMS;
 
@@ -65,6 +69,10 @@
     TRACE_PRN_FN_EXT;
     }
 
+// ---------------------------------------------------------------------------
+// TMSCenRepAudioHandler::HandleNotifyPSL
+// ---------------------------------------------------------------------------
+//
 void TMSCenRepAudioHandler::HandleNotifyPSL(const TUid /*aUid*/,
         const TInt& /*aKey*/, const TRequestStatus& /*aStatus*/)
     {
@@ -97,6 +105,25 @@
     }
 
 // ---------------------------------------------------------------------------
+// TMSCenRepAudioHandler::SetMuteState
+// ---------------------------------------------------------------------------
+//
+void TMSCenRepAudioHandler::SetMuteState(TInt level)
+    {
+    if (iMuteListener)
+        {
+        if (level == 0)
+            {
+            iMuteListener->Set(EPSTelMicMuteOn);
+            }
+        else
+            {
+            iMuteListener->Set(EPSTelMicMuteOff);
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
 // TMSCenRepAudioHandler::SetLoudSpeakerVol
 // ---------------------------------------------------------------------------
 //
--- a/mmserv/tms/tmsserver/src/tmsglobaleffectssettings.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsserver/src/tmsglobaleffectssettings.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -20,11 +20,17 @@
 #include "tmsclientserver.h"
 
 using namespace TMS;
+
 // CONSTANTS
 const TInt KDefaultVolume = 4;
 const TInt KDefaultMaxVolume = 10;
 const TInt KDefaultGain = 1;
+
+#ifndef __WINS__
+const TInt KDefaultMaxGain = 1;
+#else
 const TInt KDefaultMaxGain = 64;
+#endif
 
 TUid KCRUidTmseffects = {0x10207C80};
 const TUint32 KTmsEarPieceVolume = 0x00000001;
@@ -41,7 +47,8 @@
     iMaxVolume(KDefaultMaxVolume),
     iMaxGain(KDefaultMaxGain),
     iEarVolume(KDefaultVolume),
-    iLoudSpkrVolume(KDefaultVolume)
+    iLoudSpkrVolume(KDefaultVolume),
+    iRepository(NULL)
     {
     }
 
--- a/mmserv/tms/tmsserver/src/tmspubsublistener.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsserver/src/tmspubsublistener.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -154,4 +154,14 @@
     return iProperty.Get(iUid, iId, aVal);
     }
 
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::Set
+// Sets integer value.
+// -----------------------------------------------------------------------------
+//
+TInt TMSPubSubListener::Set(TInt aVal)
+    {
+    return iProperty.Set(iUid, iId, aVal);
+    }
+
 // End of File
--- a/mmserv/tms/tmsserver/src/tmsserver.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/tms/tmsserver/src/tmsserver.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -697,6 +697,7 @@
     TInt status = SendMessageToCallServ(TMS_EFFECT_GLOBAL_GAIN_SET, level);
     if (status == TMS_RESULT_SUCCESS)
         {
+        iAudioCenRepHandler->SetMuteState(level);
         iEffectSettings->SetGain(level);
         iSessionIter.SetToFirst();
 
--- a/mmserv/voipaudioservices/VoIPClient/src/VoIPAudioSession.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/voipaudioservices/VoIPClient/src/VoIPAudioSession.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -152,12 +152,10 @@
 //
 EXPORT_C TInt RVoIPAudioSession::GetMaxVolume()
     {
-    TInt maxVol = 0;
     TPckgBuf<TInt> pckg;
     TIpcArgs args(&pckg);
-    SendClientRequest(EVoIPGetMaxVolume, args);
-    maxVol = pckg();
-    return maxVol;
+    TInt err = SendClientRequest(EVoIPGetMaxVolume, args);
+    return (err == KErrNone) ? pckg() : err;
     }
 
 // -----------------------------------------------------------------------------
@@ -338,12 +336,10 @@
 //
 EXPORT_C TInt RVoIPAudioSession::GetMaxGain()
     {
-    TInt maxGain = 0;
     TPckgBuf<TInt> pckg;
     TIpcArgs args(&pckg);
-    SendClientRequest(EVoIPGetMaxGain, args);
-    maxGain = pckg();
-    return maxGain;
+    TInt err = SendClientRequest(EVoIPGetMaxGain, args);
+    return (err == KErrNone) ? pckg() : err;
     }
 
 // -----------------------------------------------------------------------------
--- a/mmserv/voipaudioservices/VoIPServer/inc/VoIPServerSession.h	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/voipaudioservices/VoIPServer/inc/VoIPServerSession.h	Thu Jul 15 19:13:36 2010 +0300
@@ -171,7 +171,7 @@
      * @param RMessage2&
      * @return void
      */
-    void GetVolume(const RMessage2& aMessage);
+    void GetVolumeL(const RMessage2& aMessage);
 
     /**
      * ?description
@@ -195,7 +195,7 @@
      * @param RMessage2&
      * @return void
      */
-    void GetGain(const RMessage2& aMessage);
+    void GetGainL(const RMessage2& aMessage);
 
     /**
      * ?description
@@ -219,7 +219,7 @@
      * @param RMessage2&
      * @return void
      */
-    void GetAudioDevice(const RMessage2& aMessage);
+    void GetAudioDeviceL(const RMessage2& aMessage);
 
     /**
      * ?description
@@ -260,7 +260,7 @@
      * @param RMessage2&
      * @return void
      */
-    void GetIlbcCodecMode(const RMessage2& aMessage);
+    void GetIlbcCodecModeL(const RMessage2& aMessage);
 
     /**
      * ?description
@@ -276,7 +276,7 @@
      * @param RMessage2&
      * @return void
      */
-    void GetG711CodecMode(const RMessage2& aMessage);
+    void GetG711CodecModeL(const RMessage2& aMessage);
 
     /**
      * ?description
@@ -284,7 +284,7 @@
      * @param RMessage2&
      * @return void
      */
-    void GetSupportedBitratesCount(const RMessage2& aMessage);
+    void GetSupportedBitratesCountL(const RMessage2& aMessage);
 
     /**
      * ?description
@@ -308,7 +308,7 @@
      * @param RMessage2&
      * @return void
      */
-    void GetBitrate(const RMessage2& aMessage);
+    void GetBitrateL(const RMessage2& aMessage);
 
     /**
      * ?description
@@ -316,7 +316,7 @@
      * @param RMessage2&
      * @return void
      */
-    void FrameModeRqrdForEC(const RMessage2& aMessage);
+    void FrameModeRqrdForEcL(const RMessage2& aMessage);
 
     /**
      * ?description
@@ -332,7 +332,7 @@
      * @param RMessage2&
      * @return void
      */
-    void GetFrameMode(const RMessage2& aMessage);
+    void GetFrameModeL(const RMessage2& aMessage);
 
     /**
      * ?description
@@ -356,7 +356,7 @@
      * @param RMessage2&
      * @return void
      */
-    void GetVad(const RMessage2& aMessage);
+    void GetVadL(const RMessage2& aMessage);
 
     /**
      * ?description
@@ -372,7 +372,7 @@
      * @param RMessage2&
      * @return void
      */
-    void GetCng(const RMessage2& aMessage);
+    void GetCngL(const RMessage2& aMessage);
 
     /**
      * ?description
@@ -388,7 +388,7 @@
      * @param RMessage2&
      * @return void
      */
-    void GetPlc(const RMessage2& aMessage);
+    void GetPlcL(const RMessage2& aMessage);
 
     /**
      * ?description
--- a/mmserv/voipaudioservices/VoIPServer/src/VoIPServerSession.cpp	Mon Jun 21 16:15:34 2010 +0300
+++ b/mmserv/voipaudioservices/VoIPServer/src/VoIPServerSession.cpp	Thu Jul 15 19:13:36 2010 +0300
@@ -240,7 +240,7 @@
             GetMaxVolumeL(aMessage);
             break;
         case EVoIPGetVolume:
-            GetVolume(aMessage);
+            GetVolumeL(aMessage);
             break;
         case EVoIPSetVolume:
             SetVolume(aMessage);
@@ -249,7 +249,7 @@
             GetMaxGainL(aMessage);
             break;
         case EVoIPGetGain:
-            GetGain(aMessage);
+            GetGainL(aMessage);
             break;
         case EVoIPSetGain:
             SetGain(aMessage);
@@ -258,7 +258,7 @@
             SetAudioDeviceL(aMessage);
             break;
         case EVoIPGetAudioDevice:
-            GetAudioDevice(aMessage);
+            GetAudioDeviceL(aMessage);
             break;
         case EVoIPBufferFilled:
             BufferFilledL(aMessage);
@@ -270,16 +270,16 @@
             SetIlbcCodecModeL(aMessage);
             break;
         case EVoIPGetIlbcCodecMode:
-            GetIlbcCodecMode(aMessage);
+            GetIlbcCodecModeL(aMessage);
             break;
         case EVoIPSetG711CodecMode:
             SetG711CodecModeL(aMessage);
             break;
         case EVoIPGetG711CodecMode:
-            GetG711CodecMode(aMessage);
+            GetG711CodecModeL(aMessage);
             break;
         case EVoIPGetSupportedBitratesCount:
-            GetSupportedBitratesCount(aMessage);
+            GetSupportedBitratesCountL(aMessage);
             break;
         case EVoIPGetSupportedBitrates:
             GetSupportedBitratesL(aMessage);
@@ -288,16 +288,16 @@
             SetBitrate(aMessage);
             break;
         case EVoIPGetBitrate:
-            GetBitrate(aMessage);
+            GetBitrateL(aMessage);
             break;
         case EVoIPFrameModeRqrdForEC:
-            FrameModeRqrdForEC(aMessage);
+            FrameModeRqrdForEcL(aMessage);
             break;
         case EVoIPSetFrameMode:
             SetFrameMode(aMessage);
             break;
         case EVoIPGetFrameMode:
-            GetFrameMode(aMessage);
+            GetFrameModeL(aMessage);
             break;
         case EVoIPConcealErrForNextBuf:
             ConcealErrorForNextBuffer();
@@ -306,19 +306,19 @@
             SetVad(aMessage);
             break;
         case EVoIPGetVad:
-            GetVad(aMessage);
+            GetVadL(aMessage);
             break;
         case EVoIPSetCng:
             SetCng(aMessage);
             break;
         case EVoIPGetCng:
-            GetCng(aMessage);
+            GetCngL(aMessage);
             break;
         case EVoIPSetPlc:
             SetPlc(aMessage);
             break;
         case EVoIPGetPlc:
-            GetPlc(aMessage);
+            GetPlcL(aMessage);
             break;
         case EVoIPBadLsfNextBuffer:
             BadLsfNextBuffer();
@@ -439,29 +439,11 @@
             iCodecsUp.Reset();
             iCodecsCountUp = 0;
             iDevSound->GetSupportedInputDataTypesL(iCodecsUp, iPriority);
-/*
-#ifdef __WINSCW__
-            // Support for adaptation stubs
-            iCodecsUp.Append(KMccFourCCIdG711);
-            iCodecsUp.Append(KMccFourCCIdG729);
-            iCodecsUp.Append(KMccFourCCIdILBC);
-            iCodecsUp.Append(KMccFourCCIdAMRNB);
-#endif
-*/
             iCodecsCountUp = iCodecsUp.Count();
 
             iCodecsDn.Reset();
             iCodecsCountDn = 0;
             iDevSound->GetSupportedOutputDataTypesL(iCodecsDn, iPriority);
-/*
-#ifdef __WINSCW__
-            // Support for adaptation stubs
-            iCodecsDn.Append(KMccFourCCIdG711);
-            iCodecsDn.Append(KMccFourCCIdG729);
-            iCodecsDn.Append(KMccFourCCIdILBC);
-            iCodecsDn.Append(KMccFourCCIdAMRNB);
-#endif
-*/
             iCodecsCountDn = iCodecsDn.Count();
             }
         }
@@ -737,23 +719,37 @@
 //
 void CVoIPAudioServerSession::GetMaxVolumeL(const RMessage2& aMessage)
     {
-    TPckgBuf<TInt> p(iMaxVolume);
-    aMessage.WriteL(0, p);
+    if (iThread.Handle() > 0 && iMaxVolume > 0)
+        {
+        TPckgBuf<TInt> p(iMaxVolume);
+        aMessage.WriteL(0, p);
+        }
+    else
+        {
+        User::Leave(KErrBadHandle);
+        }
 
     TRACE_PRN_N1(_L("VoIP->SRV-SESSION: GetMaxVolumeL->MaxVolume [%d]"),
             iMaxVolume);
     }
 
 // -----------------------------------------------------------------------------
-// CVoIPAudioServerSession::GetVolume
+// CVoIPAudioServerSession::GetVolumeL
 //
 // -----------------------------------------------------------------------------
 //
-void CVoIPAudioServerSession::GetVolume(const RMessage2& aMessage)
+void CVoIPAudioServerSession::GetVolumeL(const RMessage2& aMessage)
     {
-    iMessage = aMessage;
-    iMsgQueued = ETrue;
-    SendCmdToThread(ECmdGetVolume);
+    if (iThread.Handle() > 0)
+        {
+        iMessage = aMessage;
+        iMsgQueued = ETrue;
+        SendCmdToThread(ECmdGetVolume);
+        }
+    else
+        {
+        User::Leave(KErrBadHandle);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -776,22 +772,35 @@
 //
 void CVoIPAudioServerSession::GetMaxGainL(const RMessage2& aMessage)
     {
-    TPckgBuf<TInt> p(iMaxGain);
-    aMessage.WriteL(0, p);
-
+    if (iThread.Handle() > 0 && iMaxGain > 0)
+        {
+        TPckgBuf<TInt> p(iMaxGain);
+        aMessage.WriteL(0, p);
+        }
+    else
+        {
+        User::Leave(KErrBadHandle);
+        }
     TRACE_PRN_N1(_L("VoIP->SRV-SESSION: GetMaxGainL->MaxGain [%d]"), iMaxGain);
     }
 
 // -----------------------------------------------------------------------------
-// CVoIPAudioServerSession::GetGain
+// CVoIPAudioServerSession::GetGainL
 //
 // -----------------------------------------------------------------------------
 //
-void CVoIPAudioServerSession::GetGain(const RMessage2& aMessage)
+void CVoIPAudioServerSession::GetGainL(const RMessage2& aMessage)
     {
-    iMessage = aMessage;
-    iMsgQueued = ETrue;
-    SendCmdToThread(ECmdGetGain);
+    if (iThread.Handle() > 0)
+        {
+        iMessage = aMessage;
+        iMsgQueued = ETrue;
+        SendCmdToThread(ECmdGetGain);
+        }
+    else
+        {
+        User::Leave(KErrBadHandle);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -829,15 +838,22 @@
     }
 
 // -----------------------------------------------------------------------------
-// CVoIPAudioServerSession::GetAudioDevice
+// CVoIPAudioServerSession::GetAudioDeviceL
 //
 // -----------------------------------------------------------------------------
 //
-void CVoIPAudioServerSession::GetAudioDevice(const RMessage2& aMessage)
+void CVoIPAudioServerSession::GetAudioDeviceL(const RMessage2& aMessage)
     {
-    iMessage = aMessage;
-    iMsgQueued = ETrue;
-    SendCmdToThread(ECmdGetAudioDevice);
+    if (iThread.Handle() > 0)
+        {
+        iMessage = aMessage;
+        iMsgQueued = ETrue;
+        SendCmdToThread(ECmdGetAudioDevice);
+        }
+    else
+        {
+        User::Leave(KErrBadHandle);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -847,8 +863,6 @@
 //
 void CVoIPAudioServerSession::BufferFilledL(const RMessage2& aMessage)
     {
-    //    TRACE_PRN_FN_ENT;
-
     TVoIPMsgBufPckg pckg;
     aMessage.ReadL(0, pckg);
     iShared.iMutex.Wait();
@@ -856,8 +870,6 @@
     iShared.iSequenceNum = pckg().iUint;
     iShared.iMutex.Signal();
     SendCmdToThread(ECmdBufferFilled);
-
-    //    TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
@@ -867,9 +879,7 @@
 //
 void CVoIPAudioServerSession::BufferEmptiedL(const RMessage2& /*aMessage*/)
     {
-    //    TRACE_PRN_FN_ENT;
     SendCmdToThread(ECmdBufferEmptied);
-    //    TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
@@ -888,15 +898,22 @@
     }
 
 // -----------------------------------------------------------------------------
-// CVoIPAudioServerSession::GetIlbcCodecMode
+// CVoIPAudioServerSession::GetIlbcCodecModeL
 //
 // -----------------------------------------------------------------------------
 //
-void CVoIPAudioServerSession::GetIlbcCodecMode(const RMessage2& aMessage)
+void CVoIPAudioServerSession::GetIlbcCodecModeL(const RMessage2& aMessage)
     {
-    iMessage = aMessage;
-    iMsgQueued = ETrue;
-    SendCmdToThread(ECmdGetIlbcCodecMode);
+    if (iThread.Handle() > 0)
+        {
+        iMessage = aMessage;
+        iMsgQueued = ETrue;
+        SendCmdToThread(ECmdGetIlbcCodecMode);
+        }
+    else
+        {
+        User::Leave(KErrBadHandle);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -915,28 +932,42 @@
     }
 
 // -----------------------------------------------------------------------------
-// CVoIPAudioServerSession::GetG711CodecMode
+// CVoIPAudioServerSession::GetG711CodecModeL
 //
 // -----------------------------------------------------------------------------
 //
-void CVoIPAudioServerSession::GetG711CodecMode(const RMessage2& aMessage)
+void CVoIPAudioServerSession::GetG711CodecModeL(const RMessage2& aMessage)
     {
-    iMessage = aMessage;
-    iMsgQueued = ETrue;
-    SendCmdToThread(ECmdGetG711CodecMode);
+    if (iThread.Handle() > 0)
+        {
+        iMessage = aMessage;
+        iMsgQueued = ETrue;
+        SendCmdToThread(ECmdGetG711CodecMode);
+        }
+    else
+        {
+        User::Leave(KErrBadHandle);
+        }
     }
 
 // -----------------------------------------------------------------------------
-// CVoIPAudioServerSession::GetSupportedBitratesCount
+// CVoIPAudioServerSession::GetSupportedBitratesCountL
 //
 // -----------------------------------------------------------------------------
 //
-void CVoIPAudioServerSession::GetSupportedBitratesCount(
+void CVoIPAudioServerSession::GetSupportedBitratesCountL(
         const RMessage2& aMessage)
     {
-    iMessage = aMessage;
-    iMsgQueued = ETrue;
-    SendCmdToThread(ECmdGetSupportedBitrates);
+    if (iThread.Handle() > 0)
+        {
+        iMessage = aMessage;
+        iMsgQueued = ETrue;
+        SendCmdToThread(ECmdGetSupportedBitrates);
+        }
+    else
+        {
+        User::Leave(KErrBadHandle);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -992,27 +1023,41 @@
     }
 
 // -----------------------------------------------------------------------------
-// CVoIPAudioServerSession::GetBitrate
+// CVoIPAudioServerSession::GetBitrateL
 //
 // -----------------------------------------------------------------------------
 //
-void CVoIPAudioServerSession::GetBitrate(const RMessage2& aMessage)
+void CVoIPAudioServerSession::GetBitrateL(const RMessage2& aMessage)
     {
-    iMessage = aMessage;
-    iMsgQueued = ETrue;
-    SendCmdToThread(ECmdGetBitrate);
+    if (iThread.Handle() > 0)
+        {
+        iMessage = aMessage;
+        iMsgQueued = ETrue;
+        SendCmdToThread(ECmdGetBitrate);
+        }
+    else
+        {
+        User::Leave(KErrBadHandle);
+        }
     }
 
 // -----------------------------------------------------------------------------
-// CVoIPAudioServerSession::FrameModeRequiredForEC
+// CVoIPAudioServerSession::FrameModeRequiredForEcL
 //
 // -----------------------------------------------------------------------------
 //
-void CVoIPAudioServerSession::FrameModeRqrdForEC(const RMessage2& aMessage)
+void CVoIPAudioServerSession::FrameModeRqrdForEcL(const RMessage2& aMessage)
     {
-    iMessage = aMessage;
-    iMsgQueued = ETrue;
-    SendCmdToThread(ECmdFrameModeRqrdForEC);
+    if (iThread.Handle() > 0)
+        {
+        iMessage = aMessage;
+        iMsgQueued = ETrue;
+        SendCmdToThread(ECmdFrameModeRqrdForEC);
+        }
+    else
+        {
+        User::Leave(KErrBadHandle);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -1029,15 +1074,22 @@
     }
 
 // -----------------------------------------------------------------------------
-// CVoIPAudioServerSession::GetFrameMode
+// CVoIPAudioServerSession::GetFrameModeL
 //
 // -----------------------------------------------------------------------------
 //
-void CVoIPAudioServerSession::GetFrameMode(const RMessage2& aMessage)
+void CVoIPAudioServerSession::GetFrameModeL(const RMessage2& aMessage)
     {
-    iMessage = aMessage;
-    iMsgQueued = ETrue;
-    SendCmdToThread(ECmdGetFrameMode);
+    if (iThread.Handle() > 0)
+        {
+        iMessage = aMessage;
+        iMsgQueued = ETrue;
+        SendCmdToThread(ECmdGetFrameMode);
+        }
+    else
+        {
+        User::Leave(KErrBadHandle);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -1063,15 +1115,22 @@
     }
 
 // -----------------------------------------------------------------------------
-// CVoIPAudioServerSession::GetVad
+// CVoIPAudioServerSession::GetVadL
 //
 // -----------------------------------------------------------------------------
 //
-void CVoIPAudioServerSession::GetVad(const RMessage2& aMessage)
+void CVoIPAudioServerSession::GetVadL(const RMessage2& aMessage)
     {
-    iMessage = aMessage;
-    iMsgQueued = ETrue;
-    SendCmdToThread(ECmdGetVad);
+    if (iThread.Handle() > 0)
+        {
+        iMessage = aMessage;
+        iMsgQueued = ETrue;
+        SendCmdToThread(ECmdGetVad);
+        }
+    else
+        {
+        User::Leave(KErrBadHandle);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -1088,15 +1147,22 @@
     }
 
 // -----------------------------------------------------------------------------
-// CVoIPAudioServerSession::GetCng
+// CVoIPAudioServerSession::GetCngL
 //
 // -----------------------------------------------------------------------------
 //
-void CVoIPAudioServerSession::GetCng(const RMessage2& aMessage)
+void CVoIPAudioServerSession::GetCngL(const RMessage2& aMessage)
     {
-    iMessage = aMessage;
-    iMsgQueued = ETrue;
-    SendCmdToThread(ECmdGetCng);
+    if (iThread.Handle() > 0)
+        {
+        iMessage = aMessage;
+        iMsgQueued = ETrue;
+        SendCmdToThread(ECmdGetCng);
+        }
+    else
+        {
+        User::Leave(KErrBadHandle);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -1113,15 +1179,22 @@
     }
 
 // -----------------------------------------------------------------------------
-// CVoIPAudioServerSession::GetPlc
+// CVoIPAudioServerSession::GetPlcL
 //
 // -----------------------------------------------------------------------------
 //
-void CVoIPAudioServerSession::GetPlc(const RMessage2& aMessage)
+void CVoIPAudioServerSession::GetPlcL(const RMessage2& aMessage)
     {
-    iMessage = aMessage;
-    iMsgQueued = ETrue;
-    SendCmdToThread(ECmdGetPlc);
+    if (iThread.Handle() > 0)
+        {
+        iMessage = aMessage;
+        iMsgQueued = ETrue;
+        SendCmdToThread(ECmdGetPlc);
+        }
+    else
+        {
+        User::Leave(KErrBadHandle);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -1202,7 +1275,8 @@
         if (iDTMFTonePlayer)
             {
             iDTMFTonePlayerInitRequest = ETrue;
-            TRAPD(err, iDTMFTonePlayer->InitializeL(*this, EMMFStateTonePlaying));
+            TRAPD(err, iDTMFTonePlayer->InitializeL(*this,
+                    EMMFStateTonePlaying));
             if (err != KErrNone)
                 {
                 delete iDTMFTonePlayer;
@@ -1857,14 +1931,6 @@
         iMsgBuffer.iStatus = aStatus;
         iITCMsgComQueue.Send(iMsgBuffer);
         }
-    else
-        {
-        if (iMsgQueued)
-            {
-            iMessage.Complete(KErrCancel);
-            iMsgQueued = EFalse;
-            }
-        }
     }
 
 // -----------------------------------------------------------------------------
@@ -2091,22 +2157,21 @@
 // -----------------------------------------------------------------------------
 //
 void CVoIPAudioServerSession::DoHandleError(TInt /*aError*/)
-    {
-    /*    DEBPRN1(_L("VoIP->CVoIPAudioServerSession[0x%x]::DoHandleError [%d] :>"), aError);
-     iShared.iMutex.Wait();
-     TUserCommand cmd = iShared.iCmd;
-     iShared.iMutex.Signal();
+    {/*
+    DEBPRN1(_L("VoIP->CVoIPAudioServerSession[0x%x]::DoHandleError [%d] :>"), aError);
+    iShared.iMutex.Wait();
+    TUserCommand cmd = iShared.iCmd;
+    iShared.iMutex.Signal();
 
-     if (iMsgQueued)
-     {
-     iMessage.Complete(aError);
-     iMsgQueued = EFalse;
-     }
-     else
-     {
-     NotifyClient(cmd, aError);
-     }
-     */
+    if (iMsgQueued)
+        {
+        iMessage.Complete(aError);
+        iMsgQueued = EFalse;
+        }
+    else
+        {
+        NotifyClient(cmd, aError);
+        }*/
     }
 
 // -----------------------------------------------------------------------------