mmserv/tms/tmscallserver/src/callipadpt.cpp
changeset 12 5a06f39ad45b
parent 0 71ca22bcf22a
equal deleted inserted replaced
0:71ca22bcf22a 12:5a06f39ad45b
    23 #include "callipadpt.h"
    23 #include "callipadpt.h"
    24 
    24 
    25 using namespace TMS;
    25 using namespace TMS;
    26 
    26 
    27 // -----------------------------------------------------------------------------
    27 // -----------------------------------------------------------------------------
    28 // CallIPAdpt::NewL
    28 // TMSCallIPAdpt::NewL
    29 // Symbian constructor.
    29 // Symbian constructor.
    30 // -----------------------------------------------------------------------------
    30 // -----------------------------------------------------------------------------
    31 //
    31 //
    32 CallIPAdpt* CallIPAdpt::NewL()
    32 TMSCallIPAdpt* TMSCallIPAdpt::NewL()
    33     {
    33     {
    34     CallIPAdpt* self = new (ELeave) CallIPAdpt();
    34     TMSCallIPAdpt* self = new (ELeave) TMSCallIPAdpt();
    35     CleanupStack::PushL(self);
    35     CleanupStack::PushL(self);
    36     self->ConstructL();
    36     self->ConstructL();
    37     CleanupStack::Pop(self);
    37     CleanupStack::Pop(self);
    38     return self;
    38     return self;
    39     }
    39     }
    40 
    40 
    41 // -----------------------------------------------------------------------------
    41 // -----------------------------------------------------------------------------
    42 // CallIPAdpt::ConstructL
    42 // TMSCallIPAdpt::ConstructL
    43 // 2-nd phase constructor.
    43 // 2-nd phase constructor.
    44 // -----------------------------------------------------------------------------
    44 // -----------------------------------------------------------------------------
    45 //
    45 //
    46 void CallIPAdpt::ConstructL()
    46 void TMSCallIPAdpt::ConstructL()
    47     {
    47     {
    48     TRACE_PRN_FN_ENT;
    48     TRACE_PRN_FN_ENT;
    49     iVoIPUplink = NULL;
    49     iIPUplink = NULL;
    50     iVoIPDownlink = NULL;
    50     iIPDownlink = NULL;
    51     TRACE_PRN_FN_EXT;
    51     iDTMFDnlinkPlayer = NULL;
    52     }
    52     iDTMFUplinkPlayer = NULL;
    53 
    53     iDTMFNotifier = NULL;
    54 // -----------------------------------------------------------------------------
    54     TRACE_PRN_FN_EXT;
    55 // CallIPAdpt::CallIPAdpt
    55     }
    56 //
    56 
    57 // -----------------------------------------------------------------------------
    57 // -----------------------------------------------------------------------------
    58 //
    58 // TMSCallIPAdpt::TMSCallIPAdpt
    59 CallIPAdpt::CallIPAdpt()
    59 //
    60     {
    60 // -----------------------------------------------------------------------------
    61     }
    61 //
    62 
    62 TMSCallIPAdpt::TMSCallIPAdpt()
    63 // -----------------------------------------------------------------------------
    63     {
    64 // CallIPAdpt::~CallIPAdpt
    64     }
    65 //
    65 
    66 // -----------------------------------------------------------------------------
    66 // -----------------------------------------------------------------------------
    67 //
    67 // TMSCallIPAdpt::~TMSCallIPAdpt
    68 CallIPAdpt::~CallIPAdpt()
    68 //
       
    69 // -----------------------------------------------------------------------------
       
    70 //
       
    71 TMSCallIPAdpt::~TMSCallIPAdpt()
    69     {
    72     {
    70     TRACE_PRN_FN_ENT;
    73     TRACE_PRN_FN_ENT;
    71 
    74 
    72     iCodecs.Reset();
    75     iCodecs.Reset();
    73     iCodecs.Close();
    76     iCodecs.Close();
    74     iArrBitrates.Reset();
    77     iArrBitrates.Reset();
    75 
    78     delete iDTMFUplinkPlayer;
    76     delete iVoIPUplink;
    79     delete iDTMFDnlinkPlayer;
    77     delete iVoIPDownlink;
    80     delete iDTMFNotifier;
       
    81     delete iIPUplink;
       
    82     delete iIPDownlink;
    78 
    83 
    79     if (iMsgQueueUp.Handle() > 0)
    84     if (iMsgQueueUp.Handle() > 0)
    80         {
    85         {
    81         iMsgQueueUp.Close();
    86         iMsgQueueUp.Close();
    82         }
    87         }
    87 
    92 
    88     TRACE_PRN_FN_EXT;
    93     TRACE_PRN_FN_EXT;
    89     }
    94     }
    90 
    95 
    91 // -----------------------------------------------------------------------------
    96 // -----------------------------------------------------------------------------
    92 // CallIPAdpt::PostConstruct
    97 // TMSCallIPAdpt::PostConstruct
    93 //
    98 //
    94 // -----------------------------------------------------------------------------
    99 // -----------------------------------------------------------------------------
    95 //
   100 //
    96 gint CallIPAdpt::PostConstruct()
   101 gint TMSCallIPAdpt::PostConstruct()
    97     {
   102     {
    98     TRACE_PRN_FN_ENT;
   103     TRACE_PRN_FN_ENT;
    99     gint status(TMS_RESULT_SUCCESS);
   104     gint status(TMS_RESULT_SUCCESS);
   100     iNextStreamId = 1;
   105     iNextStreamId = 1;
   101     iUplinkInitialized = FALSE;
   106     iUplinkInitialized = FALSE;
   104     TRACE_PRN_FN_EXT;
   109     TRACE_PRN_FN_EXT;
   105     return status;
   110     return status;
   106     }
   111     }
   107 
   112 
   108 // -----------------------------------------------------------------------------
   113 // -----------------------------------------------------------------------------
   109 // CallIPAdpt::CreateStream
   114 // TMSCallIPAdpt::CreateStream
   110 //
   115 //
   111 // -----------------------------------------------------------------------------
   116 // -----------------------------------------------------------------------------
   112 //
   117 //
   113 gint CallIPAdpt::CreateStream(TMSCallType /*callType*/,
   118 gint TMSCallIPAdpt::CreateStream(TMSCallType /*callType*/,
   114         TMSStreamType strmType, gint& outStrmId)
   119         TMSStreamType strmType, gint& outStrmId)
   115     {
   120     {
   116     TRACE_PRN_FN_ENT;
   121     TRACE_PRN_FN_ENT;
   117     gint status(TMS_RESULT_SUCCESS);
   122     gint status(TMS_RESULT_SUCCESS);
   118     switch (strmType)
   123     switch (strmType)
   152     TRACE_PRN_FN_EXT;
   157     TRACE_PRN_FN_EXT;
   153     return status;
   158     return status;
   154     }
   159     }
   155 
   160 
   156 // -----------------------------------------------------------------------------
   161 // -----------------------------------------------------------------------------
   157 // CallIPAdpt::InitStream
   162 // TMSCallIPAdpt::InitStream
   158 //
   163 //
   159 // -----------------------------------------------------------------------------
   164 // -----------------------------------------------------------------------------
   160 //
   165 //
   161 gint CallIPAdpt::InitStreamL(TMSCallType /*callType*/,
   166 gint TMSCallIPAdpt::InitStreamL(TMSCallType /*callType*/,
   162         TMSStreamType strmType, gint strmId, TMSFormatType frmtType,
   167         TMSStreamType strmType, gint strmId, TMSFormatType frmtType,
   163         const RMessage2& aMessage)
   168         const RMessage2& aMessage)
   164     {
   169     {
   165     TRACE_PRN_FN_ENT;
   170     TRACE_PRN_FN_ENT;
   166     gint status(TMS_RESULT_SUCCESS);
   171     gint status(TMS_RESULT_SUCCESS);
   178             status = TMS_RESULT_DOES_NOT_EXIST;
   183             status = TMS_RESULT_DOES_NOT_EXIST;
   179             if (strmId == iUplinkStreamId)
   184             if (strmId == iUplinkStreamId)
   180                 {
   185                 {
   181                 SetFormat(iUplinkStreamId, fourCC);
   186                 SetFormat(iUplinkStreamId, fourCC);
   182                 status = OpenUplinkL(aMessage);
   187                 status = OpenUplinkL(aMessage);
       
   188 
       
   189                 iDTMFUplinkPlayer = TMSAudioDtmfTonePlayer::NewL(*this,
       
   190                         KAudioPrefUnknownVoipAudioUplink,
       
   191                         KAudioPriorityUnknownVoipAudioUplink);
       
   192 
       
   193                 if(!iDTMFNotifier)
       
   194                     {
       
   195                     iDTMFNotifier = TMSDtmfNotifier::NewL();
       
   196                     }
       
   197 
   183                 NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status);
   198                 NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status);
   184                 }
   199                 }
   185             break;
   200             break;
   186             }
   201             }
   187         case TMS_STREAM_DOWNLINK:
   202         case TMS_STREAM_DOWNLINK:
   189             status = TMS_RESULT_DOES_NOT_EXIST;
   204             status = TMS_RESULT_DOES_NOT_EXIST;
   190             if (strmId == iDnlinkStreamId)
   205             if (strmId == iDnlinkStreamId)
   191                 {
   206                 {
   192                 SetFormat(iDnlinkStreamId, fourCC);
   207                 SetFormat(iDnlinkStreamId, fourCC);
   193                 status = OpenDownlinkL(aMessage);
   208                 status = OpenDownlinkL(aMessage);
       
   209 
       
   210                 iDTMFDnlinkPlayer = TMSAudioDtmfTonePlayer::NewL(*this,
       
   211                         KAudioPrefUnknownVoipAudioDownlink,
       
   212                         KAudioPriorityUnknownVoipAudioDownlink);
       
   213 
       
   214                 if(!iDTMFNotifier)
       
   215                     {
       
   216                     iDTMFNotifier = TMSDtmfNotifier::NewL();
       
   217                     }
       
   218 
   194                 NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status);
   219                 NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status);
   195                 }
   220                 }
   196             break;
   221             break;
   197             }
   222             }
   198         default:
   223         default:
   206     TRACE_PRN_FN_EXT;
   231     TRACE_PRN_FN_EXT;
   207     return status;
   232     return status;
   208     }
   233     }
   209 
   234 
   210 // -----------------------------------------------------------------------------
   235 // -----------------------------------------------------------------------------
   211 // CallIPAdpt::StartStream
   236 // TMSCallIPAdpt::StartStream
   212 //
   237 //
   213 // -----------------------------------------------------------------------------
   238 // -----------------------------------------------------------------------------
   214 //
   239 //
   215 gint CallIPAdpt::StartStream(TMSCallType /*callType*/, TMSStreamType strmType,
   240 gint TMSCallIPAdpt::StartStream(TMSCallType /*callType*/,
   216         gint strmId)
   241         TMSStreamType strmType, gint strmId)
   217     {
   242     {
   218     TRACE_PRN_FN_ENT;
   243     TRACE_PRN_FN_ENT;
   219     gint status(TMS_RESULT_INVALID_STATE);
   244     gint status(TMS_RESULT_INVALID_STATE);
   220     switch (strmType)
   245     switch (strmType)
   221         {
   246         {
   222         case TMS_STREAM_UPLINK:
   247         case TMS_STREAM_UPLINK:
   223             {
   248             {
   224             if (strmId == iUplinkStreamId && iVoIPUplink)
   249             if (strmId == iUplinkStreamId && iIPUplink)
   225                 {
   250                 {
   226                 iVoIPUplink->Start();
   251                 iIPUplink->Start();
   227                 status = TMS_RESULT_SUCCESS;
   252                 status = TMS_RESULT_SUCCESS;
   228                 NotifyClient(iUplinkStreamId, ECmdUplinkStarted, status);
   253                 NotifyClient(iUplinkStreamId, ECmdUplinkStarted, status);
   229                 }
   254                 }
   230             break;
   255             break;
   231             }
   256             }
   232         case TMS_STREAM_DOWNLINK:
   257         case TMS_STREAM_DOWNLINK:
   233             {
   258             {
   234             if (strmId == iDnlinkStreamId && iVoIPDownlink)
   259             if (strmId == iDnlinkStreamId && iIPDownlink)
   235                 {
   260                 {
   236                 iVoIPDownlink->Start();
   261                 iIPDownlink->Start();
   237                 status = TMS_RESULT_SUCCESS;
   262                 status = TMS_RESULT_SUCCESS;
   238                 NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, status);
   263                 NotifyClient(iDnlinkStreamId, ECmdDownlinkStarted, status);
   239                 }
   264                 }
   240             break;
   265             break;
   241             }
   266             }
   248     TRACE_PRN_FN_EXT;
   273     TRACE_PRN_FN_EXT;
   249     return status;
   274     return status;
   250     }
   275     }
   251 
   276 
   252 // -----------------------------------------------------------------------------
   277 // -----------------------------------------------------------------------------
   253 // CallIPAdpt::PauseStream
   278 // TMSCallIPAdpt::PauseStream
   254 //
   279 //
   255 // -----------------------------------------------------------------------------
   280 // -----------------------------------------------------------------------------
   256 //
   281 //
   257 gint CallIPAdpt::PauseStream(TMSCallType /*callType*/, TMSStreamType strmType,
   282 gint TMSCallIPAdpt::PauseStream(TMSCallType /*callType*/,
   258         gint strmId)
   283         TMSStreamType strmType, gint strmId)
   259     {
   284     {
   260     TRACE_PRN_FN_ENT;
   285     TRACE_PRN_FN_ENT;
   261     gint status(TMS_RESULT_INVALID_STATE);
   286     gint status(TMS_RESULT_INVALID_STATE);
   262     switch (strmType)
   287     switch (strmType)
   263         {
   288         {
   264         case TMS_STREAM_UPLINK:
   289         case TMS_STREAM_UPLINK:
   265             {
   290             {
   266             if (strmId == iUplinkStreamId && iVoIPUplink)
   291             if (strmId == iUplinkStreamId && iIPUplink)
   267                 {
   292                 {
   268                 iVoIPUplink->Stop();
   293                 iIPUplink->Stop();
   269                 status = TMS_RESULT_SUCCESS;
   294                 status = TMS_RESULT_SUCCESS;
   270                 NotifyClient(iUplinkStreamId, ECmdUplinkPaused, status);
   295                 NotifyClient(iUplinkStreamId, ECmdUplinkPaused, status);
   271                 }
   296                 }
   272             break;
   297             break;
   273             }
   298             }
   274         case TMS_STREAM_DOWNLINK:
   299         case TMS_STREAM_DOWNLINK:
   275             {
   300             {
   276             if (strmId == iDnlinkStreamId && iVoIPDownlink)
   301             if (strmId == iDnlinkStreamId && iIPDownlink)
   277                 {
   302                 {
   278                 iVoIPDownlink->Stop();
   303                 iIPDownlink->Stop();
   279                 status = TMS_RESULT_SUCCESS;
   304                 status = TMS_RESULT_SUCCESS;
   280                 NotifyClient(iDnlinkStreamId, ECmdDownlinkPaused, status);
   305                 NotifyClient(iDnlinkStreamId, ECmdDownlinkPaused, status);
   281                 }
   306                 }
   282             break;
   307             break;
   283             }
   308             }
   290     TRACE_PRN_FN_EXT;
   315     TRACE_PRN_FN_EXT;
   291     return status;
   316     return status;
   292     }
   317     }
   293 
   318 
   294 // -----------------------------------------------------------------------------
   319 // -----------------------------------------------------------------------------
   295 // CallIPAdpt::StopStream
   320 // TMSCallIPAdpt::StopStream
   296 //
   321 //
   297 // -----------------------------------------------------------------------------
   322 // -----------------------------------------------------------------------------
   298 //
   323 //
   299 gint CallIPAdpt::StopStream(TMSCallType /*callType*/, TMSStreamType strmType,
   324 gint TMSCallIPAdpt::StopStream(TMSCallType /*callType*/, TMSStreamType strmType,
   300         gint strmId)
   325         gint strmId)
   301     {
   326     {
   302     TRACE_PRN_FN_ENT;
   327     TRACE_PRN_FN_ENT;
   303     gint status(TMS_RESULT_INVALID_STATE);
   328     gint status(TMS_RESULT_INVALID_STATE);
   304 
   329 
   305     switch (strmType)
   330     switch (strmType)
   306         {
   331         {
   307         case TMS_STREAM_UPLINK:
   332         case TMS_STREAM_UPLINK:
   308             {
   333             {
   309             if (strmId == iUplinkStreamId && iVoIPUplink)
   334             if (strmId == iUplinkStreamId && iIPUplink)
   310                 {
   335                 {
   311                 iVoIPUplink->Stop();
   336                 iIPUplink->Stop();
   312                 status = TMS_RESULT_SUCCESS;
   337                 status = TMS_RESULT_SUCCESS;
   313                 NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status);
   338                 NotifyClient(iUplinkStreamId, ECmdUplinkInitComplete, status);
   314                 }
   339                 }
   315             break;
   340             break;
   316             }
   341             }
   317         case TMS_STREAM_DOWNLINK:
   342         case TMS_STREAM_DOWNLINK:
   318             {
   343             {
   319             if (strmId == iDnlinkStreamId && iVoIPDownlink)
   344             if (strmId == iDnlinkStreamId && iIPDownlink)
   320                 {
   345                 {
   321                 iVoIPDownlink->Stop();
   346                 iIPDownlink->Stop();
   322                 status = TMS_RESULT_SUCCESS;
   347                 status = TMS_RESULT_SUCCESS;
   323                 NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status);
   348                 NotifyClient(iDnlinkStreamId, ECmdDownlinkInitComplete, status);
   324                 }
   349                 }
   325             break;
   350             break;
   326             }
   351             }
   333     TRACE_PRN_FN_EXT;
   358     TRACE_PRN_FN_EXT;
   334     return status;
   359     return status;
   335     }
   360     }
   336 
   361 
   337 // -----------------------------------------------------------------------------
   362 // -----------------------------------------------------------------------------
   338 // CallIPAdpt::DeinitStream
   363 // TMSCallIPAdpt::DeinitStream
   339 //
   364 //
   340 // -----------------------------------------------------------------------------
   365 // -----------------------------------------------------------------------------
   341 //
   366 //
   342 gint CallIPAdpt::DeinitStream(TMSCallType /*callType*/, TMSStreamType strmType,
   367 gint TMSCallIPAdpt::DeinitStream(TMSCallType /*callType*/,
   343         gint strmId)
   368         TMSStreamType strmType, gint strmId)
   344     {
   369     {
   345     TRACE_PRN_FN_ENT;
   370     TRACE_PRN_FN_ENT;
   346     gint status(TMS_RESULT_INVALID_STATE);
   371     gint status(TMS_RESULT_INVALID_STATE);
   347 
   372 
   348     switch (strmType)
   373     switch (strmType)
   349         {
   374         {
   350         case TMS_STREAM_UPLINK:
   375         case TMS_STREAM_UPLINK:
   351             {
   376             {
   352             if (strmId == iUplinkStreamId && iVoIPUplink)
   377             if (strmId == iUplinkStreamId && iIPUplink)
   353                 {
   378                 {
   354                 iVoIPUplink->Stop();
   379                 iIPUplink->Stop();
   355                 //iUplinkStreamId = -1;
   380                 //iUplinkStreamId = -1;
   356                 iUplinkInitialized = FALSE;
   381                 iUplinkInitialized = FALSE;
   357                 status = TMS_RESULT_SUCCESS;
   382                 status = TMS_RESULT_SUCCESS;
   358                 NotifyClient(iUplinkStreamId, ECmdDownlinkDeInitComplete,
   383                 NotifyClient(iUplinkStreamId, ECmdDownlinkDeInitComplete,
   359                         status);
   384                         status);
   360                 }
   385                 }
   361             break;
   386             break;
   362             }
   387             }
   363         case TMS_STREAM_DOWNLINK:
   388         case TMS_STREAM_DOWNLINK:
   364             {
   389             {
   365             if (strmId == iDnlinkStreamId && iVoIPDownlink)
   390             if (strmId == iDnlinkStreamId && iIPDownlink)
   366                 {
   391                 {
   367                 iVoIPDownlink->Stop();
   392                 iIPDownlink->Stop();
   368                 //iDnlinkStreamId = -1;
   393                 //iDnlinkStreamId = -1;
   369                 iDnlinkInitialized = FALSE;
   394                 iDnlinkInitialized = FALSE;
   370                 status = TMS_RESULT_SUCCESS;
   395                 status = TMS_RESULT_SUCCESS;
   371                 NotifyClient(iDnlinkStreamId, ECmdDownlinkDeInitComplete,
   396                 NotifyClient(iDnlinkStreamId, ECmdDownlinkDeInitComplete,
   372                         status);
   397                         status);
   383     TRACE_PRN_FN_EXT;
   408     TRACE_PRN_FN_EXT;
   384     return status;
   409     return status;
   385     }
   410     }
   386 
   411 
   387 // -----------------------------------------------------------------------------
   412 // -----------------------------------------------------------------------------
   388 // CallIPAdpt::DeleteStream
   413 // TMSCallIPAdpt::DeleteStream
   389 //
   414 //
   390 // -----------------------------------------------------------------------------
   415 // -----------------------------------------------------------------------------
   391 //
   416 //
   392 gint CallIPAdpt::DeleteStream(TMSCallType /*callType*/,
   417 gint TMSCallIPAdpt::DeleteStream(TMSCallType /*callType*/,
   393         TMSStreamType strmType, gint strmId)
   418         TMSStreamType strmType, gint strmId)
   394     {
   419     {
   395     TRACE_PRN_FN_ENT;
   420     TRACE_PRN_FN_ENT;
   396     gint status(TMS_RESULT_SUCCESS);
   421     gint status(TMS_RESULT_SUCCESS);
   397     switch (strmType)
   422     switch (strmType)
   425     TRACE_PRN_FN_EXT;
   450     TRACE_PRN_FN_EXT;
   426     return status;
   451     return status;
   427     }
   452     }
   428 
   453 
   429 // -----------------------------------------------------------------------------
   454 // -----------------------------------------------------------------------------
   430 // CallIPAdpt::DataXferBufferEmptied
   455 // TMSCallIPAdpt::DataXferBufferEmptied
   431 //
   456 //
   432 // -----------------------------------------------------------------------------
   457 // -----------------------------------------------------------------------------
   433 //
   458 //
   434 gint CallIPAdpt::DataXferBufferEmptied(TMSCallType /*callType*/,
   459 gint TMSCallIPAdpt::DataXferBufferEmptied(TMSCallType /*callType*/,
   435         TMSStreamType strmType, gint strmId)
   460         TMSStreamType strmType, gint strmId)
   436     {
   461     {
   437     TRACE_PRN_FN_ENT;
   462     TRACE_PRN_FN_ENT;
   438     gint status(TMS_RESULT_SUCCESS);
   463     gint status(TMS_RESULT_SUCCESS);
   439     switch (strmType)
   464     switch (strmType)
   456     TRACE_PRN_FN_EXT;
   481     TRACE_PRN_FN_EXT;
   457     return status;
   482     return status;
   458     }
   483     }
   459 
   484 
   460 // -----------------------------------------------------------------------------
   485 // -----------------------------------------------------------------------------
   461 // CallIPAdpt::DataXferBufferFilled
   486 // TMSCallIPAdpt::DataXferBufferFilled
   462 //
   487 //
   463 // -----------------------------------------------------------------------------
   488 // -----------------------------------------------------------------------------
   464 //
   489 //
   465 gint CallIPAdpt::DataXferBufferFilled(TMSCallType /*callType*/,
   490 gint TMSCallIPAdpt::DataXferBufferFilled(TMSCallType /*callType*/,
   466         TMSStreamType strmType, gint strmId, guint datasize)
   491         TMSStreamType strmType, gint strmId, guint datasize)
   467     {
   492     {
   468     TRACE_PRN_FN_ENT;
   493     TRACE_PRN_FN_ENT;
   469     gint status(TMS_RESULT_SUCCESS);
   494     gint status(TMS_RESULT_SUCCESS);
   470     switch (strmType)
   495     switch (strmType)
   485     TRACE_PRN_FN_EXT;
   510     TRACE_PRN_FN_EXT;
   486     return status;
   511     return status;
   487     }
   512     }
   488 
   513 
   489 // -----------------------------------------------------------------------------
   514 // -----------------------------------------------------------------------------
   490 // CallIPAdpt::GetDataXferBufferHndl
   515 // TMSCallIPAdpt::GetDataXferBufferHndl
   491 //
   516 //
   492 // -----------------------------------------------------------------------------
   517 // -----------------------------------------------------------------------------
   493 //
   518 //
   494 gint CallIPAdpt::GetDataXferBufferHndl(const TMSCallType /*callType*/,
   519 gint TMSCallIPAdpt::GetDataXferBufferHndl(const TMSCallType /*callType*/,
   495         const TMSStreamType strmType, const gint strmId, const guint32 key,
   520         const TMSStreamType strmType, const gint strmId, const guint32 key,
   496         RChunk& chunk)
   521         RChunk& chunk)
   497     {
   522     {
   498     TRACE_PRN_FN_ENT;
   523     TRACE_PRN_FN_ENT;
   499     gint status(TMS_RESULT_SUCCESS);
   524     gint status(TMS_RESULT_SUCCESS);
   522     TRACE_PRN_FN_EXT;
   547     TRACE_PRN_FN_EXT;
   523     return status;
   548     return status;
   524     }
   549     }
   525 
   550 
   526 // -----------------------------------------------------------------------------
   551 // -----------------------------------------------------------------------------
   527 // CallIPAdpt::GetMaxVolume
   552 // TMSCallIPAdpt::GetMaxVolume
   528 //
   553 //
   529 // -----------------------------------------------------------------------------
   554 // -----------------------------------------------------------------------------
   530 //
   555 //
   531 gint CallIPAdpt::GetMaxVolume(guint& volume)
   556 gint TMSCallIPAdpt::GetMaxVolume(guint& volume)
   532     {
   557     {
   533     TRACE_PRN_FN_ENT;
   558     TRACE_PRN_FN_ENT;
   534     gint status(TMS_RESULT_INVALID_STATE);
   559     gint status(TMS_RESULT_INVALID_STATE);
   535 
   560 
   536     if (iDnlinkInitialized && iVoIPDownlink)
   561     if (iDnlinkInitialized && iIPDownlink)
   537         {
   562         {
   538         status = iVoIPDownlink->GetMaxVolume(volume);
   563         status = iIPDownlink->GetMaxVolume(volume);
   539         iMaxVolume = volume;
   564         iMaxVolume = volume;
   540         TRACE_PRN_N1(_L("TMS->CallIPAdpt: GetMaxVolume [%d]"), iMaxVolume);
   565         TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: GetMaxVolume [%d]"), iMaxVolume);
   541         }
   566         }
   542 
   567 
   543     TRACE_PRN_FN_EXT;
   568     TRACE_PRN_FN_EXT;
   544     return status;
   569     return status;
   545     }
   570     }
   546 
   571 
   547 // -----------------------------------------------------------------------------
   572 // -----------------------------------------------------------------------------
   548 // CallIPAdpt::SetVolume
   573 // TMSCallIPAdpt::SetVolume
   549 //
   574 //
   550 // -----------------------------------------------------------------------------
   575 // -----------------------------------------------------------------------------
   551 //
   576 //
   552 gint CallIPAdpt::SetVolume(const guint volume)
   577 gint TMSCallIPAdpt::SetVolume(const guint volume)
   553     {
   578     {
   554     TRACE_PRN_FN_ENT;
   579     TRACE_PRN_FN_ENT;
   555     gint status(TMS_RESULT_INVALID_STATE);
   580     gint status(TMS_RESULT_INVALID_STATE);
   556     if (iDnlinkInitialized && iVoIPDownlink)
   581     if (iDnlinkInitialized && iIPDownlink)
   557         {
   582         {
   558         status = iVoIPDownlink->SetVolume(volume);
   583         status = iIPDownlink->SetVolume(volume);
   559         NotifyClient(iDnlinkStreamId, ECmdSetVolume, status);
   584         NotifyClient(iDnlinkStreamId, ECmdSetVolume, status);
   560         }
   585         }
   561     TRACE_PRN_FN_EXT;
   586     TRACE_PRN_FN_EXT;
   562     return status;
   587     return status;
   563     }
   588     }
   564 
   589 
   565 // -----------------------------------------------------------------------------
   590 // -----------------------------------------------------------------------------
   566 // CallIPAdpt::GetVolume
   591 // TMSCallIPAdpt::GetVolume
   567 //
   592 //
   568 // -----------------------------------------------------------------------------
   593 // -----------------------------------------------------------------------------
   569 //
   594 //
   570 gint CallIPAdpt::GetVolume(guint& volume)
   595 gint TMSCallIPAdpt::GetVolume(guint& volume)
   571     {
   596     {
   572     TRACE_PRN_FN_ENT;
   597     TRACE_PRN_FN_ENT;
   573     gint status(TMS_RESULT_INVALID_STATE);
   598     gint status(TMS_RESULT_INVALID_STATE);
   574     if (iDnlinkInitialized && iVoIPDownlink)
   599     if (iDnlinkInitialized && iIPDownlink)
   575         {
   600         {
   576         status = iVoIPDownlink->GetVolume(volume);
   601         status = iIPDownlink->GetVolume(volume);
   577         }
   602         }
   578     TRACE_PRN_FN_EXT;
   603     TRACE_PRN_FN_EXT;
   579     return status;
   604     return status;
   580     }
   605     }
   581 
   606 
   582 // -----------------------------------------------------------------------------
   607 // -----------------------------------------------------------------------------
   583 // CallIPAdpt::GetMaxGain
   608 // TMSCallIPAdpt::GetMaxGain
   584 //
   609 //
   585 // -----------------------------------------------------------------------------
   610 // -----------------------------------------------------------------------------
   586 //
   611 //
   587 gint CallIPAdpt::GetMaxGain(guint& gain)
   612 gint TMSCallIPAdpt::GetMaxGain(guint& gain)
   588     {
   613     {
   589     TRACE_PRN_FN_ENT;
   614     TRACE_PRN_FN_ENT;
   590     gint status(TMS_RESULT_INVALID_STATE);
   615     gint status(TMS_RESULT_INVALID_STATE);
   591     if (iUplinkInitialized && iVoIPUplink)
   616     if (iUplinkInitialized && iIPUplink)
   592         {
   617         {
   593         status = iVoIPUplink->GetMaxGain(gain);
   618         status = iIPUplink->GetMaxGain(gain);
   594         iMaxGain = gain;
   619         iMaxGain = gain;
   595         TRACE_PRN_N1(_L("TMS->CallIPAdpt::GetMaxGain [%d]"), iMaxGain);
   620         TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetMaxGain [%d]"), iMaxGain);
   596         }
   621         }
   597     TRACE_PRN_FN_EXT;
   622     TRACE_PRN_FN_EXT;
   598     return status;
   623     return status;
   599     }
   624     }
   600 
   625 
   601 // -----------------------------------------------------------------------------
   626 // -----------------------------------------------------------------------------
   602 // CallIPAdpt::SetGain
   627 // TMSCallIPAdpt::SetGain
   603 //
   628 //
   604 // -----------------------------------------------------------------------------
   629 // -----------------------------------------------------------------------------
   605 //
   630 //
   606 gint CallIPAdpt::SetGain(const guint gain)
   631 gint TMSCallIPAdpt::SetGain(const guint gain)
   607     {
   632     {
   608     TRACE_PRN_FN_ENT;
   633     TRACE_PRN_FN_ENT;
   609     gint status(TMS_RESULT_INVALID_STATE);
   634     gint status(TMS_RESULT_INVALID_STATE);
   610     if (iUplinkInitialized && iVoIPUplink)
   635     if (iUplinkInitialized && iIPUplink)
   611         {
   636         {
   612         status = iVoIPUplink->SetGain(gain);
   637         status = iIPUplink->SetGain(gain);
   613         NotifyClient(iUplinkStreamId, ECmdSetGain, status);
   638         NotifyClient(iUplinkStreamId, ECmdSetGain, status);
   614         }
   639         }
   615     TRACE_PRN_FN_EXT;
   640     TRACE_PRN_FN_EXT;
   616     return status;
   641     return status;
   617     }
   642     }
   618 
   643 
   619 // -----------------------------------------------------------------------------
   644 // -----------------------------------------------------------------------------
   620 // CallIPAdpt::GetGain
   645 // TMSCallIPAdpt::GetGain
   621 //
   646 //
   622 // -----------------------------------------------------------------------------
   647 // -----------------------------------------------------------------------------
   623 //
   648 //
   624 gint CallIPAdpt::GetGain(guint& gain)
   649 gint TMSCallIPAdpt::GetGain(guint& gain)
   625     {
   650     {
   626     TRACE_PRN_FN_ENT;
   651     TRACE_PRN_FN_ENT;
   627     gint status(TMS_RESULT_INVALID_STATE);
   652     gint status(TMS_RESULT_INVALID_STATE);
   628     if (iUplinkInitialized && iVoIPUplink)
   653     if (iUplinkInitialized && iIPUplink)
   629         {
   654         {
   630         status = iVoIPUplink->GetGain(gain);
   655         status = iIPUplink->GetGain(gain);
   631         }
   656         }
   632     TRACE_PRN_FN_EXT;
   657     TRACE_PRN_FN_EXT;
   633     return status;
   658     return status;
   634     }
   659     }
   635 
   660 
   636 // -----------------------------------------------------------------------------
   661 // -----------------------------------------------------------------------------
   637 // CallIPAdpt::GetGlobalMaxVolume
   662 // TMSCallIPAdpt::GetGlobalMaxVolume
   638 //
   663 //
   639 // -----------------------------------------------------------------------------
   664 // -----------------------------------------------------------------------------
   640 //
   665 //
   641 gint CallIPAdpt::GetGlobalMaxVolume(guint& volume)
   666 gint TMSCallIPAdpt::GetGlobalMaxVolume(guint& volume)
   642     {
   667     {
   643     TRACE_PRN_FN_ENT;
   668     TRACE_PRN_FN_ENT;
   644     gint status(TMS_RESULT_INVALID_STATE);
   669     gint status(TMS_RESULT_INVALID_STATE);
   645     if (iDnlinkInitialized && iVoIPDownlink)
   670     if (iDnlinkInitialized && iIPDownlink)
   646         {
   671         {
   647         status = iVoIPDownlink->GetMaxVolume(volume);
   672         status = iIPDownlink->GetMaxVolume(volume);
   648         iMaxVolume = volume;
   673         iMaxVolume = volume;
   649         TRACE_PRN_N1(_L("TMS->CallIPAdpt: GetMaxVolume [%d]"), iMaxVolume);
   674         TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: GetMaxVolume [%d]"), iMaxVolume);
   650         }
   675         }
   651     TRACE_PRN_FN_EXT;
   676     TRACE_PRN_FN_EXT;
   652     return status;
   677     return status;
   653     }
   678     }
   654 
   679 
   655 // -----------------------------------------------------------------------------
   680 // -----------------------------------------------------------------------------
   656 // CallIPAdpt::SetGlobalVolume
   681 // TMSCallIPAdpt::SetGlobalVolume
   657 //
   682 //
   658 // -----------------------------------------------------------------------------
   683 // -----------------------------------------------------------------------------
   659 //
   684 //
   660 gint CallIPAdpt::SetGlobalVolume(const guint volume)
   685 gint TMSCallIPAdpt::SetGlobalVolume(const guint volume)
   661     {
   686     {
   662     TRACE_PRN_FN_ENT;
   687     TRACE_PRN_FN_ENT;
   663     gint status(TMS_RESULT_INVALID_STATE);
   688     gint status(TMS_RESULT_INVALID_STATE);
   664     if (iDnlinkInitialized && iVoIPDownlink)
   689     if (iDnlinkInitialized && iIPDownlink)
   665         {
   690         {
   666         status = iVoIPDownlink->SetVolume(volume);
   691         status = iIPDownlink->SetVolume(volume);
   667         }
   692         }
   668     TRACE_PRN_FN_EXT;
   693     TRACE_PRN_FN_EXT;
   669     return status;
   694     return status;
   670     }
   695     }
   671 
   696 
   672 // -----------------------------------------------------------------------------
   697 // -----------------------------------------------------------------------------
   673 // CallIPAdpt::GetGlobalVolume
   698 // TMSCallIPAdpt::GetGlobalVolume
   674 //
   699 //
   675 // -----------------------------------------------------------------------------
   700 // -----------------------------------------------------------------------------
   676 //
   701 //
   677 gint CallIPAdpt::GetGlobalVolume(guint& volume)
   702 gint TMSCallIPAdpt::GetGlobalVolume(guint& volume)
   678     {
   703     {
   679     TRACE_PRN_FN_ENT;
   704     TRACE_PRN_FN_ENT;
   680     gint status(TMS_RESULT_INVALID_STATE);
   705     gint status(TMS_RESULT_INVALID_STATE);
   681     if (iDnlinkInitialized && iVoIPDownlink)
   706     if (iDnlinkInitialized && iIPDownlink)
   682         {
   707         {
   683         status = iVoIPDownlink->GetVolume(volume);
   708         status = iIPDownlink->GetVolume(volume);
   684         }
   709         }
   685     TRACE_PRN_FN_EXT;
   710     TRACE_PRN_FN_EXT;
   686     return status;
   711     return status;
   687     }
   712     }
   688 
   713 
   689 // -----------------------------------------------------------------------------
   714 // -----------------------------------------------------------------------------
   690 // CallIPAdpt::GetGlobalMaxGain
   715 // TMSCallIPAdpt::GetGlobalMaxGain
   691 //
   716 //
   692 // -----------------------------------------------------------------------------
   717 // -----------------------------------------------------------------------------
   693 //
   718 //
   694 gint CallIPAdpt::GetGlobalMaxGain(guint& gain)
   719 gint TMSCallIPAdpt::GetGlobalMaxGain(guint& gain)
   695     {
   720     {
   696     TRACE_PRN_FN_ENT;
   721     TRACE_PRN_FN_ENT;
   697     gint status(TMS_RESULT_INVALID_STATE);
   722     gint status(TMS_RESULT_INVALID_STATE);
   698     if (iUplinkInitialized && iVoIPUplink)
   723     if (iUplinkInitialized && iIPUplink)
   699         {
   724         {
   700         status = iVoIPUplink->GetMaxGain(gain);
   725         status = iIPUplink->GetMaxGain(gain);
   701         iMaxGain = gain;
   726         iMaxGain = gain;
   702         TRACE_PRN_N1(_L("TMS->CallIPAdpt::GetMaxGain [%d]"), iMaxGain);
   727         TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt::GetMaxGain [%d]"), iMaxGain);
   703         }
   728         }
   704     TRACE_PRN_FN_EXT;
   729     TRACE_PRN_FN_EXT;
   705     return status;
   730     return status;
   706     }
   731     }
   707 
   732 
   708 // -----------------------------------------------------------------------------
   733 // -----------------------------------------------------------------------------
   709 // CallIPAdpt::SetGlobalGain
   734 // TMSCallIPAdpt::SetGlobalGain
   710 //
   735 //
   711 // -----------------------------------------------------------------------------
   736 // -----------------------------------------------------------------------------
   712 //
   737 //
   713 gint CallIPAdpt::SetGlobalGain(const guint gain)
   738 gint TMSCallIPAdpt::SetGlobalGain(const guint gain)
   714     {
   739     {
   715     TRACE_PRN_FN_ENT;
   740     TRACE_PRN_FN_ENT;
   716     gint status(TMS_RESULT_INVALID_STATE);
   741     gint status(TMS_RESULT_INVALID_STATE);
   717     if (iUplinkInitialized && iVoIPUplink)
   742     if (iUplinkInitialized && iIPUplink)
   718         {
   743         {
   719         status = iVoIPUplink->SetGain(gain);
   744         status = iIPUplink->SetGain(gain);
   720         }
   745         }
   721     TRACE_PRN_FN_EXT;
   746     TRACE_PRN_FN_EXT;
   722     return status;
   747     return status;
   723     }
   748     }
   724 
   749 
   725 // -----------------------------------------------------------------------------
   750 // -----------------------------------------------------------------------------
   726 // CallIPAdpt::GetGlobalGain
   751 // TMSCallIPAdpt::GetGlobalGain
   727 //
   752 //
   728 // -----------------------------------------------------------------------------
   753 // -----------------------------------------------------------------------------
   729 //
   754 //
   730 gint CallIPAdpt::GetGlobalGain(guint& gain)
   755 gint TMSCallIPAdpt::GetGlobalGain(guint& gain)
   731     {
   756     {
   732     TRACE_PRN_FN_ENT;
   757     TRACE_PRN_FN_ENT;
   733     gint status(TMS_RESULT_INVALID_STATE);
   758     gint status(TMS_RESULT_INVALID_STATE);
   734     if (iUplinkInitialized && iVoIPUplink)
   759     if (iUplinkInitialized && iIPUplink)
   735         {
   760         {
   736         status = iVoIPUplink->GetGain(gain);
   761         status = iIPUplink->GetGain(gain);
   737         }
   762         }
   738     TRACE_PRN_FN_EXT;
   763     TRACE_PRN_FN_EXT;
   739     return status;
   764     return status;
   740     }
   765     }
   741 
   766 
   742 // -----------------------------------------------------------------------------
   767 // -----------------------------------------------------------------------------
   743 // CallIPAdpt::GetCodecMode
   768 // TMSCallIPAdpt::GetCodecMode
   744 //
   769 //
   745 // -----------------------------------------------------------------------------
   770 // -----------------------------------------------------------------------------
   746 //
   771 //
   747 gint CallIPAdpt::GetCodecMode(const TMSFormatType fmttype,
   772 gint TMSCallIPAdpt::GetCodecMode(const TMSFormatType fmttype,
   748         const TMSStreamType strmtype, gint& mode)
   773         const TMSStreamType strmtype, gint& mode)
   749     {
   774     {
   750     TRACE_PRN_FN_ENT;
   775     TRACE_PRN_FN_ENT;
   751     gint status(TMS_RESULT_SUCCESS);
   776     gint status(TMS_RESULT_SUCCESS);
   752     switch (fmttype)
   777     switch (fmttype)
   764     TRACE_PRN_FN_EXT;
   789     TRACE_PRN_FN_EXT;
   765     return status;
   790     return status;
   766     }
   791     }
   767 
   792 
   768 // -----------------------------------------------------------------------------
   793 // -----------------------------------------------------------------------------
   769 // CallIPAdpt::SetCodecMode
   794 // TMSCallIPAdpt::SetCodecMode
   770 //
   795 //
   771 // -----------------------------------------------------------------------------
   796 // -----------------------------------------------------------------------------
   772 //
   797 //
   773 gint CallIPAdpt::SetCodecMode(const TMSFormatType fmttype,
   798 gint TMSCallIPAdpt::SetCodecMode(const TMSFormatType fmttype,
   774         const TMSStreamType strmtype, const gint mode)
   799         const TMSStreamType strmtype, const gint mode)
   775     {
   800     {
   776     TRACE_PRN_FN_ENT;
   801     TRACE_PRN_FN_ENT;
   777     gint status(TMS_RESULT_SUCCESS);
   802     gint status(TMS_RESULT_SUCCESS);
   778     switch (fmttype)
   803     switch (fmttype)
   790     TRACE_PRN_FN_EXT;
   815     TRACE_PRN_FN_EXT;
   791     return status;
   816     return status;
   792     }
   817     }
   793 
   818 
   794 // -----------------------------------------------------------------------------
   819 // -----------------------------------------------------------------------------
   795 // CallIPAdpt::GetSupportedBitRatesCount
   820 // TMSCallIPAdpt::GetSupportedBitRatesCount
   796 //
   821 //
   797 // -----------------------------------------------------------------------------
   822 // -----------------------------------------------------------------------------
   798 //
   823 //
   799 gint CallIPAdpt::GetSupportedBitRatesCount(guint& count)
   824 gint TMSCallIPAdpt::GetSupportedBitRatesCount(guint& count)
   800     {
   825     {
   801     TRACE_PRN_FN_ENT;
   826     TRACE_PRN_FN_ENT;
   802     gint status(TMS_RESULT_INVALID_STATE);
   827     gint status(TMS_RESULT_INVALID_STATE);
   803     if (iVoIPUplink)
   828     if (iIPUplink)
   804         {
   829         {
   805         status = iVoIPUplink->GetSupportedBitrates(iArrBitrates);
   830         status = iIPUplink->GetSupportedBitrates(iArrBitrates);
   806         count = iArrBitrates.Count();
   831         count = iArrBitrates.Count();
   807         }
   832         }
   808     TRACE_PRN_FN_EXT;
   833     TRACE_PRN_FN_EXT;
   809     return status;
   834     return status;
   810     }
   835     }
   811 
   836 
   812 // -----------------------------------------------------------------------------
   837 // -----------------------------------------------------------------------------
   813 // CallIPAdpt::GetSupportedBitRates
   838 // TMSCallIPAdpt::GetSupportedBitRates
   814 //
   839 //
   815 // Bitrates are already returned from the codec as a result of call to
   840 // Bitrates are already returned from the codec as a result of call to
   816 // GetSupportedBitratesCount(). Just pack them into a descriptor and return
   841 // GetSupportedBitratesCount(). Just pack them into a descriptor and return
   817 // back to the client.
   842 // back to the client.
   818 // -----------------------------------------------------------------------------
   843 // -----------------------------------------------------------------------------
   819 //
   844 //
   820 gint CallIPAdpt::GetSupportedBitRates(CBufFlat*& brbuffer)
   845 gint TMSCallIPAdpt::GetSupportedBitRates(CBufFlat*& brbuffer)
   821     {
   846     {
   822     TRAPD(status, GetSupportedBitRatesL(brbuffer));
   847     TRAPD(status, GetSupportedBitRatesL(brbuffer));
   823     return status;
   848     return status;
   824     }
   849     }
   825 
   850 
   826 // -----------------------------------------------------------------------------
   851 // -----------------------------------------------------------------------------
   827 // CallIPAdpt::GetSupportedBitRatesL
   852 // TMSCallIPAdpt::GetSupportedBitRatesL
   828 //
   853 //
   829 // GetSupportedBitRates implementation which can leave.
   854 // GetSupportedBitRates implementation which can leave.
   830 // -----------------------------------------------------------------------------
   855 // -----------------------------------------------------------------------------
   831 //
   856 //
   832 void CallIPAdpt::GetSupportedBitRatesL(CBufFlat*& brbuffer)
   857 void TMSCallIPAdpt::GetSupportedBitRatesL(CBufFlat*& brbuffer)
   833     {
   858     {
   834     TRACE_PRN_FN_ENT;
   859     TRACE_PRN_FN_ENT;
   835     RBufWriteStream stream;
   860     RBufWriteStream stream;
   836     stream.Open(*brbuffer);
   861     stream.Open(*brbuffer);
   837     CleanupClosePushL(stream);
   862     CleanupClosePushL(stream);
   838     guint numOfItems = iArrBitrates.Count();
   863     guint numOfItems = iArrBitrates.Count();
   839 
   864 
   840     for (guint i = 0; i < numOfItems; i++)
   865     for (guint i = 0; i < numOfItems; i++)
   841         {
   866         {
   842         stream.WriteUint32L(iArrBitrates[i]);
   867         stream.WriteUint32L(iArrBitrates[i]);
   843         //TRACE_PRN_N1(_L("TMS->CallIPAdpt: BR: [%d]"), iArrBitrates[i]);
   868         //TRACE_PRN_N1(_L("TMS->TMSCallIPAdpt: BR: [%d]"), iArrBitrates[i]);
   844         }
   869         }
   845 
   870 
   846     CleanupStack::PopAndDestroy(&stream);
   871     CleanupStack::PopAndDestroy(&stream);
   847     TRACE_PRN_FN_EXT;
   872     TRACE_PRN_FN_EXT;
   848     }
   873     }
   849 
   874 
   850 // -----------------------------------------------------------------------------
   875 // -----------------------------------------------------------------------------
   851 // CallIPAdpt::GetBitRate
   876 // TMSCallIPAdpt::GetBitRate
   852 //
   877 //
   853 // -----------------------------------------------------------------------------
   878 // -----------------------------------------------------------------------------
   854 //
   879 //
   855 gint CallIPAdpt::GetBitRate(guint& bitrate)
   880 gint TMSCallIPAdpt::GetBitRate(guint& bitrate)
   856     {
   881     {
   857     TRACE_PRN_FN_ENT;
   882     TRACE_PRN_FN_ENT;
   858     gint status(TMS_RESULT_INVALID_STATE);
   883     gint status(TMS_RESULT_INVALID_STATE);
   859     if (iVoIPUplink)
   884     if (iIPUplink)
   860         {
   885         {
   861         status = iVoIPUplink->GetBitrate(bitrate);
   886         status = iIPUplink->GetBitrate(bitrate);
   862         }
   887         }
   863     TRACE_PRN_FN_EXT;
   888     TRACE_PRN_FN_EXT;
   864     return status;
   889     return status;
   865     }
   890     }
   866 
   891 
   867 // -----------------------------------------------------------------------------
   892 // -----------------------------------------------------------------------------
   868 // CallIPAdpt::SetBitRate
   893 // TMSCallIPAdpt::SetBitRate
   869 //
   894 //
   870 // -----------------------------------------------------------------------------
   895 // -----------------------------------------------------------------------------
   871 //
   896 //
   872 gint CallIPAdpt::SetBitRate(const guint bitrate)
   897 gint TMSCallIPAdpt::SetBitRate(const guint bitrate)
   873     {
   898     {
   874     TRACE_PRN_FN_ENT;
   899     TRACE_PRN_FN_ENT;
   875     gint status(TMS_RESULT_INVALID_STATE);
   900     gint status(TMS_RESULT_INVALID_STATE);
   876     if (iVoIPUplink)
   901     if (iIPUplink)
   877         {
   902         {
   878         status = iVoIPUplink->SetBitrate(bitrate);
   903         status = iIPUplink->SetBitrate(bitrate);
   879         }
   904         }
   880     TRACE_PRN_FN_EXT;
   905     TRACE_PRN_FN_EXT;
   881     return status;
   906     return status;
   882     }
   907     }
   883 
   908 
   884 // -----------------------------------------------------------------------------
   909 // -----------------------------------------------------------------------------
   885 // CallIPAdpt::GetVAD
   910 // TMSCallIPAdpt::GetVAD
   886 //
   911 //
   887 // -----------------------------------------------------------------------------
   912 // -----------------------------------------------------------------------------
   888 //
   913 //
   889 gint CallIPAdpt::GetVAD(const TMSFormatType fmttype, gboolean& vad)
   914 gint TMSCallIPAdpt::GetVAD(const TMSFormatType fmttype, gboolean& vad)
   890     {
   915     {
   891     TRACE_PRN_FN_ENT;
   916     TRACE_PRN_FN_ENT;
   892     gint status(TMS_RESULT_INVALID_STATE);
   917     gint status(TMS_RESULT_INVALID_STATE);
   893     if (iVoIPUplink)
   918     if (iIPUplink)
   894         {
   919         {
   895         status = iVoIPUplink->GetVad(fmttype, vad);
   920         status = iIPUplink->GetVad(fmttype, vad);
   896         }
   921         }
   897     TRACE_PRN_FN_EXT;
   922     TRACE_PRN_FN_EXT;
   898     return status;
   923     return status;
   899     }
   924     }
   900 
   925 
   901 // -----------------------------------------------------------------------------
   926 // -----------------------------------------------------------------------------
   902 // CallIPAdpt::SetVAD
   927 // TMSCallIPAdpt::SetVAD
   903 //
   928 //
   904 // -----------------------------------------------------------------------------
   929 // -----------------------------------------------------------------------------
   905 //
   930 //
   906 gint CallIPAdpt::SetVAD(const TMSFormatType fmttype, const gboolean vad)
   931 gint TMSCallIPAdpt::SetVAD(const TMSFormatType fmttype, const gboolean vad)
   907     {
   932     {
   908     TRACE_PRN_FN_ENT;
   933     TRACE_PRN_FN_ENT;
   909     gint status(TMS_RESULT_INVALID_STATE);
   934     gint status(TMS_RESULT_INVALID_STATE);
   910     if (iVoIPUplink)
   935     if (iIPUplink)
   911         {
   936         {
   912         status = iVoIPUplink->SetVad(fmttype, vad);
   937         status = iIPUplink->SetVad(fmttype, vad);
   913         }
   938         }
   914     TRACE_PRN_FN_EXT;
   939     TRACE_PRN_FN_EXT;
   915     return status;
   940     return status;
   916     }
   941     }
   917 
   942 
   918 // -----------------------------------------------------------------------------
   943 // -----------------------------------------------------------------------------
   919 // CallIPAdpt::GetCNG
   944 // TMSCallIPAdpt::GetCNG
   920 //
   945 //
   921 // -----------------------------------------------------------------------------
   946 // -----------------------------------------------------------------------------
   922 //
   947 //
   923 gint CallIPAdpt::GetCNG(const TMSFormatType fmttype, gboolean& cng)
   948 gint TMSCallIPAdpt::GetCNG(const TMSFormatType fmttype, gboolean& cng)
   924     {
   949     {
   925     TRACE_PRN_FN_ENT;
   950     TRACE_PRN_FN_ENT;
   926     gint status(TMS_RESULT_INVALID_STATE);
   951     gint status(TMS_RESULT_INVALID_STATE);
   927     if (iVoIPDownlink)
   952     if (iIPDownlink)
   928         {
   953         {
   929         status = iVoIPDownlink->GetCng(fmttype, cng);
   954         status = iIPDownlink->GetCng(fmttype, cng);
   930         }
   955         }
   931     TRACE_PRN_FN_EXT;
   956     TRACE_PRN_FN_EXT;
   932     return status;
   957     return status;
   933     }
   958     }
   934 
   959 
   935 // -----------------------------------------------------------------------------
   960 // -----------------------------------------------------------------------------
   936 // CallIPAdpt::SetCNG
   961 // TMSCallIPAdpt::SetCNG
   937 //
   962 //
   938 // -----------------------------------------------------------------------------
   963 // -----------------------------------------------------------------------------
   939 //
   964 //
   940 gint CallIPAdpt::SetCNG(const TMSFormatType fmttype, const gboolean cng)
   965 gint TMSCallIPAdpt::SetCNG(const TMSFormatType fmttype, const gboolean cng)
   941     {
   966     {
   942     TRACE_PRN_FN_ENT;
   967     TRACE_PRN_FN_ENT;
   943     gint status(TMS_RESULT_INVALID_STATE);
   968     gint status(TMS_RESULT_INVALID_STATE);
   944     if (iVoIPDownlink)
   969     if (iIPDownlink)
   945         {
   970         {
   946         status = iVoIPDownlink->SetCng(fmttype, cng);
   971         status = iIPDownlink->SetCng(fmttype, cng);
   947         }
   972         }
   948     TRACE_PRN_FN_EXT;
   973     TRACE_PRN_FN_EXT;
   949     return status;
   974     return status;
   950     }
   975     }
   951 
   976 
   952 // -----------------------------------------------------------------------------
   977 // -----------------------------------------------------------------------------
   953 // CallIPAdpt::GetPlc
   978 // TMSCallIPAdpt::GetPlc
   954 //
   979 //
   955 // -----------------------------------------------------------------------------
   980 // -----------------------------------------------------------------------------
   956 //
   981 //
   957 gint CallIPAdpt::GetPlc(const TMSFormatType fmttype, gboolean& plc)
   982 gint TMSCallIPAdpt::GetPlc(const TMSFormatType fmttype, gboolean& plc)
   958     {
   983     {
   959     TRACE_PRN_FN_ENT;
   984     TRACE_PRN_FN_ENT;
   960     gint status(TMS_RESULT_INVALID_STATE);
   985     gint status(TMS_RESULT_INVALID_STATE);
   961     if (iVoIPDownlink)
   986     if (iIPDownlink)
   962         {
   987         {
   963         status = iVoIPDownlink->GetPlc(fmttype, plc);
   988         status = iIPDownlink->GetPlc(fmttype, plc);
   964         }
   989         }
   965     TRACE_PRN_FN_EXT;
   990     TRACE_PRN_FN_EXT;
   966     return status;
   991     return status;
   967     }
   992     }
   968 
   993 
   969 // -----------------------------------------------------------------------------
   994 // -----------------------------------------------------------------------------
   970 // CallIPAdpt::SetPlc
   995 // TMSCallIPAdpt::SetPlc
   971 //
   996 //
   972 // -----------------------------------------------------------------------------
   997 // -----------------------------------------------------------------------------
   973 //
   998 //
   974 gint CallIPAdpt::SetPlc(const TMSFormatType fmttype, const gboolean plc)
   999 gint TMSCallIPAdpt::SetPlc(const TMSFormatType fmttype, const gboolean plc)
   975     {
  1000     {
   976     TRACE_PRN_FN_ENT;
  1001     TRACE_PRN_FN_ENT;
   977     gint status(TMS_RESULT_INVALID_STATE);
  1002     gint status(TMS_RESULT_INVALID_STATE);
   978     if (iVoIPDownlink)
  1003     if (iIPDownlink)
   979         {
  1004         {
   980         status = iVoIPDownlink->SetPlc(fmttype, plc);
  1005         status = iIPDownlink->SetPlc(fmttype, plc);
   981         }
  1006         }
   982     TRACE_PRN_FN_EXT;
  1007     TRACE_PRN_FN_EXT;
   983     return status;
  1008     return status;
   984     }
  1009     }
   985 
  1010 
   986 // -----------------------------------------------------------------------------
  1011 // -----------------------------------------------------------------------------
   987 // CallIPAdpt::OpenDownlinkL
  1012 // TMSCallIPAdpt::OpenDownlinkL
   988 // Method for player initialization.
  1013 // Method for player initialization.
   989 // -----------------------------------------------------------------------------
  1014 // -----------------------------------------------------------------------------
   990 //
  1015 //
   991 gint CallIPAdpt::OpenDownlinkL(const RMessage2& aMessage)
  1016 gint TMSCallIPAdpt::OpenDownlinkL(const RMessage2& aMessage)
   992     {
  1017     {
   993     TRACE_PRN_FN_ENT;
  1018     TRACE_PRN_FN_ENT;
   994     gint status(TMS_RESULT_SUCCESS);
  1019     gint status(TMS_RESULT_SUCCESS);
   995 
  1020 
   996     // Ensure clients have MultimediaDD capability to use this priority/pref
  1021     // Clients must have MultimediaDD capability to use this priority/pref.
   997     // TODO: TMS must monitor for emergency call now
  1022     // TODO: Also, TMS will monitor for emergency call and if detected it
   998     iPriority.iPref = TMdaPriorityPreference(KAudioPrefVoipAudioDownlink);
  1023     //       will deny access to audio resources.
   999     iPriority.iPriority = TMdaPriority(KAudioPriorityVoipAudioDownlink);
  1024     iPriority.iPref = KAudioPrefVoipAudioDownlink;
  1000 
  1025     iPriority.iPriority = KAudioPriorityVoipAudioDownlink;
  1001     if (!iVoIPDownlink)
  1026 
  1002         {
  1027     if (!iIPDownlink)
  1003         iVoIPDownlink = TMSVoIPDownlink::NewL(iDnFourCC, iPriority);
  1028         {
  1004         }
  1029         iIPDownlink = TMSIPDownlink::NewL(iDnFourCC, iPriority);
  1005 
  1030         }
  1006     if (iVoIPDownlink)
  1031 
       
  1032     if (iIPDownlink)
  1007         {
  1033         {
  1008         // Open message queue for handling server notifications to the client
  1034         // Open message queue for handling server notifications to the client
  1009         if (iMsgQueueDn.Handle() <= 0)
  1035         if (iMsgQueueDn.Handle() <= 0)
  1010             {
  1036             {
  1011             // Second argument in TMSCallProxy::InitStream
  1037             // Second argument in TMSCallProxy::InitStream
  1013             }
  1039             }
  1014 
  1040 
  1015         if (status == TMS_RESULT_SUCCESS)
  1041         if (status == TMS_RESULT_SUCCESS)
  1016             {
  1042             {
  1017             // For transfer data buffer processing
  1043             // For transfer data buffer processing
  1018             iVoIPDownlink->SetMsgQueue(iMsgQueueDn);
  1044             iIPDownlink->SetMsgQueue(iMsgQueueDn);
  1019             }
  1045             }
  1020         }
  1046         }
  1021 
  1047 
  1022     TRACE_PRN_IF_ERR(status);
  1048     TRACE_PRN_IF_ERR(status);
  1023     TRACE_PRN_FN_EXT;
  1049     TRACE_PRN_FN_EXT;
  1024     return status;
  1050     return status;
  1025     }
  1051     }
  1026 
  1052 
  1027 // -----------------------------------------------------------------------------
  1053 // -----------------------------------------------------------------------------
  1028 // CallIPAdpt::OpenUplinkL
  1054 // TMSCallIPAdpt::OpenUplinkL
  1029 // Method for recorder initialization.
  1055 // Method for recorder initialization.
  1030 // -----------------------------------------------------------------------------
  1056 // -----------------------------------------------------------------------------
  1031 //
  1057 //
  1032 gint CallIPAdpt::OpenUplinkL(const RMessage2& aMessage)
  1058 gint TMSCallIPAdpt::OpenUplinkL(const RMessage2& aMessage)
  1033     {
  1059     {
  1034     TRACE_PRN_FN_ENT;
  1060     TRACE_PRN_FN_ENT;
  1035     gint status(TMS_RESULT_SUCCESS);
  1061     gint status(TMS_RESULT_SUCCESS);
  1036 
  1062 
  1037     // Ensure clients have MultimediaDD capability to use this priority/pref
  1063     // Ensure clients have MultimediaDD capability to use this priority/pref
  1038     iPriority.iPref = TMdaPriorityPreference(KAudioPrefVoipAudioUplink);
  1064     iPriority.iPref = KAudioPrefVoipAudioUplink;
  1039     iPriority.iPriority = TMdaPriority(KAudioPriorityVoipAudioUplink);
  1065     iPriority.iPriority = KAudioPriorityVoipAudioUplink;
  1040 
  1066 
  1041     if (!iVoIPUplink)
  1067     if (!iIPUplink)
  1042         {
  1068         {
  1043         iVoIPUplink = TMSVoIPUplink::NewL(iUpFourCC, iPriority);
  1069         iIPUplink = TMSIPUplink::NewL(iUpFourCC, iPriority);
  1044         }
  1070         }
  1045 
  1071 
  1046     if (iVoIPUplink)
  1072     if (iIPUplink)
  1047         {
  1073         {
  1048         // Open message queue for handling server notifications to the client
  1074         // Open message queue for handling server notifications to the client
  1049         if (iMsgQueueUp.Handle() <= 0)
  1075         if (iMsgQueueUp.Handle() <= 0)
  1050             {
  1076             {
  1051             // Second argument in TMSCallProxy::InitStream
  1077             // Second argument in TMSCallProxy::InitStream
  1053             }
  1079             }
  1054 
  1080 
  1055         if (status == TMS_RESULT_SUCCESS)
  1081         if (status == TMS_RESULT_SUCCESS)
  1056             {
  1082             {
  1057             // For transfer data buffer processing
  1083             // For transfer data buffer processing
  1058             iVoIPUplink->SetMsgQueue(iMsgQueueUp);
  1084             iIPUplink->SetMsgQueue(iMsgQueueUp);
  1059             }
  1085             }
  1060         }
  1086         }
  1061 
  1087 
  1062     TRACE_PRN_IF_ERR(status);
  1088     TRACE_PRN_IF_ERR(status);
  1063     TRACE_PRN_FN_EXT;
  1089     TRACE_PRN_FN_EXT;
  1064     return status;
  1090     return status;
  1065     }
  1091     }
  1066 
  1092 
  1067 // -----------------------------------------------------------------------------
  1093 // -----------------------------------------------------------------------------
  1068 // CallIPAdpt::SetFormat
  1094 // TMSCallIPAdpt::SetFormat
  1069 //
  1095 //
  1070 // -----------------------------------------------------------------------------
  1096 // -----------------------------------------------------------------------------
  1071 //
  1097 //
  1072 void CallIPAdpt::SetFormat(const gint strmId, const TUint32 aFormat)
  1098 void TMSCallIPAdpt::SetFormat(const gint strmId, const TUint32 aFormat)
  1073     {
  1099     {
  1074     if (strmId == iUplinkStreamId)
  1100     if (strmId == iUplinkStreamId)
  1075         {
  1101         {
  1076         iUpFourCC = aFormat;
  1102         iUpFourCC = aFormat;
  1077         }
  1103         }
  1080         iDnFourCC = aFormat;
  1106         iDnFourCC = aFormat;
  1081         }
  1107         }
  1082     }
  1108     }
  1083 
  1109 
  1084 // -----------------------------------------------------------------------------
  1110 // -----------------------------------------------------------------------------
  1085 // CallIPAdpt::BufferFilled
  1111 // TMSCallIPAdpt::BufferFilled
  1086 //
  1112 //
  1087 // -----------------------------------------------------------------------------
  1113 // -----------------------------------------------------------------------------
  1088 //
  1114 //
  1089 void CallIPAdpt::BufferFilledL(TUint dataSize)
  1115 void TMSCallIPAdpt::BufferFilledL(TUint dataSize)
  1090     {
  1116     {
  1091     if (iVoIPDownlink)
  1117     if (iIPDownlink)
  1092         {
  1118         {
  1093         iVoIPDownlink->BufferFilled(dataSize);
  1119         iIPDownlink->BufferFilled(dataSize);
  1094         }
  1120         }
  1095     }
  1121     }
  1096 
  1122 
  1097 // -----------------------------------------------------------------------------
  1123 // -----------------------------------------------------------------------------
  1098 // CallIPAdpt::BufferEmptied
  1124 // TMSCallIPAdpt::BufferEmptied
  1099 //
  1125 //
  1100 // -----------------------------------------------------------------------------
  1126 // -----------------------------------------------------------------------------
  1101 //
  1127 //
  1102 void CallIPAdpt::BufferEmptiedL()
  1128 void TMSCallIPAdpt::BufferEmptiedL()
  1103     {
  1129     {
  1104     if (iVoIPUplink)
  1130     if (iIPUplink)
  1105         {
  1131         {
  1106         iVoIPUplink->BufferEmptied();
  1132         iIPUplink->BufferEmptied();
  1107         }
  1133         }
  1108     }
  1134     }
  1109 
  1135 
  1110 // ----------------------------------------------------------------------------
  1136 // -----------------------------------------------------------------------------
  1111 // CallIPAdpt::GetDataXferChunkHndl
  1137 // TMSCallIPAdpt::GetDataXferChunkHndl
  1112 //
  1138 //
  1113 // ----------------------------------------------------------------------------
  1139 // -----------------------------------------------------------------------------
  1114 //
  1140 //
  1115 gint CallIPAdpt::GetDataXferChunkHndl(const TMSStreamType strmType,
  1141 gint TMSCallIPAdpt::GetDataXferChunkHndl(const TMSStreamType strmType,
  1116         const TUint32 key, RChunk& chunk)
  1142         const TUint32 key, RChunk& chunk)
  1117     {
  1143     {
  1118     TRACE_PRN_FN_ENT;
  1144     TRACE_PRN_FN_ENT;
  1119 
  1145 
  1120     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1146     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1121     switch (strmType)
  1147     switch (strmType)
  1122         {
  1148         {
  1123         case TMS_STREAM_DOWNLINK:
  1149         case TMS_STREAM_DOWNLINK:
  1124             {
  1150             {
  1125             if (iVoIPDownlink)
  1151             if (iIPDownlink)
  1126                 {
  1152                 {
  1127                 status = iVoIPDownlink->GetDataXferChunkHndl(key, chunk);
  1153                 status = iIPDownlink->GetDataXferChunkHndl(key, chunk);
  1128                 }
  1154                 }
  1129             break;
  1155             break;
  1130             }
  1156             }
  1131         case TMS_STREAM_UPLINK:
  1157         case TMS_STREAM_UPLINK:
  1132             {
  1158             {
  1133             if (iVoIPUplink)
  1159             if (iIPUplink)
  1134                 {
  1160                 {
  1135                 status = iVoIPUplink->GetDataXferChunkHndl(key, chunk);
  1161                 status = iIPUplink->GetDataXferChunkHndl(key, chunk);
  1136                 }
  1162                 }
  1137             break;
  1163             break;
  1138             }
  1164             }
  1139         default:
  1165         default:
  1140             status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED;
  1166             status = TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED;
  1144     TRACE_PRN_FN_EXT;
  1170     TRACE_PRN_FN_EXT;
  1145     return status;
  1171     return status;
  1146     }
  1172     }
  1147 
  1173 
  1148 // -----------------------------------------------------------------------------
  1174 // -----------------------------------------------------------------------------
  1149 // CallIPAdpt::SetIlbcCodecMode
  1175 // TMSCallIPAdpt::SetIlbcCodecMode
  1150 //
  1176 //
  1151 // -----------------------------------------------------------------------------
  1177 // -----------------------------------------------------------------------------
  1152 //
  1178 //
  1153 gint CallIPAdpt::SetIlbcCodecMode(const gint mode, const TMSStreamType strmtype)
  1179 gint TMSCallIPAdpt::SetIlbcCodecMode(const gint mode,
       
  1180         const TMSStreamType strmtype)
  1154     {
  1181     {
  1155     gint status(TMS_RESULT_INVALID_ARGUMENT);
  1182     gint status(TMS_RESULT_INVALID_ARGUMENT);
  1156 
  1183 
  1157     if (strmtype == TMS_STREAM_DOWNLINK)
  1184     if (strmtype == TMS_STREAM_DOWNLINK)
  1158         {
  1185         {
  1159         if (iDnlinkInitialized && iVoIPDownlink)
  1186         if (iDnlinkInitialized && iIPDownlink)
  1160             {
  1187             {
  1161             status = iVoIPDownlink->SetIlbcCodecMode(mode);
  1188             status = iIPDownlink->SetIlbcCodecMode(mode);
  1162             }
  1189             }
  1163         }
  1190         }
  1164     else if (strmtype == TMS_STREAM_UPLINK)
  1191     else if (strmtype == TMS_STREAM_UPLINK)
  1165         {
  1192         {
  1166         if (iUplinkInitialized && iVoIPUplink)
  1193         if (iUplinkInitialized && iIPUplink)
  1167             {
  1194             {
  1168             status = iVoIPUplink->SetIlbcCodecMode(mode);
  1195             status = iIPUplink->SetIlbcCodecMode(mode);
  1169             }
  1196             }
  1170         }
  1197         }
  1171 
  1198 
  1172     return status;
  1199     return status;
  1173     }
  1200     }
  1174 
  1201 
  1175 // -----------------------------------------------------------------------------
  1202 // -----------------------------------------------------------------------------
  1176 // CallIPAdpt::GetIlbcCodecMode
  1203 // TMSCallIPAdpt::GetIlbcCodecMode
  1177 //
  1204 //
  1178 // -----------------------------------------------------------------------------
  1205 // -----------------------------------------------------------------------------
  1179 //
  1206 //
  1180 gint CallIPAdpt::GetIlbcCodecMode(gint& mode, const TMSStreamType strmtype)
  1207 gint TMSCallIPAdpt::GetIlbcCodecMode(gint& mode, const TMSStreamType strmtype)
  1181     {
  1208     {
  1182     gint status(TMS_RESULT_INVALID_ARGUMENT);
  1209     gint status(TMS_RESULT_INVALID_ARGUMENT);
  1183 
  1210 
  1184     if (strmtype == TMS_STREAM_DOWNLINK)
  1211     if (strmtype == TMS_STREAM_DOWNLINK)
  1185         {
  1212         {
  1186         if (iDnlinkInitialized && iVoIPDownlink)
  1213         if (iDnlinkInitialized && iIPDownlink)
  1187             {
  1214             {
  1188             status = iVoIPDownlink->GetIlbcCodecMode(mode);
  1215             status = iIPDownlink->GetIlbcCodecMode(mode);
  1189             }
  1216             }
  1190         }
  1217         }
  1191     else if (strmtype == TMS_STREAM_UPLINK)
  1218     else if (strmtype == TMS_STREAM_UPLINK)
  1192         {
  1219         {
  1193         if (iUplinkInitialized && iVoIPUplink)
  1220         if (iUplinkInitialized && iIPUplink)
  1194             {
  1221             {
  1195             status = iVoIPUplink->GetIlbcCodecMode(mode);
  1222             status = iIPUplink->GetIlbcCodecMode(mode);
  1196             }
  1223             }
  1197         }
  1224         }
  1198 
  1225 
  1199     return status;
  1226     return status;
  1200     }
  1227     }
  1201 
  1228 
  1202 // -----------------------------------------------------------------------------
  1229 // -----------------------------------------------------------------------------
  1203 // CallIPAdpt::SetG711CodecMode
  1230 // TMSCallIPAdpt::SetG711CodecMode
  1204 //
  1231 //
  1205 // -----------------------------------------------------------------------------
  1232 // -----------------------------------------------------------------------------
  1206 //
  1233 //
  1207 gint CallIPAdpt::SetG711CodecMode(const gint mode, const TMSStreamType strmtype)
  1234 gint TMSCallIPAdpt::SetG711CodecMode(const gint mode,
       
  1235         const TMSStreamType strmtype)
  1208     {
  1236     {
  1209     gint status(TMS_RESULT_INVALID_ARGUMENT);
  1237     gint status(TMS_RESULT_INVALID_ARGUMENT);
  1210 
  1238 
  1211     if (strmtype == TMS_STREAM_DOWNLINK)
  1239     if (strmtype == TMS_STREAM_DOWNLINK)
  1212         {
  1240         {
  1213         if (iDnlinkInitialized && iVoIPDownlink)
  1241         if (iDnlinkInitialized && iIPDownlink)
  1214             {
  1242             {
  1215             status = iVoIPDownlink->SetG711CodecMode(mode);
  1243             status = iIPDownlink->SetG711CodecMode(mode);
  1216             }
  1244             }
  1217         }
  1245         }
  1218     else if (strmtype == TMS_STREAM_UPLINK)
  1246     else if (strmtype == TMS_STREAM_UPLINK)
  1219         {
  1247         {
  1220         if (iUplinkInitialized && iVoIPUplink)
  1248         if (iUplinkInitialized && iIPUplink)
  1221             {
  1249             {
  1222             status = iVoIPUplink->SetG711CodecMode(mode);
  1250             status = iIPUplink->SetG711CodecMode(mode);
  1223             }
  1251             }
  1224         }
  1252         }
  1225 
  1253 
  1226     return status;
  1254     return status;
  1227     }
  1255     }
  1228 
  1256 
  1229 // -----------------------------------------------------------------------------
  1257 // -----------------------------------------------------------------------------
  1230 // CallIPAdpt::GetG711CodecMode
  1258 // TMSCallIPAdpt::GetG711CodecMode
  1231 //
  1259 //
  1232 // -----------------------------------------------------------------------------
  1260 // -----------------------------------------------------------------------------
  1233 //
  1261 //
  1234 gint CallIPAdpt::GetG711CodecMode(gint& mode, const TMSStreamType strmtype)
  1262 gint TMSCallIPAdpt::GetG711CodecMode(gint& mode, const TMSStreamType strmtype)
  1235     {
  1263     {
  1236     gint status(TMS_RESULT_INVALID_ARGUMENT);
  1264     gint status(TMS_RESULT_INVALID_ARGUMENT);
  1237 
  1265 
  1238     if (strmtype == TMS_STREAM_DOWNLINK)
  1266     if (strmtype == TMS_STREAM_DOWNLINK)
  1239         {
  1267         {
  1240         if (iDnlinkInitialized && iVoIPDownlink)
  1268         if (iDnlinkInitialized && iIPDownlink)
  1241             {
  1269             {
  1242             status = iVoIPDownlink->GetG711CodecMode(mode);
  1270             status = iIPDownlink->GetG711CodecMode(mode);
  1243             }
  1271             }
  1244         }
  1272         }
  1245     else if (strmtype == TMS_STREAM_UPLINK)
  1273     else if (strmtype == TMS_STREAM_UPLINK)
  1246         {
  1274         {
  1247         if (iUplinkInitialized && iVoIPUplink)
  1275         if (iUplinkInitialized && iIPUplink)
  1248             {
  1276             {
  1249             status = iVoIPUplink->GetG711CodecMode(mode);
  1277             status = iIPUplink->GetG711CodecMode(mode);
  1250             }
  1278             }
  1251         }
  1279         }
  1252 
  1280 
  1253     return status;
  1281     return status;
  1254     }
  1282     }
  1255 
  1283 
  1256 // -----------------------------------------------------------------------------
  1284 // -----------------------------------------------------------------------------
  1257 // CallIPAdpt::FrameModeRequiredForEC
  1285 // TMSCallIPAdpt::FrameModeRequiredForEC
  1258 //
  1286 //
  1259 // -----------------------------------------------------------------------------
  1287 // -----------------------------------------------------------------------------
  1260 //
  1288 //
  1261 gint CallIPAdpt::FrameModeRqrdForEC(gboolean& frmodereq)
  1289 gint TMSCallIPAdpt::FrameModeRqrdForEC(gboolean& frmodereq)
  1262     {
  1290     {
  1263     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1291     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1264     if (iVoIPDownlink)
  1292     if (iIPDownlink)
  1265         {
  1293         {
  1266         status = iVoIPDownlink->FrameModeRqrdForEC(frmodereq);
  1294         status = iIPDownlink->FrameModeRqrdForEC(frmodereq);
  1267         }
  1295         }
  1268     return status;
  1296     return status;
  1269     }
  1297     }
  1270 
  1298 
  1271 // -----------------------------------------------------------------------------
  1299 // -----------------------------------------------------------------------------
  1272 // CallIPAdpt::SetFrameMode
  1300 // TMSCallIPAdpt::SetFrameMode
  1273 //
  1301 //
  1274 // -----------------------------------------------------------------------------
  1302 // -----------------------------------------------------------------------------
  1275 //
  1303 //
  1276 gint CallIPAdpt::SetFrameMode(const gboolean frmode)
  1304 gint TMSCallIPAdpt::SetFrameMode(const gboolean frmode)
  1277     {
  1305     {
  1278     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1306     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1279     if (iVoIPDownlink)
  1307     if (iIPDownlink)
  1280         {
  1308         {
  1281         status = iVoIPDownlink->SetFrameMode(frmode);
  1309         status = iIPDownlink->SetFrameMode(frmode);
  1282         }
  1310         }
  1283     return status;
  1311     return status;
  1284     }
  1312     }
  1285 
  1313 
  1286 // -----------------------------------------------------------------------------
  1314 // -----------------------------------------------------------------------------
  1287 // CallIPAdpt::GetFrameMode
  1315 // TMSCallIPAdpt::GetFrameMode
  1288 //
  1316 //
  1289 // -----------------------------------------------------------------------------
  1317 // -----------------------------------------------------------------------------
  1290 //
  1318 //
  1291 gint CallIPAdpt::GetFrameMode(gboolean& frmode)
  1319 gint TMSCallIPAdpt::GetFrameMode(gboolean& frmode)
  1292     {
  1320     {
  1293     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1321     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1294     if (iVoIPDownlink)
  1322     if (iIPDownlink)
  1295         {
  1323         {
  1296         status = iVoIPDownlink->GetFrameMode(frmode);
  1324         status = iIPDownlink->GetFrameMode(frmode);
  1297         }
  1325         }
  1298     return status;
  1326     return status;
  1299     }
  1327     }
  1300 
  1328 
  1301 // -----------------------------------------------------------------------------
  1329 // -----------------------------------------------------------------------------
  1302 // CallIPAdpt::ConcealErrorForNextBuffer
  1330 // TMSCallIPAdpt::ConcealErrorForNextBuffer
  1303 // -----------------------------------------------------------------------------
  1331 // -----------------------------------------------------------------------------
  1304 //
  1332 //
  1305 gint CallIPAdpt::ConcealErrorForNextBuffer()
  1333 gint TMSCallIPAdpt::ConcealErrorForNextBuffer()
  1306     {
  1334     {
  1307     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1335     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1308     if (iVoIPDownlink)
  1336     if (iIPDownlink)
  1309         {
  1337         {
  1310         status = iVoIPDownlink->ConcealErrorForNextBuffer();
  1338         status = iIPDownlink->ConcealErrorForNextBuffer();
  1311         }
  1339         }
  1312     return status;
  1340     return status;
  1313     }
  1341     }
  1314 
  1342 
  1315 // -----------------------------------------------------------------------------
  1343 // -----------------------------------------------------------------------------
  1316 // CallIPAdpt::BadLsfNextBuffer
  1344 // TMSCallIPAdpt::BadLsfNextBuffer
  1317 //
  1345 //
  1318 // -----------------------------------------------------------------------------
  1346 // -----------------------------------------------------------------------------
  1319 //
  1347 //
  1320 gint CallIPAdpt::BadLsfNextBuffer()
  1348 gint TMSCallIPAdpt::BadLsfNextBuffer()
  1321     {
  1349     {
  1322     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1350     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1323     if (iVoIPDownlink)
  1351     if (iIPDownlink)
  1324         {
  1352         {
  1325         status = iVoIPDownlink->BadLsfNextBuffer();
  1353         status = iIPDownlink->BadLsfNextBuffer();
  1326         }
  1354         }
  1327     return status;
  1355     return status;
  1328     }
  1356     }
  1329 
  1357 
  1330 // -----------------------------------------------------------------------------
  1358 // -----------------------------------------------------------------------------
  1331 // CallIPAdpt::SetOutput
  1359 // TMSCallIPAdpt::SetOutput
  1332 //
  1360 //
  1333 // -----------------------------------------------------------------------------
  1361 // -----------------------------------------------------------------------------
  1334 //
  1362 //
  1335 gint CallIPAdpt::SetOutput(TMSAudioOutput output)
  1363 gint TMSCallIPAdpt::SetOutput(TMSAudioOutput output)
  1336     {
  1364     {
  1337     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1365     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1338     if (iDnlinkInitialized && iVoIPDownlink)
  1366     if (iDnlinkInitialized && iIPDownlink)
  1339         {
  1367         {
  1340         TRAP(status, iVoIPDownlink->SetAudioDeviceL(output));
  1368         TRAP(status, iIPDownlink->SetAudioDeviceL(output));
  1341         }
  1369         }
  1342     return status;
  1370     return status;
  1343     }
  1371     }
  1344 // -----------------------------------------------------------------------------
  1372 // -----------------------------------------------------------------------------
  1345 // CallIPAdpt::GetOutput
  1373 // TMSCallIPAdpt::GetOutput
  1346 //
  1374 //
  1347 // -----------------------------------------------------------------------------
  1375 // -----------------------------------------------------------------------------
  1348 //
  1376 //
  1349 gint CallIPAdpt::GetOutput(TMSAudioOutput& output)
  1377 gint TMSCallIPAdpt::GetOutput(TMSAudioOutput& output)
  1350     {
  1378     {
  1351     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1379     gint status(TMS_RESULT_UNINITIALIZED_OBJECT);
  1352     if (iDnlinkInitialized && iVoIPDownlink)
  1380     if (iDnlinkInitialized && iIPDownlink)
  1353         {
  1381         {
  1354         TRAP(status, iVoIPDownlink->GetAudioDeviceL(output));
  1382         TRAP(status, iIPDownlink->GetAudioDeviceL(output));
  1355         }
  1383         }
  1356     return status;
  1384     return status;
  1357     }
  1385     }
  1358 // -----------------------------------------------------------------------------
  1386 // -----------------------------------------------------------------------------
  1359 // CallIPAdpt::GetPreviousOutput
  1387 // TMSCallIPAdpt::GetPreviousOutput
  1360 //
  1388 //
  1361 // -----------------------------------------------------------------------------
  1389 // -----------------------------------------------------------------------------
  1362 //
  1390 //
  1363 gint CallIPAdpt::GetPreviousOutput(TMSAudioOutput& /*output*/)
  1391 gint TMSCallIPAdpt::GetPreviousOutput(TMSAudioOutput& /*output*/)
  1364     {
  1392     {
  1365     return TMS_RESULT_FEATURE_NOT_SUPPORTED;
  1393     return TMS_RESULT_FEATURE_NOT_SUPPORTED;
  1366     }
  1394     }
  1367 
  1395 
  1368 // -----------------------------------------------------------------------------
  1396 // -----------------------------------------------------------------------------
  1369 // CallIPAdpt::GetAvailableOutputsL
  1397 // TMSCallIPAdpt::GetAvailableOutputsL
  1370 //
  1398 //
  1371 // -----------------------------------------------------------------------------
  1399 // -----------------------------------------------------------------------------
  1372 //
  1400 //
  1373 gint CallIPAdpt::GetAvailableOutputsL(gint& /*count*/, CBufFlat*& /*outputsbuffer*/)
  1401 gint TMSCallIPAdpt::GetAvailableOutputsL(gint& /*count*/,
       
  1402         CBufFlat*& /*outputsbuffer*/)
  1374     {
  1403     {
  1375     return TMS_RESULT_FEATURE_NOT_SUPPORTED;
  1404     return TMS_RESULT_FEATURE_NOT_SUPPORTED;
  1376     }
  1405     }
  1377 
  1406 
  1378 // -----------------------------------------------------------------------------
  1407 // -----------------------------------------------------------------------------
  1379 // CallIPAdpt::NotifyClient
  1408 // TMSCallIPAdpt::StartDTMF
  1380 // -----------------------------------------------------------------------------
  1409 //
  1381 //
  1410 // -----------------------------------------------------------------------------
  1382 void CallIPAdpt::NotifyClient(const gint strmId, const TInt aCommand,
  1411 //
       
  1412 gint TMSCallIPAdpt::StartDTMF(TMSStreamType strmtype, TDes& dtmfstring)
       
  1413     {
       
  1414     TRACE_PRN_FN_ENT;
       
  1415     TmsMsgBufPckg dtmfpckg;
       
  1416     if (strmtype == TMS_STREAM_DOWNLINK)
       
  1417         {
       
  1418         if (iDTMFDnlinkPlayer /*&& iDTMFDnlinkStatus*/)
       
  1419             {
       
  1420             iDTMFDnlinkPlayer->PlayDtmfTone(dtmfstring);
       
  1421             dtmfpckg().iStatus = TMS_RESULT_SUCCESS;
       
  1422             //TMS_EVENT_DTMF_TONE_STARTED
       
  1423             dtmfpckg().iRequest = ECmdDTMFOpenDnlinkComplete;
       
  1424             }
       
  1425         }
       
  1426     else if (strmtype == TMS_STREAM_UPLINK)
       
  1427         {
       
  1428         if (iDTMFUplinkPlayer /*&& iDTMFUplinkStatus*/)
       
  1429             {
       
  1430             iDTMFUplinkPlayer->PlayDtmfTone(dtmfstring);
       
  1431             dtmfpckg().iStatus = TMS_RESULT_SUCCESS;
       
  1432             //TMS_EVENT_DTMF_TONE_STARTED
       
  1433             dtmfpckg().iRequest = ECmdDTMFOpenUplinkComplete;
       
  1434             }
       
  1435         }
       
  1436 
       
  1437     if (iDTMFNotifier)
       
  1438         {
       
  1439         iDTMFNotifier->SetDtmf(dtmfpckg, TRUE);
       
  1440         }
       
  1441     TRACE_PRN_FN_EXT;
       
  1442     return TMS_RESULT_SUCCESS;
       
  1443     }
       
  1444 // -----------------------------------------------------------------------------
       
  1445 // TMSCallIPAdpt::StopDTMF
       
  1446 //
       
  1447 // -----------------------------------------------------------------------------
       
  1448 //
       
  1449 gint TMSCallIPAdpt::StopDTMF(TMSStreamType streamtype)
       
  1450     {
       
  1451     TRACE_PRN_FN_ENT;
       
  1452 
       
  1453     if (streamtype == TMS_STREAM_DOWNLINK)
       
  1454         {
       
  1455         iDTMFDnlinkPlayer->Cancel();
       
  1456         }
       
  1457     else
       
  1458         {
       
  1459         iDTMFUplinkPlayer->Cancel();
       
  1460         }
       
  1461 
       
  1462     TRACE_PRN_FN_EXT;
       
  1463     return TMS_RESULT_SUCCESS;
       
  1464     }
       
  1465 
       
  1466 // -----------------------------------------------------------------------------
       
  1467 // TMSCallIPAdpt::ContinueDTMF
       
  1468 //
       
  1469 // -----------------------------------------------------------------------------
       
  1470 //
       
  1471 gint TMSCallIPAdpt::ContinueDTMF(TBool /*continuesending*/)
       
  1472     {
       
  1473     TRACE_PRN_FN_ENT;
       
  1474     TRACE_PRN_FN_EXT;
       
  1475     return TMS_RESULT_FEATURE_NOT_SUPPORTED;
       
  1476     }
       
  1477 
       
  1478 //From DTMFTonePlayerObserver
       
  1479 // -----------------------------------------------------------------------------
       
  1480 // TMSCallIPAdpt::DTMFInitCompleted
       
  1481 //
       
  1482 // -----------------------------------------------------------------------------
       
  1483 //
       
  1484 void TMSCallIPAdpt::DTMFInitCompleted(TInt /*error*/)
       
  1485     {
       
  1486     //DTMF init status
       
  1487     TRACE_PRN_FN_ENT;
       
  1488     TRACE_PRN_FN_EXT;
       
  1489     }
       
  1490 
       
  1491 // -----------------------------------------------------------------------------
       
  1492 // TMSCallIPAdpt::DTMFToneFinished
       
  1493 //
       
  1494 // -----------------------------------------------------------------------------
       
  1495 //
       
  1496 void TMSCallIPAdpt::DTMFToneFinished(TInt error)
       
  1497     {
       
  1498     TRACE_PRN_FN_ENT;
       
  1499     TmsMsgBufPckg dtmfpckg;
       
  1500 
       
  1501      if(error == KErrUnderflow || error == KErrInUse)
       
  1502          {
       
  1503          error = TMS_RESULT_SUCCESS;
       
  1504          }
       
  1505 
       
  1506     dtmfpckg().iStatus = error;
       
  1507     //TMS_EVENT_DTMF_TONE_STOPPED
       
  1508     dtmfpckg().iRequest = ECmdDTMFTonePlayFinished;
       
  1509     if (iDTMFNotifier)
       
  1510         {
       
  1511         iDTMFNotifier->SetDtmf(dtmfpckg, TRUE);
       
  1512         }
       
  1513     TRACE_PRN_FN_EXT;
       
  1514     }
       
  1515 
       
  1516 // -----------------------------------------------------------------------------
       
  1517 // TMSCallIPAdpt::NotifyClient
       
  1518 // -----------------------------------------------------------------------------
       
  1519 //
       
  1520 void TMSCallIPAdpt::NotifyClient(const gint strmId, const TInt aCommand,
  1383         const TInt aStatus, const TInt64 /*aInt64*/)
  1521         const TInt aStatus, const TInt64 /*aInt64*/)
  1384     {
  1522     {
  1385     iMsgBuffer.iRequest = aCommand;
  1523     iMsgBuffer.iRequest = aCommand;
  1386     iMsgBuffer.iStatus = aStatus;
  1524     iMsgBuffer.iStatus = aStatus;
  1387 
  1525