realtimenetprots/sipfw/ProfileAgent/IETF_Agent/src/Sipietfconnectioncontext.cpp
branchRCL_3
changeset 12 c2e8c8b73582
parent 0 307788aac0a8
equal deleted inserted replaced
10:dc4cddf5f2f8 12:c2e8c8b73582
   364 // CSIPIetfConnectionContext::IncomingResponse
   364 // CSIPIetfConnectionContext::IncomingResponse
   365 // (other items were commented in a header).
   365 // (other items were commented in a header).
   366 // -----------------------------------------------------------------------------
   366 // -----------------------------------------------------------------------------
   367 //
   367 //
   368 void CSIPIetfConnectionContext::IncomingResponse(
   368 void CSIPIetfConnectionContext::IncomingResponse(
   369 	CSIPClientTransaction& aTransaction,
   369     CSIPClientTransaction& aTransaction,
   370 	CSIPRegistrationBinding& aRegistration)
   370     CSIPRegistrationBinding& aRegistration)
   371 	{
   371     {
   372 	PROFILE_DEBUG1("CSIPIetfConnectionContext::IncomingResponse")
   372     PROFILE_DEBUG1("CSIPIetfConnectionContext::IncomingResponse")
   373 	TBool handled = EFalse;
   373     TBool handled = EFalse;
   374 
   374 
   375 	CleanIdleContexts();
   375     CleanIdleContexts();
   376 
   376 
   377 	for (TInt i=0; i<iContexts.Count() && !handled; i++)
   377     for (TInt i=0; i<iContexts.Count() && !handled; i++)
   378 		{
   378         {
   379 		const CSIPResponseElements* response = aTransaction.ResponseElements();
   379         const CSIPResponseElements* response = aTransaction.ResponseElements();
   380 		if (response)
   380         if (response)
   381 		    {
   381             {
   382     		TBool isErrorResponse = (response->StatusCode() >= 300);
   382             TInt contextCountBefore = iContexts.Count();
   383     		TInt contextCountBefore = iContexts.Count();
   383             TBool isErrorResponse = (response->StatusCode() >= 300);
   384     		
   384             TInt statusCode = response->StatusCode();
   385     		iContexts[i]->IncomingResponse(aTransaction, aRegistration, handled);
   385             iContexts[i]->IncomingResponse(aTransaction, aRegistration, handled);
   386     		
   386             TBool contextRemoved = (iContexts.Count() != contextCountBefore);
   387     		TBool contextRemoved = (iContexts.Count() != contextCountBefore);	
   387             if (handled && !contextRemoved && isErrorResponse)
   388     		if (handled && !contextRemoved && isErrorResponse)
   388                 {
   389     			{
   389                 if ( iContexts[i]->RetryTimerInUse() )
   390                 iContexts[i]->RetryRegistration();
   390                     {
   391     			}
   391                     iContexts[i]->RetryDeltaTimer(iContexts[i]->DelayTime(), statusCode );
   392 		    }
   392                     }
   393 		}
   393                 else
   394 	}
   394                     {
       
   395                     iContexts[i]->RetryRegistration();
       
   396                     }
       
   397                }    
       
   398             }
       
   399         }
       
   400     }
   395 
   401 
   396 // -----------------------------------------------------------------------------
   402 // -----------------------------------------------------------------------------
   397 // CSIPIetfConnectionContext::ErrorOccured
   403 // CSIPIetfConnectionContext::ErrorOccured
   398 // (other items were commented in a header).
   404 // (other items were commented in a header).
   399 // -----------------------------------------------------------------------------
   405 // -----------------------------------------------------------------------------