qtms/src/qtmscall.cpp
changeset 51 e61a04404bdf
parent 32 edd273b3192a
equal deleted inserted replaced
44:d141fc1ad77b 51:e61a04404bdf
    24 using namespace QTMS;
    24 using namespace QTMS;
    25 using namespace TMS;
    25 using namespace TMS;
    26 
    26 
    27 QTMSCall::QTMSCall() :
    27 QTMSCall::QTMSCall() :
    28     iTmsCall(NULL)
    28     iTmsCall(NULL)
    29     {
    29 {
    30     }
    30 }
    31 
    31 
    32 QTMSCall::~QTMSCall()
    32 QTMSCall::~QTMSCall()
    33     {
    33 {
    34     }
    34 }
    35 
    35 
    36 QTMSCallType QTMSCall::GetCallType()
    36 QTMSCallType QTMSCall::GetCallType()
    37     {
    37 {
    38     QTMSCallType calltype(-1);
    38     QTMSCallType calltype(-1);
    39     if (iTmsCall)
    39     if (iTmsCall) {
    40         {
       
    41         calltype = iTmsCall->GetCallType();
    40         calltype = iTmsCall->GetCallType();
    42         }
    41     }
    43     return calltype;
    42     return calltype;
    44     }
    43 }
    45 
    44 
    46 gint QTMSCall::GetCallContextId(guint& ctxid)
    45 gint QTMSCall::GetCallContextId(guint& ctxid)
    47     {
    46 {
    48     gint status(QTMS_RESULT_UNINITIALIZED_OBJECT);
    47     gint status(QTMS_RESULT_UNINITIALIZED_OBJECT);
    49     if (iTmsCall)
    48     if (iTmsCall) {
    50         {
       
    51         status = iTmsCall->GetCallContextId(ctxid);
    49         status = iTmsCall->GetCallContextId(ctxid);
    52         }
    50     }
    53     return status;
    51     return status;
    54     }
    52 }
    55 
    53 
    56 gint QTMSCall::CreateStream(const QTMSStreamType type, QTMSStream*& qstrm)
    54 gint QTMSCall::CreateStream(const QTMSStreamType type, QTMSStream*& qstrm)
    57     {
    55 {
    58     gint status(QTMS_RESULT_UNINITIALIZED_OBJECT);
    56     gint status(QTMS_RESULT_UNINITIALIZED_OBJECT);
    59 
    57 
    60     TMSStream* tmsstrm(NULL);
    58     TMSStream* tmsstrm(NULL);
    61     if (iTmsCall)
    59     if (iTmsCall) {
    62         {
       
    63         status = iTmsCall->CreateStream(type, tmsstrm);
    60         status = iTmsCall->CreateStream(type, tmsstrm);
    64         }
       
    65 
       
    66     if (status == TMS_RESULT_SUCCESS)
       
    67         {
       
    68         QTMSCallType calltype = iTmsCall->GetCallType();
       
    69         switch (type)
       
    70             {
       
    71             case TMS_STREAM_UPLINK:
       
    72             case TMS_STREAM_DOWNLINK:
       
    73                 status = QTMSStreamImpl::Create(calltype, type, qstrm, tmsstrm);
       
    74                 break;
       
    75             default:
       
    76                 status = QTMS_RESULT_STREAM_TYPE_NOT_SUPPORTED;
       
    77                 break;
       
    78             }
       
    79         }
       
    80     return status;
       
    81     }
    61     }
    82 
    62 
       
    63     if (status == TMS_RESULT_SUCCESS) {
       
    64         QTMSCallType calltype = iTmsCall->GetCallType();
       
    65         switch (type) {
       
    66         case TMS_STREAM_UPLINK:
       
    67         case TMS_STREAM_DOWNLINK:
       
    68             status = QTMSStreamImpl::Create(calltype, type, qstrm, tmsstrm);
       
    69             break;
       
    70         default:
       
    71             status = QTMS_RESULT_STREAM_TYPE_NOT_SUPPORTED;
       
    72             break;
       
    73         }
       
    74     }
       
    75     return status;
       
    76 }
       
    77 
    83 gint QTMSCall::DeleteStream(QTMSStream*& strm)
    78 gint QTMSCall::DeleteStream(QTMSStream*& strm)
    84     {
    79 {
    85     gint status(QTMS_RESULT_SUCCESS);
    80     gint status(QTMS_RESULT_SUCCESS);
    86     delete strm;
    81     delete strm;
    87     strm = NULL;
    82     strm = NULL;
    88     return status;
    83     return status;
    89     }
    84 }
    90 
    85 
    91 // End of file
    86 // End of file