tsrc/sipclientstub/src/Csipservertransaction.cpp
changeset 0 f0cf47e981f9
equal deleted inserted replaced
-1:000000000000 0:f0cf47e981f9
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #include "sipservertransaction.h"
       
    19 #include "siprequestelements.h"
       
    20 #include "sipresponseelements.h"
       
    21 #include <sipstrings.h>
       
    22 #include <sipstrconsts.h>
       
    23 #include "CSipSseTestTls.h"
       
    24 #include "musunittesting.h"
       
    25 
       
    26 
       
    27 EXPORT_C CSIPServerTransaction::~CSIPServerTransaction()
       
    28 	{
       
    29 	delete iRequestElements;
       
    30 	}
       
    31 
       
    32 
       
    33 CSIPServerTransaction::CSIPServerTransaction( RStringF aType )
       
    34  : CSIPTransactionBase( aType, EFalse )
       
    35 	{
       
    36 	}
       
    37 
       
    38 
       
    39 EXPORT_C CSIPServerTransaction* CSIPServerTransaction::NewL( RStringF aType )
       
    40 	{
       
    41 	return new(ELeave)CSIPServerTransaction( aType );
       
    42 	}
       
    43 
       
    44 
       
    45 EXPORT_C void CSIPServerTransaction::SetRequestElements(
       
    46     CSIPRequestElements* aElements)
       
    47     {
       
    48     if( iRequestElements )
       
    49     	{
       
    50     	delete iRequestElements;
       
    51     	}
       
    52     
       
    53     iRequestElements = aElements;
       
    54     }
       
    55 
       
    56 
       
    57 EXPORT_C void CSIPServerTransaction::SendResponseL(
       
    58     CSIPResponseElements *aElements)
       
    59     {
       
    60     CSipSseTestTls* tls = CSipSseTestTls::Storage();
       
    61     if ( tls )
       
    62         {
       
    63         User::LeaveIfError( tls->Error() );
       
    64        // tls->SIPSends( Type(), aElements );
       
    65         }
       
    66     else
       
    67         {
       
    68         delete aElements;
       
    69         }
       
    70     }
       
    71 
       
    72 
       
    73 EXPORT_C const CSIPRequestElements* CSIPServerTransaction::RequestElements() const
       
    74     {
       
    75     return iRequestElements;
       
    76     }
       
    77     
       
    78 EXPORT_C TBool CSIPServerTransaction::ResponseAllowed() const
       
    79     {
       
    80     if ( Type() == SIPStrings::StringF( SipStrConsts::EAck ) )
       
    81         {
       
    82         return EFalse;
       
    83         }
       
    84     else
       
    85         {
       
    86         return ETrue;
       
    87         }
       
    88     }