tsrc/mceclientstub/src/mceoutsession.cpp
branchRCL_3
changeset 23 bc78a40cd63c
parent 22 73a1feb507fb
equal deleted inserted replaced
22:73a1feb507fb 23:bc78a40cd63c
    29 // CMceOutSession::NewL
    29 // CMceOutSession::NewL
    30 // -----------------------------------------------------------------------------
    30 // -----------------------------------------------------------------------------
    31 //
    31 //
    32 EXPORT_C CMceOutSession* CMceOutSession::NewL(
    32 EXPORT_C CMceOutSession* CMceOutSession::NewL(
    33                         CMceManager& aManager,
    33                         CMceManager& aManager,
    34                         CSIPProfile& aProfile,
    34                         CSIPProfile& /*aProfile*/,
    35                         const TDesC8& aRecipient,
    35                         const TDesC8& aRecipient,
    36 						HBufC8* aOriginator )
    36 						HBufC8* aOriginator )
    37     {
    37     {
    38     // Check that profile has been registered
       
    39     TBool profileRegistered = EFalse;   
       
    40         
       
    41     aProfile.GetParameter( KSIPProfileRegistered, profileRegistered  );  
       
    42     __ASSERT_ALWAYS( profileRegistered, User::Leave( KErrCouldNotConnect ) );        
       
    43     
       
    44     CMceOutSession* self = new (ELeave) CMceOutSession( &aManager, 0 );
    38     CMceOutSession* self = new (ELeave) CMceOutSession( &aManager, 0 );
    45     CleanupStack::PushL( self );
    39     CleanupStack::PushL( self );
    46     self->ConstructL( aRecipient, aOriginator );
    40     self->ConstructL( aRecipient, aOriginator );
    47     CleanupStack::Pop( self );
    41     CleanupStack::Pop( self );
    48     return self;
    42     return self;
    64 EXPORT_C CMceOutSession* CMceOutSession::NewL( CMceRefer& /*aRefer*/ )
    58 EXPORT_C CMceOutSession* CMceOutSession::NewL( CMceRefer& /*aRefer*/ )
    65     {
    59     {
    66     return NULL;
    60     return NULL;
    67     }
    61     }
    68 
    62 
    69 // -----------------------------------------------------------------------------
       
    70 // CMceOutSession::NewL
       
    71 // -----------------------------------------------------------------------------
       
    72 //
       
    73 EXPORT_C CMceOutSession* CMceOutSession::NewL()
       
    74     {
       
    75     return new( ELeave )CMceOutSession( NULL, 0 );
       
    76     }
       
    77 
    63 
    78 // -----------------------------------------------------------------------------
    64 // -----------------------------------------------------------------------------
    79 // CMceOutSession::~CMceOutSession
    65 // CMceOutSession::~CMceOutSession
    80 // -----------------------------------------------------------------------------
    66 // -----------------------------------------------------------------------------
    81 //
    67 //
   116     iHeaders = aHeaders;
   102     iHeaders = aHeaders;
   117     delete aContentType;
   103     delete aContentType;
   118     delete aContent;
   104     delete aContent;
   119     delete aContentHeaders;
   105     delete aContentHeaders;
   120 
   106 
   121 	iState = CMceSession::EOffering; 
   107 	iState = CMceSession::EOffering;
       
   108     
       
   109     
       
   110     
   122     }
   111     }
   123 
   112 
   124 
   113 
   125 // -----------------------------------------------------------------------------
   114 // -----------------------------------------------------------------------------
   126 // CMceOutSession::AddStreamL
   115 // CMceOutSession::AddStreamL
   169 // CMceOutSession::ConstructL
   158 // CMceOutSession::ConstructL
   170 // -----------------------------------------------------------------------------
   159 // -----------------------------------------------------------------------------
   171 //
   160 //
   172 void CMceOutSession::ConstructL( const TDesC8& aRecipient, HBufC8* aOriginator )
   161 void CMceOutSession::ConstructL( const TDesC8& aRecipient, HBufC8* aOriginator )
   173     {
   162     {
       
   163   
   174     delete iRecipient;
   164     delete iRecipient;
   175     iRecipient = NULL;
   165     iRecipient = NULL;
   176     iRecipient = aRecipient.AllocL();
   166     iRecipient = aRecipient.AllocL();
   177 
   167 
   178     delete iOriginator;
   168     delete iOriginator;
   182         iOriginator = aOriginator->AllocL();
   172         iOriginator = aOriginator->AllocL();
   183         delete aOriginator;    
   173         delete aOriginator;    
   184         }
   174         }
   185         
   175         
   186     CMceSession::ConstructL();
   176     CMceSession::ConstructL();
       
   177     
       
   178     
   187     }
   179     }