realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/Sipprflderegisterrequestedstate.cpp
branchRCL_3
changeset 13 822e1f077722
parent 0 307788aac0a8
equal deleted inserted replaced
12:a7d1e54a7332 13:822e1f077722
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 // Name        : sipprflderegisterrequestedstate.cpp
    14 // Name        : sipprflderegisterrequestedstate.cpp
    15 // Part of     : sip profile fsm
    15 // Part of     : sip profile fsm
    16 // implementation
    16 // implementation
    17 // Version     : %version: 2.1.1 %
    17 // Version     : %version: 2.1.2 %
    18 //
    18 //
    19 
    19 
    20 
    20 
    21 
    21 
    22 // INCLUDE FILES
    22 // INCLUDE FILES
    96 	__ASSERT_DEBUG(aContext.Profile()!=0, User::Invariant());
    96 	__ASSERT_DEBUG(aContext.Profile()!=0, User::Invariant());
    97 	aContext.SetNextState(*iRegisteredState);
    97 	aContext.SetNextState(*iRegisteredState);
    98 	}
    98 	}
    99 
    99 
   100 // -----------------------------------------------------------------------------
   100 // -----------------------------------------------------------------------------
       
   101 // CSIPPrflDeregisterRequestedState::DeregisterL()
       
   102 // (other items were commented in a header).
       
   103 // -----------------------------------------------------------------------------
       
   104 //
       
   105 void CSIPPrflDeregisterRequestedState::DeregisterL(
       
   106     MSIPProfileContext& aContext)
       
   107     {
       
   108     __ASSERT_DEBUG(aContext.Profile()!=0, User::Invariant());
       
   109     __ASSERT_DEBUG(aContext.Registration()!=0, User::Invariant());
       
   110     if (aContext.Connection().State()==CSIPConnection::EActive)
       
   111         {
       
   112         if (iUser.AddProfileIntoQueue(*aContext.Profile())) //compares the registrar of the present profile with the other profiles existing in the connection context array.
       
   113             {
       
   114             iUser.DeregisterProfileL(*aContext.Profile()); 
       
   115             
       
   116             } 
       
   117         else
       
   118             {
       
   119             CSIPMessageElements* elements = 
       
   120                 aContext.CreateDeRegisterElementsL();
       
   121             CleanupStack::PushL(elements);
       
   122             CSIPClientTransaction* tx = 
       
   123                 aContext.Registration()->DeregisterL(elements);
       
   124             CleanupStack::Pop(elements);
       
   125             aContext.SetTransaction(tx);
       
   126             aContext.SetNextState(*iDeregistrationInProgressState);
       
   127             }
       
   128         }
       
   129     aContext.AgentObserver().SIPProfileStatusEvent(
       
   130     *aContext.Profile(),
       
   131     aContext.Registration()->ContextId());
       
   132     }
       
   133 
       
   134 
       
   135 // -----------------------------------------------------------------------------
   101 // CSIPPrflDeregisterRequestedState::ErrorOccured()
   136 // CSIPPrflDeregisterRequestedState::ErrorOccured()
   102 // This can happen if the de-register was reguested while the connection is
   137 // This can happen if the de-register was reguested while the connection is
   103 // suspended (registered->de-register requested). SIP stack has removed
   138 // suspended (registered->de-register requested). SIP stack has removed
   104 // the registration binding, so NOP and transition to Init state.
   139 // the registration binding, so NOP and transition to Init state.
   105 // (other items were commented in a header).
   140 // (other items were commented in a header).