mmserv/tms/tmsimpl/src/tmsdtmfbodyimpl.cpp
changeset 42 1fa3fb47b1e3
parent 22 128eb6a32b84
--- a/mmserv/tms/tmsimpl/src/tmsdtmfbodyimpl.cpp	Tue Jul 06 14:50:35 2010 +0300
+++ b/mmserv/tms/tmsimpl/src/tmsdtmfbodyimpl.cpp	Wed Aug 18 10:17:22 2010 +0300
@@ -52,31 +52,30 @@
     TRACE_PRN_FN_EXT;
     }
 
-gint TMSDTMFBodyImpl::Create(TMSStreamType streamtype, TMSDTMFBody*& bodyimpl)
+gint TMSDTMFBodyImpl::Create(TMSStreamType streamtype, TMSDTMF& parent,
+        TMSDTMFBody*& bodyimpl)
     {
     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
     TMSDTMFBodyImpl* self = new TMSDTMFBodyImpl();
     if (self)
         {
-        ret = self->PostConstruct();
+        ret = self->PostConstruct(streamtype, parent);
         if (ret != TMS_RESULT_SUCCESS)
             {
             delete self;
             self = NULL;
             }
-        else
-            {
-            self->iStreamType = streamtype;
-            }
         }
     bodyimpl = self;
     return ret;
     }
 
-gint TMSDTMFBodyImpl::PostConstruct()
+gint TMSDTMFBodyImpl::PostConstruct(TMSStreamType streamtype, TMSDTMF& parent)
     {
     gint ret(TMS_RESULT_SUCCESS);
     iClientId = 1;
+    iParent = &parent;
+    iStreamType = streamtype;
     iProxy = new TMSProxy();
     if (!iProxy)
         {
@@ -84,7 +83,11 @@
         }
     else
         {
-        if (iProxy->Connect() != TMS_RESULT_SUCCESS)
+        if (iProxy->Connect() == TMS_RESULT_SUCCESS)
+            {
+            ret = iProxy->InitDTMFPlayer(iStreamType);
+            }
+        else
             {
             delete iProxy;
             iProxy = NULL;
@@ -106,10 +109,6 @@
             {
             ret = iProxy->SetMsgQueueNotifier(EMsgQueueDTMFType, iObserver,
                     iParent, iClientId);
-            if (ret == TMS_RESULT_SUCCESS)
-                {
-                ret = iProxy->StartDTMFNotifier();
-                }
             }
         else
             {
@@ -130,7 +129,6 @@
         {
         ret = iProxy->RemoveMsgQueueNotifier(EMsgQueueDTMFType, iObserver);
         iObserver = NULL;
-        iProxy->CancelDTMFNotifier();
         }
     else
         {
@@ -179,7 +177,6 @@
     __ASSERT_ALWAYS(string, PANIC(TMS_RESULT_NULL_ARGUMENT));
 
     gint ret(TMS_RESULT_SUCCESS);
-
     if (iString)
         {
         if (iString->len)
@@ -206,8 +203,3 @@
     return ret;
     }
 
-void TMSDTMFBodyImpl::SetParent(TMSDTMF*& parent)
-    {
-    iParent = parent;
-    }
-