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