mmserv/tms/tmscallserver/src/tmscallipadpt.cpp
changeset 42 1fa3fb47b1e3
parent 32 94fc26b6e006
child 55 e267340986c9
--- a/mmserv/tms/tmscallserver/src/tmscallipadpt.cpp	Tue Jul 06 14:50:35 2010 +0300
+++ b/mmserv/tms/tmscallserver/src/tmscallipadpt.cpp	Wed Aug 18 10:17:22 2010 +0300
@@ -47,9 +47,6 @@
     TRACE_PRN_FN_ENT;
     iIPDownlink = NULL;
     iIPUplink = NULL;
-    iDTMFDnlinkPlayer = NULL;
-    iDTMFUplinkPlayer = NULL;
-    iDTMFNotifier = NULL;
     TRACE_PRN_FN_EXT;
     }
 
@@ -74,9 +71,6 @@
     iCodecs.Reset();
     iCodecs.Close();
     iArrBitrates.Reset();
-    delete iDTMFUplinkPlayer;
-    delete iDTMFDnlinkPlayer;
-    delete iDTMFNotifier;
     delete iIPUplink;
     delete iIPDownlink;
 
@@ -102,8 +96,8 @@
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_SUCCESS);
     iNextStreamId = 1;
-    iUplinkInitialized = FALSE;
-    iDnlinkInitialized = FALSE;
+    iUplState = EIdle;
+    iDnlState = EIdle;
     TRACE_PRN_FN_EXT;
     return status;
     }
@@ -123,12 +117,11 @@
         case TMS_STREAM_UPLINK:
             {
             status = TMS_RESULT_ALREADY_EXIST;
-            if (!iUplinkInitialized)
+            if (iUplState == EIdle)
                 {
                 iUplinkStreamId = iNextStreamId;
                 outStrmId = iUplinkStreamId;
                 iNextStreamId++;
-                //iUplinkInitialized = TRUE; //not initialized yet!
                 status = TMS_RESULT_SUCCESS;
                 }
             break;
@@ -136,12 +129,11 @@
         case TMS_STREAM_DOWNLINK:
             {
             status = TMS_RESULT_ALREADY_EXIST;
-            if (!iDnlinkInitialized)
+            if (iDnlState == EIdle)
                 {
                 iDnlinkStreamId = iNextStreamId;
                 outStrmId = iDnlinkStreamId;
                 iNextStreamId++;
-                //iDnlinkInitialized = TRUE; //not initialized yet!
                 status = TMS_RESULT_SUCCESS;
                 }
             break;
@@ -183,10 +175,6 @@
                 {
                 SetFormat(iUplinkStreamId, fourCC);
                 status = OpenUplink(message, retrytime);
-                if (status == TMS_RESULT_SUCCESS)
-                    {
-                    status = InitDTMF(TMS_STREAM_UPLINK);
-                    }
                 }
             break;
             }
@@ -197,10 +185,6 @@
                 {
                 SetFormat(iDnlinkStreamId, fourCC);
                 status = OpenDownlink(message, retrytime);
-                if (status == TMS_RESULT_SUCCESS)
-                    {
-                    status = InitDTMF(TMS_STREAM_DOWNLINK);
-                    }
                 }
             break;
             }
@@ -230,21 +214,21 @@
         {
         case TMS_STREAM_UPLINK:
             {
-            if (iIPUplink && strmId == iUplinkStreamId)
+            if (iIPUplink && strmId == iUplinkStreamId &&
+                    iUplState == EInitialized)
                 {
                 iIPUplink->Start(retrytime);
                 status = TMS_RESULT_SUCCESS;
-                NotifyClient(iUplinkStreamId, ECmdUplinkStarted, status);
                 }
             break;
             }
         case TMS_STREAM_DOWNLINK:
             {
-            if (iIPDownlink && strmId == iDnlinkStreamId)
+            if (iIPDownlink && strmId == iDnlinkStreamId &&
+                    iDnlState == EInitialized)
                 {
                 iIPDownlink->Start(retrytime);
                 status = TMS_RESULT_SUCCESS;
-                NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, status);
                 }
             break;
             }
@@ -275,6 +259,7 @@
             if (strmId == iUplinkStreamId && iIPUplink)
                 {
                 iIPUplink->Stop();
+                iUplState = EInitialized;
                 status = TMS_RESULT_SUCCESS;
                 NotifyClient(iUplinkStreamId, ECmdUplinkPaused, status);
                 }
@@ -285,6 +270,7 @@
             if (strmId == iDnlinkStreamId && iIPDownlink)
                 {
                 iIPDownlink->Stop();
+                iDnlState = EInitialized;
                 status = TMS_RESULT_SUCCESS;
                 NotifyClient(iDnlinkStreamId, ECmdDownlinkPaused, status);
                 }
@@ -315,9 +301,11 @@
         {
         case TMS_STREAM_UPLINK:
             {
-            if (iIPUplink && strmId == iUplinkStreamId)
+            if (iIPUplink && strmId == iUplinkStreamId &&
+                    iUplState == EActivated)
                 {
                 iIPUplink->Stop();
+                iUplState = EInitialized;
                 status = TMS_RESULT_SUCCESS;
                 NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status);
                 }
@@ -325,9 +313,11 @@
             }
         case TMS_STREAM_DOWNLINK:
             {
-            if (iIPDownlink && strmId == iDnlinkStreamId)
+            if (iIPDownlink && strmId == iDnlinkStreamId &&
+                    iDnlState == EActivated)
                 {
                 iIPDownlink->Stop();
+                iDnlState = EInitialized;
                 status = TMS_RESULT_SUCCESS;
                 NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status);
                 }
@@ -358,11 +348,10 @@
         {
         case TMS_STREAM_UPLINK:
             {
-            if (iIPUplink && strmId == iUplinkStreamId)
+            if (iIPUplink && strmId == iUplinkStreamId && iUplState != EIdle)
                 {
                 iIPUplink->Stop();
-                //iUplinkStreamId = -1;
-                iUplinkInitialized = FALSE;
+                iUplState = EIdle;
                 status = TMS_RESULT_SUCCESS;
                 NotifyClient(iUplinkStreamId, ECmdUplinkDeInitComplete, status);
                 }
@@ -370,11 +359,10 @@
             }
         case TMS_STREAM_DOWNLINK:
             {
-            if (iIPDownlink && strmId == iDnlinkStreamId)
+            if (iIPDownlink && strmId == iDnlinkStreamId && iDnlState != EIdle)
                 {
                 iIPDownlink->Stop();
-                //iDnlinkStreamId = -1;
-                iDnlinkInitialized = FALSE;
+                iDnlState = EIdle;
                 status = TMS_RESULT_SUCCESS;
                 NotifyClient(iDnlinkStreamId, ECmdDownlinkDeInitComplete,
                         status);
@@ -387,7 +375,6 @@
             break;
             }
         }
-
     TRACE_PRN_FN_EXT;
     return status;
     }
@@ -409,7 +396,7 @@
             if (strmId == iUplinkStreamId)
                 {
                 iUplinkStreamId = -1;
-                iUplinkInitialized = FALSE;
+                iUplState = EIdle;
                 }
             break;
             }
@@ -418,7 +405,7 @@
             if (strmId == iDnlinkStreamId)
                 {
                 iDnlinkStreamId = -1;
-                iDnlinkInitialized = FALSE;
+                iDnlState = EIdle;
                 }
             break;
             }
@@ -538,7 +525,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iDnlinkInitialized && iIPDownlink)
+    if (iIPDownlink && iDnlState != EIdle)
         {
         status = iIPDownlink->GetMaxVolume(volume);
         iMaxVolume = volume;
@@ -557,7 +544,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iDnlinkInitialized && iIPDownlink)
+    if (iIPDownlink && iDnlState != EIdle)
         {
         status = iIPDownlink->SetVolume(volume);
         NotifyClient(iDnlinkStreamId, ECmdSetVolume, status);
@@ -575,7 +562,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iDnlinkInitialized && iIPDownlink)
+    if (iIPDownlink && iDnlState != EIdle)
         {
         status = iIPDownlink->GetVolume(volume);
         }
@@ -592,7 +579,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iUplinkInitialized && iIPUplink)
+    if (iIPUplink && iUplState != EIdle)
         {
         status = iIPUplink->GetMaxGain(gain);
         iMaxGain = gain;
@@ -611,7 +598,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iUplinkInitialized && iIPUplink)
+    if (iIPUplink && iUplState != EIdle)
         {
         status = iIPUplink->SetGain(gain);
         NotifyClient(iUplinkStreamId, ECmdSetGain, status);
@@ -629,7 +616,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iUplinkInitialized && iIPUplink)
+    if (iIPUplink && iUplState != EIdle)
         {
         status = iIPUplink->GetGain(gain);
         }
@@ -646,7 +633,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iDnlinkInitialized && iIPDownlink)
+    if (iIPDownlink && iDnlState != EIdle)
         {
         status = iIPDownlink->GetMaxVolume(volume);
         iMaxVolume = volume;
@@ -666,7 +653,7 @@
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
     //iGlobalVol = volume;
-    if (iDnlinkInitialized && iIPDownlink)
+    if (iIPDownlink && iDnlState != EIdle)
         {
         status = iIPDownlink->SetVolume(volume);
         }
@@ -683,7 +670,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iDnlinkInitialized && iIPDownlink)
+    if (iIPDownlink && iDnlState != EIdle)
         {
         status = iIPDownlink->GetVolume(volume);
         }
@@ -700,7 +687,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iUplinkInitialized && iIPUplink)
+    if (iIPUplink && iUplState != EIdle)
         {
         status = iIPUplink->GetMaxGain(gain);
         iMaxGain = gain;
@@ -720,7 +707,7 @@
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
     //iGlobalGain = gain;
-    if (iUplinkInitialized && iIPUplink)
+    if (iIPUplink && iUplState != EIdle)
         {
         status = iIPUplink->SetGain(gain);
         }
@@ -737,7 +724,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iUplinkInitialized && iIPUplink)
+    if (iIPUplink && iUplState != EIdle)
         {
         status = iIPUplink->GetGain(gain);
         }
@@ -806,7 +793,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iIPUplink)
+    if (iIPUplink && iUplState != EIdle)
         {
         status = iIPUplink->GetSupportedBitrates(iArrBitrates);
         count = iArrBitrates.Count();
@@ -862,7 +849,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iIPUplink)
+    if (iIPUplink && iUplState != EIdle)
         {
         status = iIPUplink->GetBitrate(bitrate);
         }
@@ -879,7 +866,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iIPUplink)
+    if (iIPUplink && iUplState != EIdle)
         {
         status = iIPUplink->SetBitrate(bitrate);
         }
@@ -896,7 +883,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iIPUplink)
+    if (iIPUplink && iUplState != EIdle)
         {
         status = iIPUplink->GetVad(fmttype, vad);
         }
@@ -913,7 +900,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iIPUplink)
+    if (iIPUplink && iUplState != EIdle)
         {
         status = iIPUplink->SetVad(fmttype, vad);
         }
@@ -930,7 +917,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iIPDownlink)
+    if (iIPDownlink && iDnlState == EInitialized)
         {
         status = iIPDownlink->GetCng(fmttype, cng);
         }
@@ -947,7 +934,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iIPDownlink)
+    if (iIPDownlink && iDnlState == EInitialized)
         {
         status = iIPDownlink->SetCng(fmttype, cng);
         }
@@ -964,7 +951,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iIPDownlink)
+    if (iIPDownlink && iDnlState != EIdle)
         {
         status = iIPDownlink->GetPlc(fmttype, plc);
         }
@@ -981,7 +968,7 @@
     {
     TRACE_PRN_FN_ENT;
     gint status(TMS_RESULT_INVALID_STATE);
-    if (iIPDownlink)
+    if (iIPDownlink && iDnlState == EInitialized)
         {
         status = iIPDownlink->SetPlc(fmttype, plc);
         }
@@ -1055,7 +1042,7 @@
      * 2) KAudioPrefVoipAudioUplink             -NOK native VoIP?
      *    KAudioPriorityVoipAudioUplink         -NOK native VoIP?
      */
-    iPriority.iPref = KAudioPrefVoipAudioUplink;
+    iPriority.iPref = KAudioPrefVoipAudioUplinkNonSignal;
     iPriority.iPriority = KAudioPriorityVoipAudioUplink;
 
     delete iIPUplink;
@@ -1172,23 +1159,22 @@
 gint TMSCallIPAdpt::SetIlbcCodecMode(const gint mode,
         const TMSStreamType strmtype)
     {
-    gint status(TMS_RESULT_INVALID_ARGUMENT);
+    gint status(TMS_RESULT_SUCCESS);
 
-    if (strmtype == TMS_STREAM_DOWNLINK)
+    if (strmtype == TMS_STREAM_DOWNLINK && iIPDownlink &&
+            iDnlState == EInitialized)
         {
-        if (iDnlinkInitialized && iIPDownlink)
-            {
-            status = iIPDownlink->SetIlbcCodecMode(mode);
-            }
+        status = iIPDownlink->SetIlbcCodecMode(mode);
         }
-    else if (strmtype == TMS_STREAM_UPLINK)
+    else if (strmtype == TMS_STREAM_UPLINK && iIPUplink &&
+            iUplState == EInitialized)
         {
-        if (iUplinkInitialized && iIPUplink)
-            {
-            status = iIPUplink->SetIlbcCodecMode(mode);
-            }
+        status = iIPUplink->SetIlbcCodecMode(mode);
         }
-
+    else
+        {
+        status = TMS_RESULT_INVALID_STATE;
+        }
     return status;
     }
 
@@ -1199,23 +1185,22 @@
 //
 gint TMSCallIPAdpt::GetIlbcCodecMode(gint& mode, const TMSStreamType strmtype)
     {
-    gint status(TMS_RESULT_INVALID_ARGUMENT);
+    gint status(TMS_RESULT_SUCCESS);
 
-    if (strmtype == TMS_STREAM_DOWNLINK)
+    if (strmtype == TMS_STREAM_DOWNLINK && iIPDownlink &&
+            iDnlState != EIdle)
         {
-        if (iDnlinkInitialized && iIPDownlink)
-            {
-            status = iIPDownlink->GetIlbcCodecMode(mode);
-            }
+        status = iIPDownlink->GetIlbcCodecMode(mode);
         }
-    else if (strmtype == TMS_STREAM_UPLINK)
+    else if (strmtype == TMS_STREAM_UPLINK && iIPUplink &&
+            iUplState != EIdle)
         {
-        if (iUplinkInitialized && iIPUplink)
-            {
-            status = iIPUplink->GetIlbcCodecMode(mode);
-            }
+        status = iIPUplink->GetIlbcCodecMode(mode);
         }
-
+    else
+        {
+        status = TMS_RESULT_INVALID_STATE;
+        }
     return status;
     }
 
@@ -1227,23 +1212,22 @@
 gint TMSCallIPAdpt::SetG711CodecMode(const gint mode,
         const TMSStreamType strmtype)
     {
-    gint status(TMS_RESULT_INVALID_ARGUMENT);
+    gint status(TMS_RESULT_SUCCESS);
 
-    if (strmtype == TMS_STREAM_DOWNLINK)
+    if (strmtype == TMS_STREAM_DOWNLINK && iIPDownlink &&
+            iDnlState == EInitialized)
         {
-        if (iDnlinkInitialized && iIPDownlink)
-            {
-            status = iIPDownlink->SetG711CodecMode(mode);
-            }
+        status = iIPDownlink->SetG711CodecMode(mode);
         }
-    else if (strmtype == TMS_STREAM_UPLINK)
+    else if (strmtype == TMS_STREAM_UPLINK && iIPUplink &&
+            iUplState == EInitialized)
         {
-        if (iUplinkInitialized && iIPUplink)
-            {
-            status = iIPUplink->SetG711CodecMode(mode);
-            }
+        status = iIPUplink->SetG711CodecMode(mode);
         }
-
+    else
+        {
+        status = TMS_RESULT_INVALID_STATE;
+        }
     return status;
     }
 
@@ -1254,23 +1238,22 @@
 //
 gint TMSCallIPAdpt::GetG711CodecMode(gint& mode, const TMSStreamType strmtype)
     {
-    gint status(TMS_RESULT_INVALID_ARGUMENT);
+    gint status(TMS_RESULT_SUCCESS);
 
-    if (strmtype == TMS_STREAM_DOWNLINK)
+    if (strmtype == TMS_STREAM_DOWNLINK && iIPDownlink &&
+            iDnlState != EIdle)
         {
-        if (iDnlinkInitialized && iIPDownlink)
-            {
-            status = iIPDownlink->GetG711CodecMode(mode);
-            }
+        status = iIPDownlink->GetG711CodecMode(mode);
         }
-    else if (strmtype == TMS_STREAM_UPLINK)
+    else if (strmtype == TMS_STREAM_UPLINK && iIPUplink &&
+            iUplState != EIdle)
         {
-        if (iUplinkInitialized && iIPUplink)
-            {
-            status = iIPUplink->GetG711CodecMode(mode);
-            }
+        status = iIPUplink->GetG711CodecMode(mode);
         }
-
+    else
+        {
+        status = TMS_RESULT_INVALID_STATE;
+        }
     return status;
     }
 
@@ -1281,8 +1264,8 @@
 //
 gint TMSCallIPAdpt::FrameModeRqrdForEC(gboolean& frmodereq)
     {
-    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
-    if (iIPDownlink)
+    gint status(TMS_RESULT_INVALID_STATE);
+    if (iIPDownlink && iDnlState == EInitialized)
         {
         status = iIPDownlink->FrameModeRqrdForEC(frmodereq);
         }
@@ -1296,8 +1279,8 @@
 //
 gint TMSCallIPAdpt::SetFrameMode(const gboolean frmode)
     {
-    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
-    if (iIPDownlink)
+    gint status(TMS_RESULT_INVALID_STATE);
+    if (iIPDownlink && iDnlState == EInitialized)
         {
         status = iIPDownlink->SetFrameMode(frmode);
         }
@@ -1311,8 +1294,8 @@
 //
 gint TMSCallIPAdpt::GetFrameMode(gboolean& frmode)
     {
-    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
-    if (iIPDownlink)
+    gint status(TMS_RESULT_INVALID_STATE);
+    if (iIPDownlink && iDnlState != EIdle)
         {
         status = iIPDownlink->GetFrameMode(frmode);
         }
@@ -1325,8 +1308,8 @@
 //
 gint TMSCallIPAdpt::ConcealErrorForNextBuffer()
     {
-    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
-    if (iIPDownlink)
+    gint status(TMS_RESULT_INVALID_STATE);
+    if (iIPDownlink && iDnlState == EActivated)
         {
         status = iIPDownlink->ConcealErrorForNextBuffer();
         }
@@ -1340,8 +1323,8 @@
 //
 gint TMSCallIPAdpt::BadLsfNextBuffer()
     {
-    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
-    if (iIPDownlink)
+    gint status(TMS_RESULT_INVALID_STATE);
+    if (iIPDownlink && iDnlState == EActivated)
         {
         status = iIPDownlink->BadLsfNextBuffer();
         }
@@ -1356,14 +1339,15 @@
 gint TMSCallIPAdpt::SetOutput(TMSAudioOutput output)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
-    if (iDnlinkInitialized && iIPDownlink)
+    gint status(TMS_RESULT_INVALID_STATE);
+    if (iIPDownlink && iDnlState != EIdle)
         {
         TRAP(status, iIPDownlink->SetAudioDeviceL(output));
         }
     TRACE_PRN_FN_EXT;
     return status;
     }
+
 // -----------------------------------------------------------------------------
 // TMSCallIPAdpt::GetOutput
 //
@@ -1372,8 +1356,8 @@
 gint TMSCallIPAdpt::GetOutput(TMSAudioOutput& output)
     {
     TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
-    if (iDnlinkInitialized && iIPDownlink)
+    gint status(TMS_RESULT_INVALID_STATE);
+    if (iIPDownlink && iDnlState != EIdle)
         {
         TRAP(status, iIPDownlink->GetAudioDeviceL(output));
         }
@@ -1399,162 +1383,11 @@
 gint TMSCallIPAdpt::GetAvailableOutputsL(gint& /*count*/,
         CBufFlat*& /*outputsbuf*/)
     {
+    //TODO: return public & private
     return TMS_RESULT_FEATURE_NOT_SUPPORTED;
     }
 
 // -----------------------------------------------------------------------------
-// TMSCallIPAdpt::InitDTMF
-//
-// -----------------------------------------------------------------------------
-//
-gint TMSCallIPAdpt::InitDTMF(TMSStreamType strmtype)
-    {
-    TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED);
-
-    if (strmtype == TMS_STREAM_DOWNLINK)
-        {
-        delete iDTMFDnlinkPlayer;
-        iDTMFDnlinkPlayer = NULL;
-        TRAP(status, iDTMFDnlinkPlayer = TMSAudioDtmfTonePlayer::NewL(*this,
-                KAudioDTMFString, KAudioPriorityDTMFString));
-         }
-    else if (strmtype == TMS_STREAM_UPLINK)
-        {
-        delete iDTMFUplinkPlayer;
-        iDTMFUplinkPlayer = NULL;
-        TRAP(status, iDTMFUplinkPlayer = TMSAudioDtmfTonePlayer::NewL(*this,
-                KAudioDTMFString, KAudioPriorityDTMFString));
-        }
-
-    if (!iDTMFNotifier && status == TMS_RESULT_SUCCESS)
-         {
-         TRAP(status, iDTMFNotifier = TMSDtmfNotifier::NewL());
-         }
-
-    TRACE_PRN_FN_EXT;
-    return status;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSCallIPAdpt::StartDTMF
-//
-// -----------------------------------------------------------------------------
-//
-gint TMSCallIPAdpt::StartDTMF(TMSStreamType strmtype, TDes& dtmfstring)
-    {
-    TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED);
-    TmsMsgBufPckg dtmfpckg;
-    dtmfpckg().iStatus = status;
-    dtmfpckg().iRequest = ECmdDTMFTonePlayFinished;
-
-    if (strmtype == TMS_STREAM_DOWNLINK)
-        {
-        status = TMS_RESULT_UNINITIALIZED_OBJECT;
-        if (iDTMFDnlinkPlayer)
-            {
-            iDTMFDnlinkPlayer->PlayDtmfTone(dtmfstring);
-            status = TMS_RESULT_SUCCESS;
-            }
-        dtmfpckg().iStatus = status;
-        dtmfpckg().iRequest = ECmdDTMFToneDnlPlayStarted;
-        }
-    else if (strmtype == TMS_STREAM_UPLINK)
-        {
-        status = TMS_RESULT_UNINITIALIZED_OBJECT;
-        if (iDTMFUplinkPlayer)
-            {
-            iDTMFUplinkPlayer->PlayDtmfTone(dtmfstring);
-            status = TMS_RESULT_SUCCESS;
-            }
-        dtmfpckg().iStatus = status;
-        dtmfpckg().iRequest = ECmdDTMFToneUplPlayStarted;
-        }
-
-    if (iDTMFNotifier)
-        {
-        iDTMFNotifier->SetDtmf(dtmfpckg);
-        }
-
-    TRACE_PRN_IF_ERR(status);
-    TRACE_PRN_FN_EXT;
-    return status;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSCallIPAdpt::StopDTMF
-//
-// -----------------------------------------------------------------------------
-//
-gint TMSCallIPAdpt::StopDTMF(TMSStreamType streamtype)
-    {
-    TRACE_PRN_FN_ENT;
-    gint status(TMS_RESULT_SUCCESS);
-
-    if (streamtype == TMS_STREAM_DOWNLINK && iDTMFDnlinkPlayer)
-        {
-        iDTMFDnlinkPlayer->Cancel();
-        }
-    else if (streamtype == TMS_STREAM_UPLINK && iDTMFUplinkPlayer)
-        {
-        //status = iDTMFUplinkPlayer->StopDtmfTone();
-        iDTMFUplinkPlayer->Cancel();
-        }
-
-    TRACE_PRN_FN_EXT;
-    return status;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSCallIPAdpt::ContinueDTMF
-//
-// -----------------------------------------------------------------------------
-//
-gint TMSCallIPAdpt::ContinueDTMF(const gboolean /*sending*/)
-    {
-    return TMS_RESULT_FEATURE_NOT_SUPPORTED;
-    }
-
-//From DTMFTonePlayerObserver
-// -----------------------------------------------------------------------------
-// TMSCallIPAdpt::DTMFInitCompleted
-//
-// -----------------------------------------------------------------------------
-//
-void TMSCallIPAdpt::DTMFInitCompleted(gint /*status*/)
-    {
-    TRACE_PRN_FN_ENT;
-    // TODO: process error
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
-// TMSCallIPAdpt::DTMFToneFinished
-//
-// -----------------------------------------------------------------------------
-//
-void TMSCallIPAdpt::DTMFToneFinished(gint status)
-    {
-    TRACE_PRN_FN_ENT;
-    TRACE_PRN_IF_ERR(status);
-    TmsMsgBufPckg dtmfpckg;
-
-    // KErrUnderflow indicates end of DTMF playback.
-    if (status == KErrUnderflow /*|| status == KErrInUse*/)
-        {
-        status = TMS_RESULT_SUCCESS;
-        }
-    dtmfpckg().iStatus = TMSUtility::TMSResult(status);
-    dtmfpckg().iRequest = ECmdDTMFTonePlayFinished;
-    if (iDTMFNotifier)
-        {
-        iDTMFNotifier->SetDtmf(dtmfpckg);
-        }
-    TRACE_PRN_FN_EXT;
-    }
-
-// -----------------------------------------------------------------------------
 // TMSCallIPAdpt::DownlinkInitCompleted
 // From TMSIPDevSoundObserver
 // -----------------------------------------------------------------------------
@@ -1564,7 +1397,7 @@
     TRACE_PRN_FN_ENT;
     if (status == TMS_RESULT_SUCCESS)
         {
-        iDnlinkInitialized = TRUE;
+        iDnlState = EInitialized;
         }
     NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status);
     TRACE_PRN_FN_EXT;
@@ -1580,7 +1413,7 @@
     TRACE_PRN_FN_ENT;
     if (status == TMS_RESULT_SUCCESS)
         {
-        iUplinkInitialized = TRUE;
+        iUplState = EInitialized;
         }
     NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status);
     TRACE_PRN_FN_EXT;
@@ -1594,6 +1427,10 @@
 void TMSCallIPAdpt::UplinkStarted(gint status)
     {
     TRACE_PRN_FN_ENT;
+    if (status == TMS_RESULT_SUCCESS)
+        {
+        iUplState = EActivated;
+        }
     NotifyClient(iUplinkStreamId, ECmdUplinkStarted, status);
     TRACE_PRN_FN_EXT;
     }
@@ -1606,6 +1443,10 @@
 void TMSCallIPAdpt::DownlinkStarted(gint status)
     {
     TRACE_PRN_FN_ENT;
+    if (status == TMS_RESULT_SUCCESS)
+        {
+        iDnlState = EActivated;
+        }
     NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, status);
     TRACE_PRN_FN_EXT;
     }
@@ -1630,4 +1471,3 @@
         }
     }
 
-// End of file