realtimenetprots/sipfw/SIP/Server/src/CSipCSSubSessionReceiver.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2006-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          : CSipCSSubSessionReceiver.cpp
       
    15 // Part of       : SIPServerCore
       
    16 // Version       : SIP/5.0 
       
    17 //
       
    18 
       
    19 
       
    20 
       
    21 #include "CSipCSSubSessionReceiver.h"
       
    22 #include "siprequest.h"
       
    23 #include "sipresponse.h"
       
    24 #include "sipinternalerr.h"
       
    25 #include "MSIPCSReceiverOwner.h"
       
    26 
       
    27 
       
    28 // -----------------------------------------------------------------------------
       
    29 // CSipCSSubSessionReceiver::NewL
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 CSipCSSubSessionReceiver* CSipCSSubSessionReceiver::NewL(
       
    33     CSipCSServerITC& aITC,
       
    34     MSIPSecUser& aSIPSecUser,
       
    35     MSIPCSReceiverOwner& aOwner)
       
    36 	{
       
    37     CSipCSSubSessionReceiver* self = 
       
    38         CSipCSSubSessionReceiver::NewLC(
       
    39             aITC,aSIPSecUser,aOwner);
       
    40     CleanupStack::Pop(self);
       
    41     return self;
       
    42 	}
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // CSipCSSubSessionReceiver::NewLC
       
    46 // -----------------------------------------------------------------------------
       
    47 //
       
    48 CSipCSSubSessionReceiver* CSipCSSubSessionReceiver::NewLC(
       
    49     CSipCSServerITC& aITC,
       
    50     MSIPSecUser& aSIPSecUser,
       
    51     MSIPCSReceiverOwner& aOwner)
       
    52 	{
       
    53     CSipCSSubSessionReceiver* self = 
       
    54         new(ELeave)CSipCSSubSessionReceiver(
       
    55             aITC,aSIPSecUser,aOwner);
       
    56     CleanupStack::PushL(self);
       
    57     self->ConstructL();
       
    58     return self;
       
    59 	}
       
    60 
       
    61 
       
    62 // -----------------------------------------------------------------------------
       
    63 // CSipCSSubSessionReceiver::CSipCSSubSessionReceiver
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 CSipCSSubSessionReceiver::CSipCSSubSessionReceiver(
       
    67     CSipCSServerITC& aITC,
       
    68     MSIPSecUser& aSIPSecUser,
       
    69     MSIPCSReceiverOwner& aOwner)
       
    70 : CSipCSReceiverBase (aITC,aSIPSecUser),
       
    71   iOwner(aOwner)
       
    72 	{
       
    73 	}
       
    74 
       
    75 // -----------------------------------------------------------------------------
       
    76 // CSipCSSubSessionReceiver::~CSipCSSubSessionReceiver
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 CSipCSSubSessionReceiver::~CSipCSSubSessionReceiver()
       
    80 	{
       
    81 	}
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // CSipCSSubSessionReceiver::ReceiveL
       
    85 // From MTransactionOwner:
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 void CSipCSSubSessionReceiver::ReceiveL(TUint32 aIapId,
       
    89                                         TTransactionId aTransactionId,
       
    90                                         CSIPRequest* aRequest)
       
    91 	{
       
    92 	SipRequestReceivedL(aIapId,aTransactionId,aRequest);
       
    93 	}
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // CSipCSSubSessionReceiver::ReceiveL
       
    97 // From MTransactionOwner
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 void CSipCSSubSessionReceiver::ReceiveL(TTransactionId aTransactionId,
       
   101                                         CSIPResponse* aResponse)
       
   102 	{
       
   103 	TSIPIds ids;
       
   104 	ids.iRequestId = aTransactionId;
       
   105     SipMessageReceivedL (ids,aResponse);
       
   106 	}	
       
   107 	
       
   108 // -----------------------------------------------------------------------------
       
   109 // CSipCSSubSessionReceiver::TransportParams
       
   110 // From MRegistrationOwner
       
   111 // -----------------------------------------------------------------------------
       
   112 //    
       
   113 const TSIPTransportParams& CSipCSSubSessionReceiver::TransportParams() const
       
   114     {
       
   115     return iOwner.TransportParams();
       
   116     }	
       
   117 
       
   118 // -----------------------------------------------------------------------------
       
   119 // CSipCSSubSessionReceiver::TransportParams
       
   120 // From MRefreshOwner and MDialogOwner
       
   121 // -----------------------------------------------------------------------------
       
   122 //    
       
   123 TSIPTransportParams CSipCSSubSessionReceiver::TransportParams(
       
   124     const TRegistrationId& aRegistrationId)
       
   125     {
       
   126     return iOwner.TransportParams(aRegistrationId);
       
   127     }
       
   128 
       
   129 // -----------------------------------------------------------------------------
       
   130 // CSipCSSubSessionReceiver::SIPSecUser
       
   131 // From MRefreshOwner and MDialogOwner
       
   132 // -----------------------------------------------------------------------------
       
   133 //
       
   134 const MSIPSecUser* CSipCSSubSessionReceiver::SIPSecUser(
       
   135     const TRegistrationId& aRegistrationId)
       
   136     {
       
   137     return iOwner.SIPSecUser(aRegistrationId);
       
   138     }
       
   139 
       
   140 // -----------------------------------------------------------------------------
       
   141 // CSipCSSubSessionReceiver::RefreshReceivedL
       
   142 // From MRefreshOwner
       
   143 // -----------------------------------------------------------------------------
       
   144 //
       
   145 void CSipCSSubSessionReceiver::RefreshReceivedL(TTransactionId aTransactionId,
       
   146                                                 TRefreshId aRefreshId,
       
   147                                                 CSIPResponse* aResponse)
       
   148 	{
       
   149 	TSIPIds ids;
       
   150 	ids.iRequestId = aTransactionId;
       
   151 	ids.iRefreshId = aRefreshId;
       
   152     SipMessageReceivedL (ids,aResponse);
       
   153 	}
       
   154 
       
   155 // -----------------------------------------------------------------------------
       
   156 // CSipCSSubSessionReceiver::RefreshError
       
   157 // From MRefreshOwner
       
   158 // -----------------------------------------------------------------------------
       
   159 //
       
   160 TInt CSipCSSubSessionReceiver::RefreshError(TRefreshId aRefreshId,
       
   161 											TTransactionId aTransactionId,
       
   162 											TInt aReason)
       
   163 	{		
       
   164 	TSIPIds ids;
       
   165 	ids.iRequestId = aTransactionId;
       
   166 	ids.iRefreshId = aRefreshId;
       
   167 	return ErrorReceived(ids,aReason);
       
   168 	}
       
   169 
       
   170 // -----------------------------------------------------------------------------
       
   171 // CSipCSSubSessionReceiver::NextRefreshCSeq
       
   172 // From MRefreshOwner
       
   173 // -----------------------------------------------------------------------------
       
   174 //
       
   175 TInt CSipCSSubSessionReceiver::NextRefreshCSeq(TUint& aCSeq)
       
   176 	{
       
   177     return NextCSeq (aCSeq);
       
   178 	}
       
   179 
       
   180 // -----------------------------------------------------------------------------
       
   181 // CSipCSSubSessionReceiver::RefreshDurationL
       
   182 // -----------------------------------------------------------------------------
       
   183 //
       
   184 TUint CSipCSSubSessionReceiver::RefreshDurationL()
       
   185 	{
       
   186 	User::Leave(KErrNotFound);
       
   187 	return 0;
       
   188 	}
       
   189 
       
   190 // -----------------------------------------------------------------------------
       
   191 // CSipCSSubSessionReceiver::RegistrationReceivedL
       
   192 // From MRegistrationOwner
       
   193 // -----------------------------------------------------------------------------
       
   194 //
       
   195 void 
       
   196 CSipCSSubSessionReceiver::RegistrationReceivedL(TTransactionId aTransactionId,
       
   197                                                 TRefreshId aRefreshId,
       
   198                                                 TRegistrationId aRegistrationId,
       
   199                                                 CSIPResponse* aResponse)
       
   200 	{
       
   201 	TSIPIds ids;
       
   202 	ids.iRequestId = aTransactionId;
       
   203 	ids.iRefreshId = aRefreshId;
       
   204 	ids.iRegistrationId = aRegistrationId;
       
   205     SipMessageReceivedL (ids,aResponse);
       
   206 	}
       
   207 
       
   208 // -----------------------------------------------------------------------------
       
   209 // CSipCSSubSessionReceiver::RegistrationError
       
   210 // From MRegistrationOwner 
       
   211 // -----------------------------------------------------------------------------
       
   212 //
       
   213 TInt 
       
   214 CSipCSSubSessionReceiver::RegistrationError(TTransactionId aTransactionId,
       
   215                                             TRegistrationId aRegistrationId,
       
   216                                             TInt aReason)
       
   217 	{	
       
   218 	TSIPIds ids;
       
   219 	ids.iRequestId = aTransactionId;
       
   220 	ids.iRegistrationId = aRegistrationId;
       
   221 	return ErrorReceived(ids,aReason);
       
   222 	}
       
   223 
       
   224 // -----------------------------------------------------------------------------
       
   225 // CSipCSSubSessionReceiver::DialogsReceivedL
       
   226 // From MDialogOwner
       
   227 // -----------------------------------------------------------------------------
       
   228 //
       
   229 void CSipCSSubSessionReceiver::DialogsReceivedL(TTransactionId aTransactionId,
       
   230                                                 TDialogId aDialogId,
       
   231                                                 CSIPRequest* aRequest)
       
   232 	{
       
   233 	TSIPIds ids;
       
   234 	ids.iRequestId = aTransactionId;
       
   235 	ids.iDialogId = aDialogId;
       
   236     SipMessageReceivedL (ids,aRequest);
       
   237 	}
       
   238 
       
   239 // -----------------------------------------------------------------------------
       
   240 // CSipCSSubSessionReceiver::DialogsReceivedL
       
   241 // From MDialogOwner
       
   242 // -----------------------------------------------------------------------------
       
   243 //
       
   244 void CSipCSSubSessionReceiver::DialogsReceivedL(TTransactionId aTransactionId,
       
   245                                                 CSIPResponse* aResponse)
       
   246 	{
       
   247 	TSIPIds ids;
       
   248 	ids.iRequestId = aTransactionId;
       
   249     SipMessageReceivedL (ids,aResponse);
       
   250 	}
       
   251 
       
   252 // -----------------------------------------------------------------------------
       
   253 // CSipCSSubSessionReceiver::DialogsReceivedL
       
   254 // From MDialogOwner
       
   255 // -----------------------------------------------------------------------------
       
   256 //
       
   257 void CSipCSSubSessionReceiver::DialogsReceivedL(TTransactionId aTransactionId,
       
   258                                                 TRefreshId aRefreshId,
       
   259                                                 TDialogId aDialogId,
       
   260                                                 CSIPResponse* aResponse)
       
   261 	{
       
   262 	TSIPIds ids;
       
   263 	ids.iRequestId = aTransactionId;
       
   264 	ids.iRefreshId = aRefreshId;
       
   265 	ids.iDialogId = aDialogId;
       
   266     SipMessageReceivedL (ids,aResponse);
       
   267 	}
       
   268 
       
   269 // -----------------------------------------------------------------------------
       
   270 // CSipCSSubSessionReceiver::DialogsError
       
   271 // From MDialogOwner
       
   272 // -----------------------------------------------------------------------------
       
   273 //
       
   274 TInt CSipCSSubSessionReceiver::DialogsError(TTransactionId aTransactionId,
       
   275                                             TInt aReason)
       
   276 	{
       
   277 	TSIPIds ids;
       
   278 	ids.iRequestId = aTransactionId;
       
   279     return ErrorReceived(ids,aReason);
       
   280 	}
       
   281 
       
   282 // -----------------------------------------------------------------------------
       
   283 // CSipCSSubSessionReceiver::DialogsError
       
   284 // From MDialogOwner
       
   285 // -----------------------------------------------------------------------------
       
   286 //
       
   287 TInt CSipCSSubSessionReceiver::DialogsError(TTransactionId aTransactionId,
       
   288                                             TRefreshId aRefreshId,
       
   289                                             TDialogId aDialogId,
       
   290                                             TInt aReason)
       
   291 	{
       
   292 	TSIPIds ids;
       
   293 	ids.iRequestId = aTransactionId;
       
   294 	ids.iRefreshId = aRefreshId;
       
   295 	ids.iDialogId = aDialogId;
       
   296     return ErrorReceived(ids,aReason);
       
   297 	}
       
   298 
       
   299 // -----------------------------------------------------------------------------
       
   300 // CSipCSSubSessionReceiver::InviteTransactionCompleted
       
   301 // From MDialogOwner
       
   302 // -----------------------------------------------------------------------------
       
   303 //
       
   304 TInt CSipCSSubSessionReceiver::InviteTransactionCompleted(TTransactionId aId)
       
   305     {
       
   306 	TSIPIds ids;
       
   307 	ids.iRequestId = aId;
       
   308     return ErrorReceived(ids,KInviteTransactionCompleted);
       
   309     }
       
   310 
       
   311 // -----------------------------------------------------------------------------
       
   312 // CSipCSSubSessionReceiver::ConnectionStateChangedL
       
   313 // -----------------------------------------------------------------------------
       
   314 //
       
   315 void 
       
   316 CSipCSSubSessionReceiver::ConnectionStateChangedL(CSIPConnection::TState aState)
       
   317 	{
       
   318 	TSIPIds ids;
       
   319 	User::LeaveIfError (ErrorReceived(ids,aState));
       
   320 	}