Revision: 201011 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 22:29:45 +0300
branchRCL_3
changeset 7 3d8c721bf319
parent 6 e35735ece90c
child 8 03a293c97d5c
Revision: 201011 Kit: 201013
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioPlayController.cpp
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Data/101FAFB3.rss
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Data/101FAFB9.rss
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Data/101FAFBC.rss
mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Data/101FAFB6.rss
mmfenh/enhancedmediaclient/Plugins/DescriptorSource/group/ABLD.BAT
mmmw_plat/equalizer_ui_api/inc/EqualizerPresetsDialog.h
mmmw_plat/progressive_download_api/inc/MProgressiveDownloadUtility.h
mmmw_plat/telephony_multimedia_service_api/inc/tms.h
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/group/TmsAudioServicesTestClass.pkg
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/RD.crt
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/RD.key
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/TmsAudioServicesTestClass.pkg
mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/create_sis.bat
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/VoIPAudioServicesTestClass.pkg
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/sis/RD.crt
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/sis/RD.key
mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/sis/VoIPAudioServicesTestClass.pkg
mmserv/audioeffectsui/equalizer/data/Equalizer.rss
mmserv/tms/inc/tmsamrformatimpl.h
mmserv/tms/inc/tmsbufferimpl.h
mmserv/tms/inc/tmscallimpl.h
mmserv/tms/inc/tmsclientserver.h
mmserv/tms/inc/tmsclientsinkimpl.h
mmserv/tms/inc/tmsclientsourceimpl.h
mmserv/tms/inc/tmseffectimpl.h
mmserv/tms/inc/tmsformatimpl.h
mmserv/tms/inc/tmsg711formatimpl.h
mmserv/tms/inc/tmsg729formatimpl.h
mmserv/tms/inc/tmsgaineffectimpl.h
mmserv/tms/inc/tmsglobalgaineffectimpl.h
mmserv/tms/inc/tmsglobalroutingimpl.h
mmserv/tms/inc/tmsglobalvoleffectimpl.h
mmserv/tms/inc/tmsilbcformatimpl.h
mmserv/tms/inc/tmsmembuffer.h
mmserv/tms/inc/tmsmicsourceimpl.h
mmserv/tms/inc/tmsmodemsinkimpl.h
mmserv/tms/inc/tmsmodemsourceimpl.h
mmserv/tms/inc/tmspcmformatimpl.h
mmserv/tms/inc/tmsproxy.h
mmserv/tms/inc/tmsshared.h
mmserv/tms/inc/tmssinkimpl.h
mmserv/tms/inc/tmssourceimpl.h
mmserv/tms/inc/tmsspeakersinkimpl.h
mmserv/tms/inc/tmsstreamimpl.h
mmserv/tms/inc/tmsutility.h
mmserv/tms/inc/tmsvolumeeffectimpl.h
mmserv/tms/tmscallproxy/src/tmscallproxy.cpp
mmserv/tms/tmscallserver/src/cspdevsound.cpp
mmserv/tms/tmscallserver/src/ipcalldownlinkds.cpp
mmserv/tms/tmsfactory/inc/tmsfactoryimpl.h
mmserv/tms/tmsfactory/src/tmsfactory.cpp
mmserv/tms/tmsfactory/src/tmsfactoryimpl.cpp
mmserv/tms/tmsimpl/bwins/tmsimpl.def
mmserv/tms/tmsimpl/eabi/tmsimpl.def
mmserv/tms/tmsimpl/inc/tmsformatbodyimpl.h
mmserv/tms/tmsimpl/inc/tmsgaineffectbodyimpl.h
mmserv/tms/tmsimpl/inc/tmsglobalgaineffectbodyimpl.h
mmserv/tms/tmsimpl/inc/tmsglobalroutingbodyimpl.h
mmserv/tms/tmsimpl/inc/tmsglobalvoleffectbodyimpl.h
mmserv/tms/tmsimpl/inc/tmsstreambodyimpl.h
mmserv/tms/tmsimpl/inc/tmsvolumeeffectbodyimpl.h
mmserv/tms/tmsimpl/src/tmsamrimpl.cpp
mmserv/tms/tmsimpl/src/tmsbufferimpl.cpp
mmserv/tms/tmsimpl/src/tmscallimpl.cpp
mmserv/tms/tmsimpl/src/tmsclientsinkimpl.cpp
mmserv/tms/tmsimpl/src/tmsclientsourceimpl.cpp
mmserv/tms/tmsimpl/src/tmscscallbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmseffectimpl.cpp
mmserv/tms/tmsimpl/src/tmsformatimpl.cpp
mmserv/tms/tmsimpl/src/tmsg711impl.cpp
mmserv/tms/tmsimpl/src/tmsg729impl.cpp
mmserv/tms/tmsimpl/src/tmsgaineffectbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsgaineffectimpl.cpp
mmserv/tms/tmsimpl/src/tmsglobalgaineffectbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsglobalgaineffectimpl.cpp
mmserv/tms/tmsimpl/src/tmsglobalroutingbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsglobalroutingimpl.cpp
mmserv/tms/tmsimpl/src/tmsglobalvoleffectbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsglobalvoleffectimpl.cpp
mmserv/tms/tmsimpl/src/tmsilbcimpl.cpp
mmserv/tms/tmsimpl/src/tmsipcallbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsmicsourceimpl.cpp
mmserv/tms/tmsimpl/src/tmsmodemsinkimpl.cpp
mmserv/tms/tmsimpl/src/tmsmodemsourceimpl.cpp
mmserv/tms/tmsimpl/src/tmspcmimpl.cpp
mmserv/tms/tmsimpl/src/tmsqueuehandler.cpp
mmserv/tms/tmsimpl/src/tmssinkimpl.cpp
mmserv/tms/tmsimpl/src/tmssourceimpl.cpp
mmserv/tms/tmsimpl/src/tmsspeakersinkimpl.cpp
mmserv/tms/tmsimpl/src/tmsstreamimpl.cpp
mmserv/tms/tmsimpl/src/tmsvolumeeffectbodyimpl.cpp
mmserv/tms/tmsimpl/src/tmsvolumeeffectimpl.cpp
mmserv/tms/tmsproxy/src/tmsproxy.cpp
mmserv/tms/tmsproxy/src/tmsqueuehandler.cpp
mmserv/tms/tmsserver/group/tmsserver.mmp
mmserv/tms/tmsserver/inc/cspaudiohandler.h
mmserv/tms/tmsserver/inc/cspcenreplistener.h
mmserv/tms/tmsserver/inc/globaleffectssettings.h
mmserv/tms/tmsserver/inc/mcspcenrepobserver.h
mmserv/tms/tmsserver/inc/tareventhandler.h
mmserv/tms/tmsserver/inc/tmscenrepaudiohandler.h
mmserv/tms/tmsserver/inc/tmscenreplistener.h
mmserv/tms/tmsserver/inc/tmscenrepobserver.h
mmserv/tms/tmsserver/inc/tmsglobaleffectssettings.h
mmserv/tms/tmsserver/inc/tmspubsublistener.h
mmserv/tms/tmsserver/inc/tmspubsubobserver.h
mmserv/tms/tmsserver/inc/tmsserver.h
mmserv/tms/tmsserver/inc/tmsserversession.h
mmserv/tms/tmsserver/inc/tmstareventhandler.h
mmserv/tms/tmsserver/inc/tmstelephonycenrep.h
mmserv/tms/tmsserver/src/cspaudiohandler.cpp
mmserv/tms/tmsserver/src/cspcenreplistener.cpp
mmserv/tms/tmsserver/src/globaleffectssettings.cpp
mmserv/tms/tmsserver/src/tareventhandler.cpp
mmserv/tms/tmsserver/src/tmscenrepaudiohandler.cpp
mmserv/tms/tmsserver/src/tmscenreplistener.cpp
mmserv/tms/tmsserver/src/tmsglobaleffectssettings.cpp
mmserv/tms/tmsserver/src/tmspubsublistener.cpp
mmserv/tms/tmsserver/src/tmsserver.cpp
mmserv/tms/tmsserver/src/tmsserversession.cpp
mmserv/tms/tmsserver/src/tmstareventhandler.cpp
mmserv/tms/tmsutility/bwins/tmsutility.def
mmserv/tms/tmsutility/eabi/tmsutility.def
mmserv/tms/tmsutility/src/tmsutility.cpp
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioPlayController.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioController/Src/AdvancedAudioPlayController.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -684,6 +684,7 @@
     TRAP(err, DoPauseL(ETrue)); // this is a preemption pause
 	// In case of pre-emption we should only Pause ... but not Stop.
     SendEventToClient(TMMFEvent(KMMFEventCategoryPlaybackComplete, aError));
+    SendEventToClient(TMMFEvent(KStreamControlEventStateChangedPaused, aError));
     }
 
 // -----------------------------------------------------------------------------
@@ -1654,7 +1655,7 @@
 
 	TTimeIntervalMicroSeconds positionMicroSeconds(0);
 
-    if (iState == EPlaying)
+    if (iState == EPlaying || iState == EAutoPaused)
     	{
     	DP1 (_L("CAdvancedAudioPlayController::PositionL iTimePositionInMicroSecs [%d] msec"), iTimePositionInMicroSecs);
         // adjust the position here since devsound returns the incremented postion value during loopplay
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Data/101FAFB3.rss	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/aacaudioplaycontroller/Data/101FAFB3.rss	Wed Mar 31 22:29:45 2010 +0300
@@ -46,7 +46,7 @@
 					version_no = 1;
 					display_name = "AAC Audio Controller Plugin";
 					default_data = "?";
-					opaque_data = "<s>Nokia<i>0x101F5D07<p>0x101FAFB5<d>";
+					opaque_data = "<s>Nokia<i>0x101F5D07<p>0x101FAFB5<a>0x200000<d>";
                                         rom_only = 0;					
 					}
 				};
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Data/101FAFB9.rss	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/amraudioplaycontroller/Data/101FAFB9.rss	Wed Mar 31 22:29:45 2010 +0300
@@ -46,7 +46,7 @@
 					version_no = 1;
 					display_name = "AMR Audio Play Controller Plugin";
 					default_data = "?";
-					opaque_data = "<s>Nokia<i>0x101F5D07<p>0x101FAFBB<d>";
+					opaque_data = "<s>Nokia<i>0x101F5D07<p>0x101FAFBB<a>0x200000<d>";
                                         rom_only = 0;					
 					}
 				};
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Data/101FAFBC.rss	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/awbaudioplaycontroller/Data/101FAFBC.rss	Wed Mar 31 22:29:45 2010 +0300
@@ -46,7 +46,7 @@
 					version_no = 1;
 					display_name = "AWB Audio Play Controller Plugin";
 					default_data = "?";
-					opaque_data = "<s>Nokia<i>0x101F5D07<p>0x101FAFBE<d>";
+					opaque_data = "<s>Nokia<i>0x101F5D07<p>0x101FAFBE<a>0x200000<d>";
                                         rom_only = 0;					
 					}
 				};
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Data/101FAFB6.rss	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/mp3audioplaycontroller/Data/101FAFB6.rss	Wed Mar 31 22:29:45 2010 +0300
@@ -46,7 +46,7 @@
 					version_no = 1;
 					display_name = "MP3 Audio Controller Plugin";
 					default_data = "?";
-					opaque_data = "<s>Nokia<i>0x101F5D07<p>0x101FAFB8<d>";
+					opaque_data = "<s>Nokia<i>0x101F5D07<p>0x101FAFB8<a>0x200000<d>";
                                         rom_only = 0;					
 					}
 				};
--- a/mmfenh/enhancedmediaclient/Plugins/DescriptorSource/group/ABLD.BAT	Mon Mar 15 12:42:35 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-rem
-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 License "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
-rem Description:
-rem
-
-@ECHO OFF
-
-REM Bldmake-generated batch file - ABLD.BAT
-REM ** DO NOT EDIT **
-
-perl -S ABLD.PL "\s60\mw\mmenhs\audioenhancements\EnhancedMediaClient\Plugins\DescriptorSource\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9
-if errorlevel==1 goto CheckPerl
-goto End
-
-:CheckPerl
-perl -v >NUL
-if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed?
-goto End
-
-:End
--- a/mmmw_plat/equalizer_ui_api/inc/EqualizerPresetsDialog.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmmw_plat/equalizer_ui_api/inc/EqualizerPresetsDialog.h	Wed Mar 31 22:29:45 2010 +0300
@@ -25,7 +25,7 @@
 #include <AknDialog.h> 
 #include <aknlists.h>
 #include <EqualizerConstants.h>
-#include <AudioEqualizerutility.h>
+#include <AudioEqualizerUtility.h>
 
 // CLASS DECLARATION
 class CEqualizerPresetListArray;
--- a/mmmw_plat/progressive_download_api/inc/MProgressiveDownloadUtility.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmmw_plat/progressive_download_api/inc/MProgressiveDownloadUtility.h	Wed Mar 31 22:29:45 2010 +0300
@@ -21,7 +21,7 @@
 #define __MPROGRESSIVEDOWNLOADUTILITY_H__
 
 
-#include <BrCtlDownloadObserver.h>
+#include <brctldownloadobserver.h>
 
 
 class MProgessiveDownloadUtility//:public MBrCtlDownloadObserver
--- a/mmmw_plat/telephony_multimedia_service_api/inc/tms.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmmw_plat/telephony_multimedia_service_api/inc/tms.h	Wed Mar 31 22:29:45 2010 +0300
@@ -119,8 +119,8 @@
 #define TMS_FORMAT_ILBC                         ((gint)17)
 
 typedef gint TMSRTPSessionType;
-#define TMS_SESSION_RTP_PUSH                    ((gint)18)
-#define TMS_SESSION_RTP_PULL                    ((gint)19)
+#define TMS_SESSION_RTP_PULL                    ((gint)0)
+#define TMS_SESSION_RTP_PUSH                    ((gint)1)
 
 // TMS vectors
 typedef std::vector<TMSFormat*> FormatVector;
@@ -153,6 +153,7 @@
 #define TMS_AUDIO_OUTPUT_WIRED_ACCESSORY        ((gint)5)
 #define TMS_AUDIO_OUTPUT_ACCESSORY              ((gint)6)
 #define TMS_AUDIO_OUTPUT_ETTY                   ((gint)7)
+#define TMS_AUDIO_OUTPUT_NOT_ACTIVE             ((gint)8)
 
 // TMSSignalEvent structure for callback notifications
 struct TMSSignalEvent
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/group/TmsAudioServicesTestClass.pkg	Wed Mar 31 22:29:45 2010 +0300
@@ -0,0 +1,38 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: Telephony Multimedia Service - STIF TEST
+;
+;
+
+;languages
+&EN
+
+;Header
+#{"TmsAudioServicesTestClass"},(0x10207C72),1,0,0
+
+;Localised Vendor name
+%{"TmsAudioServicesTestClass"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files to install
+
+"/epoc32/release/armv5/urel/TmsAudioServicesTestClass.dll" - "c:/Sys/Bin/TmsAudioServicesTestClass.dll"
+; If installation process fails, exclude testframework.ini from the sis file and
+; copy manually.
+"../../init/TestFramework.ini"-"c:/Testframework/TestFramework.ini"
+"../../init/TmsAudioServicesTestClass.ini"-"c:/Testframework/TmsAudioServicesTestClass.ini"
+"../../Conf/TMSAudioServicesTestClass.cfg"-"c:/Testframework/TMSAudioServicesTestClass.cfg"
+
Binary file mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/RD.crt has changed
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/RD.key	Mon Mar 15 12:42:35 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXQIBAAKBgQC/TDP7KKIaf5+uW4OD2iVZuUMC2a+SeQTjf6srlKcOm+CpPNXn
-uLNm/8fdEnyOIuRXPRKmqhs1n0JkxEGHynELWMTuKXbQx9SRAGUXzyneGn+IJNnO
-vOKHWgKCouX2hfI8rtkdqJpqmO460gGsMgw+lsbeyWyW9lnfLxq+ZC7sqQIDAQAB
-AoGBALmUWZE8GBaQ3P4u9WUCSd3DJkkrmXIFSULSZeH/chlwCwDjbbhArHothVzo
-REE3hEFFlERvHbplZ+mNouzy7boduvgUzbksGrbGMLJ2qO1GzWWVwV+GzOWKd3ss
-/98Gwoy5R8pjnkqUE2wP1iJFw0FjvUTKcYv/z6t3LLJ0CsoBAkEA+c7ixvsviQ3J
-s0INytCKU2bf8fqFQJi1VI82ukxNsujGTQ9upVSjuvqPvWyDvvTdrUBHqO+3qPut
-sEh01Q8aiQJBAMQKDJPVRu4ud3mwUfEavzL5EjqwG1k9VCNGYsT4FwtrHcxu1oP/
-pk6M3rIZukqomoEEnHWPMwhrK3fhBqi0OSECQQDr40VXege4FnH5OI2Hj4afHMyp
-VdQQXGMWFyopnzXblFz0lXb43cTCIiorR9XcMqNFHybLypkWE5o+lRzlt55pAkBQ
-P/zeF5Sts//cpL0mgdh7OVKpC6ZmZaCnwAx2rUhhuDu+kDDoYCLoTOps5fNI1LRK
-1GRoC3LMo3Jr5IYhUYWBAkBpCpN6k4JU/mszq98EojHerQNxk8sPqvQKUzTutohT
-1gLX9yepGayB/TtT2EEJDkWOlnTy/dvN6W3vzbJYz97x
------END RSA PRIVATE KEY-----
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/TmsAudioServicesTestClass.pkg	Mon Mar 15 12:42:35 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description: Telephony Multimedia Service - STIF TEST
-;
-;
-
-;languages
-&EN
-
-;Header
-#{"TmsAudioServicesTestClass"},(0x10207C72),1,0,0
-
-;Localised Vendor name
-%{"TmsAudioServicesTestClass"}
-
-;Unique Vendor name
-:"Nokia"
-
-;Files to install
-
-"/epoc32/release/armv5/urel/TmsAudioServicesTestClass.dll" - "c:/Sys/Bin/TmsAudioServicesTestClass.dll"
-; If installation process fails, exclude testframework.ini from the sis file and 
-; copy manually. 
-"../../init/TestFramework.ini"-"c:/Testframework/TestFramework.ini"
-"../../init/TmsAudioServicesTestClass.ini"-"c:/Testframework/TmsAudioServicesTestClass.ini"
-"../../Conf/TMSAudioServicesTestClass.cfg"-"c:/Testframework/TMSAudioServicesTestClass.cfg"
-
--- a/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/create_sis.bat	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmmw_plat/telephony_multimedia_service_api/tsrc/TmsAudioServicesTestClass/sis/create_sis.bat	Wed Mar 31 22:29:45 2010 +0300
@@ -19,4 +19,4 @@
 
 del TmsAudioServicesTestClass.sis*
 makesis TmsAudioServicesTestClass.pkg TmsAudioServicesTestClass.sis
-signsis TmsAudioServicesTestClass.sis TmsAudioServicesTestClass.sisx rd.crt rd.key
+rem signsis TmsAudioServicesTestClass.sis TmsAudioServicesTestClass.sisx rd.crt rd.key
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/group/VoIPAudioServicesTestClass.pkg	Wed Mar 31 22:29:45 2010 +0300
@@ -0,0 +1,37 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: VoIP Audio Service - STIF Test
+;
+
+;languages
+&EN
+
+;Header
+#{"VoIPAudioServicesTestClass"},(0x10005942),1,0,0
+
+;Localised Vendor name
+%{"VoIPAudioServicesTestClass"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files to install
+
+"/epoc32/release/armv5/urel/VoIPAudioServicesTestClass.dll"-"c:/Sys/Bin/VoIPAudioServicesTestClass.dll"
+;"../../init/TestFramework.ini"-"c:/Testframework/TestFramework.ini"
+"../../conf/VoIPAudioServicesTestClass.cfg"-"c:/Testframework/VoIPAudioServicesTestClass.cfg"
+
+;"../../data/mmc/alarm 1.aac"-"e:/testing/data/alarm 1.aac"
+;"../../data/mmc/alarm.aac"-"e:/testing/data/alarm.aac"
+"../../data/mmc/test_8khz.wav"-"c:/testing/data/test_8khz.wav"
\ No newline at end of file
Binary file mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/sis/RD.crt has changed
--- a/mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/sis/RD.key	Mon Mar 15 12:42:35 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXQIBAAKBgQC/TDP7KKIaf5+uW4OD2iVZuUMC2a+SeQTjf6srlKcOm+CpPNXn
-uLNm/8fdEnyOIuRXPRKmqhs1n0JkxEGHynELWMTuKXbQx9SRAGUXzyneGn+IJNnO
-vOKHWgKCouX2hfI8rtkdqJpqmO460gGsMgw+lsbeyWyW9lnfLxq+ZC7sqQIDAQAB
-AoGBALmUWZE8GBaQ3P4u9WUCSd3DJkkrmXIFSULSZeH/chlwCwDjbbhArHothVzo
-REE3hEFFlERvHbplZ+mNouzy7boduvgUzbksGrbGMLJ2qO1GzWWVwV+GzOWKd3ss
-/98Gwoy5R8pjnkqUE2wP1iJFw0FjvUTKcYv/z6t3LLJ0CsoBAkEA+c7ixvsviQ3J
-s0INytCKU2bf8fqFQJi1VI82ukxNsujGTQ9upVSjuvqPvWyDvvTdrUBHqO+3qPut
-sEh01Q8aiQJBAMQKDJPVRu4ud3mwUfEavzL5EjqwG1k9VCNGYsT4FwtrHcxu1oP/
-pk6M3rIZukqomoEEnHWPMwhrK3fhBqi0OSECQQDr40VXege4FnH5OI2Hj4afHMyp
-VdQQXGMWFyopnzXblFz0lXb43cTCIiorR9XcMqNFHybLypkWE5o+lRzlt55pAkBQ
-P/zeF5Sts//cpL0mgdh7OVKpC6ZmZaCnwAx2rUhhuDu+kDDoYCLoTOps5fNI1LRK
-1GRoC3LMo3Jr5IYhUYWBAkBpCpN6k4JU/mszq98EojHerQNxk8sPqvQKUzTutohT
-1gLX9yepGayB/TtT2EEJDkWOlnTy/dvN6W3vzbJYz97x
------END RSA PRIVATE KEY-----
--- a/mmmw_plat/voip_audio_services_api/tsrc/VoIPAudioServicesTestClass/sis/VoIPAudioServicesTestClass.pkg	Mon Mar 15 12:42:35 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description: VoIP Audio Service - STIF Test
-;
-
-;languages
-&EN
-
-;Header
-#{"VoIPAudioServicesTestClass"},(0x10005942),1,0,0
-
-;Localised Vendor name
-%{"VoIPAudioServicesTestClass"}
-
-;Unique Vendor name
-:"Nokia"
-
-;Files to install
-
-"/epoc32/release/armv5/urel/VoIPAudioServicesTestClass.dll"-"c:/Sys/Bin/VoIPAudioServicesTestClass.dll"
-;"../../init/TestFramework.ini"-"c:/Testframework/TestFramework.ini"
-"../../conf/VoIPAudioServicesTestClass.cfg"-"c:/Testframework/VoIPAudioServicesTestClass.cfg"
-
-;"../../data/mmc/alarm 1.aac"-"e:/testing/data/alarm 1.aac"
-;"../../data/mmc/alarm.aac"-"e:/testing/data/alarm.aac"
-"../../data/mmc/test_8khz.wav"-"c:/testing/data/test_8khz.wav"
\ No newline at end of file
--- a/mmserv/audioeffectsui/equalizer/data/Equalizer.rss	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/audioeffectsui/equalizer/data/Equalizer.rss	Wed Mar 31 22:29:45 2010 +0300
@@ -65,8 +65,7 @@
 
 RESOURCE EIK_APP_INFO
     {
-    menubar=r_equalizer_container_menubar;
-    cba=R_AVKON_SOFTKEYS_OPTIONS_BACK;     
+    cba=R_AVKON_SOFTKEYS_BACK;
     }
 
 //----------------------------------------------------
@@ -190,7 +189,7 @@
     flags = EEikDialogFlagNoDrag | EEikDialogFlagCbaButtons |
               EEikDialogFlagWait| EEikDialogFlagFillAppClientRect | EEikDialogFlagNotifyEsc; 
     title = qtn_eq_title_equalizer;
-    buttons = r_equalizer_softkeys_options_back__select;
+    buttons = R_AVKON_SOFTKEYS_BACK; 
 
     items =
         {
--- a/mmserv/tms/inc/tmsamrformatimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsamrformatimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -24,14 +24,11 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSCallProxy;
-
 // TMSAMRFormatImpl class
 class TMSAMRFormatImpl : public TMSAMRFormat
     {
 public:
-    ~TMSAMRFormatImpl();
+    virtual ~TMSAMRFormatImpl();
     static gint Create(TMSFormat*& tmsfmt);
     gint SetProxy(TMSGlobalContext* context, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsbufferimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsbufferimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -29,9 +29,13 @@
 class TMSBufferImpl
     {
 public:
+    ~TMSBufferImpl();
     IMPORT_C static gint Create(TMSBufferType ctype, guint size,
             TMSBuffer*& tmsbuffer);
     IMPORT_C static gint Delete(TMSBuffer*& tmsbuffer);
+
+private:
+    TMSBufferImpl();
     };
 
 } //namespace TMS
--- a/mmserv/tms/inc/tmscallimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmscallimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -27,11 +27,10 @@
 class TMSCallImpl : public TMSCall
     {
 public:
-    ~TMSCallImpl();
-    // We don't have to export this if factory impl is part of tmsimpl.lib
-    // TO DO stop exporting this function
+    virtual ~TMSCallImpl();
     IMPORT_C static gint Create(TMSCallType ctype, TMSCall*& tmscall,
             guint ctxid);
+    IMPORT_C static gint Delete(TMSCall*& tmscall);
 
 private:
     TMSCallImpl();
--- a/mmserv/tms/inc/tmsclientserver.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsclientserver.h	Wed Mar 31 22:29:45 2010 +0300
@@ -47,17 +47,24 @@
     ETMSStartGlobalEffectNotifier,
     ETMSCancelGlobalEffectNotifier,
     ETMSSetMsgQueueHandle,
-    ETMSRingToneInitDefaultProfile,
+    ETMSRingToneInitDefault,
     ETMSRingToneInitFile,
-    ETMSRingToneInitMimeContent,
+    ETMSRingToneInitSequence,
+    ETMSRingToneInitBeepOnce,
+    ETMSRingToneInitSilent,
+    ETMSRingToneInitUnsecureVoIP,
     ETMSRingToneDeinit,
     ETMSRingTonePlay,
     ETMSRingTonePause,
     ETMSRingToneStop,
+    ETMSRingToneMute,
     ETMSStartDTMFNotifier,
     ETMSCancelDTMFNotifier,
     ETMSStartDTMF,
-    ETMSStopDTMF
+    ETMSStopDTMF,
+    ETMSContinueDTMF,
+    ETMSStartInbandTone,
+    ETMSStopInbandTone
     };
 
 // Ring tone open methods
@@ -85,7 +92,8 @@
     EMsgQueueDTMFType,
     EMsgQueueGlobalRoutingType,
     EMsgQueueGlobalVolumeType,
-    EMsgQueueGlobalGainType
+    EMsgQueueGlobalGainType,
+    EMsgQueueInbandToneType
     };
 
 // CONSTANTS
--- a/mmserv/tms/inc/tmsclientsinkimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsclientsinkimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -30,7 +30,7 @@
 class TMSClientSinkImpl : public TMSClientSink
     {
 public:
-    ~TMSClientSinkImpl();
+    virtual ~TMSClientSinkImpl();
     static gint Create(TMSSink*& tmssink);
     gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsclientsourceimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsclientsourceimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -30,8 +30,7 @@
 class TMSClientSourceImpl : public TMSClientSource
     {
 public:
-    ~TMSClientSourceImpl();
-
+    virtual ~TMSClientSourceImpl();
     static gint Create(TMSSource*& tmssource);
     gint SetProxy(TMSCallProxy* aProxy, gint strmid, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmseffectimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmseffectimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -29,9 +29,13 @@
 class TMSEffectImpl
     {
 public:
+    ~TMSEffectImpl();
     IMPORT_C static gint Create(TMSEffectType effecttype,
             TMSEffect*& tmseffect);
     IMPORT_C static gint Delete(TMSEffect*& tmseffect);
+
+private:
+    TMSEffectImpl();
     };
 
 } //namespace TMS
--- a/mmserv/tms/inc/tmsformatimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsformatimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -30,6 +30,7 @@
 class TMSFormatImpl : public TMSFormat
     {
 public:
+    virtual ~TMSFormatImpl();
     IMPORT_C static gint Create(TMSFormatType formattype,
             TMSFormat*& tmsformat);
     IMPORT_C static gint Delete(TMSFormat*& tmsformat);
--- a/mmserv/tms/inc/tmsg711formatimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsg711formatimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -23,15 +23,11 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSCallProxy;
-
 // TMSG711FormatImpl class
 class TMSG711FormatImpl : public TMSG711Format
     {
 public:
-    ~TMSG711FormatImpl();
-
+    virtual ~TMSG711FormatImpl();
     static gint Create(TMSFormat*& tmsfmt);
     gint SetProxy(TMSGlobalContext* context, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsg729formatimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsg729formatimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -23,15 +23,11 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSCallProxy;
-
 // TMSG729FormatImpl class
 class TMSG729FormatImpl : public TMSG729Format
     {
 public:
-    ~TMSG729FormatImpl();
-
+    virtual ~TMSG729FormatImpl();
     static gint Create(TMSFormat*& tmsfmt);
     gint SetProxy(TMSGlobalContext* context, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsgaineffectimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsgaineffectimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -30,19 +30,17 @@
 class TMSGainEffectImpl : public TMSGainEffect
     {
 public:
-    ~TMSGainEffectImpl();
-
+    virtual ~TMSGainEffectImpl();
     static gint Create(TMSEffect*& tmseffect);
     gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
-    gint SetParentEffect(TMSEffect*& parenteffect);
 
 private:
     TMSGainEffectImpl();
     gint PostConstruct();
+    gint SetParent(TMSEffect*& parent);
     };
 
 } //namespace TMS
 
 #endif // TMS_GAIN_EFFECT_IMPL_H
 
-// End of file
--- a/mmserv/tms/inc/tmsglobalgaineffectimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsglobalgaineffectimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -23,25 +23,20 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSProxy;
-
 // TMSGlobalGainEffectImpl class
 class TMSGlobalGainEffectImpl : public TMSGlobalGainEffect
     {
 public:
-    ~TMSGlobalGainEffectImpl();
-
+    virtual ~TMSGlobalGainEffectImpl();
     static gint Create(TMSEffect*& tmseffect);
-    gint SetParentEffect(TMSEffect*& parenteffect);
 
 private:
     TMSGlobalGainEffectImpl();
     gint PostConstruct();
+    gint SetParent(TMSEffect*& parent);
     };
 
 } //namespace TMS
 
 #endif // TMS_GLOBAL_GAIN_EFFECT_IMPL_H
 
-// End of file
--- a/mmserv/tms/inc/tmsglobalroutingimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsglobalroutingimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -23,25 +23,21 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSProxy;
-
 // TMSGlobalRoutingImpl class
 class TMSGlobalRoutingImpl : public TMSGlobalRouting
     {
 public:
-    ~TMSGlobalRoutingImpl();
-
+    virtual ~TMSGlobalRoutingImpl();
     IMPORT_C static gint Create(TMSGlobalRouting*& globrouting);
     IMPORT_C static gint Delete(TMSGlobalRouting*& globrouting);
 
 private:
     TMSGlobalRoutingImpl();
     gint PostConstruct();
+    gint SetParent(TMSGlobalRouting*& parent);
     };
 
 } //namespace TMS
 
 #endif // TMS_GLOBAL_ROUTING_IMPL_H
 
-// End of file
--- a/mmserv/tms/inc/tmsglobalvoleffectimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsglobalvoleffectimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -23,24 +23,20 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSProxy;
-
 // TMSGlobalVolEffectImpl class
 class TMSGlobalVolEffectImpl : public TMSGlobalVolEffect
     {
 public:
-    ~TMSGlobalVolEffectImpl();
+    virtual ~TMSGlobalVolEffectImpl();
     static gint Create(TMSEffect*& tmseffect);
 
 private:
     TMSGlobalVolEffectImpl();
     gint PostConstruct();
-    gint SetParentEffect(TMSEffect*& parenteffect);
+    gint SetParent(TMSEffect*& parent);
     };
 
 } //namespace TMS
 
 #endif // TMS_GLOBAL_VOLUME_EFFECT_IMPL_H
 
-// End of file
--- a/mmserv/tms/inc/tmsilbcformatimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsilbcformatimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -23,16 +23,12 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSCallProxy;
-
 // TMSILBCFormatImpl class
 class TMSILBCFormatImpl : public TMSILBCFormat
     {
 public:
 
-    ~TMSILBCFormatImpl();
-
+    virtual ~TMSILBCFormatImpl();
     static gint Create(TMSFormat*& tmsfmt);
     gint SetProxy(TMSGlobalContext* context, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsmembuffer.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsmembuffer.h	Wed Mar 31 22:29:45 2010 +0300
@@ -26,8 +26,11 @@
 class TMSMemBuffer : public TMSBuffer
     {
 public:
-    ~TMSMemBuffer();
+    virtual ~TMSMemBuffer();
 
+    /**
+     * Factory methods
+     */
     static gint Create(guint size, TMSBuffer*& tmsbuffer);
     static gint Create(guint size, guint8* dataptr, TMSBuffer*& tmsbuffer);
 
--- a/mmserv/tms/inc/tmsmicsourceimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsmicsourceimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -30,7 +30,7 @@
 class TMSMicSourceImpl : public TMSMicSource
     {
 public:
-    ~TMSMicSourceImpl();
+    virtual ~TMSMicSourceImpl();
     static gint Create(TMSSource*& tmssource);
     gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsmodemsinkimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsmodemsinkimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -30,7 +30,7 @@
 class TMSModemSinkImpl : public TMSModemSink
     {
 public:
-    ~TMSModemSinkImpl();
+    virtual ~TMSModemSinkImpl();
     static gint Create(TMSSink*& tmssink);
     gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsmodemsourceimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsmodemsourceimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -30,7 +30,7 @@
 class TMSModemSourceImpl : public TMSModemSource
     {
 public:
-    ~TMSModemSourceImpl();
+    virtual ~TMSModemSourceImpl();
     static gint Create(TMSSource*& tmssource);
     gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmspcmformatimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmspcmformatimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -23,15 +23,11 @@
 
 namespace TMS {
 
-// FORWARD DECLARATIONS
-class TMSCallProxy;
-
 // TMSPCMFormatImpl class
 class TMSPCMFormatImpl : public TMSPCMFormat
     {
 public:
-
-    ~TMSPCMFormatImpl();
+    virtual ~TMSPCMFormatImpl();
     static gint Create(TMSFormat*& tmsfmt);
     gint SetProxy(TMSGlobalContext* context, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsproxy.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsproxy.h	Wed Mar 31 22:29:45 2010 +0300
@@ -108,12 +108,13 @@
 
     gint CreateQueue(const gint aNumSlots);
     void ReceiveMsgQHandlerEventsL();
+    void ResetObjectLists();
 
 private:
     TRoutingMsgBufPckg ipckg;
     RPointerArray<TMSEffectObserver> iEffectsObsrvrList;
+    RPointerArray<TMSGlobalRoutingObserver> iRoutingObsrvrList;
     RPointerArray<TMSEffect> iEffectsParentList;
-    RPointerArray<TMSGlobalRoutingObserver> iRoutingObsrvrList;
     RPointerArray<TMSGlobalRouting> iRoutingParentList;
 
     // Message queue and the handler
--- a/mmserv/tms/inc/tmsshared.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsshared.h	Wed Mar 31 22:29:45 2010 +0300
@@ -119,10 +119,13 @@
     ECmdDTMFTonePlayFinished,
     ECmdRingToneOpenComplete,
     ECmdRingTonePlayComplete,
+    ECmdRingToneDeinitComplete,
     ECmdDownlinkClosed,
     ECmdUplinkClosed,
     ECmdGlobalRoutingChange,
-    ECmdGlobalEffectChange
+    ECmdGlobalEffectChange,
+    ECmdInbandToneStarted,
+    ECmdInbandToneStopped
     };
 
 // -----------------------------------------------------------------------------
--- a/mmserv/tms/inc/tmssinkimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmssinkimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -29,8 +29,12 @@
 class TMSSinkImpl
     {
 public:
+    ~TMSSinkImpl();
     IMPORT_C static gint Create(TMSSinkType sinktype, TMSSink*& tmssink);
     IMPORT_C static gint Delete(TMSSink*& tmssink);
+
+private:
+    TMSSinkImpl();
     };
 
 } //namespace TMS
--- a/mmserv/tms/inc/tmssourceimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmssourceimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -29,9 +29,13 @@
 class TMSSourceImpl
     {
 public:
+    ~TMSSourceImpl();
     IMPORT_C static gint Create(TMSSourceType sourcetype,
             TMSSource*& tmssource);
     IMPORT_C static gint Delete(TMSSource*& tmssource);
+
+private:
+    TMSSourceImpl();
     };
 
 } //namespace TMS
--- a/mmserv/tms/inc/tmsspeakersinkimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsspeakersinkimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -30,7 +30,7 @@
 class TMSSpeakerSinkImpl : public TMSSpeakerSink
     {
 public:
-    ~TMSSpeakerSinkImpl();
+    virtual ~TMSSpeakerSinkImpl();
     static gint Create(TMSSink*& tmssink);
     gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
 
--- a/mmserv/tms/inc/tmsstreamimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsstreamimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -30,9 +30,10 @@
 class TMSStreamImpl : public TMSStream
     {
 public:
-    ~TMSStreamImpl();
+    virtual ~TMSStreamImpl();
     static gint Create(TMSCallType callType, TMSStreamType ctype,
             TMSCallProxy* proxy, TMSStream*& tmsstream);
+    static gint Delete(TMSStream*& tmsrt);
 
 private:
     TMSStreamImpl();
--- a/mmserv/tms/inc/tmsutility.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsutility.h	Wed Mar 31 22:29:45 2010 +0300
@@ -63,11 +63,15 @@
 #define TOFOURCC(format) TMSUtility::ToFourCC(format)
 #define TOTMSFORMAT(fourcc) TMSUtility::FourCCToTMSFormat(fourcc)
 
+_LIT(KTMSPanic, "TMS Panic!" );
+#define PANIC(reason) User::Panic(KTMSPanic, reason)
+
 // TMSUtility class
 class TMSUtility
     {
 public:
     IMPORT_C static gint TMSResult(const gint error);
+    IMPORT_C static gint EtelToTMSResult(const gint error);
     IMPORT_C static TMSAudioOutput ToTMSOutput(
             CTelephonyAudioRouting::TAudioOutput taroutput);
     IMPORT_C static CTelephonyAudioRouting::TAudioOutput ToTAROutput(
--- a/mmserv/tms/inc/tmsvolumeeffectimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/inc/tmsvolumeeffectimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -30,19 +30,17 @@
 class TMSVolumeEffectImpl : public TMSVolumeEffect
     {
 public:
-    ~TMSVolumeEffectImpl();
-
+    virtual ~TMSVolumeEffectImpl();
     static gint Create(TMSEffect*& tmseffect);
     gint SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
-    gint SetParentEffect(TMSEffect*& parenteffect);
 
 private:
     TMSVolumeEffectImpl();
     gint PostConstruct();
+    gint SetParent(TMSEffect*& parent);
     };
 
 } //namespace TMS
 
 #endif // TMS_VOLUME_EFFECT_IMPL_H
 
-// End of file
--- a/mmserv/tms/tmscallproxy/src/tmscallproxy.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmscallproxy/src/tmscallproxy.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -24,8 +24,6 @@
 
 using namespace TMS;
 
-// CONSTANTS
-
 // -----------------------------------------------------------------------------
 // TMSCallProxy::TMSCallProxy
 //
@@ -34,7 +32,6 @@
 EXPORT_C TMSCallProxy::TMSCallProxy() :
     iTMSProxy(NULL)
     {
-    // No impl
     }
 
 // -----------------------------------------------------------------------------
@@ -285,7 +282,7 @@
     inPckg().StreamId = strmId;
     status = RSessionBase::SendReceive(TMS_DATA_XFER_BUFFER_EMPTIED,
             TIpcArgs(&inPckg));
-    
+
     TRACE_PRN_FN_EXT;
     return TMSRESULT(status);
     }
--- a/mmserv/tms/tmscallserver/src/cspdevsound.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/cspdevsound.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -77,8 +77,7 @@
     if (!IsActive() && !IsActivationOngoing())
         {
         iActivationOngoing = ETrue;
-        gint err = KErrNone;
-        TRAP(err, DoActivateL());
+        TRAP_IGNORE(DoActivateL());
         }
     }
 
--- a/mmserv/tms/tmscallserver/src/ipcalldownlinkds.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmscallserver/src/ipcalldownlinkds.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -216,16 +216,9 @@
         {
         // Fill D/S buffer and send it for playback
         iDevSoundBufPtr->Data() = dataPtr;
-        TRAPD(ignore, iDevSoundBufPtr->SetRequestSizeL(buflen));
-        if (ignore) //makes compiler happy
-            {
-            //try playing anyway
-            iDevSound->PlayData();
-            }
-        else
-            {
-            iDevSound->PlayData();
-            }
+        TRAP_IGNORE(iDevSoundBufPtr->SetRequestSizeL(buflen));
+        //try playing anyway
+        iDevSound->PlayData();
         }
     }
 
--- a/mmserv/tms/tmsfactory/inc/tmsfactoryimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsfactory/inc/tmsfactoryimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -68,4 +68,5 @@
 
 } //namespace TMS
 
-#endif
+#endif //TMSFACTORYIMPL_H_
+
--- a/mmserv/tms/tmsfactory/src/tmsfactory.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsfactory/src/tmsfactory.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -30,7 +30,8 @@
     delete impl;
     }
 
-EXPORT_C gint TMSFactory::CreateFactory(TMSFactory*& tmsfactory, TMSVer& /*ver*/)
+EXPORT_C gint TMSFactory::CreateFactory(TMSFactory*& tmsfactory,
+        TMSVer& /*ver*/)
     {
     TMSFactory* self = new TMSFactory();
     tmsfactory = self;
@@ -58,7 +59,8 @@
     return status;
     }
 
-EXPORT_C gint TMSFactory::IsCallTypeSupported(TMSCallType ctype, gboolean& flag)
+EXPORT_C gint TMSFactory::IsCallTypeSupported(TMSCallType ctype,
+        gboolean& flag)
     {
     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
     if (impl)
--- a/mmserv/tms/tmsfactory/src/tmsfactoryimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsfactory/src/tmsfactoryimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,15 +15,6 @@
  *
  */
 
-#include <tms.h>
-#include <tmscall.h>
-#include <tmsformat.h>
-#include <tmseffect.h>
-#include <tmsbuffer.h>
-#include <tmssource.h>
-#include <tmssink.h>
-#include "tmsutility.h"
-#include "tmsproxy.h"
 #include "tmscallimpl.h"
 #include "tmsformatimpl.h"
 #include "tmseffectimpl.h"
@@ -31,6 +22,9 @@
 #include "tmssourceimpl.h"
 #include "tmssinkimpl.h"
 #include "tmsglobalroutingimpl.h"
+
+#include "tmsutility.h"
+#include "tmsproxy.h"
 #include "tmsfactoryimpl.h"
 
 using namespace TMS;
@@ -57,9 +51,7 @@
 gint TMSFactoryImpl::DeleteCall(TMSCall*& tmscall)
     {
     gint ret(TMS_RESULT_SUCCESS);
-    // TODO put the delete in the impl
-    delete tmscall; //iTMSCall
-    tmscall = NULL;
+    ret = TMSCallImpl::Delete(tmscall);
     return ret;
     }
 
--- a/mmserv/tms/tmsimpl/bwins/tmsimpl.def	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/bwins/tmsimpl.def	Wed Mar 31 22:29:45 2010 +0300
@@ -4,12 +4,13 @@
 	?Create@TMSSinkImpl@TMS@@SAHHAAPAVTMSSink@2@@Z @ 3 NONAME ; int TMS::TMSSinkImpl::Create(int, class TMS::TMSSink * &)
 	?Create@TMSSourceImpl@TMS@@SAHHAAPAVTMSSource@2@@Z @ 4 NONAME ; int TMS::TMSSourceImpl::Create(int, class TMS::TMSSource * &)
 	?Delete@TMSFormatImpl@TMS@@SAHAAPAVTMSFormat@2@@Z @ 5 NONAME ; int TMS::TMSFormatImpl::Delete(class TMS::TMSFormat * &)
-	?Create@TMSFormatImpl@TMS@@SAHHAAPAVTMSFormat@2@@Z @ 6 NONAME ; int TMS::TMSFormatImpl::Create(int, class TMS::TMSFormat * &)
-	?Delete@TMSSinkImpl@TMS@@SAHAAPAVTMSSink@2@@Z @ 7 NONAME ; int TMS::TMSSinkImpl::Delete(class TMS::TMSSink * &)
-	?Delete@TMSBufferImpl@TMS@@SAHAAPAVTMSBuffer@2@@Z @ 8 NONAME ; int TMS::TMSBufferImpl::Delete(class TMS::TMSBuffer * &)
-	?Delete@TMSSourceImpl@TMS@@SAHAAPAVTMSSource@2@@Z @ 9 NONAME ; int TMS::TMSSourceImpl::Delete(class TMS::TMSSource * &)
-	?Delete@TMSEffectImpl@TMS@@SAHAAPAVTMSEffect@2@@Z @ 10 NONAME ; int TMS::TMSEffectImpl::Delete(class TMS::TMSEffect * &)
-	?Create@TMSGlobalRoutingImpl@TMS@@SAHAAPAVTMSGlobalRouting@2@@Z @ 11 NONAME ; int TMS::TMSGlobalRoutingImpl::Create(class TMS::TMSGlobalRouting * &)
-	?Create@TMSBufferImpl@TMS@@SAHHIAAPAVTMSBuffer@2@@Z @ 12 NONAME ; int TMS::TMSBufferImpl::Create(int, unsigned int, class TMS::TMSBuffer * &)
-	?Create@TMSCallImpl@TMS@@SAHHAAPAVTMSCall@2@I@Z @ 13 NONAME ; int TMS::TMSCallImpl::Create(int, class TMS::TMSCall * &, unsigned int)
+	?Delete@TMSCallImpl@TMS@@SAHAAPAVTMSCall@2@@Z @ 6 NONAME ; int TMS::TMSCallImpl::Delete(class TMS::TMSCall * &)
+	?Create@TMSFormatImpl@TMS@@SAHHAAPAVTMSFormat@2@@Z @ 7 NONAME ; int TMS::TMSFormatImpl::Create(int, class TMS::TMSFormat * &)
+	?Delete@TMSSinkImpl@TMS@@SAHAAPAVTMSSink@2@@Z @ 8 NONAME ; int TMS::TMSSinkImpl::Delete(class TMS::TMSSink * &)
+	?Delete@TMSBufferImpl@TMS@@SAHAAPAVTMSBuffer@2@@Z @ 9 NONAME ; int TMS::TMSBufferImpl::Delete(class TMS::TMSBuffer * &)
+	?Delete@TMSSourceImpl@TMS@@SAHAAPAVTMSSource@2@@Z @ 10 NONAME ; int TMS::TMSSourceImpl::Delete(class TMS::TMSSource * &)
+	?Delete@TMSEffectImpl@TMS@@SAHAAPAVTMSEffect@2@@Z @ 11 NONAME ; int TMS::TMSEffectImpl::Delete(class TMS::TMSEffect * &)
+	?Create@TMSGlobalRoutingImpl@TMS@@SAHAAPAVTMSGlobalRouting@2@@Z @ 12 NONAME ; int TMS::TMSGlobalRoutingImpl::Create(class TMS::TMSGlobalRouting * &)
+	?Create@TMSBufferImpl@TMS@@SAHHIAAPAVTMSBuffer@2@@Z @ 13 NONAME ; int TMS::TMSBufferImpl::Create(int, unsigned int, class TMS::TMSBuffer * &)
+	?Create@TMSCallImpl@TMS@@SAHHAAPAVTMSCall@2@I@Z @ 14 NONAME ; int TMS::TMSCallImpl::Create(int, class TMS::TMSCall * &, unsigned int)
 
--- a/mmserv/tms/tmsimpl/eabi/tmsimpl.def	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/eabi/tmsimpl.def	Wed Mar 31 22:29:45 2010 +0300
@@ -1,93 +1,98 @@
 EXPORTS
 	_ZN3TMS11TMSCallImpl6CreateEiRPNS_7TMSCallEj @ 1 NONAME
-	_ZN3TMS11TMSSinkImpl6CreateEiRPNS_7TMSSinkE @ 2 NONAME
-	_ZN3TMS11TMSSinkImpl6DeleteERPNS_7TMSSinkE @ 3 NONAME
-	_ZN3TMS13TMSBufferImpl6CreateEijRPNS_9TMSBufferE @ 4 NONAME
-	_ZN3TMS13TMSBufferImpl6DeleteERPNS_9TMSBufferE @ 5 NONAME
-	_ZN3TMS13TMSEffectImpl6CreateEiRPNS_9TMSEffectE @ 6 NONAME
-	_ZN3TMS13TMSEffectImpl6DeleteERPNS_9TMSEffectE @ 7 NONAME
-	_ZN3TMS13TMSFormatImpl6CreateEiRPNS_9TMSFormatE @ 8 NONAME
-	_ZN3TMS13TMSFormatImpl6DeleteERPNS_9TMSFormatE @ 9 NONAME
-	_ZN3TMS13TMSSourceImpl6CreateEiRPNS_9TMSSourceE @ 10 NONAME
-	_ZN3TMS13TMSSourceImpl6DeleteERPNS_9TMSSourceE @ 11 NONAME
-	_ZN3TMS20TMSGlobalRoutingImpl6CreateERPNS_16TMSGlobalRoutingE @ 12 NONAME
-	_ZN3TMS20TMSGlobalRoutingImpl6DeleteERPNS_16TMSGlobalRoutingE @ 13 NONAME
-	_ZTIN3TMS11TMSCallImplE @ 14 NONAME
-	_ZTIN3TMS12TMSMemBufferE @ 15 NONAME
-	_ZTIN3TMS15TMSCallBodyImplE @ 16 NONAME
-	_ZTIN3TMS16TMSAMRFormatImplE @ 17 NONAME
-	_ZTIN3TMS16TMSMicSourceImplE @ 18 NONAME
-	_ZTIN3TMS16TMSModemSinkImplE @ 19 NONAME
-	_ZTIN3TMS16TMSPCMFormatImplE @ 20 NONAME
-	_ZTIN3TMS17TMSCSCallBodyImplE @ 21 NONAME
-	_ZTIN3TMS17TMSClientSinkImplE @ 22 NONAME
-	_ZTIN3TMS17TMSFormatBodyImplE @ 23 NONAME
-	_ZTIN3TMS17TMSG711FormatImplE @ 24 NONAME
-	_ZTIN3TMS17TMSG729FormatImplE @ 25 NONAME
-	_ZTIN3TMS17TMSGainEffectImplE @ 26 NONAME
-	_ZTIN3TMS17TMSILBCFormatImplE @ 27 NONAME
-	_ZTIN3TMS17TMSIPCallBodyImplE @ 28 NONAME
-	_ZTIN3TMS17TMSStreamBodyImplE @ 29 NONAME
-	_ZTIN3TMS18TMSModemSourceImplE @ 30 NONAME
-	_ZTIN3TMS18TMSSpeakerSinkImplE @ 31 NONAME
-	_ZTIN3TMS19TMSClientSourceImplE @ 32 NONAME
-	_ZTIN3TMS19TMSVolumeEffectImplE @ 33 NONAME
-	_ZTIN3TMS20TMSAMRFormatBodyImplE @ 34 NONAME
-	_ZTIN3TMS20TMSGlobalRoutingImplE @ 35 NONAME
-	_ZTIN3TMS20TMSMicSourceBodyImplE @ 36 NONAME
-	_ZTIN3TMS20TMSModemSinkBodyImplE @ 37 NONAME
-	_ZTIN3TMS20TMSPCMFormatBodyImplE @ 38 NONAME
-	_ZTIN3TMS21TMSClientSinkBodyImplE @ 39 NONAME
-	_ZTIN3TMS21TMSG711FormatBodyImplE @ 40 NONAME
-	_ZTIN3TMS21TMSG729FormatBodyImplE @ 41 NONAME
-	_ZTIN3TMS21TMSGainEffectBodyImplE @ 42 NONAME
-	_ZTIN3TMS21TMSILBCFormatBodyImplE @ 43 NONAME
-	_ZTIN3TMS22TMSGlobalVolEffectImplE @ 44 NONAME
-	_ZTIN3TMS22TMSModemSourceBodyImplE @ 45 NONAME
-	_ZTIN3TMS22TMSSpeakerSinkBodyImplE @ 46 NONAME
-	_ZTIN3TMS23TMSClientSourceBodyImplE @ 47 NONAME
-	_ZTIN3TMS23TMSGlobalGainEffectImplE @ 48 NONAME
-	_ZTIN3TMS23TMSVolumeEffectBodyImplE @ 49 NONAME
-	_ZTIN3TMS24TMSGlobalRoutingBodyImplE @ 50 NONAME
-	_ZTIN3TMS26TMSGlobalVolEffectBodyImplE @ 51 NONAME
-	_ZTIN3TMS27TMSGlobalGainEffectBodyImplE @ 52 NONAME
-	_ZTVN3TMS11TMSCallImplE @ 53 NONAME
-	_ZTVN3TMS12TMSMemBufferE @ 54 NONAME
-	_ZTVN3TMS15TMSCallBodyImplE @ 55 NONAME
-	_ZTVN3TMS16TMSAMRFormatImplE @ 56 NONAME
-	_ZTVN3TMS16TMSMicSourceImplE @ 57 NONAME
-	_ZTVN3TMS16TMSModemSinkImplE @ 58 NONAME
-	_ZTVN3TMS16TMSPCMFormatImplE @ 59 NONAME
-	_ZTVN3TMS17TMSCSCallBodyImplE @ 60 NONAME
-	_ZTVN3TMS17TMSClientSinkImplE @ 61 NONAME
-	_ZTVN3TMS17TMSFormatBodyImplE @ 62 NONAME
-	_ZTVN3TMS17TMSG711FormatImplE @ 63 NONAME
-	_ZTVN3TMS17TMSG729FormatImplE @ 64 NONAME
-	_ZTVN3TMS17TMSGainEffectImplE @ 65 NONAME
-	_ZTVN3TMS17TMSILBCFormatImplE @ 66 NONAME
-	_ZTVN3TMS17TMSIPCallBodyImplE @ 67 NONAME
-	_ZTVN3TMS17TMSStreamBodyImplE @ 68 NONAME
-	_ZTVN3TMS18TMSModemSourceImplE @ 69 NONAME
-	_ZTVN3TMS18TMSSpeakerSinkImplE @ 70 NONAME
-	_ZTVN3TMS19TMSClientSourceImplE @ 71 NONAME
-	_ZTVN3TMS19TMSVolumeEffectImplE @ 72 NONAME
-	_ZTVN3TMS20TMSAMRFormatBodyImplE @ 73 NONAME
-	_ZTVN3TMS20TMSGlobalRoutingImplE @ 74 NONAME
-	_ZTVN3TMS20TMSMicSourceBodyImplE @ 75 NONAME
-	_ZTVN3TMS20TMSModemSinkBodyImplE @ 76 NONAME
-	_ZTVN3TMS20TMSPCMFormatBodyImplE @ 77 NONAME
-	_ZTVN3TMS21TMSClientSinkBodyImplE @ 78 NONAME
-	_ZTVN3TMS21TMSG711FormatBodyImplE @ 79 NONAME
-	_ZTVN3TMS21TMSG729FormatBodyImplE @ 80 NONAME
-	_ZTVN3TMS21TMSGainEffectBodyImplE @ 81 NONAME
-	_ZTVN3TMS21TMSILBCFormatBodyImplE @ 82 NONAME
-	_ZTVN3TMS22TMSGlobalVolEffectImplE @ 83 NONAME
-	_ZTVN3TMS22TMSModemSourceBodyImplE @ 84 NONAME
-	_ZTVN3TMS22TMSSpeakerSinkBodyImplE @ 85 NONAME
-	_ZTVN3TMS23TMSClientSourceBodyImplE @ 86 NONAME
-	_ZTVN3TMS23TMSGlobalGainEffectImplE @ 87 NONAME
-	_ZTVN3TMS23TMSVolumeEffectBodyImplE @ 88 NONAME
-	_ZTVN3TMS24TMSGlobalRoutingBodyImplE @ 89 NONAME
-	_ZTVN3TMS26TMSGlobalVolEffectBodyImplE @ 90 NONAME
-	_ZTVN3TMS27TMSGlobalGainEffectBodyImplE @ 91 NONAME
+	_ZN3TMS11TMSCallImpl6DeleteERPNS_7TMSCallE @ 2 NONAME
+	_ZN3TMS11TMSSinkImpl6CreateEiRPNS_7TMSSinkE @ 3 NONAME
+	_ZN3TMS11TMSSinkImpl6DeleteERPNS_7TMSSinkE @ 4 NONAME
+	_ZN3TMS13TMSBufferImpl6CreateEijRPNS_9TMSBufferE @ 5 NONAME
+	_ZN3TMS13TMSBufferImpl6DeleteERPNS_9TMSBufferE @ 6 NONAME
+	_ZN3TMS13TMSEffectImpl6CreateEiRPNS_9TMSEffectE @ 7 NONAME
+	_ZN3TMS13TMSEffectImpl6DeleteERPNS_9TMSEffectE @ 8 NONAME
+	_ZN3TMS13TMSFormatImpl6CreateEiRPNS_9TMSFormatE @ 9 NONAME
+	_ZN3TMS13TMSFormatImpl6DeleteERPNS_9TMSFormatE @ 10 NONAME
+	_ZN3TMS13TMSSourceImpl6CreateEiRPNS_9TMSSourceE @ 11 NONAME
+	_ZN3TMS13TMSSourceImpl6DeleteERPNS_9TMSSourceE @ 12 NONAME
+	_ZN3TMS20TMSGlobalRoutingImpl6CreateERPNS_16TMSGlobalRoutingE @ 13 NONAME
+	_ZN3TMS20TMSGlobalRoutingImpl6DeleteERPNS_16TMSGlobalRoutingE @ 14 NONAME
+	_ZTIN3TMS11TMSCallImplE @ 15 NONAME
+	_ZTIN3TMS12TMSMemBufferE @ 16 NONAME
+	_ZTIN3TMS13TMSFormatImplE @ 17 NONAME
+	_ZTIN3TMS13TMSStreamImplE @ 18 NONAME
+	_ZTIN3TMS15TMSCallBodyImplE @ 19 NONAME
+	_ZTIN3TMS16TMSAMRFormatImplE @ 20 NONAME
+	_ZTIN3TMS16TMSMicSourceImplE @ 21 NONAME
+	_ZTIN3TMS16TMSModemSinkImplE @ 22 NONAME
+	_ZTIN3TMS16TMSPCMFormatImplE @ 23 NONAME
+	_ZTIN3TMS17TMSCSCallBodyImplE @ 24 NONAME
+	_ZTIN3TMS17TMSClientSinkImplE @ 25 NONAME
+	_ZTIN3TMS17TMSFormatBodyImplE @ 26 NONAME
+	_ZTIN3TMS17TMSG711FormatImplE @ 27 NONAME
+	_ZTIN3TMS17TMSG729FormatImplE @ 28 NONAME
+	_ZTIN3TMS17TMSGainEffectImplE @ 29 NONAME
+	_ZTIN3TMS17TMSILBCFormatImplE @ 30 NONAME
+	_ZTIN3TMS17TMSIPCallBodyImplE @ 31 NONAME
+	_ZTIN3TMS17TMSStreamBodyImplE @ 32 NONAME
+	_ZTIN3TMS18TMSModemSourceImplE @ 33 NONAME
+	_ZTIN3TMS18TMSSpeakerSinkImplE @ 34 NONAME
+	_ZTIN3TMS19TMSClientSourceImplE @ 35 NONAME
+	_ZTIN3TMS19TMSVolumeEffectImplE @ 36 NONAME
+	_ZTIN3TMS20TMSAMRFormatBodyImplE @ 37 NONAME
+	_ZTIN3TMS20TMSGlobalRoutingImplE @ 38 NONAME
+	_ZTIN3TMS20TMSMicSourceBodyImplE @ 39 NONAME
+	_ZTIN3TMS20TMSModemSinkBodyImplE @ 40 NONAME
+	_ZTIN3TMS20TMSPCMFormatBodyImplE @ 41 NONAME
+	_ZTIN3TMS21TMSClientSinkBodyImplE @ 42 NONAME
+	_ZTIN3TMS21TMSG711FormatBodyImplE @ 43 NONAME
+	_ZTIN3TMS21TMSG729FormatBodyImplE @ 44 NONAME
+	_ZTIN3TMS21TMSGainEffectBodyImplE @ 45 NONAME
+	_ZTIN3TMS21TMSILBCFormatBodyImplE @ 46 NONAME
+	_ZTIN3TMS22TMSGlobalVolEffectImplE @ 47 NONAME
+	_ZTIN3TMS22TMSModemSourceBodyImplE @ 48 NONAME
+	_ZTIN3TMS22TMSSpeakerSinkBodyImplE @ 49 NONAME
+	_ZTIN3TMS23TMSClientSourceBodyImplE @ 50 NONAME
+	_ZTIN3TMS23TMSGlobalGainEffectImplE @ 51 NONAME
+	_ZTIN3TMS23TMSVolumeEffectBodyImplE @ 52 NONAME
+	_ZTIN3TMS24TMSGlobalRoutingBodyImplE @ 53 NONAME
+	_ZTIN3TMS26TMSGlobalVolEffectBodyImplE @ 54 NONAME
+	_ZTIN3TMS27TMSGlobalGainEffectBodyImplE @ 55 NONAME
+	_ZTVN3TMS11TMSCallImplE @ 56 NONAME
+	_ZTVN3TMS12TMSMemBufferE @ 57 NONAME
+	_ZTVN3TMS13TMSFormatImplE @ 58 NONAME
+	_ZTVN3TMS13TMSStreamImplE @ 59 NONAME
+	_ZTVN3TMS15TMSCallBodyImplE @ 60 NONAME
+	_ZTVN3TMS16TMSAMRFormatImplE @ 61 NONAME
+	_ZTVN3TMS16TMSMicSourceImplE @ 62 NONAME
+	_ZTVN3TMS16TMSModemSinkImplE @ 63 NONAME
+	_ZTVN3TMS16TMSPCMFormatImplE @ 64 NONAME
+	_ZTVN3TMS17TMSCSCallBodyImplE @ 65 NONAME
+	_ZTVN3TMS17TMSClientSinkImplE @ 66 NONAME
+	_ZTVN3TMS17TMSFormatBodyImplE @ 67 NONAME
+	_ZTVN3TMS17TMSG711FormatImplE @ 68 NONAME
+	_ZTVN3TMS17TMSG729FormatImplE @ 69 NONAME
+	_ZTVN3TMS17TMSGainEffectImplE @ 70 NONAME
+	_ZTVN3TMS17TMSILBCFormatImplE @ 71 NONAME
+	_ZTVN3TMS17TMSIPCallBodyImplE @ 72 NONAME
+	_ZTVN3TMS17TMSStreamBodyImplE @ 73 NONAME
+	_ZTVN3TMS18TMSModemSourceImplE @ 74 NONAME
+	_ZTVN3TMS18TMSSpeakerSinkImplE @ 75 NONAME
+	_ZTVN3TMS19TMSClientSourceImplE @ 76 NONAME
+	_ZTVN3TMS19TMSVolumeEffectImplE @ 77 NONAME
+	_ZTVN3TMS20TMSAMRFormatBodyImplE @ 78 NONAME
+	_ZTVN3TMS20TMSGlobalRoutingImplE @ 79 NONAME
+	_ZTVN3TMS20TMSMicSourceBodyImplE @ 80 NONAME
+	_ZTVN3TMS20TMSModemSinkBodyImplE @ 81 NONAME
+	_ZTVN3TMS20TMSPCMFormatBodyImplE @ 82 NONAME
+	_ZTVN3TMS21TMSClientSinkBodyImplE @ 83 NONAME
+	_ZTVN3TMS21TMSG711FormatBodyImplE @ 84 NONAME
+	_ZTVN3TMS21TMSG729FormatBodyImplE @ 85 NONAME
+	_ZTVN3TMS21TMSGainEffectBodyImplE @ 86 NONAME
+	_ZTVN3TMS21TMSILBCFormatBodyImplE @ 87 NONAME
+	_ZTVN3TMS22TMSGlobalVolEffectImplE @ 88 NONAME
+	_ZTVN3TMS22TMSModemSourceBodyImplE @ 89 NONAME
+	_ZTVN3TMS22TMSSpeakerSinkBodyImplE @ 90 NONAME
+	_ZTVN3TMS23TMSClientSourceBodyImplE @ 91 NONAME
+	_ZTVN3TMS23TMSGlobalGainEffectImplE @ 92 NONAME
+	_ZTVN3TMS23TMSVolumeEffectBodyImplE @ 93 NONAME
+	_ZTVN3TMS24TMSGlobalRoutingBodyImplE @ 94 NONAME
+	_ZTVN3TMS26TMSGlobalVolEffectBodyImplE @ 95 NONAME
+	_ZTVN3TMS27TMSGlobalGainEffectBodyImplE @ 96 NONAME
 
--- a/mmserv/tms/tmsimpl/inc/tmsformatbodyimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/inc/tmsformatbodyimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -32,7 +32,7 @@
 class TMSFormatBodyImpl : public TMSFormatBody
     {
 public:
-    ~TMSFormatBodyImpl();
+    virtual ~TMSFormatBodyImpl();
 
     gint GetSupportedBitRates(BitRateVector& aVector);
     gint SetBitRate(const guint aBitrate);
--- a/mmserv/tms/tmsimpl/inc/tmsgaineffectbodyimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/inc/tmsgaineffectbodyimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -35,9 +35,9 @@
     {
 public:
     static gint Create(TMSGainEffectBody*& bodyimpl);
+    virtual ~TMSGainEffectBodyImpl();
 
     // From TMSGainEffectBody
-    virtual ~TMSGainEffectBodyImpl();
     virtual gint AddObserver(TMSEffectObserver& obsrvr, gpointer user_data);
     virtual gint RemoveObserver(TMSEffectObserver& obsrvr);
     virtual gint SetLevel(const guint level);
@@ -48,7 +48,7 @@
     // From MQueueHandlerObserver
     virtual void QueueEvent(TInt aEventType, TInt aError, void* user_data);
 
-    gint SetParentEffect(TMSEffect*& parenteffect);
+    void SetParent(TMSEffect*& parent);
     void SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
 
 private:
@@ -59,11 +59,10 @@
     TMSEffectObserver* iObserver;
     gpointer iUserData;
     TMSCallProxy* iProxy;
-    TMSEffect* iParentEffect;
+    TMSEffect* iParent;
     };
 
 } //namespace TMS
 
 #endif // TMS_GAIN_EFFECT_BODY_IMPL_H
 
-// End of file
--- a/mmserv/tms/tmsimpl/inc/tmsglobalgaineffectbodyimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/inc/tmsglobalgaineffectbodyimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -43,7 +43,7 @@
     virtual gint GetMaxLevel(guint& level);
     virtual gint GetType(TMSEffectType& effecttype);
 
-    void SetParentEffect(TMSEffect*& parenteffect);
+    void SetParent(TMSEffect*& parent);
 
 private:
     TMSGlobalGainEffectBodyImpl();
@@ -54,11 +54,10 @@
     gint iClientId;
     gpointer iUserData;
     TMSProxy* iProxy;
-    TMSEffect* iGlobalEffect;
+    TMSEffect* iParent;
     };
 
 } //namespace TMS
 
 #endif // TMS_GLOBAL_GAIN_EFFECT_BODY_IMPL_H
 
-// End of file
--- a/mmserv/tms/tmsimpl/inc/tmsglobalroutingbodyimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/inc/tmsglobalroutingbodyimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -27,6 +27,7 @@
 
 // FORWARD DECLARATIONS
 class TMSGlobalRoutingObserver;
+class TMSGlobalRouting;
 class TMSProxy;
 
 // TMSGlobalRoutingBodyImpl class
@@ -34,9 +35,9 @@
     {
 public:
     static gint Create(TMSGlobalRoutingBody*& bodyimpl);
+    virtual ~TMSGlobalRoutingBodyImpl();
 
     // From TMSGlobalRoutingBody
-    virtual ~TMSGlobalRoutingBodyImpl();
     virtual gint AddObserver(TMSGlobalRoutingObserver& obsrvr,
             gpointer user_data);
     virtual gint RemoveObserver(TMSGlobalRoutingObserver& obsrvr);
@@ -45,6 +46,8 @@
     virtual gint GetPreviousOutput(TMSAudioOutput& output);
     virtual gint GetAvailableOutputs(OutputVector& outputs);
 
+    void SetParent(TMSGlobalRouting*& parent);
+
 private:
     TMSGlobalRoutingBodyImpl();
     gint PostConstruct();
@@ -56,10 +59,10 @@
     RPointerArray<TMSGlobalRoutingObserver> iObserversList; // (not owned)
     gpointer iUserData;
     TMSProxy* iProxy;
+    TMSGlobalRouting* iParent;
     };
 
 } //namespace TMS
 
 #endif // TMS_GLOBAL_ROUTING_BODY_IMPL_H
 
-// End of file
--- a/mmserv/tms/tmsimpl/inc/tmsglobalvoleffectbodyimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/inc/tmsglobalvoleffectbodyimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -33,9 +33,9 @@
     {
 public:
     static gint Create(TMSGlobalVolEffectBody*& bodyimpl);
+    virtual ~TMSGlobalVolEffectBodyImpl();
 
     // From TMSVolumeEffectBody
-    virtual ~TMSGlobalVolEffectBodyImpl();
     virtual gint AddObserver(TMSEffectObserver& obsrvr, gpointer user_data);
     virtual gint RemoveObserver(TMSEffectObserver& obsrvr);
     virtual gint SetLevel(const guint level);
@@ -43,7 +43,7 @@
     virtual gint GetMaxLevel(guint& level);
     virtual gint GetType(TMSEffectType& effecttype);
 
-    void SetParentEffect(TMSEffect*& parenteffect);
+    void SetParent(TMSEffect*& parent);
 
 private:
     TMSGlobalVolEffectBodyImpl();
@@ -54,11 +54,10 @@
     gint iClientId;
     gpointer iUserData;
     TMSProxy* iProxy;
-    TMSEffect* iGlobalEffect;
+    TMSEffect* iParent;
     };
 
 } //namespace TMS
 
 #endif // TMS_GLOBAL_VOLUME_EFFECT_BODY_IMPL_H
 
-// End of file
--- a/mmserv/tms/tmsimpl/inc/tmsstreambodyimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/inc/tmsstreambodyimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -49,8 +49,7 @@
 
 public:
     static gint Create(TMSCallType callType, TMSStreamType stype,
-            TMSCallProxy* proxy, TMSStream& parent,
-            TMSStreamBody*& bodyimpl);
+            TMSCallProxy* proxy, TMSStream& parent, TMSStreamBody*& bodyimpl);
     virtual ~TMSStreamBodyImpl();
 
     // From TMSStreamBody
--- a/mmserv/tms/tmsimpl/inc/tmsvolumeeffectbodyimpl.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/inc/tmsvolumeeffectbodyimpl.h	Wed Mar 31 22:29:45 2010 +0300
@@ -48,7 +48,7 @@
     // From MQueueHandlerObserver
     virtual void QueueEvent(TInt aEventType, TInt aError, void* user_data);
 
-    gint SetParentEffect(TMSEffect*& parenteffect);
+    void SetParent(TMSEffect*& parent);
     void SetProxy(TMSCallProxy* aProxy, gpointer queuehandler);
 
 private:
@@ -59,11 +59,10 @@
     TMSEffectObserver* iObserver;
     gpointer iUserData;
     TMSCallProxy* iProxy;
-    TMSEffect* iParentEffect;
+    TMSEffect* iParent;
     };
 
 } //namespace TMS
 
 #endif // TMS_VOLUME_EFFECT_BODY_IMPL_H
 
-// End of file
--- a/mmserv/tms/tmsimpl/src/tmsamrimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsamrimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsamrbodyimpl.h"
 #include "tmsamrformatimpl.h"
--- a/mmserv/tms/tmsimpl/src/tmsbufferimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsbufferimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,13 +15,24 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsmembuffer.h"
 #include "tmsbufferimpl.h"
 
 using namespace TMS;
 
+TMSBufferImpl::TMSBufferImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+TMSBufferImpl::~TMSBufferImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
 EXPORT_C gint TMSBufferImpl::Create(TMSBufferType buffertype, guint size,
         TMSBuffer*& tmsbuffer)
     {
--- a/mmserv/tms/tmsimpl/src/tmscallimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmscallimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsipcallbodyimpl.h"
 #include "tmscscallbodyimpl.h"
@@ -63,7 +62,6 @@
     return ret;
     }
 
-// TO DO stop exporting this function
 EXPORT_C gint TMSCallImpl::Create(TMSCallType ctype, TMSCall*& tmscall,
         guint ctxid)
     {
@@ -85,4 +83,13 @@
     return ret;
     }
 
-// End of file
+EXPORT_C gint TMSCallImpl::Delete(TMSCall*& tmscall)
+    {
+    TRACE_PRN_FN_ENT;
+    gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
+    delete (TMSCallImpl*) (tmscall);
+    tmscall = NULL;
+    TRACE_PRN_FN_EXT;    
+    return ret;
+    }
+
--- a/mmserv/tms/tmsimpl/src/tmsclientsinkimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsclientsinkimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsclientsinkimpl.h"
 #include "tmsclientsinkbodyimpl.h"
--- a/mmserv/tms/tmsimpl/src/tmsclientsourceimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsclientsourceimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsclientsourcebodyimpl.h"
 #include "tmsclientsourceimpl.h"
@@ -24,10 +23,14 @@
 
 TMSClientSourceImpl::TMSClientSourceImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 TMSClientSourceImpl::~TMSClientSourceImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSClientSourceImpl::PostConstruct()
@@ -45,7 +48,6 @@
     return ret;
     }
 
-// TO DO stop exporting this function
 gint TMSClientSourceImpl::Create(TMSSource*& tmssource)
     {
     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
--- a/mmserv/tms/tmsimpl/src/tmscscallbodyimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmscscallbodyimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -197,9 +197,7 @@
         // will point to the next item (if available); so, do NOT attempt
         // deleting itStrm here! (Will result in KERN-EXEC)
         iStreamsVector.erase(itStrm); // Remove from array
-        delete strm; // Free memory
-        strm = NULL;
-        ret = TMS_RESULT_SUCCESS;
+        ret = TMSStreamImpl::Delete(strm);
         }
     TRACE_PRN_FN_EXT;
     return ret;
--- a/mmserv/tms/tmsimpl/src/tmseffectimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmseffectimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsvolumeeffectimpl.h"
 #include "tmsgaineffectimpl.h"
 #include "tmsglobalvoleffectimpl.h"
@@ -25,6 +24,18 @@
 
 using namespace TMS;
 
+TMSEffectImpl::TMSEffectImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+TMSEffectImpl::~TMSEffectImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
 EXPORT_C gint TMSEffectImpl::Create(TMSEffectType effecttype,
         TMSEffect*& tmseffect)
     {
--- a/mmserv/tms/tmsimpl/src/tmsformatimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsformatimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsamrformatimpl.h"
 #include "tmsg711formatimpl.h"
@@ -29,6 +28,14 @@
 
 TMSFormatImpl::TMSFormatImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+TMSFormatImpl::~TMSFormatImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 EXPORT_C gint TMSFormatImpl::Create(TMSFormatType fmttype, TMSFormat*& tmsfmt)
--- a/mmserv/tms/tmsimpl/src/tmsg711impl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsg711impl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsg711bodyimpl.h"
 #include "tmsg711formatimpl.h"
--- a/mmserv/tms/tmsimpl/src/tmsg729impl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsg729impl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsg729bodyimpl.h"
 #include "tmsutility.h"
 #include "tmsg729formatimpl.h"
--- a/mmserv/tms/tmsimpl/src/tmsgaineffectbodyimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsgaineffectbodyimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -17,6 +17,7 @@
 
 #include <tms.h>
 #include <tmseffectobsrvr.h>
+#include "tmsutility.h"
 #include "tmscallproxy.h"
 #include "tmsqueuehandler.h"
 #include "tmsgaineffectbodyimpl.h"
@@ -26,12 +27,14 @@
 TMSGainEffectBodyImpl::TMSGainEffectBodyImpl() :
     iObserver(NULL),
     iProxy(NULL),
-    iParentEffect(NULL)
+    iParent(NULL)
     {
     }
 
 TMSGainEffectBodyImpl::~TMSGainEffectBodyImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSGainEffectBodyImpl::Create(TMSGainEffectBody*& bodyimpl)
@@ -73,21 +76,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 TMSGainEffectBodyImpl::RemoveObserver(TMSEffectObserver& obsrvr)
     {
     gint ret(TMS_RESULT_SUCCESS);
@@ -151,26 +139,25 @@
     return ret;
     }
 
-gint TMSGainEffectBodyImpl::SetParentEffect(TMSEffect*& parenteffect)
+void TMSGainEffectBodyImpl::SetParent(TMSEffect*& parent)
     {
-    gint ret(TMS_RESULT_SUCCESS);
-    iParentEffect = NULL;
-    iParentEffect = parenteffect;
-    return ret;
+    iParent = parent;
     }
 
 void TMSGainEffectBodyImpl::SetProxy(TMSCallProxy* aProxy,
         gpointer queuehandler)
     {
     iProxy = aProxy;
-    ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_EFFECT_GAIN);
+    if (queuehandler)
+        {
+        ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_EFFECT_GAIN);
+        }
     }
 
 void TMSGainEffectBodyImpl::QueueEvent(TInt aEventType, TInt aError,
         void* /*user_data*/)
     {
     TMSSignalEvent event;
-
     event.type = TMS_EVENT_EFFECT_GAIN_CHANGED;
     event.reason = aError;
 
@@ -178,9 +165,9 @@
         {
         case TMS_EVENT_EFFECT_GAIN_CHANGED:
             {
-            if (iObserver && iParentEffect)
+            if (iObserver && iParent)
                 {
-                iObserver->EffectsEvent(iParentEffect, event);
+                iObserver->EffectsEvent(iParent, event);
                 }
             }
             break;
@@ -189,4 +176,3 @@
         }
     }
 
-// End of file
--- a/mmserv/tms/tmsimpl/src/tmsgaineffectimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsgaineffectimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,9 +15,8 @@
  *
  */
 
-#include <tms.h>
+#include "tmsutility.h"
 #include "tmsgaineffectbodyimpl.h"
-#include "tmsutility.h"
 #include "tmsgaineffectimpl.h"
 
 using namespace TMS;
@@ -64,30 +63,15 @@
             self = NULL;
             }
         }
-
     if (self && ret == TMS_RESULT_SUCCESS)
         {
         tmseffect = self;
-        ret = self->SetParentEffect(tmseffect);
+        ret = self->SetParent(tmseffect);
         }
     TRACE_PRN_FN_EXT;
     return ret;
     }
 
-gint TMSGainEffectImpl::SetParentEffect(TMSEffect*& parenteffect)
-    {
-    gint  ret(TMS_RESULT_SUCCESS);
-    if (this->iBody)
-        {
-        ((TMSGainEffectBodyImpl*) this->iBody)->SetParentEffect(parenteffect);
-        }
-    else
-        {
-        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
-        }
-    return ret;
-    }
-
 gint TMSGainEffectImpl::SetProxy(TMSCallProxy* aProxy, gpointer queuehandler)
     {
     gint ret(TMS_RESULT_SUCCESS);
@@ -102,4 +86,17 @@
     return ret;
     }
 
-// End of file
+gint TMSGainEffectImpl::SetParent(TMSEffect*& parent)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (this->iBody)
+        {
+        ((TMSGainEffectBodyImpl*) this->iBody)->SetParent(parent);
+        }
+    else
+        {
+        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
+        }
+    return ret;
+    }
+
--- a/mmserv/tms/tmsimpl/src/tmsglobalgaineffectbodyimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsglobalgaineffectbodyimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -26,7 +26,7 @@
 TMSGlobalGainEffectBodyImpl::TMSGlobalGainEffectBodyImpl() :
     iObserver(NULL),
     iProxy(NULL),
-    iGlobalEffect(NULL)
+    iParent(NULL)
     {
     }
 
@@ -39,7 +39,7 @@
         iProxy = NULL;
         }
     iObserver = NULL;
-    iGlobalEffect = NULL;
+    iParent = NULL;
     iUserData = NULL;
     }
 
@@ -65,35 +65,43 @@
     gint ret(TMS_RESULT_SUCCESS);
     iClientId = 1;
     iProxy = new TMSProxy;
-
-    if (iProxy)
+    if (!iProxy)
         {
-        if (iProxy->Connect() != TMS_RESULT_SUCCESS)
-            {
-            delete iProxy;
-            iProxy = NULL;
-            ret = TMS_RESULT_FATAL_ERROR;
-            }
+        ret = TMS_RESULT_INSUFFICIENT_MEMORY;
+        }
+    RET_REASON_IF_ERR(ret);
+
+    if (iProxy->Connect() != TMS_RESULT_SUCCESS)
+        {
+        delete iProxy;
+        iProxy = NULL;
+        ret = TMS_RESULT_FATAL_ERROR;
         }
     else
         {
-        ret = TMS_RESULT_INSUFFICIENT_MEMORY;
+        // Starts TAR if not started already;
+        ret = iProxy->StartRoutingNotifier();
         }
+    RET_REASON_IF_ERR(ret);
     return ret;
     }
 
 gint TMSGlobalGainEffectBodyImpl::AddObserver(TMSEffectObserver& obsrvr,
-        gpointer /*user_data*/)
+        gpointer user_data)
     {
     gint ret(TMS_RESULT_SUCCESS);
     if (!iObserver)
         {
         iObserver = &obsrvr;
-        //iUserData = user_data;
+        iUserData = user_data;
         if (iProxy)
             {
             ret = iProxy->SetMsgQueueNotifier(EMsgQueueGlobalGainType,
-                    iObserver, iGlobalEffect, iClientId);
+                    iObserver, iParent, iClientId);
+            if (ret == TMS_RESULT_SUCCESS)
+                {
+                ret = iProxy->StartGlobalEffectNotifier();
+                }
             }
         else
             {
@@ -104,19 +112,19 @@
         {
         ret = TMS_RESULT_ALREADY_EXIST;
         }
-
     return ret;
     }
 
 gint TMSGlobalGainEffectBodyImpl::RemoveObserver(TMSEffectObserver& obsrvr)
     {
     gint ret(TMS_RESULT_SUCCESS);
-
     if (iProxy && (&obsrvr == iObserver))
         {
         ret = iProxy->RemoveMsgQueueNotifier(EMsgQueueGlobalGainType,
                 iObserver);
         iObserver = NULL;
+        ret = iProxy->CancelGlobalEffectNotifier();
+        ret = iProxy->CancelRoutingNotifier();
         }
     else
         {
@@ -174,10 +182,8 @@
     return ret;
     }
 
-void TMSGlobalGainEffectBodyImpl::SetParentEffect(TMSEffect*& parenteffect)
+void TMSGlobalGainEffectBodyImpl::SetParent(TMSEffect*& parent)
     {
-    iGlobalEffect = NULL;
-    iGlobalEffect = parenteffect;
+    iParent = parent;
     }
 
-// End of file
--- a/mmserv/tms/tmsimpl/src/tmsglobalgaineffectimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsglobalgaineffectimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,9 +15,8 @@
  *
  */
 
-#include <tms.h>
+#include "tmsutility.h"
 #include "tmsglobalgaineffectbodyimpl.h"
-#include "tmsutility.h"
 #include "tmsglobalgaineffectimpl.h"
 
 using namespace TMS;
@@ -67,19 +66,18 @@
     if (self && ret == TMS_RESULT_SUCCESS)
         {
         tmseffect = self;
-        self->SetParentEffect(tmseffect);
+        ret = self->SetParent(tmseffect);
         }
     TRACE_PRN_FN_EXT;
     return ret;
     }
 
-gint TMSGlobalGainEffectImpl::SetParentEffect(TMSEffect*& parenteffect)
+gint TMSGlobalGainEffectImpl::SetParent(TMSEffect*& parent)
     {
     gint ret(TMS_RESULT_SUCCESS);
     if (this->iBody)
         {
-        ((TMSGlobalGainEffectBodyImpl*) this->iBody)->SetParentEffect(
-                parenteffect);
+        ((TMSGlobalGainEffectBodyImpl*) this->iBody)->SetParent(parent);
         }
     else
         {
@@ -88,4 +86,3 @@
     return ret;
     }
 
-// End of file
--- a/mmserv/tms/tmsimpl/src/tmsglobalroutingbodyimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsglobalroutingbodyimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -25,7 +25,8 @@
 
 TMSGlobalRoutingBodyImpl::TMSGlobalRoutingBodyImpl() :
     iObserver(NULL),
-    iProxy(NULL)
+    iProxy(NULL),
+    iParent(NULL)
     {
     }
 
@@ -38,6 +39,7 @@
         iProxy = NULL;
         }
     iObserver = NULL;
+    iParent = NULL;
     iUserData = NULL;
     }
 
@@ -63,38 +65,38 @@
     gint ret(TMS_RESULT_SUCCESS);
     iClientId = 1;
     iProxy = new TMSProxy;
-    if (iProxy)
+    if (!iProxy)
         {
-        if (iProxy->Connect() != TMS_RESULT_SUCCESS)
-            {
-            delete iProxy;
-            iProxy = NULL;
-            ret = TMS_RESULT_FATAL_ERROR;
-            }
-        else
-            {
-            ret = iProxy->StartRoutingNotifier(); //starts TAR
-            }
+        ret = TMS_RESULT_INSUFFICIENT_MEMORY;
+        }
+    RET_REASON_IF_ERR(ret);
+
+    if (iProxy->Connect() != TMS_RESULT_SUCCESS)
+        {
+        delete iProxy;
+        iProxy = NULL;
+        ret = TMS_RESULT_FATAL_ERROR;
         }
     else
         {
-        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
+        ret = iProxy->StartRoutingNotifier(); //starts TAR
         }
+    RET_REASON_IF_ERR(ret);
     return ret;
     }
 
 gint TMSGlobalRoutingBodyImpl::AddObserver(TMSGlobalRoutingObserver& obsrvr,
-        gpointer /*user_data*/)
+        gpointer user_data)
     {
     gint ret(TMS_RESULT_SUCCESS);
     if (!iObserver)
         {
         iObserver = &obsrvr;
-        //iUserData = user_data;
+        iUserData = user_data;
         if (iProxy)
             {
             ret = iProxy->SetMsgQueueNotifier(EMsgQueueGlobalRoutingType,
-                    iObserver, NULL, iClientId);
+                    iObserver, iParent, iClientId);
             }
         else
             {
@@ -113,9 +115,10 @@
     gint ret(TMS_RESULT_SUCCESS);
     if (iProxy && (&obsrvr == iObserver))
         {
-        iProxy->RemoveMsgQueueNotifier(EMsgQueueGlobalRoutingType, iObserver);
+        ret = iProxy->RemoveMsgQueueNotifier(EMsgQueueGlobalRoutingType,
+                iObserver);
+        iObserver = NULL;
         ret = iProxy->CancelRoutingNotifier();
-        iObserver = NULL;
         }
     else
         {
@@ -180,4 +183,8 @@
     return ret;
     }
 
-// End of file
+void TMSGlobalRoutingBodyImpl::SetParent(TMSGlobalRouting*& parent)
+    {
+    iParent = parent;
+    }
+
--- a/mmserv/tms/tmsimpl/src/tmsglobalroutingimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsglobalroutingimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsglobalroutingbodyimpl.h"
 #include "tmsglobalroutingimpl.h"
@@ -49,7 +48,6 @@
     return ret;
     }
 
-// TO DO stop exporting this function
 EXPORT_C gint TMSGlobalRoutingImpl::Create(TMSGlobalRouting*& globrouting)
     {
     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
@@ -65,7 +63,11 @@
             self = NULL;
             }
         }
-    globrouting = self;
+    if (self && ret == TMS_RESULT_SUCCESS)
+        {
+        globrouting = self;
+        ret = self->SetParent(globrouting);
+        }
     TRACE_PRN_FN_EXT;
     return ret;
     }
@@ -80,4 +82,17 @@
     return ret;
     }
 
-// End of file
+gint TMSGlobalRoutingImpl::SetParent(TMSGlobalRouting*& parent)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (this->iBody)
+        {
+        ((TMSGlobalRoutingBodyImpl*) this->iBody)->SetParent(parent);
+        }
+    else
+        {
+        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
+        }
+    return ret;
+    }
+
--- a/mmserv/tms/tmsimpl/src/tmsglobalvoleffectbodyimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsglobalvoleffectbodyimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -26,7 +26,7 @@
 TMSGlobalVolEffectBodyImpl::TMSGlobalVolEffectBodyImpl() :
     iObserver(NULL),
     iProxy(NULL),
-    iGlobalEffect(NULL)
+    iParent(NULL)
     {
     }
 
@@ -39,7 +39,7 @@
         iProxy = NULL;
         }
     iObserver = NULL;
-    iGlobalEffect = NULL;
+    iParent = NULL;
     iUserData = NULL;
     }
 
@@ -65,34 +65,39 @@
     gint ret(TMS_RESULT_SUCCESS);
     iClientId = 1;
     iProxy = new TMSProxy;
-    if (iProxy)
+    if (!iProxy)
         {
-        if (iProxy->Connect() != TMS_RESULT_SUCCESS)
-            {
-            delete iProxy;
-            iProxy = NULL;
-            ret = TMS_RESULT_FATAL_ERROR;
-            }
+        ret = TMS_RESULT_INSUFFICIENT_MEMORY;
+        }
+    RET_REASON_IF_ERR(ret);
+
+    if (iProxy->Connect() != TMS_RESULT_SUCCESS)
+        {
+        delete iProxy;
+        iProxy = NULL;
+        ret = TMS_RESULT_FATAL_ERROR;
         }
     else
         {
-        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
+        // Starts TAR if not started already;
+        ret = iProxy->StartRoutingNotifier();
         }
+    RET_REASON_IF_ERR(ret);
     return ret;
     }
 
 gint TMSGlobalVolEffectBodyImpl::AddObserver(TMSEffectObserver& obsrvr,
-        gpointer /*user_data*/)
+        gpointer user_data)
     {
     gint ret(TMS_RESULT_SUCCESS);
     if (!iObserver)
         {
         iObserver = &obsrvr;
-        //iUserData = user_data;
+        iUserData = user_data;
         if (iProxy)
             {
             ret = iProxy->SetMsgQueueNotifier(EMsgQueueGlobalVolumeType,
-                    iObserver, iGlobalEffect, iClientId);
+                    iObserver, iParent, iClientId);
             if (ret == TMS_RESULT_SUCCESS)
                 {
                 ret = iProxy->StartGlobalEffectNotifier();
@@ -113,12 +118,13 @@
 gint TMSGlobalVolEffectBodyImpl::RemoveObserver(TMSEffectObserver& obsrvr)
     {
     gint ret(TMS_RESULT_SUCCESS);
-
     if (iProxy && (&obsrvr == iObserver))
         {
-        iProxy->RemoveMsgQueueNotifier(EMsgQueueGlobalVolumeType, iObserver);
+        ret = iProxy->RemoveMsgQueueNotifier(EMsgQueueGlobalVolumeType,
+            iObserver);
         iObserver = NULL;
-        //ret = iProxy->StopEffectNotifier(obsrvr);
+        ret = iProxy->CancelGlobalEffectNotifier();
+        ret = iProxy->CancelRoutingNotifier();
         }
     else
         {
@@ -176,10 +182,8 @@
     return ret;
     }
 
-void TMSGlobalVolEffectBodyImpl::SetParentEffect(TMSEffect*& parenteffect)
+void TMSGlobalVolEffectBodyImpl::SetParent(TMSEffect*& parent)
     {
-    iGlobalEffect = NULL;
-    iGlobalEffect = parenteffect;
+    iParent = parent;
     }
 
-// End of file
--- a/mmserv/tms/tmsimpl/src/tmsglobalvoleffectimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsglobalvoleffectimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,9 +15,8 @@
  *
  */
 
-#include <tms.h>
+#include "tmsutility.h"
 #include "tmsglobalvoleffectbodyimpl.h"
-#include "tmsutility.h"
 #include "tmsglobalvoleffectimpl.h"
 
 using namespace TMS;
@@ -45,7 +44,6 @@
         {
         this->iBody = bodyimpl;
         }
-
     TRACE_PRN_FN_EXT;
     return ret;
     }
@@ -65,23 +63,21 @@
             self = NULL;
             }
         }
-
     if (self && ret == TMS_RESULT_SUCCESS)
         {
         tmseffect = self;
-        ret = self->SetParentEffect(tmseffect);
+        ret = self->SetParent(tmseffect);
         }
-
     TRACE_PRN_FN_EXT;
     return ret;
     }
 
-gint TMSGlobalVolEffectImpl::SetParentEffect(TMSEffect*& parenteffect)
+gint TMSGlobalVolEffectImpl::SetParent(TMSEffect*& parent)
     {
-    gint  ret(TMS_RESULT_SUCCESS);
+    gint ret(TMS_RESULT_SUCCESS);
     if (this->iBody)
         {
-        ((TMSGlobalVolEffectBodyImpl*) this->iBody)->SetParentEffect(parenteffect);
+        ((TMSGlobalVolEffectBodyImpl*) this->iBody)->SetParent(parent);
         }
     else
         {
@@ -90,4 +86,3 @@
     return ret;
     }
 
-// End of file
--- a/mmserv/tms/tmsimpl/src/tmsilbcimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsilbcimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsilbcbodyimpl.h"
 #include "tmsilbcformatimpl.h"
--- a/mmserv/tms/tmsimpl/src/tmsipcallbodyimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsipcallbodyimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -125,7 +125,7 @@
             if (ret == TMS_RESULT_SUCCESS)
                 {
                 ret = AddStreamToList(strm);
-                }           
+                }
             //TODO:Need longer term fix to not destory everything
             //if more the one stream is trying to be created.
             else if (ret == TMS_RESULT_ALREADY_EXIST)
@@ -194,10 +194,9 @@
     if (itStrm)
         {
         iStreamsVector.erase(itStrm); // Remove from array
-        // Don't delete itStrm as it is now pointing to the next item on the list
-        delete strm; // Free memory
-        strm = NULL;
-        ret = TMS_RESULT_SUCCESS;
+        // Don't delete itStrm as the iterator advanced to the next 
+        // item on the list
+        ret = TMSStreamImpl::Delete(strm);
         }
     TRACE_PRN_FN_EXT;
     return ret;
--- a/mmserv/tms/tmsimpl/src/tmsmicsourceimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsmicsourceimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsmicsourcebodyimpl.h"
 #include "tmsmicsourceimpl.h"
@@ -24,10 +23,14 @@
 
 TMSMicSourceImpl::TMSMicSourceImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 TMSMicSourceImpl::~TMSMicSourceImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSMicSourceImpl::PostConstruct()
--- a/mmserv/tms/tmsimpl/src/tmsmodemsinkimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsmodemsinkimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsmodemsinkimpl.h"
 #include "tmsmodemsinkbodyimpl.h"
@@ -24,10 +23,14 @@
 
 TMSModemSinkImpl::TMSModemSinkImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 TMSModemSinkImpl::~TMSModemSinkImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSModemSinkImpl::PostConstruct()
--- a/mmserv/tms/tmsimpl/src/tmsmodemsourceimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsmodemsourceimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsmodemsourceimpl.h"
 #include "tmsmodemsourcebodyimpl.h"
@@ -24,10 +23,14 @@
 
 TMSModemSourceImpl::TMSModemSourceImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 TMSModemSourceImpl::~TMSModemSourceImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSModemSourceImpl::PostConstruct()
--- a/mmserv/tms/tmsimpl/src/tmspcmimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmspcmimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmspcmbodyimpl.h"
 #include "tmspcmformatimpl.h"
@@ -24,10 +23,14 @@
 
 TMSPCMFormatImpl::TMSPCMFormatImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 TMSPCMFormatImpl::~TMSPCMFormatImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSPCMFormatImpl::PostConstruct()
--- a/mmserv/tms/tmsimpl/src/tmsqueuehandler.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsqueuehandler.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -251,7 +251,8 @@
                 if (index != KErrNotFound)
                     {
                     iObserversList[index]->QueueEvent(
-                            TMS_EVENT_EFFECT_VOL_CHANGED, msgBuf.iStatus, NULL);
+                            TMS_EVENT_EFFECT_VOL_CHANGED, msgBuf.iStatus,
+                            NULL);
                     }
                 }
                 break;
@@ -289,8 +290,7 @@
             hndl = (iTMSGlobalContext->CallProxy)->GetDataXferChunkHandle(
                     iTMSGlobalContext->CallType,
                     iTMSGlobalContext->StreamType,
-                    iTMSGlobalContext->StreamId,
-                    key);
+                    iTMSGlobalContext->StreamId, key);
             err = iChunk.SetReturnedHandle(hndl);
             }
         }
@@ -308,8 +308,8 @@
         gint index = iClientList.Find(TMS_SOURCE_CLIENT);
         if (index != KErrNotFound)
             {
-            iObserversList[index]->QueueEvent(
-                    TMS_EVENT_SOURCE_FILL_BUFFER, aStatus, iBuffer);
+            iObserversList[index]->QueueEvent(TMS_EVENT_SOURCE_FILL_BUFFER,
+                    aStatus, iBuffer);
             }
         else
             {
@@ -348,8 +348,7 @@
             hndl = (iTMSGlobalContext->CallProxy)->GetDataXferChunkHandle(
                     iTMSGlobalContext->CallType,
                     iTMSGlobalContext->StreamType,
-                    iTMSGlobalContext->StreamId,
-                    key);
+                    iTMSGlobalContext->StreamId, key);
             err = iChunk.SetReturnedHandle(hndl);
             }
         // TODO handle error here
@@ -369,8 +368,8 @@
         gint index = iClientList.Find(TMS_SINK_CLIENT);
         if (index != KErrNotFound)
             {
-            iObserversList[index]->QueueEvent(
-                    TMS_EVENT_SINK_PROCESS_BUFFER, aStatus, iBuffer);
+            iObserversList[index]->QueueEvent(TMS_EVENT_SINK_PROCESS_BUFFER,
+                    aStatus, iBuffer);
             }
         else
             {
--- a/mmserv/tms/tmsimpl/src/tmssinkimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmssinkimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,15 +15,26 @@
  *
  */
 
-#include <tms.h>
+#include "tmsutility.h"
 #include "tmsclientsinkimpl.h"
-#include "tmsutility.h"
-#include "tmssinkimpl.h"
 #include "tmsmodemsinkimpl.h"
 #include "tmsspeakersinkimpl.h"
+#include "tmssinkimpl.h"
 
 using namespace TMS;
 
+TMSSinkImpl::TMSSinkImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+TMSSinkImpl::~TMSSinkImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
 EXPORT_C gint TMSSinkImpl::Create(TMSSinkType sinktype, TMSSink*& tmssink)
     {
     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
--- a/mmserv/tms/tmsimpl/src/tmssourceimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmssourceimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsclientsourceimpl.h"
 #include "tmsutility.h"
 #include "tmssourceimpl.h"
@@ -24,6 +23,18 @@
 
 using namespace TMS;
 
+TMSSourceImpl::TMSSourceImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
+TMSSourceImpl::~TMSSourceImpl()
+    {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
+    }
+
 EXPORT_C gint TMSSourceImpl::Create(TMSSourceType sourcetype,
         TMSSource*& tmssource)
     {
--- a/mmserv/tms/tmsimpl/src/tmsspeakersinkimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsspeakersinkimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include <tms.h>
 #include "tmsutility.h"
 #include "tmsspeakersinkimpl.h"
 #include "tmsspeakersinkbodyimpl.h"
@@ -24,10 +23,14 @@
 
 TMSSpeakerSinkImpl::TMSSpeakerSinkImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 TMSSpeakerSinkImpl::~TMSSpeakerSinkImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSSpeakerSinkImpl::PostConstruct()
--- a/mmserv/tms/tmsimpl/src/tmsstreamimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsstreamimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,7 +15,7 @@
  *
  */
 
-#include <tms.h>
+#include "tmsutility.h"
 #include "tmsstreambodyimpl.h"
 #include "tmsstreamimpl.h"
 
@@ -23,10 +23,14 @@
 
 TMSStreamImpl::TMSStreamImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 TMSStreamImpl::~TMSStreamImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSStreamImpl::PostConstruct(TMSCallType callType, TMSStreamType stype,
@@ -63,4 +67,13 @@
     return ret;
     }
 
-// End of file
+gint TMSStreamImpl::Delete(TMSStream*& strm)
+    {
+    TRACE_PRN_FN_ENT;
+    gint ret(TMS_RESULT_SUCCESS);
+    delete (TMSStreamImpl*) (strm);
+    strm = NULL;
+    TRACE_PRN_FN_EXT;
+    return ret;
+    }
+
--- a/mmserv/tms/tmsimpl/src/tmsvolumeeffectbodyimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsvolumeeffectbodyimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -17,6 +17,7 @@
 
 #include <tms.h>
 #include <tmseffectobsrvr.h>
+#include "tmsutility.h"
 #include "tmscallproxy.h"
 #include "tmsqueuehandler.h"
 #include "tmsvolumeeffectbodyimpl.h"
@@ -26,12 +27,14 @@
 TMSVolumeEffectBodyImpl::TMSVolumeEffectBodyImpl() :
     iObserver(NULL),
     iProxy(NULL),
-    iParentEffect(NULL)
+    iParent(NULL)
     {
     }
 
 TMSVolumeEffectBodyImpl::~TMSVolumeEffectBodyImpl()
     {
+    TRACE_PRN_FN_ENT;
+    TRACE_PRN_FN_EXT;
     }
 
 gint TMSVolumeEffectBodyImpl::Create(TMSVolumeEffectBody*& bodyimpl)
@@ -136,12 +139,9 @@
     return ret;
     }
 
-gint TMSVolumeEffectBodyImpl::SetParentEffect(TMSEffect*& parenteffect)
+void TMSVolumeEffectBodyImpl::SetParent(TMSEffect*& parent)
     {
-    gint ret(TMS_RESULT_SUCCESS);
-    iParentEffect = NULL;
-    iParentEffect = parenteffect;
-    return ret;
+    iParent = parent;
     }
 
 void TMSVolumeEffectBodyImpl::SetProxy(TMSCallProxy* aProxy,
@@ -150,7 +150,8 @@
     iProxy = aProxy;
     if (queuehandler)
         {
-        ((TMSQueueHandler*) queuehandler)->AddObserver(*this, TMS_EFFECT_VOLUME);
+        ((TMSQueueHandler*) queuehandler)->AddObserver(*this,
+                TMS_EFFECT_VOLUME);
         }
     }
 
@@ -158,7 +159,6 @@
         void* /*user_data*/)
     {
     TMSSignalEvent event;
-
     event.type = TMS_EVENT_EFFECT_VOL_CHANGED;
     event.reason = aError;
 
@@ -166,9 +166,9 @@
         {
         case TMS_EVENT_EFFECT_VOL_CHANGED:
             {
-            if (iObserver && iParentEffect)
+            if (iObserver && iParent)
                 {
-                iObserver->EffectsEvent(iParentEffect, event);
+                iObserver->EffectsEvent(iParent, event);
                 }
             }
             break;
@@ -177,4 +177,3 @@
         }
     }
 
-// End of file
--- a/mmserv/tms/tmsimpl/src/tmsvolumeeffectimpl.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsimpl/src/tmsvolumeeffectimpl.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -15,9 +15,8 @@
  *
  */
 
-#include <tms.h>
+#include "tmsutility.h"
 #include "tmsvolumeeffectbodyimpl.h"
-#include "tmsutility.h"
 #include "tmsvolumeeffectimpl.h"
 
 using namespace TMS;
@@ -64,30 +63,15 @@
             self = NULL;
             }
         }
-
     if (self && ret == TMS_RESULT_SUCCESS)
         {
         tmseffect = self;
-        ret = self->SetParentEffect(tmseffect);
+        ret = self->SetParent(tmseffect);
         }
     TRACE_PRN_FN_EXT;
     return ret;
     }
 
-gint TMSVolumeEffectImpl::SetParentEffect(TMSEffect*& parenteffect)
-    {
-    gint  ret(TMS_RESULT_SUCCESS);
-    if (this->iBody)
-        {
-        ((TMSVolumeEffectBodyImpl*) this->iBody)->SetParentEffect(parenteffect);
-        }
-    else
-        {
-        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
-        }
-    return ret;
-    }
-
 gint TMSVolumeEffectImpl::SetProxy(TMSCallProxy* aProxy, gpointer queuehandler)
     {
     gint ret(TMS_RESULT_SUCCESS);
@@ -103,4 +87,17 @@
     return ret;
     }
 
-// End of file
+gint TMSVolumeEffectImpl::SetParent(TMSEffect*& parent)
+    {
+    gint ret(TMS_RESULT_SUCCESS);
+    if (this->iBody)
+        {
+        ((TMSVolumeEffectBodyImpl*) this->iBody)->SetParent(parent);
+        }
+    else
+        {
+        ret = TMS_RESULT_UNINITIALIZED_OBJECT;
+        }
+    return ret;
+    }
+
--- a/mmserv/tms/tmsproxy/src/tmsproxy.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsproxy/src/tmsproxy.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -26,7 +26,7 @@
 using namespace TMS;
 
 // CONSTANTS
-const TUint KServerConnectRetries = 2;
+const TUint KTMSServerConnectRetries = 2;
 const TUint KSessionMessageSlots = 10;
 
 // -----------------------------------------------------------------------------
@@ -76,10 +76,7 @@
 //
 EXPORT_C TMSProxy::TMSProxy()
     {
-    iEffectsObsrvrList.Reset();
-    iEffectsParentList.Reset();
-    iRoutingObsrvrList.Reset();
-    iRoutingParentList.Reset();
+    ResetObjectLists();
     iMsgQHandler = NULL;
     }
 
@@ -89,10 +86,7 @@
 //
 EXPORT_C TMSProxy::~TMSProxy()
     {
-    iEffectsObsrvrList.Reset();
-    iEffectsParentList.Reset();
-    iRoutingObsrvrList.Reset();
-    iRoutingParentList.Reset();
+    ResetObjectLists();
 
     if (iMsgQHandler)
         {
@@ -118,7 +112,7 @@
     {
     TRACE_PRN_FN_ENT;
 
-    gint retry = KServerConnectRetries;
+    gint retry = KTMSServerConnectRetries;
     gint err(TMS_RESULT_GENERAL_ERROR);
     gint numMessageSlots = KSessionMessageSlots;
 
@@ -471,7 +465,8 @@
             status = RemoveGlobalEffectObserver((*(TMSEffectObserver*) obsrv));
             break;
         case EMsgQueueGlobalRoutingType:
-            status = RemoveRoutingObserver((*(TMSGlobalRoutingObserver*) obsrv));
+            status = RemoveRoutingObserver((*(TMSGlobalRoutingObserver*)
+                    obsrv));
             break;
         default:
             status = TMS_RESULT_INVALID_ARGUMENT;
@@ -512,7 +507,6 @@
         {
         status = iEffectsObsrvrList.Append(&obsrv);
         status = iEffectsParentList.Append(&parent);
-        //status = iClientList.Append(clientid);
         }
     else
         {
@@ -529,7 +523,6 @@
         {
         iEffectsObsrvrList.Remove(index);
         iEffectsParentList.Remove(index);
-        //iClientList.Remove(index);
         }
     else
         {
@@ -546,7 +539,6 @@
         {
         status = iRoutingObsrvrList.Append(&obsrv);
         status = iRoutingParentList.Append(&parent);
-        //status = iClientList.Append(clientid);
         }
     else
         {
@@ -563,7 +555,6 @@
         {
         iRoutingObsrvrList.Remove(index);
         iRoutingParentList.Remove(index);
-        //iClientList.Remove(index);
         }
     else
         {
@@ -663,4 +654,17 @@
         }
     }
 
+// ---------------------------------------------------------------------------
+// TMSProxy::ResetObjectLists
+// ---------------------------------------------------------------------------
+//
+void TMSProxy::ResetObjectLists()
+    {
+    iEffectsObsrvrList.Reset();
+    iRoutingObsrvrList.Reset();
+
+    iEffectsParentList.Reset();
+    iRoutingParentList.Reset();
+    }
+
 // End of file
--- a/mmserv/tms/tmsproxy/src/tmsqueuehandler.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsproxy/src/tmsqueuehandler.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -163,7 +163,7 @@
         {
         err = TMS_RESULT_INVALID_STATE;
         }
-        
+
     // Start monitoring for more events before calling the observer in case
     // client decides to destroy us before this RunL completes executing.
     Start();
--- a/mmserv/tms/tmsserver/group/tmsserver.mmp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsserver/group/tmsserver.mmp	Wed Mar 31 22:29:45 2010 +0300
@@ -23,22 +23,26 @@
 UID             0 0x10207C7C
 EPOCSTACKSIZE   0x5000
 EPOCHEAPSIZE    0x500000 0x1000000
-CAPABILITY      ALL -Tcb
+CAPABILITY      ProtServ MultiMediaDD ReadDeviceData WriteDeviceData ReadUserData WriteUserData UserEnvironment
 VENDORID        VID_DEFAULT
 
+EPOCPROCESSPRIORITY high
+
 SOURCEPATH      ../src
 
 SOURCE          tmsserver.cpp
 SOURCE          tmsserversession.cpp
 SOURCE          tmsservershutdown.cpp
-SOURCE          globaleffectssettings.cpp
-SOURCE          tareventhandler.cpp
-SOURCE          cspcenreplistener.cpp
-SOURCE          cspaudiohandler.cpp
+SOURCE          tmsglobaleffectssettings.cpp
+SOURCE          tmstareventhandler.cpp
+SOURCE          tmscenreplistener.cpp
+SOURCE          tmscenrepaudiohandler.cpp
+SOURCE          tmspubsublistener.cpp
 
 USERINCLUDE     ../inc
 USERINCLUDE     ../../inc
 
+APP_LAYER_SYSTEMINCLUDE
 MW_LAYER_SYSTEMINCLUDE
 OS_LAYER_LIBC_SYSTEMINCLUDE
 OS_LAYER_GLIB_SYSTEMINCLUDE
--- a/mmserv/tms/tmsserver/inc/cspaudiohandler.h	Mon Mar 15 12:42:35 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  Declarations for class TMSCenRepAudioHandler
- *
- */
-
-#ifndef CSPAUDIOHANDLER_H
-#define CSPAUDIOHANDLER_H
-
-#include <sounddevice.h>
-
-#include "mcspcenrepobserver.h"
-#include "tmsserver.h"
-
-namespace TMS {
-
-class TMSCSPPubSubListener;
-class TMSCenRepListener;
-class TMSCSPAudioStreams;
-
-/**
- * Handles call adding from calls not done by the plugin.
- *
- */
-class TMSCenRepAudioHandler : public MCSPCenRepObserver
-    {
-public:
-    //Constructors and descructor
-
-    /**
-     * Two-phased constructing for the monitor.
-     *
-     * @param aObserver the observer for getting notification
-     * @param aLine the line to monitor
-     * @param aLineId line identifier
-     */
-    static TMSCenRepAudioHandler* NewL(TMSServer* aServer);
-
-    /**
-     * C++ default destructor
-     */
-    virtual ~TMSCenRepAudioHandler();
-
-    void SetLoudSpeakerVol(TInt vol);
-    void SetEarPieceVol(TInt vol);
-
-    // from base class MCSPPubSubObserver
-    /**
-     * Handler for changed event.
-     * @param aUid uid of setting
-     * @param aKey id of setting
-     * @param aStatus status of completed AO operation
-     */
-    //virtual void HandleNotifyPSL( const TUid aUid, const TInt& aKey,
-    //    const TRequestStatus& aStatus );
-
-    // from base class MCSPCenRepObserver
-    /**
-     * Handler for changed event.
-     * @param aUid uid of setting
-     * @param aVal value
-     */
-    virtual void TMSCenRepAudioHandler::HandleNotifyCenRepL(const TUid aUid,
-            const TUint32 aKey, TInt aVal);
-
-    // from base class MDevSoundObserver
-protected:
-    //From DevSound
-
-
-protected:
-    // From CActive
-    /**
-     * From CActive
-     * RunL
-     */
-    void RunL();
-
-    /**
-     * From CActive
-     * Catches errors if RunL leaves
-     * @param aError error code
-     * @return error code
-     */
-    TInt RunError(TInt aError);
-
-    /**
-     * From CActive
-     * Cancels the monitor
-     */
-    void DoCancel();
-
-private:
-    /**
-     * C++ default constructor
-     * @param aObserver the observer for status change (incoming call)
-     * @param aLine the line associated with the call
-     * @param aLineId line identifier
-     */
-    TMSCenRepAudioHandler(TMSServer* aServer);
-
-    /**
-     * Constructs the monitor in the second phase.
-     */
-    void ConstructL();
-
-private:
-    // data
-
-    /**
-     * Mute listening from Publish&Subscribe.
-     */
-    TMSCSPPubSubListener* iMuteListener;
-
-    /**
-     * Incall loudspeaker listening from Central Repository.
-     */
-    TMSCenRepListener* iIncallLoudspeakerVolumeListener;
-
-    /**
-     * Incall ear volume listening from Central Repository.
-     */
-    TMSCenRepListener* iIncallEarVolumeListener;
-
-    /**
-     * Audio streams handler.
-     */
-    //CSPAudioStreams* iAudioStreams;
-
-    /**
-     * Call count
-     */
-    TInt iCallCount;
-    TMSServer* iTMSSer;
-    };
-
-} //namespace TMS
-
-#endif // CSPAUDIOHANDLER_H
--- a/mmserv/tms/tmsserver/inc/cspcenreplistener.h	Mon Mar 15 12:42:35 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  This file contains the header of CenRep Listener class.
- *
- */
-
-#ifndef CSPCENREPLISTENER_H
-#define CSPCENREPLISTENER_H
-
-// INCLUDE FILES
-#include <glib.h>
-#include <e32base.h>
-#include <centralrepository.h>
-
-namespace TMS {
-
-// Forward declarations
-class MCSPCenRepObserver;
-
-/**
- *   TMSCenRepListener manages getting notification on CenRep key changes.
- */
-class TMSCenRepListener : public CActive
-    {
-public:
-
-    /**
-     * Two-phased construction.
-     *
-     * @param aUid cenrep Uid
-     * @param aKey key to be listened
-     * @param aObserver observer for key change.
-     * @return instance of the class
-     */
-    static TMSCenRepListener* NewL(TUid aUid, TUint32 aKey,
-            MCSPCenRepObserver* aObserver);
-
-    /**
-     * Destructor.
-     */
-    virtual ~TMSCenRepListener();
-
-public:
-
-    /**
-     * Gets the current value of the monitored setting
-     * @param aValue the current value of the monitored setting
-     * @return gint Symbian OS error code from central repository
-     */
-    gint Get(gint& aValue);
-
-    gint Set(gint aValue);
-
-protected:
-    // From CActive
-    void DoCancel();
-    gint RunError(TInt aError);
-    void RunL();
-
-private:
-
-    /**
-     * Constructor
-     * @param aUid cenrep Uid
-     * @param aKey key to be listened
-     * @param aObserver observer for key change.
-     */
-    TMSCenRepListener(TUid aUid, TUint32 aKey, MCSPCenRepObserver* aObserver);
-
-    /**
-     * Private constructing.
-     */
-    void ConstructL();
-
-    /**
-     * Submits a notification request
-     */
-    void SubmitNotifyRequestL();
-
-private:
-    // Owned by this object
-
-    /**
-     * UID of CR key.
-     */
-    TUid iUid;
-
-    /**
-     * Repository access.
-     * Own.
-     */
-    CRepository* iRepository;
-
-    /**
-     * Identification number of the monitored setting.
-     */
-    TUint32 iMonitorSetting;
-
-    MCSPCenRepObserver* iObserver;
-    };
-
-} //namespace TMS
-
-#endif // CSPCENREPLISTENER_H
--- a/mmserv/tms/tmsserver/inc/globaleffectssettings.h	Mon Mar 15 12:42:35 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: Telephony Multimedia Service
- *
- */
-
-#ifndef GLOBALEFFECTSSETTINGS_H
-#define GLOBALEFFECTSSETTINGS_H
-
-//  INCLUDES
-#include <e32property.h>
-#include <sounddevice.h>
-#include <centralrepository.h>
-
-namespace TMS {
-
-// CLASS DECLARATION
-class TMSGlobalEffectsSettings
-    {
-public:
-    /**
-     * Two-phased constructor.
-     */
-    static TMSGlobalEffectsSettings* NewL();
-
-    /**
-     * Destructor.
-     */
-    virtual ~TMSGlobalEffectsSettings();
-
-public:
-    /**
-     * Store the current loud speaker volume.
-     * @param aVolume Volume
-     */
-    void SetLoudSpkrVolume(TInt aVolume);
-
-    /**
-     * Store the current earpiece volume.
-     * @param aVolume Volume
-     */
-    void SetEarPieceVolume(TInt aVolume);
-
-
-    /**
-     * Retrieve the current loud speaker volume.
-     * @param aVolume Volume
-     */
-    void GetLoudSpkrVolume(TInt& aVolume);
-
-    /**
-     * Retrieve the current earpiece volume.
-     * @param aVolume Volume
-     */
-    void GetEarPieceVolume(TInt& aVolume);
-
-    /**
-     * Returns the current volume.
-     * @return Current volume
-     */
-    TInt MaxVolume() const;
-
-    /**
-     * Store the current gain.
-     * @param aVolume Volume
-     * @param aPublish ETrue to publish the status to clients
-     */
-    void SetGain(TInt aGain);
-
-    /**
-     * Returns the current gain.
-     * @return Current volume
-     */
-    TInt Gain() const;
-
-    /**
-     * Returns the max gain.
-     * @return Current volume
-     */
-    TInt MaxGain() const;
-
-private:
-
-    /**
-     * C++ default constructor.
-     */
-    TMSGlobalEffectsSettings();
-
-    /**
-     * By default Symbian 2nd phase constructor is private.
-     */
-    void ConstructL();
-
-private:
-    TInt iGain;
-    TInt iMaxVolume;
-    TInt iMaxGain;
-    TInt iEarVolume;
-    TInt iLoudSpkrVolume;
-
-    CRepository* iRepository;
-    };
-
-} //namespace TMS
-
-#endif      // GLOBALEFFECTSSETTINGS_H
-
-// End of File
--- a/mmserv/tms/tmsserver/inc/mcspcenrepobserver.h	Mon Mar 15 12:42:35 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  Declarations for class MCSPCenRepObserver
- *
- */
-
-#ifndef MCSPCENREPOBSERVER_H
-#define MCSPCENREPOBSERVER_H
-
-//  INCLUDES
-#include <e32std.h>
-
-namespace TMS {
-
-// CLASS DECLARATION
-
-/**
- *  Observer interface for indicating P&S changes
- *
- */
-class MCSPCenRepObserver
-    {
-public:
-    // New functions
-
-    /**
-     * Handler for changed event.
-     * @param aUid uid of setting
-     * @param aKey the changed key
-     * @param aVal value
-     */
-    virtual void HandleNotifyCenRepL(const TUid aUid, const TUint32 aKey,
-            TInt aVal) = 0;
-    };
-
-}//namespace TMS
-
-#endif      // MCSPCENREPOBSERVER_H
-
-// End of File
--- a/mmserv/tms/tmsserver/inc/tareventhandler.h	Mon Mar 15 12:42:35 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: Telephony Multimedia Service
- *
- */
-
-#ifndef TAREVENTHANDLER_H
-#define TAREVENTHANDLER_H
-
-//  INCLUDES
-#include <e32base.h>
-#include <e32property.h>
-#include "tmsserver.h"
-
-namespace TMS {
-
-// CLASS DECLARATION
-class TMSTarEventHandler : public CActive
-    {
-public:
-    /**
-     * Two-phased constructor.
-     */
-    static TMSTarEventHandler* NewL(TMSServer* aServer);
-
-    /**
-     * Destructor.
-     */
-    virtual ~TMSTarEventHandler();
-
-private:
-    /**
-     * From CActive
-     * Cancel outstanding request
-     */
-    void DoCancel();
-
-    /**
-     * From CActive
-     * Implementation of CActive::RunL.
-     * Called when server request has completed.
-     **/
-    void RunL();
-
-private:
-
-    /**
-     * C++ default constructor.
-     */
-    TMSTarEventHandler(TMSServer* aServer);
-
-    /**
-     * By default Symbian 2nd phase constructor is private.
-     */
-    void ConstructL();
-
-private:
-    TMSServer* iTMSSer;
-    RProperty iProperty;
-    };
-
-} //namespace TMS
-
-#endif  // TAREVENTHANDLER_H
-
-// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmscenrepaudiohandler.h	Wed Mar 31 22:29:45 2010 +0300
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Declarations for class TMSCenRepAudioHandler
+ *
+ */
+
+#ifndef TMSCENREPAUDIOHANDLER_H
+#define TMSCENREPAUDIOHANDLER_H
+
+#include "tmspubsubobserver.h"
+#include "tmscenrepobserver.h"
+#include "tmsserver.h"
+
+namespace TMS {
+
+class TMSPubSubListener;
+class TMSCenRepListener;
+
+/**
+ * Handles call adding from calls not done by the plugin.
+ *
+ */
+class TMSCenRepAudioHandler : public TMSPubSubObserver,
+                              public TMSCenRepObserver
+    {
+public:
+    //Constructors and descructor
+
+    /**
+     * Two-phased constructing for the monitor.
+     *
+     * @param aObserver the observer for getting notification
+     * @param aLine the line to monitor
+     * @param aLineId line identifier
+     */
+    static TMSCenRepAudioHandler* NewL(TMSServer* aServer);
+
+    /**
+     * C++ default destructor
+     */
+    virtual ~TMSCenRepAudioHandler();
+
+    void SetLoudSpeakerVol(TInt vol);
+    void SetEarPieceVol(TInt vol);
+
+    // from base class TMSPubSubObserver
+    /**
+     * Handler for changed event.
+     * @param aUid uid of setting
+     * @param aKey id of setting
+     * @param aStatus status of completed AO operation
+     */
+    virtual void HandleNotifyPSL(const TUid aUid, const TInt& aKey,
+            const TRequestStatus& aStatus);
+
+    // from base class TMSCenRepObserver
+    /**
+     * Handler for changed event.
+     * @param aUid uid of setting
+     * @param aVal value
+     */
+    virtual void HandleNotifyCenRepL(const TUid aUid, const TUint32 aKey,
+            TInt aVal);
+
+protected:
+    // From CActive
+    /**
+     * From CActive
+     * RunL
+     */
+    void RunL();
+
+    /**
+     * From CActive
+     * Catches errors if RunL leaves
+     * @param aError error code
+     * @return error code
+     */
+    TInt RunError(TInt aError);
+
+    /**
+     * From CActive
+     * Cancels the monitor
+     */
+    void DoCancel();
+
+private:
+    /**
+     * C++ default constructor
+     * @param aObserver the observer for status change (incoming call)
+     * @param aLine the line associated with the call
+     * @param aLineId line identifier
+     */
+    TMSCenRepAudioHandler(TMSServer* aServer);
+
+    /**
+     * Constructs the monitor in the second phase.
+     */
+    void ConstructL();
+
+private:
+    // data
+
+    /**
+     * Mute listening from Publish&Subscribe.
+     */
+    TMSPubSubListener* iMuteListener;
+
+    /**
+     * Incall loudspeaker listening from Central Repository.
+     */
+    TMSCenRepListener* iIncallLoudspeakerVolumeListener;
+
+    /**
+     * Incall ear volume listening from Central Repository.
+     */
+    TMSCenRepListener* iIncallEarVolumeListener;
+
+    /**
+     * Audio streams handler.
+     */
+    //CSPAudioStreams* iAudioStreams;
+
+    /**
+     * Call count
+     */
+    TInt iCallCount;
+    TMSServer* iTMSSer;
+    };
+
+} //namespace TMS
+
+#endif // TMSCENREPAUDIOHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmscenreplistener.h	Wed Mar 31 22:29:45 2010 +0300
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  This file contains the header of CenRep Listener class.
+ *
+ */
+
+#ifndef TMSCENREPLISTENER_H
+#define TMSCENREPLISTENER_H
+
+// INCLUDE FILES
+#include <glib.h>
+#include <e32base.h>
+#include <centralrepository.h>
+
+namespace TMS {
+
+// Forward declarations
+class TMSCenRepObserver;
+
+/**
+ *   TMSCenRepListener manages getting notification on CenRep key changes.
+ */
+class TMSCenRepListener : public CActive
+    {
+public:
+
+    /**
+     * Two-phased construction.
+     *
+     * @param aUid cenrep Uid
+     * @param aKey key to be listened
+     * @param aObserver observer for key change.
+     * @return instance of the class
+     */
+    static TMSCenRepListener* NewL(TUid aUid, TUint32 aKey,
+            TMSCenRepObserver* aObserver);
+
+    /**
+     * Destructor.
+     */
+    virtual ~TMSCenRepListener();
+
+public:
+
+    /**
+     * Gets the current value of the monitored setting
+     * @param aValue the current value of the monitored setting
+     * @return gint Symbian OS error code from central repository
+     */
+    gint Get(gint& aValue);
+
+    gint Set(gint aValue);
+
+protected:
+    // From CActive
+    void DoCancel();
+    gint RunError(TInt aError);
+    void RunL();
+
+private:
+
+    /**
+     * Constructor
+     * @param aUid cenrep Uid
+     * @param aKey key to be listened
+     * @param aObserver observer for key change.
+     */
+    TMSCenRepListener(TUid aUid, TUint32 aKey, TMSCenRepObserver* aObserver);
+
+    /**
+     * Private constructing.
+     */
+    void ConstructL();
+
+    /**
+     * Submits a notification request
+     */
+    void SubmitNotifyRequestL();
+
+private:
+    // Owned by this object
+
+    /**
+     * UID of CR key.
+     */
+    TUid iUid;
+
+    /**
+     * Repository access.
+     * Own.
+     */
+    CRepository* iRepository;
+
+    /**
+     * Identification number of the monitored setting.
+     */
+    TUint32 iMonitorSetting;
+
+    TMSCenRepObserver* iObserver;
+    };
+
+} //namespace TMS
+
+#endif // TMSCENREPLISTENER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmscenrepobserver.h	Wed Mar 31 22:29:45 2010 +0300
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Declarations for class TMSCenRepObserver
+ *
+ */
+
+#ifndef TMSCENREPOBSERVER_H
+#define TMSCENREPOBSERVER_H
+
+//  INCLUDES
+#include <e32std.h>
+
+namespace TMS {
+
+// CLASS DECLARATION
+
+/**
+ *  Observer interface for indicating P&S changes
+ *
+ */
+class TMSCenRepObserver
+    {
+public:
+    // New functions
+
+    /**
+     * Handler for changed event.
+     * @param aUid uid of setting
+     * @param aKey the changed key
+     * @param aVal value
+     */
+    virtual void HandleNotifyCenRepL(const TUid aUid, const TUint32 aKey,
+            TInt aVal) = 0;
+    };
+
+}//namespace TMS
+
+#endif // TMSCENREPOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmsglobaleffectssettings.h	Wed Mar 31 22:29:45 2010 +0300
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Telephony Multimedia Service
+ *
+ */
+
+#ifndef TMSGLOBALEFFECTSSETTINGS_H
+#define TMSGLOBALEFFECTSSETTINGS_H
+
+//  INCLUDES
+#include <e32property.h>
+#include <sounddevice.h>
+#include <centralrepository.h>
+
+namespace TMS {
+
+// CLASS DECLARATION
+class TMSGlobalEffectsSettings
+    {
+public:
+    /**
+     * Two-phased constructor.
+     */
+    static TMSGlobalEffectsSettings* NewL();
+
+    /**
+     * Destructor.
+     */
+    virtual ~TMSGlobalEffectsSettings();
+
+public:
+    /**
+     * Store the current loud speaker volume.
+     * @param aVolume Volume
+     */
+    void SetLoudSpkrVolume(TInt aVolume);
+
+    /**
+     * Store the current earpiece volume.
+     * @param aVolume Volume
+     */
+    void SetEarPieceVolume(TInt aVolume);
+
+
+    /**
+     * Retrieve the current loud speaker volume.
+     * @param aVolume Volume
+     */
+    void GetLoudSpkrVolume(TInt& aVolume);
+
+    /**
+     * Retrieve the current earpiece volume.
+     * @param aVolume Volume
+     */
+    void GetEarPieceVolume(TInt& aVolume);
+
+    /**
+     * Returns the current volume.
+     * @return Current volume
+     */
+    TInt MaxVolume() const;
+
+    /**
+     * Store the current gain.
+     * @param aVolume Volume
+     * @param aPublish ETrue to publish the status to clients
+     */
+    void SetGain(TInt aGain);
+
+    /**
+     * Returns the current gain.
+     * @return Current volume
+     */
+    TInt Gain() const;
+
+    /**
+     * Returns the max gain.
+     * @return Current volume
+     */
+    TInt MaxGain() const;
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    TMSGlobalEffectsSettings();
+
+    /**
+     * By default Symbian 2nd phase constructor is private.
+     */
+    void ConstructL();
+
+private:
+    TInt iGain;
+    TInt iMaxVolume;
+    TInt iMaxGain;
+    TInt iEarVolume;
+    TInt iLoudSpkrVolume;
+
+    CRepository* iRepository;
+    };
+
+} //namespace TMS
+
+#endif // TMSGLOBALEFFECTSSETTINGS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmspubsublistener.h	Wed Mar 31 22:29:45 2010 +0300
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Declarations for class TMSPubSubListener
+ *
+ */
+
+#ifndef TMSPUBSUBLISTENER_H
+#define TMSPUBSUBLISTENER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+#include <e32property.h>
+
+namespace TMS {
+
+// FORWARD DECLARATIONS
+class TMSPubSubObserver;
+
+// CLASS DECLARATION
+
+/**
+ *  RProperty poller.
+ */
+class TMSPubSubListener : public CActive
+    {
+public:
+    // Constructors and destructor
+
+    /**
+     * Two-phased constructor.
+     * @param aUid the Uid to use
+     * @param aKey item's key
+     * @param aObserver callback interface for notification
+     * @return instance of CSPPubSubListener
+     */
+    static TMSPubSubListener* NewL(const TUid aUid, const TInt aKey,
+            TMSPubSubObserver* aObserver);
+
+    /**
+     * Destructor.
+     */
+    virtual ~TMSPubSubListener();
+
+public:
+    // New functions.
+
+    /**
+     * Gets integer value from P & S.
+     * @param aVal a value in return
+     * @return error code
+     */
+    TInt Get(TInt& aVal);
+
+    /**
+     * Gets 8 bit string value from P&S.
+     * @param aVal a value in return
+     * @return error code
+     */
+    TInt Get(TDes8& aVal);
+
+    /**
+     * Gets 16 bit descriptor value from P&S.
+     * @param aVal a value in return
+     * @return error code
+     */
+    TInt Get(TDes16& aVal);
+
+private:
+    // New functions.
+
+    /**
+     * Starts the listening (RunL).
+     */
+    void StartListening();
+
+private:
+    // From CActive.
+
+    /** @see CActive::RunL */
+    virtual void RunL();
+
+    /** @see CActive::Cancel */
+    virtual void DoCancel();
+
+    /** @see CActive::RunError */
+    virtual TInt RunError(TInt aError);
+
+private:
+
+    /**
+     * Constructor of the listener.
+     * @param aUid the Uid to use
+     * @param aKey item's key
+     * @param aObserver callback interface for notification
+     */
+    TMSPubSubListener(const TUid aUid, TInt aKey,
+	        TMSPubSubObserver* aObserver);
+
+    /**
+     * By default Symbian 2nd phase constructor is private.
+     */
+    void ConstructL();
+
+private:
+    // Data
+
+    /** UID of the monitored item. */
+    TUid iUid;
+
+    /** ID of the monitored item. */
+    TInt iId;
+
+    /** Property to subscribe to. */
+    RProperty iProperty;
+
+    /** Observer for PS notifications. */
+    TMSPubSubObserver* iObserver;
+    };
+
+} //namespace TMS
+
+#endif // TMSPUBSUBLISTENER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmspubsubobserver.h	Wed Mar 31 22:29:45 2010 +0300
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Declarations for class TMSPubSubObserver
+ *
+ */
+
+#ifndef TMSPUBSUBOBSERVER_H
+#define TMSPUBSUBOBSERVER_H
+
+//  INCLUDES
+#include <e32std.h>
+
+namespace TMS {
+
+// CLASS DECLARATION
+
+/**
+ *  Observer interface for indicating P&S changes
+ *
+ */
+class TMSPubSubObserver
+    {
+public:
+    // New functions
+
+    /**
+     * Handler for changed event.
+     * @param aUid uid of setting
+     * @param aKey id of setting
+     * @param aStatus status of completed AO operation
+     */
+    virtual void HandleNotifyPSL(const TUid aUid, const TInt& aKey,
+            const TRequestStatus& aStatus) = 0;
+    };
+
+} // TMS namespace
+
+#endif // TMSPUBSUBOBSERVER_H
+
+// End of File
--- a/mmserv/tms/tmsserver/inc/tmsserver.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsserver/inc/tmsserver.h	Wed Mar 31 22:29:45 2010 +0300
@@ -47,10 +47,10 @@
 
     void AddSession();
     void DropSession();
-    TInt SessionCount();
+    TInt SessionCount() const;
 
-    void SetDnLinkSession(TBool aSession);
-    void SetUpLinkSession(TBool aSession);
+    void SetDnLinkSession(const TBool aSession);
+    void SetUpLinkSession(const TBool aSession);
 
     TBool HasDnLinkSession() const;
     TBool HasUpLinkSession() const;
@@ -101,7 +101,10 @@
     TMSTarEventHandler* iTarHandler;
     TMSCenRepAudioHandler* iAudioCenRepHandler;
     TMSAudioOutput iCurrentRouting;
+    TInt iTarHandlerCount;
+    TInt iAudioCenRepHandlerCount;
 
+    // for codecs count
     RArray<TFourCC> iDnlCodecs;
     RArray<TFourCC> iUplCodecs;
     };
--- a/mmserv/tms/tmsserver/inc/tmsserversession.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsserver/inc/tmsserversession.h	Wed Mar 31 22:29:45 2010 +0300
@@ -37,7 +37,6 @@
 class TMSServerSession : public CSession2
     {
 public:
-
     // Constractor
     static TMSServerSession* NewL(TMSServer &aServer);
 
@@ -47,8 +46,10 @@
     void HandleGlobalEffectChange(TInt globalevent);
     void HandleRoutingChange(TRoutingMsgBufPckg routinginfo);
 
+    // Send notifications to clients
+    void NotifyClient(const TInt aCommand, const TInt aStatus = KErrNone);
+
 private:
-
     // Symbian constructors
     void ConstructL();
     TMSServerSession(TMSServer& aServer);
@@ -64,9 +65,6 @@
     void SetVolLevel(const RMessage2& aMessage);
     void SetMicGain(const RMessage2& aMessage);
 
-    // Send notification to the client
-    void NotifyClient();
-
 private:
     TMSServer& iServer;
     RHandleBase iTMSCallSessionHandle;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/inc/tmstareventhandler.h	Wed Mar 31 22:29:45 2010 +0300
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Telephony Multimedia Service
+ *
+ */
+
+#ifndef TMSTAREVENTHANDLER_H
+#define TMSTAREVENTHANDLER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32property.h>
+#include "tmsserver.h"
+
+namespace TMS {
+
+// CLASS DECLARATION
+class TMSTarEventHandler : public CActive
+    {
+public:
+    /**
+     * Two-phased constructor.
+     */
+    static TMSTarEventHandler* NewL(TMSServer* aServer);
+
+    /**
+     * Destructor.
+     */
+    virtual ~TMSTarEventHandler();
+
+private:
+    /**
+     * From CActive
+     * Cancel outstanding request
+     */
+    void DoCancel();
+
+    /**
+     * From CActive
+     * Implementation of CActive::RunL.
+     * Called when server request has completed.
+     **/
+    void RunL();
+
+private:
+
+    /**
+     * C++ default constructor.
+     */
+    TMSTarEventHandler(TMSServer* aServer);
+
+    /**
+     * By default Symbian 2nd phase constructor is private.
+     */
+    void ConstructL();
+
+private:
+    TMSServer* iTMSSer;
+    RProperty iProperty;
+    };
+
+} //namespace TMS
+
+#endif //TMSTAREVENTHANDLER_H
+
+// End of File
--- a/mmserv/tms/tmsserver/inc/tmstelephonycenrep.h	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsserver/inc/tmstelephonycenrep.h	Wed Mar 31 22:29:45 2010 +0300
@@ -18,6 +18,6 @@
 #ifndef TMS_TELEPHONY_CENREP_H
 #define TMS_TELEPHONY_CENREP_H
 
-//#define _USE_TELEPHONY_CENREP_
+#define _USE_TELEPHONY_CENREP_ 1
 
 #endif //TMS_TELEPHONY_CENREP_H
--- a/mmserv/tms/tmsserver/src/cspaudiohandler.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  Implements the class TMSCenRepAudioHandler
- *
- */
-
-#include <e32base.h>
-#include "tmstelephonycenrep.h"
-
-#ifdef _USE_TELEPHONY_CENREP_
-#include <telmicmutestatuspskeys.h>
-#include <telincallvolcntrlcrkeys.h>
-#else
-const TUid KCRUidInCallVolume = {0x102828B1};
-const TUint32 KTelIncallEarVolume  = 0x00000001;
-const TUint32 KTelIncallLoudspeakerVolume  = 0x00000002;
-#endif
-
-#include "cspaudiohandler.h"
-#include "cspcenreplistener.h"
-#include "tmsutility.h"
-
-using namespace TMS;
-// ---------------------------------------------------------------------------
-// TMSCenRepAudioHandler::NewL.
-// ---------------------------------------------------------------------------
-//
-TMSCenRepAudioHandler* TMSCenRepAudioHandler::NewL(TMSServer* aServer)
-    {
-    TRACE_PRN_FN_ENT;
-    TMSCenRepAudioHandler* self = new (ELeave) TMSCenRepAudioHandler(aServer);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    TRACE_PRN_FN_EXT;
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Destructs the object by canceling first ongoing monitoring.
-// ---------------------------------------------------------------------------
-//
-TMSCenRepAudioHandler::~TMSCenRepAudioHandler()
-    {
-    TRACE_PRN_FN_ENT;
-    delete iIncallLoudspeakerVolumeListener;
-    delete iIncallEarVolumeListener;
-    TRACE_PRN_FN_EXT;
-    }
-
-// ---------------------------------------------------------------------------
-// TMSCenRepAudioHandler::SetLoudSpeakerVol
-// ---------------------------------------------------------------------------
-//
-void TMSCenRepAudioHandler::SetLoudSpeakerVol(TInt vol)
-    {
-    if (iIncallLoudspeakerVolumeListener)
-        {
-        iIncallLoudspeakerVolumeListener->Set(vol);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// TMSCenRepAudioHandler::SetEarPieceVol
-// ---------------------------------------------------------------------------
-//
-void TMSCenRepAudioHandler::SetEarPieceVol(TInt vol)
-    {
-    if (iIncallEarVolumeListener)
-        {
-        iIncallEarVolumeListener->Set(vol);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// From MCSPCenRepObserver
-// TMSCenRepAudioHandler::HandleNotifyCenRepL
-// ---------------------------------------------------------------------------
-//
-void TMSCenRepAudioHandler::HandleNotifyCenRepL(const TUid /*aUid*/,
-        const TUint32 aKey, TInt aVal)
-    {
-    TRACE_PRN_FN_ENT;
-    if (aKey == KTelIncallLoudspeakerVolume)
-        {
-        iTMSSer->SetLevel(NULL,FALSE, aVal);
-        }
-    else if (aKey == KTelIncallEarVolume)
-        {
-        iTMSSer->SetLevel(NULL,FALSE, aVal);
-        }
-    TRACE_PRN_FN_EXT;
-    }
-
-// ---------------------------------------------------------------------------
-// Constructs the monitor.
-// ---------------------------------------------------------------------------
-//
-TMSCenRepAudioHandler::TMSCenRepAudioHandler(TMSServer* aServer) :
-    iTMSSer(aServer)
-    {
-    TRACE_PRN_FN_ENT;
-    iCallCount = 0; // Active calls count
-    TRACE_PRN_FN_EXT;
-    }
-
-// ---------------------------------------------------------------------------
-// Second phase construction.
-// ---------------------------------------------------------------------------
-//
-void TMSCenRepAudioHandler::ConstructL()
-    {
-    TRACE_PRN_FN_ENT;
-
-    iIncallLoudspeakerVolumeListener = TMSCenRepListener::NewL(
-            KCRUidInCallVolume, KTelIncallLoudspeakerVolume, this);
-
-    iIncallEarVolumeListener = TMSCenRepListener::NewL(KCRUidInCallVolume,
-            KTelIncallEarVolume, this);
-
-    // Initialize audio volumes
-    TInt volEar;
-    TInt volLoud;
-
-    TInt volGetRes = iIncallEarVolumeListener->Get(volEar);
-    volGetRes = iIncallLoudspeakerVolumeListener->Get(volLoud);
-
-    TRACE_PRN_FN_EXT;
-    }
-
-// End of file
--- a/mmserv/tms/tmsserver/src/cspcenreplistener.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  Central Repository listening
- *
- */
-
-// INCLUDE FILES
-#include "cspcenreplistener.h"
-#include "mcspcenrepobserver.h"
-#include "tmsutility.h"
-
-using namespace TMS;
-
-// -----------------------------------------------------------------------------
-// TMSCenRepListener::TMSCenRepListener
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-TMSCenRepListener* TMSCenRepListener::NewL(TUid aUid,
-        TUint32 aMonitorSetting, MCSPCenRepObserver* aObserver)
-    {
-    TRACE_PRN_FN_ENT;
-    TMSCenRepListener* self = new (ELeave) TMSCenRepListener(aUid,
-            aMonitorSetting, aObserver);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    TRACE_PRN_FN_EXT;
-    return self;
-    }
-
-// Destructor
-TMSCenRepListener::~TMSCenRepListener()
-    {
-    TRACE_PRN_FN_ENT;
-    Cancel();
-    delete iRepository;
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSCenRepListener::Get
-// -----------------------------------------------------------------------------
-//
-gint TMSCenRepListener::Get(gint& aValue)
-    {
-    TRACE_PRN_FN_ENT;
-    gint status = iRepository->Get(iMonitorSetting, aValue);
-    TRACE_PRN_FN_EXT;
-    return status;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSCenRepListener::Set
-// -----------------------------------------------------------------------------
-//
-gint TMSCenRepListener::Set(gint aValue)
-    {
-    TRACE_PRN_FN_ENT;
-    gint status = iRepository->Set(iMonitorSetting, aValue);
-    TRACE_PRN_FN_EXT;
-    return status;
-
-    }
-// -----------------------------------------------------------------------------
-// TMSCenRepListener::DoCancel
-// -----------------------------------------------------------------------------
-//
-void TMSCenRepListener::DoCancel()
-    {
-    TRACE_PRN_FN_ENT;
-    iRepository->NotifyCancel(iMonitorSetting);
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSCenRepListener::RunError
-// -----------------------------------------------------------------------------
-//
-gint TMSCenRepListener::RunError(
-#ifdef _DEBUG
-        TInt aError // Log the leavecode from RunL
-#else
-        TInt /*aError*/
-#endif
-        )
-    {
-    TRACE_PRN_FN_ENT;
-#ifdef _DEBUG
-    TRACE_PRN_IF_ERR(aError);
-#endif
-    TRACE_PRN_FN_EXT;
-    return KErrNone;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSCenRepListener::RunL
-// -----------------------------------------------------------------------------
-//
-void TMSCenRepListener::RunL()
-    {
-    TRACE_PRN_FN_ENT;
-    // Don't resubmit the request on error
-    // Central repositry completes notifications with id of setting
-    // so check only that value of iStatus is negative
-    if (iStatus.Int() == KErrNone)
-        {
-        SubmitNotifyRequestL();
-        }
-
-    // The loudspeaker volume has changed in repository.
-    // Retrieve the current volume from repository.
-    gint volume;
-    Get(volume);
-    iObserver->HandleNotifyCenRepL(iUid, iMonitorSetting, volume);
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSCenRepListener::TMSCenRepListener
-// -----------------------------------------------------------------------------
-//
-TMSCenRepListener::TMSCenRepListener(TUid aUid, TUint32 aMonitorSetting,
-        MCSPCenRepObserver* aObserver) :
-    CActive(EPriorityStandard),
-    iUid(aUid),
-    iMonitorSetting(aMonitorSetting),
-    iObserver(aObserver)
-    {
-    TRACE_PRN_FN_ENT;
-    CActiveScheduler::Add(this);
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSCenRepListener::ConstructL
-// -----------------------------------------------------------------------------
-//
-void TMSCenRepListener::ConstructL()
-    {
-    TRACE_PRN_FN_ENT;
-    // Create repository instance
-    iRepository = CRepository::NewL(iUid);
-    // Start monitoring
-    SubmitNotifyRequestL();
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSCenRepListener::SubmitNotifyRequestL
-// -----------------------------------------------------------------------------
-//
-void TMSCenRepListener::SubmitNotifyRequestL()
-    {
-    TRACE_PRN_FN_ENT;
-    iStatus = KRequestPending;
-    iRepository->NotifyRequest(iMonitorSetting, iStatus);
-    SetActive();
-    TRACE_PRN_FN_EXT;
-    }
-
-// End of file
--- a/mmserv/tms/tmsserver/src/globaleffectssettings.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: Telephony Multimedia Service
- *
- */
-
-// INCLUDE FILES
-#include "globaleffectssettings.h"
-#include "tmsclientserver.h"
-
-using namespace TMS;
-// CONSTANTS
-const TInt KDefaultVolume = 4;
-const TInt KDefaultMaxVolume = 10;
-const TInt KDefaultGain = 1;
-const TInt KDefaultMaxGain = 64;
-
-TUid KCRUidTmseffects = {0x10207C80};
-const TUint32 KTmsEarPieceVolume = 0x00000001;
-const TUint32 KTmsLoudSpkrVolume = 0x00000002;
-
-// -----------------------------------------------------------------------------
-// TMSGlobalEffectsSettings::TMSGlobalEffectsSettings
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-TMSGlobalEffectsSettings::TMSGlobalEffectsSettings() :
-    iGain(KDefaultGain),
-    iMaxVolume(KDefaultMaxVolume),
-    iMaxGain(KDefaultMaxGain),
-    iEarVolume(KDefaultVolume),
-    iLoudSpkrVolume(KDefaultVolume)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// TMSGlobalEffectsSettings::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void TMSGlobalEffectsSettings::ConstructL()
-    {
-    // Create repository instance
-    iRepository = CRepository::NewL(KCRUidTmseffects);
-    if (iRepository)
-        {
-        iRepository->Get(KTmsLoudSpkrVolume, iLoudSpkrVolume);
-        iRepository->Get(KTmsEarPieceVolume, iEarVolume);
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// TMSGlobalEffectsSettings::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-TMSGlobalEffectsSettings* TMSGlobalEffectsSettings::NewL()
-    {
-    TMSGlobalEffectsSettings* self = new (ELeave) TMSGlobalEffectsSettings();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// Destructor
-TMSGlobalEffectsSettings::~TMSGlobalEffectsSettings()
-    {
-    delete iRepository;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSGlobalEffectsSettings::SetLoudSpkrVolume
-// -----------------------------------------------------------------------------
-//
-void TMSGlobalEffectsSettings::SetLoudSpkrVolume(TInt aVolume)
-    {
-    TInt status(KErrNone);
-    if (iRepository)
-        {
-        status = iRepository->Set(KTmsLoudSpkrVolume, aVolume);
-        if (status == KErrNone)
-            {
-            iLoudSpkrVolume = aVolume;
-            }
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// TMSGlobalEffectsSettings::SetEarPieceVolume
-// -----------------------------------------------------------------------------
-//
-void TMSGlobalEffectsSettings::SetEarPieceVolume(TInt aVolume)
-    {
-    TInt status(KErrNone);
-    if (iRepository)
-        {
-        status = iRepository->Set(KTmsEarPieceVolume, aVolume);
-        if (status == KErrNone)
-            {
-            iEarVolume = aVolume;
-            }
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// TMSGlobalEffectsSettings::GetLoudSpkrVolume
-// -----------------------------------------------------------------------------
-//
-void TMSGlobalEffectsSettings::GetLoudSpkrVolume(TInt& aVolume)
-    {
-    aVolume = iLoudSpkrVolume;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSGlobalEffectsSettings::GetEarPieceVolume
-// -----------------------------------------------------------------------------
-//
-void TMSGlobalEffectsSettings::GetEarPieceVolume(TInt& aVolume)
-    {
-    aVolume = iEarVolume;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSGlobalEffectsSettings::MaxVolume
-// -----------------------------------------------------------------------------
-//
-TInt TMSGlobalEffectsSettings::MaxVolume() const
-    {
-    return iMaxVolume;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSGlobalEffectsSettings::SetGain
-// -----------------------------------------------------------------------------
-//
-void TMSGlobalEffectsSettings::SetGain(TInt aGain)
-    {
-    iGain = aGain;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSGlobalEffectsSettings::Gain
-// -----------------------------------------------------------------------------
-//
-TInt TMSGlobalEffectsSettings::Gain() const
-    {
-    return iGain;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSGlobalEffectsSettings::MaxGain
-// -----------------------------------------------------------------------------
-//
-TInt TMSGlobalEffectsSettings::MaxGain() const
-    {
-    return iMaxGain;
-    }
-
-//  End of File
--- a/mmserv/tms/tmsserver/src/tareventhandler.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: Telephony Multimedia Service
- *
- */
-
-// INCLUDE FILES
-#include "tareventhandler.h"
-#include "tmsclientserver.h"
-#include "tmsutility.h"
-
-using namespace TMS;
-
-// -----------------------------------------------------------------------------
-// TMSTarEventHandler::TMSTarEventHandler
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-TMSTarEventHandler::TMSTarEventHandler(TMSServer* aServer) :
-    CActive(EPriorityStandard),
-    iTMSSer(aServer)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// TMSTarEventHandler::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void TMSTarEventHandler::ConstructL()
-    {
-    TRACE_PRN_FN_ENT;
-    CActiveScheduler::Add(this);
-    User::LeaveIfError(iProperty.Attach(KTMSPropertyCategory, ERoutingPs));
-    iStatus = KRequestPending;
-    iProperty.Subscribe(iStatus);
-    SetActive();
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSTarEventHandler::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-TMSTarEventHandler* TMSTarEventHandler::NewL(TMSServer* aServer)
-    {
-    TMSTarEventHandler* self = new (ELeave) TMSTarEventHandler(aServer);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-// Destructor
-TMSTarEventHandler::~TMSTarEventHandler()
-    {
-    TRACE_PRN_FN_ENT;
-    if (IsActive())
-        {
-        Cancel();
-        }
-    iProperty.Close();
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSTarEventHandler::DoCancel
-// -----------------------------------------------------------------------------
-//
-void TMSTarEventHandler::DoCancel()
-    {
-    TRACE_PRN_FN_ENT;
-    iProperty.Cancel();
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSTarEventHandler::RunL
-// -----------------------------------------------------------------------------
-//
-void TMSTarEventHandler::RunL()
-    {
-    TRACE_PRN_FN_ENT;
-    // Subscribe immediately before analyzing the notification to ensure that we
-    // don't miss further updates.
-    if (iStatus.Int() == KErrNone)
-        {
-        iStatus = KRequestPending;
-        iProperty.Subscribe(iStatus);
-        SetActive();
-        TRoutingMsgBufPckg routingpckg;
-        iProperty.Get(routingpckg);
-        iTMSSer->NotifyTarClients(routingpckg);
-        }
-    TRACE_PRN_FN_EXT;
-    }
-
-//  End of File
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmscenrepaudiohandler.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Implements the class TMSCenRepAudioHandler
+ *
+ */
+
+#include <e32base.h>
+#include <e32property.h>
+#include "tmstelephonycenrep.h"
+
+#ifdef _USE_TELEPHONY_CENREP_
+#include <telmicmutestatuspskeys.h>
+#include <telincallvolcntrlcrkeys.h>
+#else
+const TUid KCRUidInCallVolume = {0x102828B1};
+const TUint32 KTelIncallEarVolume = 0x00000001;
+const TUint32 KTelIncallLoudspeakerVolume = 0x00000002;
+#endif
+
+#include "tmscenrepaudiohandler.h"
+#include "tmscenreplistener.h"
+#include "tmspubsublistener.h"
+#include "tmsutility.h"
+
+const TInt KDefaultMaxGain = 64;
+
+using namespace TMS;
+
+// ---------------------------------------------------------------------------
+// TMSCenRepAudioHandler::NewL.
+// ---------------------------------------------------------------------------
+//
+TMSCenRepAudioHandler* TMSCenRepAudioHandler::NewL(TMSServer* aServer)
+    {
+    TRACE_PRN_FN_ENT;
+    TMSCenRepAudioHandler* self = new (ELeave) TMSCenRepAudioHandler(aServer);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    TRACE_PRN_FN_EXT;
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructs the object by canceling first ongoing monitoring.
+// ---------------------------------------------------------------------------
+//
+TMSCenRepAudioHandler::~TMSCenRepAudioHandler()
+    {
+    TRACE_PRN_FN_ENT;
+    delete iMuteListener;
+    delete iIncallLoudspeakerVolumeListener;
+    delete iIncallEarVolumeListener;
+    TRACE_PRN_FN_EXT;
+    }
+
+void TMSCenRepAudioHandler::HandleNotifyPSL(const TUid /*aUid*/,
+        const TInt& /*aKey*/, const TRequestStatus& /*aStatus*/)
+    {
+    TInt muteVal;
+    TInt err = KErrNotFound;
+
+    if (iMuteListener)
+        {
+        err = iMuteListener->Get(muteVal);
+        }
+    if (iTMSSer && err == KErrNone && muteVal == EPSTelMicMuteOn)
+        {
+#if !defined(__WINSCW__)
+        iTMSSer->SetGain(NULL, 0);
+#endif //__WINSCW__
+        }
+    else if (err == KErrNone)
+        {
+#if !defined(__WINSCW__)
+        // Change when gain is really changed
+        iTMSSer->SetGain(NULL, KDefaultMaxGain);
+#endif //__WINSCW__
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// TMSCenRepAudioHandler::SetLoudSpeakerVol
+// ---------------------------------------------------------------------------
+//
+void TMSCenRepAudioHandler::SetLoudSpeakerVol(TInt vol)
+    {
+    if (iIncallLoudspeakerVolumeListener)
+        {
+        iIncallLoudspeakerVolumeListener->Set(vol);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// TMSCenRepAudioHandler::SetEarPieceVol
+// ---------------------------------------------------------------------------
+//
+void TMSCenRepAudioHandler::SetEarPieceVol(TInt vol)
+    {
+    if (iIncallEarVolumeListener)
+        {
+        iIncallEarVolumeListener->Set(vol);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From TMSCenRepObserver
+// TMSCenRepAudioHandler::HandleNotifyCenRepL
+// ---------------------------------------------------------------------------
+//
+void TMSCenRepAudioHandler::HandleNotifyCenRepL(const TUid /*aUid*/,
+        const TUint32 aKey, TInt aVal)
+    {
+    TRACE_PRN_FN_ENT;
+    if (iTMSSer && aKey == KTelIncallLoudspeakerVolume)
+        {
+        iTMSSer->SetLevel(NULL, FALSE, aVal);
+        }
+    else if (iTMSSer && aKey == KTelIncallEarVolume)
+        {
+        iTMSSer->SetLevel(NULL, FALSE, aVal);
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs the monitor.
+// ---------------------------------------------------------------------------
+//
+TMSCenRepAudioHandler::TMSCenRepAudioHandler(TMSServer* aServer) :
+    iTMSSer(aServer)
+    {
+    TRACE_PRN_FN_ENT;
+    iCallCount = 0; // Active calls count
+    TRACE_PRN_FN_EXT;
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase construction.
+// ---------------------------------------------------------------------------
+//
+void TMSCenRepAudioHandler::ConstructL()
+    {
+    TRACE_PRN_FN_ENT;
+
+    RProperty::TType type(RProperty::EInt);
+    TSecurityPolicy readPolicy(ECapability_None);
+    TSecurityPolicy writePolicy(ECapabilityWriteDeviceData);
+
+    RProperty::Define(KPSUidTelMicrophoneMuteStatus, KTelMicrophoneMuteState,
+            type, readPolicy, writePolicy);
+
+    iMuteListener = TMSPubSubListener::NewL(KPSUidTelMicrophoneMuteStatus,
+            KTelMicrophoneMuteState, this);
+
+    iIncallLoudspeakerVolumeListener = TMSCenRepListener::NewL(
+            KCRUidInCallVolume, KTelIncallLoudspeakerVolume, this);
+
+    iIncallEarVolumeListener = TMSCenRepListener::NewL(KCRUidInCallVolume,
+            KTelIncallEarVolume, this);
+
+    // Initialize audio volumes
+    TInt volEar;
+    TInt volLoud;
+
+    if (iIncallEarVolumeListener)
+        {
+        /*TInt volGetRes =*/ iIncallEarVolumeListener->Get(volEar);
+        }
+    if (iIncallLoudspeakerVolumeListener)
+        {
+        /*volGetRes =*/ iIncallLoudspeakerVolumeListener->Get(volLoud);
+        }
+
+    TRACE_PRN_FN_EXT;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmscenreplistener.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -0,0 +1,190 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Central Repository listening
+ *
+ */
+
+// INCLUDE FILES
+#include "tmscenreplistener.h"
+#include "tmscenrepobserver.h"
+#include "tmsutility.h"
+
+using namespace TMS;
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::TMSCenRepListener
+// C++ default constructor
+// -----------------------------------------------------------------------------
+//
+TMSCenRepListener* TMSCenRepListener::NewL(TUid aUid, TUint32 aMonitorSetting,
+        TMSCenRepObserver* aObserver)
+    {
+    TRACE_PRN_FN_ENT;
+    TMSCenRepListener* self = new (ELeave) TMSCenRepListener(aUid,
+            aMonitorSetting, aObserver);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    TRACE_PRN_FN_EXT;
+    return self;
+    }
+
+// Destructor
+TMSCenRepListener::~TMSCenRepListener()
+    {
+    TRACE_PRN_FN_ENT;
+    Cancel();
+    delete iRepository;
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::Get
+// -----------------------------------------------------------------------------
+//
+gint TMSCenRepListener::Get(gint& aValue)
+    {
+    TRACE_PRN_FN_ENT;
+    gint status(TMS_RESULT_SUCCESS);
+    if (iRepository)
+        {
+        status = iRepository->Get(iMonitorSetting, aValue);
+        }
+    TRACE_PRN_FN_EXT;
+    return status;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::Set
+// -----------------------------------------------------------------------------
+//
+gint TMSCenRepListener::Set(gint aValue)
+    {
+    TRACE_PRN_FN_ENT;
+    gint status(TMS_RESULT_SUCCESS);
+    if (iRepository)
+        {
+        status = iRepository->Set(iMonitorSetting, aValue);
+        }
+    TRACE_PRN_FN_EXT;
+    return status;
+
+    }
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::DoCancel
+// -----------------------------------------------------------------------------
+//
+void TMSCenRepListener::DoCancel()
+    {
+    TRACE_PRN_FN_ENT;
+    if (iRepository)
+        {
+        iRepository->NotifyCancel(iMonitorSetting);
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::RunError
+// -----------------------------------------------------------------------------
+//
+gint TMSCenRepListener::RunError(
+#ifdef _DEBUG
+        TInt aError // Log the leavecode from RunL
+#else
+        TInt /*aError*/
+#endif
+        )
+    {
+    TRACE_PRN_FN_ENT;
+#ifdef _DEBUG
+    TRACE_PRN_IF_ERR(aError);
+#endif
+    TRACE_PRN_FN_EXT;
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::RunL
+// -----------------------------------------------------------------------------
+//
+void TMSCenRepListener::RunL()
+    {
+    TRACE_PRN_FN_ENT;
+    // Don't resubmit the request on error
+    // Central repositry completes notifications with id of setting
+    // so check only that value of iStatus is negative
+    if (iStatus.Int() == KErrNone)
+        {
+        SubmitNotifyRequestL();
+        }
+
+    // The loudspeaker volume has changed in repository.
+    // Retrieve the current volume from repository.
+    gint volume;
+    Get(volume);
+    if (iObserver)
+        {
+        iObserver->HandleNotifyCenRepL(iUid, iMonitorSetting, volume);
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::TMSCenRepListener
+// -----------------------------------------------------------------------------
+//
+TMSCenRepListener::TMSCenRepListener(TUid aUid, TUint32 aMonitorSetting,
+        TMSCenRepObserver* aObserver) :
+    CActive(EPriorityStandard),
+    iUid(aUid),
+    iMonitorSetting(aMonitorSetting),
+    iObserver(aObserver)
+    {
+    TRACE_PRN_FN_ENT;
+    CActiveScheduler::Add(this);
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::ConstructL
+// -----------------------------------------------------------------------------
+//
+void TMSCenRepListener::ConstructL()
+    {
+    TRACE_PRN_FN_ENT;
+    // Create repository instance
+    iRepository = CRepository::NewL(iUid);
+    // Start monitoring
+    SubmitNotifyRequestL();
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSCenRepListener::SubmitNotifyRequestL
+// -----------------------------------------------------------------------------
+//
+void TMSCenRepListener::SubmitNotifyRequestL()
+    {
+    TRACE_PRN_FN_ENT;
+    if (iRepository)
+        {
+        iStatus = KRequestPending;
+        iRepository->NotifyRequest(iMonitorSetting, iStatus);
+        SetActive();
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmsglobaleffectssettings.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Telephony Multimedia Service
+ *
+ */
+
+// INCLUDE FILES
+#include "tmsglobaleffectssettings.h"
+#include "tmsclientserver.h"
+
+using namespace TMS;
+// CONSTANTS
+const TInt KDefaultVolume = 4;
+const TInt KDefaultMaxVolume = 10;
+const TInt KDefaultGain = 1;
+const TInt KDefaultMaxGain = 64;
+
+TUid KCRUidTmseffects = {0x10207C80};
+const TUint32 KTmsEarPieceVolume = 0x00000001;
+const TUint32 KTmsLoudSpkrVolume = 0x00000002;
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::TMSGlobalEffectsSettings
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+TMSGlobalEffectsSettings::TMSGlobalEffectsSettings() :
+    iGain(KDefaultGain),
+    iMaxVolume(KDefaultMaxVolume),
+    iMaxGain(KDefaultMaxGain),
+    iEarVolume(KDefaultVolume),
+    iLoudSpkrVolume(KDefaultVolume)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void TMSGlobalEffectsSettings::ConstructL()
+    {
+    // Create repository instance
+    iRepository = CRepository::NewL(KCRUidTmseffects);
+    if (iRepository)
+        {
+        iRepository->Get(KTmsLoudSpkrVolume, iLoudSpkrVolume);
+        iRepository->Get(KTmsEarPieceVolume, iEarVolume);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+TMSGlobalEffectsSettings* TMSGlobalEffectsSettings::NewL()
+    {
+    TMSGlobalEffectsSettings* self = new (ELeave) TMSGlobalEffectsSettings();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Destructor
+TMSGlobalEffectsSettings::~TMSGlobalEffectsSettings()
+    {
+    delete iRepository;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::SetLoudSpkrVolume
+// -----------------------------------------------------------------------------
+//
+void TMSGlobalEffectsSettings::SetLoudSpkrVolume(TInt aVolume)
+    {
+    TInt status(KErrNone);
+    if (iRepository)
+        {
+        status = iRepository->Set(KTmsLoudSpkrVolume, aVolume);
+        if (status == KErrNone)
+            {
+            iLoudSpkrVolume = aVolume;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::SetEarPieceVolume
+// -----------------------------------------------------------------------------
+//
+void TMSGlobalEffectsSettings::SetEarPieceVolume(TInt aVolume)
+    {
+    TInt status(KErrNone);
+    if (iRepository)
+        {
+        status = iRepository->Set(KTmsEarPieceVolume, aVolume);
+        if (status == KErrNone)
+            {
+            iEarVolume = aVolume;
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::GetLoudSpkrVolume
+// -----------------------------------------------------------------------------
+//
+void TMSGlobalEffectsSettings::GetLoudSpkrVolume(TInt& aVolume)
+    {
+    aVolume = iLoudSpkrVolume;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::GetEarPieceVolume
+// -----------------------------------------------------------------------------
+//
+void TMSGlobalEffectsSettings::GetEarPieceVolume(TInt& aVolume)
+    {
+    aVolume = iEarVolume;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::MaxVolume
+// -----------------------------------------------------------------------------
+//
+TInt TMSGlobalEffectsSettings::MaxVolume() const
+    {
+    return iMaxVolume;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::SetGain
+// -----------------------------------------------------------------------------
+//
+void TMSGlobalEffectsSettings::SetGain(TInt aGain)
+    {
+    iGain = aGain;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::Gain
+// -----------------------------------------------------------------------------
+//
+TInt TMSGlobalEffectsSettings::Gain() const
+    {
+    return iGain;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSGlobalEffectsSettings::MaxGain
+// -----------------------------------------------------------------------------
+//
+TInt TMSGlobalEffectsSettings::MaxGain() const
+    {
+    return iMaxGain;
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmspubsublistener.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Implements the class TMSPubSubListener
+ *
+ */
+
+#include "tmspubsublistener.h"
+#include "tmspubsubobserver.h"
+
+using namespace TMS;
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::TMSPubSubListener
+// C++ constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+TMSPubSubListener::TMSPubSubListener(const TUid aUid, const TInt aKey,
+        TMSPubSubObserver* aObserver) :
+    CActive(CActive::EPriorityStandard),
+    iUid(aUid),
+    iId(aKey),
+    iObserver(aObserver)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::~TMSPubSubListener
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+TMSPubSubListener::~TMSPubSubListener()
+    {
+    Cancel();
+    iProperty.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::RunL
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+void TMSPubSubListener::RunL()
+    {
+    const TRequestStatus status(iStatus);
+    StartListening();
+    iObserver->HandleNotifyPSL(iUid, iId, status);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::DoCancel
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+void TMSPubSubListener::DoCancel()
+    {
+
+    iProperty.Cancel();
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::RunError
+// From CActive.
+// -----------------------------------------------------------------------------
+//
+TInt TMSPubSubListener::RunError(TInt /*aError*/)
+    {
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::NewL
+// -----------------------------------------------------------------------------
+//
+TMSPubSubListener* TMSPubSubListener::NewL(const TUid aUid, const TInt aKey,
+        TMSPubSubObserver* aObserver)
+    {
+
+    TMSPubSubListener* self = new (ELeave) TMSPubSubListener(aUid, aKey,
+            aObserver);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::StartListening
+// -----------------------------------------------------------------------------
+//
+void TMSPubSubListener::StartListening()
+    {
+    iProperty.Subscribe(iStatus);
+    SetActive();
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::ConstructL
+// -----------------------------------------------------------------------------
+//
+void TMSPubSubListener::ConstructL()
+    {
+    if (iObserver)
+        {
+        CActiveScheduler::Add(this);
+        }
+
+    User::LeaveIfError(iProperty.Attach(iUid, iId, EOwnerThread));
+
+    if (iObserver)
+        {
+        StartListening();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::Get
+// Read integer value.
+// -----------------------------------------------------------------------------
+//
+TInt TMSPubSubListener::Get(TInt& aVal)
+    {
+    return iProperty.Get(iUid, iId, aVal);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::Get
+// Read binary value.
+// -----------------------------------------------------------------------------
+//
+TInt TMSPubSubListener::Get(TDes8& aVal)
+    {
+    return iProperty.Get(iUid, iId, aVal);
+    }
+
+// -----------------------------------------------------------------------------
+// TMSPubSubListener::Get
+// Read string value.
+// -----------------------------------------------------------------------------
+//
+TInt TMSPubSubListener::Get(TDes16& aVal)
+    {
+    return iProperty.Get(iUid, iId, aVal);
+    }
+
+// End of File
--- a/mmserv/tms/tmsserver/src/tmsserver.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsserver/src/tmsserver.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -20,20 +20,21 @@
 #include <e32capability.h>
 #include "tmsutility.h"
 #include "tmsclientserver.h"
-#include "tmsserver.h"
+#include "tmstelephonycenrep.h"
 #include "tmsservershutdown.h"
 #include "tmsserversession.h"
 #include "tmscallserverstartparam.h"
 #include "tmscallserver.h"
 #include "tmscallclisrv.h"
-#include "globaleffectssettings.h"
-#include "tareventhandler.h"
-#include "cspaudiohandler.h"
+#include "tmsglobaleffectssettings.h"
+#include "tmstareventhandler.h"
+#include "tmscenrepaudiohandler.h"
+#include "tmsserver.h"
 
 using namespace TMS;
 
 // CONSTANTS
-const TInt KShutDownDelayTime = 5000000; // 5 sec delay time
+const TInt KTMSShutDownDelayTime = 1000000; // 1 sec delay time
 const TInt KOutputsArraySize = 10;
 
 // -----------------------------------------------------------------------------
@@ -160,7 +161,7 @@
     if (iSession == 0)
         {
         iShutdownTimer->SetDelay(TTimeIntervalMicroSeconds32(
-                KShutDownDelayTime));
+                KTMSShutDownDelayTime));
         }
 
     TRACE_PRN_N1(_L("TMS->DNL: DropSession->Active Sessions: [%d]"), iSession);
@@ -171,7 +172,7 @@
 //
 // -----------------------------------------------------------------------------
 //
-TInt TMSServer::SessionCount()
+TInt TMSServer::SessionCount() const
     {
     return iSession;
     }
@@ -181,7 +182,7 @@
 //
 // -----------------------------------------------------------------------------
 //
-void TMSServer::SetDnLinkSession(TBool aSession)
+void TMSServer::SetDnLinkSession(const TBool aSession)
     {
     iDnlinkSession = aSession;
     }
@@ -191,7 +192,7 @@
 //
 // -----------------------------------------------------------------------------
 //
-void TMSServer::SetUpLinkSession(TBool aSession)
+void TMSServer::SetUpLinkSession(const TBool aSession)
     {
     iUplinkSession = aSession;
     }
@@ -244,6 +245,7 @@
     TMSCallProxyLocal tmsCallSessionHandle;
     User::LeaveIfError(StartTMSCallServer(tmsCallSessionHandle));
     aHandle = tmsCallSessionHandle;
+
     TRACE_PRN_FN_EXT;
     }
 
@@ -255,19 +257,19 @@
 TInt TMSServer::StartTMSCallServer(TMSCallProxyLocal& aHandle)
     {
     TRACE_PRN_FN_ENT;
-    TInt status = KErrNone;
 
+    TInt status = TMS_RESULT_SUCCESS;
     TMSStartAndMonitorTMSCallThread* callServerThread = NULL;
     TRAP(status, callServerThread =TMSStartAndMonitorTMSCallThread::NewL(
             const_cast<TMSServer*>(this)));
-    if (status != KErrNone)
+    if (status != TMS_RESULT_SUCCESS)
         {
         delete callServerThread;
         }
     else
         {
         status = iTMSCallServList.Append(callServerThread);
-        if (callServerThread && status == KErrNone)
+        if (callServerThread && status == TMS_RESULT_SUCCESS)
             {
             status = callServerThread->StartTMSCallServer(aHandle);
             TInt count = 0;
@@ -312,10 +314,16 @@
 //
 void TMSServer::StartRoutingNotifierL()
     {
+    TRACE_PRN_FN_ENT;
+
     if (!iTarHandler)
         {
+        iTarHandlerCount = 0;
         iTarHandler = TMSTarEventHandler::NewL((const_cast<TMSServer*> (this)));
         }
+    iTarHandlerCount++;
+
+    TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
@@ -325,8 +333,11 @@
 //
 void TMSServer::CancelRoutingNotifier()
     {
-    delete iTarHandler;
-    iTarHandler = NULL;
+    if (--iTarHandlerCount <= 0)
+        {
+        delete iTarHandler;
+        iTarHandler = NULL;
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -336,13 +347,19 @@
 //
 void TMSServer::StartCenRepHandlerL()
     {
+    TRACE_PRN_FN_ENT;
+
 #ifdef _USE_TELEPHONY_CENREP_
     if (!iAudioCenRepHandler)
         {
-        iAudioCenRepHandler = CSPAudioHandler::NewL(
+        iAudioCenRepHandlerCount = 0;
+        iAudioCenRepHandler = TMSCenRepAudioHandler::NewL(
                 (const_cast<TMSServer*> (this)));
         }
+    iAudioCenRepHandlerCount++;
 #endif
+
+    TRACE_PRN_FN_EXT;
     }
 
 // -----------------------------------------------------------------------------
@@ -352,8 +369,11 @@
 //
 void TMSServer::CancelCenRepHandler()
     {
-    delete iAudioCenRepHandler;
-    iAudioCenRepHandler = NULL;
+    if (--iAudioCenRepHandlerCount <= 0)
+        {
+        delete iAudioCenRepHandler;
+        iAudioCenRepHandler = NULL;
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -364,11 +384,9 @@
 TInt TMSServer::SetOutput(CSession2* /*sid*/, TInt output)
     {
     TRACE_PRN_FN_ENT;
-    TInt status(KErrNone);
 
-    status = SendMessageToCallServ(TMS_ROUTING_OUTPUT_SET, output);
-
-    if (status == KErrNone)
+    TInt status = SendMessageToCallServ(TMS_ROUTING_OUTPUT_SET, output);
+    if (status == TMS_RESULT_SUCCESS)
         {
         iCurrentRouting = output;
         }
@@ -388,7 +406,7 @@
 
     TUint output;
     TInt i = 0;
-    TInt status(KErrNone);
+    TInt status(TMS_RESULT_SUCCESS);
     while (i < iTMSCallServList.Count())
         {
         TMSStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
@@ -397,7 +415,7 @@
             {
             status = callThread->iTMSCallProxyLocal.ReceiveFromCallServer(
                     TMS_ROUTING_OUTPUT_GET, output);
-            if (status != KErrNone)
+            if (status != TMS_RESULT_SUCCESS)
                 {
                 break;
                 }
@@ -406,9 +424,10 @@
         }
     TPckgBuf<TInt> p(output);
     aMessage.Write(0, p);
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
+
     TRACE_PRN_FN_EXT;
-    return KErrNone;
+    return status;
     }
 
 // -----------------------------------------------------------------------------
@@ -419,9 +438,10 @@
 TInt TMSServer::GetPreviousOutput(const RMessage2& aMessage)
     {
     TRACE_PRN_FN_ENT;
+
     TUint output;
     TInt i = 0;
-    TInt status(KErrNone);
+    TInt status(TMS_RESULT_SUCCESS);
     while (i < iTMSCallServList.Count())
         {
         TMSStartAndMonitorTMSCallThread* callThread = iTMSCallServList[i];
@@ -430,7 +450,7 @@
             {
             status = callThread->iTMSCallProxyLocal.ReceiveFromCallServer(
                     TMS_ROUTING_PREVIOUSOUTPUT_GET, output);
-            if (status != KErrNone)
+            if (status != TMS_RESULT_SUCCESS)
                 {
                 break;
                 }
@@ -439,7 +459,8 @@
         }
     TPckgBuf<TInt> p(output);
     aMessage.Write(0, p);
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
+
     TRACE_PRN_FN_EXT;
     return status;
     }
@@ -464,7 +485,7 @@
     {
     TRACE_PRN_FN_ENT;
 
-    TInt status = KErrNone;
+    TInt status = TMS_RESULT_SUCCESS;
     OutputVector outputs;
     HBufC8* buf = HBufC8::NewLC(KOutputsArraySize * sizeof(TUint32));
     TPtr8 ptr = buf->Des();
@@ -483,7 +504,7 @@
             {
             status = callThread->iTMSCallProxyLocal.ReceiveFromCallServer(
                     TMS_ROUTING_AVAILABLE_OUTPUT_GET, args);
-            if (status != KErrNone)
+            if (status != TMS_RESULT_SUCCESS)
                 {
                 break;
                 }
@@ -508,15 +529,17 @@
 TInt TMSServer::GetMaxLevel(const RMessage2& aMessage)
     {
     TRACE_PRN_FN_ENT;
-    TInt status(KErrNone);
+
+    TInt status(TMS_RESULT_SUCCESS);
     TPckgBuf<TUint> pckg;
 
     pckg() = iEffectSettings->MaxVolume();
-    if (status == KErrNone)
+    if (status == TMS_RESULT_SUCCESS)
         {
         status = aMessage.Write(0, pckg);
         aMessage.Complete(status);
         }
+
     TRACE_PRN_FN_EXT;
     return status;
     }
@@ -529,7 +552,8 @@
 TInt TMSServer::GetLevel(const RMessage2& aMessage)
     {
     TRACE_PRN_FN_ENT;
-    TInt status(KErrNone);
+
+    TInt status(TMS_RESULT_SUCCESS);
     TPckgBuf<TUint> pckg;
     TInt volume;
 
@@ -545,7 +569,7 @@
         }
 
     pckg() = volume;
-    if (status == KErrNone)
+    if (status == TMS_RESULT_SUCCESS)
         {
         aMessage.Write(0, pckg);
         aMessage.Complete(status);
@@ -563,11 +587,9 @@
 TInt TMSServer::SetLevel(CSession2* /*sid*/, TBool tmsclient, TInt level)
     {
     TRACE_PRN_FN_ENT;
-    TInt status(KErrNone);
 
-    status = SendMessageToCallServ(TMS_EFFECT_GLOBAL_VOL_SET, level);
-
-    if (status == KErrNone)
+    TInt status = SendMessageToCallServ(TMS_EFFECT_GLOBAL_VOL_SET, level);
+    if (status == TMS_RESULT_SUCCESS)
         {
         switch (iCurrentRouting)
             {
@@ -624,11 +646,11 @@
 TInt TMSServer::GetMaxGain(const RMessage2& aMessage)
     {
     TRACE_PRN_FN_ENT;
-    TInt status(KErrNone);
+
+    TInt status(TMS_RESULT_SUCCESS);
     TPckgBuf<TUint> pckg;
-
     pckg() = iEffectSettings->MaxGain();
-    if (status == KErrNone)
+    if (status == TMS_RESULT_SUCCESS)
         {
         status = aMessage.Write(0, pckg);
         aMessage.Complete(status);
@@ -646,11 +668,11 @@
 TInt TMSServer::GetGain(const RMessage2& aMessage)
     {
     TRACE_PRN_FN_ENT;
-    TInt status(KErrNone);
+
+    TInt status(TMS_RESULT_SUCCESS);
     TPckgBuf<TUint> pckg;
-
     pckg() = iEffectSettings->Gain();
-    if (status == KErrNone)
+    if (status == TMS_RESULT_SUCCESS)
         {
         status = aMessage.Write(0, pckg);
         aMessage.Complete(status);
@@ -668,11 +690,9 @@
 TInt TMSServer::SetGain(CSession2* /*sid*/, TInt level)
     {
     TRACE_PRN_FN_ENT;
-    TInt status(KErrNone);
 
-    status = SendMessageToCallServ(TMS_EFFECT_GLOBAL_GAIN_SET, level);
-
-    if (status == KErrNone)
+    TInt status = SendMessageToCallServ(TMS_EFFECT_GLOBAL_GAIN_SET, level);
+    if (status == TMS_RESULT_SUCCESS)
         {
         iEffectSettings->SetGain(level);
         iSessionIter.SetToFirst();
@@ -700,6 +720,8 @@
 TInt TMSServer::GetSupportedCodecs(const TMSStreamType strmType,
         RArray<TFourCC>*& aCodecs)
     {
+    TRACE_PRN_FN_ENT;
+
     if (strmType == TMS_STREAM_UPLINK)
         {
         aCodecs = &iUplCodecs;
@@ -708,7 +730,9 @@
         {
         aCodecs = &iDnlCodecs;
         }
-    return KErrNone;
+
+    TRACE_PRN_FN_EXT;
+    return TMS_RESULT_SUCCESS;
     }
 
 // -----------------------------------------------------------------------------
@@ -718,7 +742,9 @@
 //
 TInt TMSServer::SendMessageToCallServ(TInt func, TInt value)
     {
-    TInt status(KErrNone);
+    TRACE_PRN_FN_ENT;
+
+    TInt status(TMS_RESULT_SUCCESS);
     TInt i = 0;
     while (i < iTMSCallServList.Count())
         {
@@ -735,7 +761,7 @@
                 {
                 status = callThread->iTMSCallProxyLocal.SendToCallServer(
                         func, value);
-                if (status != KErrNone)
+                if (status != TMS_RESULT_SUCCESS)
                     {
                     break;
                     }
@@ -743,6 +769,8 @@
             }
         i++;
         }
+
+    TRACE_PRN_FN_EXT;
     return status;
     }
 
@@ -753,7 +781,9 @@
 //
 TInt TMSServer::SendMessageToCallServ(TInt func, TIpcArgs args)
     {
-    TInt status(KErrNone);
+    TRACE_PRN_FN_ENT;
+
+    TInt status(TMS_RESULT_SUCCESS);
     TInt i = 0;
     while (i < iTMSCallServList.Count())
         {
@@ -770,7 +800,7 @@
                 {
                 status = callThread->iTMSCallProxyLocal.SendToCallServer(
                         func, args);
-                if (status != KErrNone)
+                if (status != TMS_RESULT_SUCCESS)
                     {
                     break;
                     }
@@ -778,6 +808,8 @@
             }
         i++;
         }
+
+    TRACE_PRN_FN_EXT;
     return status;
     }
 
@@ -788,6 +820,8 @@
 //
 TInt TMSServer::NotifyTarClients(TRoutingMsgBufPckg routingpckg)
     {
+    TRACE_PRN_FN_ENT;
+
     iCurrentRouting = routingpckg().iOutput;
     iSessionIter.SetToFirst();
     TMSServerSession* serverSession =
@@ -798,7 +832,9 @@
         serverSession->HandleRoutingChange(routingpckg);
         serverSession = static_cast<TMSServerSession*> (iSessionIter++);
         }
-    return KErrNone;
+
+    TRACE_PRN_FN_EXT;
+    return TMS_RESULT_SUCCESS;
     }
 
 // -----------------------------------------------------------------------------
@@ -819,7 +855,7 @@
     TMSServer* server = TMSServer::NewL();
 
     // Initialisation complete, now signal the client
-    RProcess::Rendezvous(KErrNone);
+    RProcess::Rendezvous(TMS_RESULT_SUCCESS);
 
     // Start the scheduler and wait for client requests
     CActiveScheduler::Start();
@@ -868,11 +904,13 @@
         TMSServer* aServer)
     {
     TRACE_PRN_FN_ENT;
+
     TMSStartAndMonitorTMSCallThread* self =
             new (ELeave) TMSStartAndMonitorTMSCallThread(aServer);
     CleanupStack::PushL(self);
     self->ConstructL();
     CleanupStack::Pop(self);
+
     TRACE_PRN_FN_EXT;
     return self;
     }
@@ -898,7 +936,7 @@
     {
     TRACE_PRN_FN_ENT;
 
-    TInt status(KErrNone);
+    TInt status(TMS_RESULT_SUCCESS);
     TMSCallServerStartParam start(iTMSServer, iCallSrvrHndl);
     const TUidType serverUid(KNullUid, KNullUid, KUidTMSCallServerUid3);
     TThreadFunction serverFunc = TMSCallServer::StartThread;
@@ -911,7 +949,7 @@
                                   &start,
                                   EOwnerProcess);
 
-    if (status != KErrNone)
+    if (status != TMS_RESULT_SUCCESS)
         {
         return status;
         }
@@ -935,7 +973,7 @@
         }
 
     User::WaitForRequest(reqStatus); // wait for start or death
-    if (reqStatus.Int() != KErrNone)
+    if (reqStatus.Int() != TMS_RESULT_SUCCESS)
         {
         iServerThread.Close();
         iCallSrvrHndl.Close();
@@ -943,7 +981,7 @@
         }
     status = aHndl.Open(iCallSrvrHndl);
 
-    if (status != KErrNone)
+    if (status != TMS_RESULT_SUCCESS)
         {
         iServerThread.Close();
         iCallSrvrHndl.Close();
@@ -955,7 +993,7 @@
     SetActive();
 
     TRACE_PRN_FN_EXT;
-    return KErrNone;
+    return TMS_RESULT_SUCCESS;
     }
 
 // -----------------------------------------------------------------------------
@@ -995,6 +1033,7 @@
 TInt TMSCallProxyLocal::Open(RServer2& aTMSCallServerHandle)
     {
     TRACE_PRN_FN_ENT;
+
     TInt status(KErrNotSupported);
     status = CreateSession(aTMSCallServerHandle,
                            TVersion(KTMSCallServerMajorVersionNumber,
@@ -1013,7 +1052,7 @@
 //
 TInt TMSCallProxyLocal::SendToCallServer(TInt aFunc, TUint value)
     {
-    TInt status(KErrNone);
+    TInt status(TMS_RESULT_SUCCESS);
     status = SendReceive(aFunc, TIpcArgs(value));
     return status;
     }
@@ -1025,7 +1064,7 @@
 //
 TInt TMSCallProxyLocal::SendToCallServer(TInt aFunc, TIpcArgs args)
     {
-    TInt status(KErrNone);
+    TInt status(TMS_RESULT_SUCCESS);
     status = SendReceive(aFunc, args);
     return status;
     }
@@ -1037,11 +1076,11 @@
 //
 TInt TMSCallProxyLocal::ReceiveFromCallServer(TInt aFunc, TUint& value)
     {
-    TInt status(KErrNone);
+    TInt status(TMS_RESULT_SUCCESS);
     TPckgBuf<TUint> pckg;
     TIpcArgs args(&pckg);
     status = SendReceive(aFunc, args);
-    if (status == KErrNone)
+    if (status == TMS_RESULT_SUCCESS)
         {
         value = pckg();
         }
@@ -1055,7 +1094,7 @@
 //
 TInt TMSCallProxyLocal::ReceiveFromCallServer(TInt aFunc, TIpcArgs args)
     {
-    TInt status(KErrNone);
+    TInt status(TMS_RESULT_SUCCESS);
     status = SendReceive(aFunc, args);
     return status;
     }
--- a/mmserv/tms/tmsserver/src/tmsserversession.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsserver/src/tmsserversession.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -99,7 +99,7 @@
     {
     TRAPD(err, DispatchMessageL(aMessage));
 
-    if (err != KErrNone)
+    if (err != TMS_RESULT_SUCCESS)
         {
         aMessage.Complete(err);
         }
@@ -143,19 +143,19 @@
             break;
         case ETMSStartRoutingNotifier:
             iServer.StartRoutingNotifierL();
-            aMessage.Complete(KErrNone);
+            aMessage.Complete(TMS_RESULT_SUCCESS);
             break;
         case ETMSCancelRoutingNotifier:
             iServer.CancelRoutingNotifier();
-            aMessage.Complete(KErrNone);
+            aMessage.Complete(TMS_RESULT_SUCCESS);
             break;
         case ETMSStartGlobalEffectNotifier:
             iServer.StartCenRepHandlerL();
-            aMessage.Complete(KErrNone);
+            aMessage.Complete(TMS_RESULT_SUCCESS);
             break;
         case ETMSCancelGlobalEffectNotifier:
             iServer.CancelCenRepHandler();
-            aMessage.Complete(KErrNone);
+            aMessage.Complete(TMS_RESULT_SUCCESS);
             break;
         case ETMSSetMsgQueueHandle:
             SetMessageQueueHandleL(aMessage);
@@ -192,16 +192,16 @@
 //
 void TMSServerSession::SetMessageQueueHandleL(const RMessage2& aMessage)
     {
-    gint status = KErrNone;
+    gint status = TMS_RESULT_SUCCESS;
     if (iMsgQueue.Handle() <= 0)
         {
         status = iMsgQueue.Open(aMessage, 0);
         }
-    if (status != KErrNone)
+    if (status != TMS_RESULT_SUCCESS)
         {
         User::Leave(KErrArgument);
         }
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
     }
 
 // -----------------------------------------------------------------------------
@@ -212,7 +212,7 @@
     {
     TInt level = aMessage.Int0();
     iServer.SetLevel(this, TRUE, level);
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
     }
 
 // -----------------------------------------------------------------------------
@@ -223,7 +223,7 @@
     {
     TInt gain = aMessage.Int0();
     iServer.SetGain(this, gain);
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
     }
 
 // -----------------------------------------------------------------------------
@@ -233,10 +233,8 @@
 void TMSServerSession::HandleGlobalEffectChange(TInt globalevent)
     {
     TRACE_PRN_FN_ENT;
-    iMsgBuffer.iRequest = ECmdGlobalEffectChange;
-    iMsgBuffer.iStatus = KErrNone;
     iMsgBuffer.iInt = globalevent;
-    NotifyClient();
+    NotifyClient(ECmdGlobalEffectChange);
     TRACE_PRN_FN_EXT;
     }
 
@@ -247,11 +245,9 @@
 void TMSServerSession::HandleRoutingChange(TRoutingMsgBufPckg routinginfo)
     {
     TRACE_PRN_FN_ENT;
-    iMsgBuffer.iRequest = ECmdGlobalRoutingChange;
-    iMsgBuffer.iStatus = KErrNone;
     iMsgBuffer.iInt = routinginfo().iEvent;
     iMsgBuffer.iUint = routinginfo().iOutput;
-    NotifyClient();
+    NotifyClient(ECmdGlobalRoutingChange);
     TRACE_PRN_FN_EXT;
     }
 
@@ -280,7 +276,7 @@
 void TMSServerSession::GetCodecsCountL(const RMessage2& aMessage,
         TMSStreamType strmType)
     {
-    TInt err = KErrNone;
+    TInt err = TMS_RESULT_SUCCESS;
     TInt codecsCount = 0;
 
     RArray<TFourCC>* codecs;
@@ -332,7 +328,7 @@
 #endif //__WINSCW__
     p().iStatus = err;
     aMessage.WriteL(0, p);
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
     }
 
 // -----------------------------------------------------------------------------
@@ -366,7 +362,7 @@
     aMessage.WriteL(0, dataCopyBuffer->Ptr(0));
     CleanupStack::PopAndDestroy(&stream);
     CleanupStack::PopAndDestroy(dataCopyBuffer);
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
 
     TRACE_PRN_FN_EXT;
     }
@@ -379,15 +375,17 @@
     {
     TInt output = aMessage.Int0();
     iServer.SetOutput(this, output);
-    aMessage.Complete(KErrNone);
+    aMessage.Complete(TMS_RESULT_SUCCESS);
     }
 
 // -----------------------------------------------------------------------------
 // TMSServerSession::NotifyClient
 // -----------------------------------------------------------------------------
 //
-void TMSServerSession::NotifyClient()
+void TMSServerSession::NotifyClient(const TInt aCommand, const TInt aStatus)
     {
+    iMsgBuffer.iRequest = aCommand;
+    iMsgBuffer.iStatus = aStatus;
     if (iMsgQueue.Handle() > 0)
         {
         iMsgQueue.Send(iMsgBuffer);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmserv/tms/tmsserver/src/tmstareventhandler.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: Telephony Multimedia Service
+ *
+ */
+
+// INCLUDE FILES
+#include "tmstareventhandler.h"
+#include "tmsclientserver.h"
+#include "tmsutility.h"
+
+using namespace TMS;
+
+// -----------------------------------------------------------------------------
+// TMSTarEventHandler::TMSTarEventHandler
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+TMSTarEventHandler::TMSTarEventHandler(TMSServer* aServer) :
+    CActive(EPriorityStandard),
+    iTMSSer(aServer)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TMSTarEventHandler::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void TMSTarEventHandler::ConstructL()
+    {
+    TRACE_PRN_FN_ENT;
+    CActiveScheduler::Add(this);
+    User::LeaveIfError(iProperty.Attach(KTMSPropertyCategory, ERoutingPs));
+    iStatus = KRequestPending;
+    iProperty.Subscribe(iStatus);
+    SetActive();
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSTarEventHandler::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+TMSTarEventHandler* TMSTarEventHandler::NewL(TMSServer* aServer)
+    {
+    TMSTarEventHandler* self = new (ELeave) TMSTarEventHandler(aServer);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Destructor
+TMSTarEventHandler::~TMSTarEventHandler()
+    {
+    TRACE_PRN_FN_ENT;
+    if (IsActive())
+        {
+        Cancel();
+        }
+    iProperty.Close();
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSTarEventHandler::DoCancel
+// -----------------------------------------------------------------------------
+//
+void TMSTarEventHandler::DoCancel()
+    {
+    TRACE_PRN_FN_ENT;
+    iProperty.Cancel();
+    TRACE_PRN_FN_EXT;
+    }
+
+// -----------------------------------------------------------------------------
+// TMSTarEventHandler::RunL
+// -----------------------------------------------------------------------------
+//
+void TMSTarEventHandler::RunL()
+    {
+    TRACE_PRN_FN_ENT;
+    // Subscribe immediately before analyzing the notification to ensure that we
+    // don't miss further updates.
+    if (iStatus.Int() == TMS_RESULT_SUCCESS)
+        {
+        iStatus = KRequestPending;
+        iProperty.Subscribe(iStatus);
+        SetActive();
+        TRoutingMsgBufPckg routingpckg;
+        iProperty.Get(routingpckg);
+        iTMSSer->NotifyTarClients(routingpckg);
+        }
+    TRACE_PRN_FN_EXT;
+    }
+
+//  End of File
+
--- a/mmserv/tms/tmsutility/bwins/tmsutility.def	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsutility/bwins/tmsutility.def	Wed Mar 31 22:29:45 2010 +0300
@@ -2,6 +2,7 @@
 	?FourCCToTMSFormat@TMSUtility@TMS@@SAHK@Z @ 1 NONAME ; int TMS::TMSUtility::FourCCToTMSFormat(unsigned long)
 	?ToTAROutput@TMSUtility@TMS@@SA?AW4TAudioOutput@CTelephonyAudioRouting@@H@Z @ 2 NONAME ; enum CTelephonyAudioRouting::TAudioOutput TMS::TMSUtility::ToTAROutput(int)
 	?ToFourCC@TMSUtility@TMS@@SAKH@Z @ 3 NONAME ; unsigned long TMS::TMSUtility::ToFourCC(int)
-	?ToTMSOutput@TMSUtility@TMS@@SAHW4TAudioOutput@CTelephonyAudioRouting@@@Z @ 4 NONAME ; int TMS::TMSUtility::ToTMSOutput(enum CTelephonyAudioRouting::TAudioOutput)
-	?TMSResult@TMSUtility@TMS@@SAHH@Z @ 5 NONAME ; int TMS::TMSUtility::TMSResult(int)
+	?EtelToTMSResult@TMSUtility@TMS@@SAHH@Z @ 4 NONAME ; int TMS::TMSUtility::EtelToTMSResult(int)
+	?ToTMSOutput@TMSUtility@TMS@@SAHW4TAudioOutput@CTelephonyAudioRouting@@@Z @ 5 NONAME ; int TMS::TMSUtility::ToTMSOutput(enum CTelephonyAudioRouting::TAudioOutput)
+	?TMSResult@TMSUtility@TMS@@SAHH@Z @ 6 NONAME ; int TMS::TMSUtility::TMSResult(int)
 
--- a/mmserv/tms/tmsutility/eabi/tmsutility.def	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsutility/eabi/tmsutility.def	Wed Mar 31 22:29:45 2010 +0300
@@ -1,7 +1,8 @@
 EXPORTS
 	_ZN3TMS10TMSUtility11ToTAROutputEi @ 1 NONAME
 	_ZN3TMS10TMSUtility11ToTMSOutputEN22CTelephonyAudioRouting12TAudioOutputE @ 2 NONAME
-	_ZN3TMS10TMSUtility17FourCCToTMSFormatEm @ 3 NONAME
-	_ZN3TMS10TMSUtility8ToFourCCEi @ 4 NONAME
-	_ZN3TMS10TMSUtility9TMSResultEi @ 5 NONAME
+	_ZN3TMS10TMSUtility15EtelToTMSResultEi @ 3 NONAME
+	_ZN3TMS10TMSUtility17FourCCToTMSFormatEm @ 4 NONAME
+	_ZN3TMS10TMSUtility8ToFourCCEi @ 5 NONAME
+	_ZN3TMS10TMSUtility9TMSResultEi @ 6 NONAME
 
--- a/mmserv/tms/tmsutility/src/tmsutility.cpp	Mon Mar 15 12:42:35 2010 +0200
+++ b/mmserv/tms/tmsutility/src/tmsutility.cpp	Wed Mar 31 22:29:45 2010 +0300
@@ -18,7 +18,7 @@
 #include <e32cmn.h>
 #include <mmffourcc.h>
 #include <mmcccodecinformation.h>
-//#include <tms.h>
+#include <etel.h>
 #include "tmsutility.h"
 
 using namespace TMS;
@@ -120,6 +120,59 @@
     }
 
 // -----------------------------------------------------------------------------
+// TMSUtility::EtelToTMSResult
+//
+// -----------------------------------------------------------------------------
+//
+EXPORT_C gint TMSUtility::EtelToTMSResult(const gint aError)
+    {
+    gint result(TMS_RESULT_SUCCESS);
+
+    if (aError >= TMS_RESULT_SUCCESS)
+        {
+        return aError; //return TMS error
+        }
+
+    switch(aError)
+        {
+        case KErrArgument: //-6
+            result = TMS_RESULT_INVALID_ARGUMENT;
+            break;
+        case KErrEtelCallNotActive: //-2007
+            result = TMS_REASON_CALL_NOT_ACTIVE;//add TMS_RESULT_CALL_NOT_ACTIVE
+            break;
+        /**********************************/
+        //case KErrEtelCoreBase: //-2000
+        case KErrEtelNotCallOwner: //-2000
+        case KErrEtelDuplicatePhoneName: //-2001
+        case KErrEtelAlreadyCallOwner://-2002
+        case KErrEtelNoCarrier://-2003
+        case KErrEtelBusyDetected://-2004
+        case KErrEtelNoClientInterestedInThisCall://-2005
+        case KErrEtelInitialisationFailure://-2006
+        //case KErrEtelCallNotActive: //-2007
+        case KErrEtelNoAnswer://-2008
+        case KErrEtelNoDialTone://-2009
+        case KErrEtelConfigPortFailure://-2010
+        case KErrEtelFaxChunkNotCreated://-2011
+        case KErrEtelNotFaxOwner://-2012
+        case KErrEtelPortNotLoanedToClient://-2013
+        case KErrEtelWrongModemType://-2014
+        case KErrEtelUnknownModemCapability://-2015
+        case KErrEtelAnswerAlreadyOutstanding://-2016
+        case KErrEtelModemNotDetected://-2017
+        case KErrEtelModemSettingsCorrupt://-2018
+        case KErrEtelPortAlreadyLoaned://-2019
+        case KErrEtelCallAlreadyActive: //-2020
+        default:
+            result = TMS_RESULT_GENERAL_ERROR; //add TMS_DTMF_GENERAL_ERROR/FAILED
+            break;
+        }
+
+    return result;
+    }
+
+// -----------------------------------------------------------------------------
 // TMSUtility::ToTMSOutput
 //
 // -----------------------------------------------------------------------------