realtimenetprots/sipfw/SIP/Registration/src/csipregistrationstate.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Name          : csipregistrationstate.cpp
       
    15 // Part of       : SIP Registration
       
    16 // Version       : SIP/4.0 
       
    17 //
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #include "csipregistrationstate.h"
       
    23 #include "MRegistrationOwner.h"
       
    24 #include "siperr.h"
       
    25 
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CSIPRegistrationState::~CSIPRegistrationState
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 CSIPRegistrationState::~CSIPRegistrationState()
       
    32 	{
       
    33 	}
       
    34 
       
    35 // -----------------------------------------------------------------------------
       
    36 // CSIPRegistrationState::CSIPRegistrationState
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 CSIPRegistrationState::CSIPRegistrationState(
       
    40 	MRegistrationContext& aRegistration) 
       
    41 	: iRegistration (aRegistration) 
       
    42 	{
       
    43 	}
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // CSIPRegistrationState::RegisterL
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 void CSIPRegistrationState::RegisterL(TTransactionId&  /*aTransactionId*/, 
       
    50 		                              CSIPRequest*     /*aRequest*/,
       
    51 		                              CSIPRouteHeader* /*aOutboundProxy*/)
       
    52 	{
       
    53 	User::Leave(KErrSIPInvalidRegistrationState);
       
    54 	}
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CSIPRegistrationState::UpdateL
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 void CSIPRegistrationState::UpdateL(TTransactionId& /*aTransactionId*/,
       
    61 					                CSIPRequest*    /*aRequest*/)
       
    62 	{
       
    63 	User::Leave(KErrSIPInvalidRegistrationState);
       
    64 	}
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CSIPRegistrationState::UnregisterL
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 void CSIPRegistrationState::UnregisterL(TTransactionId& /*aTransactionId*/,
       
    71 							            CSIPRequest*    /*aRequest*/)
       
    72 	{
       
    73 	User::Leave(KErrSIPInvalidRegistrationState);
       
    74 	}
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CSIPRegistrationState::ReceiveL
       
    78 // -----------------------------------------------------------------------------
       
    79 //
       
    80 void CSIPRegistrationState::ReceiveL(TTransactionId /*aTransactionId*/,
       
    81 		                             CSIPResponse*  /*aResponse*/)
       
    82 	{
       
    83 	User::Leave(KErrSIPInvalidRegistrationState);
       
    84 	}
       
    85 	
       
    86 	
       
    87 // -----------------------------------------------------------------------------
       
    88 // CSIPRegistrationState::Retrying 
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 
       
    92 TBool CSIPRegistrationState::Retrying() const
       
    93 
       
    94 	{
       
    95 	return EFalse;	
       
    96 	}
       
    97 
       
    98 
       
    99 // -----------------------------------------------------------------------------
       
   100 // CSIPRegistrationState::PassResponseToOwnerL
       
   101 // -----------------------------------------------------------------------------
       
   102 //
       
   103 void CSIPRegistrationState::PassResponseToOwnerL(
       
   104 	CSIPResponse* aResponse,
       
   105 	TTransactionId aTransactionId,
       
   106 	TRegistrationId aRegistrationId)
       
   107 	{
       
   108 	MRegistrationOwner* owner = 
       
   109 		const_cast<MRegistrationOwner*>(iRegistration.Owner()); 
       
   110 
       
   111 	owner->RegistrationReceivedL(aTransactionId,iRegistration.RefreshId(),
       
   112 		                         aRegistrationId,aResponse);
       
   113 	}
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116 // CSIPRegistrationState::PassErrorToOwner
       
   117 // -----------------------------------------------------------------------------
       
   118 //
       
   119 TInt CSIPRegistrationState::PassErrorToOwner(
       
   120 	TInt aReason, 
       
   121 	TTransactionId  aTransactionId,
       
   122 	TRegistrationId aRegistrationId)
       
   123 	{
       
   124 	MRegistrationOwner* owner = 
       
   125 		const_cast<MRegistrationOwner*>(iRegistration.Owner());
       
   126 	return owner->RegistrationError(aTransactionId,aRegistrationId,aReason);
       
   127 	}