simpleengine/siputils/src/simplesipconnectionobserver.cpp
branchRCL_3
changeset 35 fbd2e7cec7ef
parent 34 2669f8761a99
equal deleted inserted replaced
34:2669f8761a99 35:fbd2e7cec7ef
   157     TSimpleLogger::Log(_L("SipConnectionObserver: ProfileStateChanged state=%d sip=%d"), aState );
   157     TSimpleLogger::Log(_L("SipConnectionObserver: ProfileStateChanged state=%d sip=%d"), aState );
   158 #endif
   158 #endif
   159       ConnectionStateChanged2( aState, aSipError );      
   159       ConnectionStateChanged2( aState, aSipError );      
   160     }     
   160     }     
   161     
   161     
       
   162 // -----------------------------------------------------------------------------
       
   163 // CSimpleSipConnectionObserver::ProfileUpdated
       
   164 // -----------------------------------------------------------------------------
       
   165 //
       
   166 void CSimpleSipConnectionObserver::ProfileUpdated()
       
   167     {
       
   168 #ifdef _DEBUG
       
   169     TSimpleLogger::Log(_L("SipConnectionObserver: ProfileUpdated"));
       
   170 #endif
       
   171     iCallback.ConnectionChanged();
       
   172     }
       
   173 
   162 // -----------------------------------------------------------------------------
   174 // -----------------------------------------------------------------------------
   163 // CSimpleSipConnectionObserver::ConnectionStateChanged2
   175 // CSimpleSipConnectionObserver::ConnectionStateChanged2
   164 // -----------------------------------------------------------------------------
   176 // -----------------------------------------------------------------------------
   165 //
   177 //
   166 void CSimpleSipConnectionObserver::ConnectionStateChanged2(
   178 void CSimpleSipConnectionObserver::ConnectionStateChanged2(
   566         const TDesC8& content = elems->MessageElements().Content();
   578         const TDesC8& content = elems->MessageElements().Content();
   567         const TDesC8& user = fromHeader->SIPAddress().Uri8().Uri().
   579         const TDesC8& user = fromHeader->SIPAddress().Uri8().Uri().
   568             Extract( EUriUserinfo );
   580             Extract( EUriUserinfo );
   569         const TDesC8& host = fromHeader->SIPAddress().Uri8().Uri().
   581         const TDesC8& host = fromHeader->SIPAddress().Uri8().Uri().
   570             Extract( EUriHost );
   582             Extract( EUriHost );
       
   583         
       
   584         CleanupStack::PushL( aTransaction ); // CS: 1
       
   585         
   571         HBufC8* from = HBufC8::NewLC( user.Length() + KAt().Length() +
   586         HBufC8* from = HBufC8::NewLC( user.Length() + KAt().Length() +
   572             host.Length() ); // CS: 1
   587             host.Length() ); // CS: 1
   573         from->Des().Copy( user );
   588         from->Des().Copy( user );
   574         from->Des().Append( KAt() );
   589         from->Des().Append( KAt() );
   575         from->Des().Append( host );
   590         from->Des().Append( host );
   576         
   591         
   577         CleanupStack::PushL( aTransaction ); // CS: 2
       
   578         CSIPResponseElements* respElem = CSIPResponseElements::NewLC( // CS: 3
   592         CSIPResponseElements* respElem = CSIPResponseElements::NewLC( // CS: 3
   579             KSimpleOK, SIPStrings::StringF( SipStrConsts::EPhraseOk ) );
   593             KSimpleOK, SIPStrings::StringF( SipStrConsts::EPhraseOk ) );
   580         
   594         
   581         // Use the transaction to send 200 OK
   595         // Use the transaction to send 200 OK
   582         aTransaction->SendResponseL( respElem );
   596         aTransaction->SendResponseL( respElem );
   583         
   597         
   584         CleanupStack::Pop( respElem );     // CS: 2
   598         CleanupStack::Pop( respElem );     // CS: 2
   585         CleanupStack::Pop( aTransaction ); // CS: 1
   599 
   586         
       
   587         iCallback.HandleReceivedMessage( *from, content );
   600         iCallback.HandleReceivedMessage( *from, content );
   588         CleanupStack::PopAndDestroy( from ); // CS: 0
   601         CleanupStack::PopAndDestroy( from ); // CS: 1
       
   602         CleanupStack::Pop( aTransaction ); // CS: 0
   589         }
   603         }
   590     
   604     
   591     // We no longer need aTransaction. Just delete it.
   605     // We no longer need aTransaction. Just delete it.
   592     delete aTransaction;
   606     delete aTransaction;
   593     aTransaction = NULL;
   607     aTransaction = NULL;