mmsharing/livecommsui/lcui/tsrc/mustester/Stubs/sipclientstub/src/Csipservertransaction.cpp
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 35 6c57ef9392d2
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
     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 
       
    25 
       
    26 EXPORT_C CSIPServerTransaction::~CSIPServerTransaction()
       
    27 	{
       
    28 	delete iRequestElements;
       
    29 	}
       
    30 
       
    31 
       
    32 CSIPServerTransaction::CSIPServerTransaction( RStringF aType )
       
    33  : CSIPTransactionBase( aType, EFalse )
       
    34 	{
       
    35 	}
       
    36 
       
    37 
       
    38 EXPORT_C CSIPServerTransaction* CSIPServerTransaction::NewL( RStringF aType )
       
    39 	{
       
    40 	return new(ELeave)CSIPServerTransaction( aType );
       
    41 	}
       
    42 
       
    43 
       
    44 EXPORT_C void CSIPServerTransaction::SetRequestElements(
       
    45     CSIPRequestElements* aElements)
       
    46     {
       
    47     if( iRequestElements )
       
    48     	{
       
    49     	delete iRequestElements;
       
    50     	}
       
    51     
       
    52     iRequestElements = aElements;
       
    53     }
       
    54 
       
    55 
       
    56 EXPORT_C void CSIPServerTransaction::SendResponseL(
       
    57     CSIPResponseElements *aElements)
       
    58     {
       
    59     CSipSseTestTls* tls = CSipSseTestTls::Storage();
       
    60     if ( tls )
       
    61         {
       
    62         User::LeaveIfError( tls->Error() );
       
    63        // tls->SIPSends( Type(), aElements );
       
    64         }
       
    65     else
       
    66         {
       
    67         delete aElements;
       
    68         }
       
    69     }
       
    70 
       
    71 
       
    72 EXPORT_C const CSIPRequestElements* CSIPServerTransaction::RequestElements() const
       
    73     {
       
    74     return iRequestElements;
       
    75     }
       
    76     
       
    77 EXPORT_C TBool CSIPServerTransaction::ResponseAllowed() const
       
    78     {
       
    79     if ( Type() == SIPStrings::StringF( SipStrConsts::EAck ) )
       
    80         {
       
    81         return EFalse;
       
    82         }
       
    83     else
       
    84         {
       
    85         return ETrue;
       
    86         }
       
    87     }