simpleengine/siputils/src/simplesipconnectionobserver.cpp
branchRCL_3
changeset 17 2669f8761a99
parent 0 c8caa15ef882
child 18 fbd2e7cec7ef
equal deleted inserted replaced
16:2580314736af 17:2669f8761a99
   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 
       
   174 // -----------------------------------------------------------------------------
   162 // -----------------------------------------------------------------------------
   175 // CSimpleSipConnectionObserver::ConnectionStateChanged2
   163 // CSimpleSipConnectionObserver::ConnectionStateChanged2
   176 // -----------------------------------------------------------------------------
   164 // -----------------------------------------------------------------------------
   177 //
   165 //
   178 void CSimpleSipConnectionObserver::ConnectionStateChanged2(
   166 void CSimpleSipConnectionObserver::ConnectionStateChanged2(
   578         const TDesC8& content = elems->MessageElements().Content();
   566         const TDesC8& content = elems->MessageElements().Content();
   579         const TDesC8& user = fromHeader->SIPAddress().Uri8().Uri().
   567         const TDesC8& user = fromHeader->SIPAddress().Uri8().Uri().
   580             Extract( EUriUserinfo );
   568             Extract( EUriUserinfo );
   581         const TDesC8& host = fromHeader->SIPAddress().Uri8().Uri().
   569         const TDesC8& host = fromHeader->SIPAddress().Uri8().Uri().
   582             Extract( EUriHost );
   570             Extract( EUriHost );
   583         
       
   584         CleanupStack::PushL( aTransaction ); // CS: 1
       
   585         
       
   586         HBufC8* from = HBufC8::NewLC( user.Length() + KAt().Length() +
   571         HBufC8* from = HBufC8::NewLC( user.Length() + KAt().Length() +
   587             host.Length() ); // CS: 1
   572             host.Length() ); // CS: 1
   588         from->Des().Copy( user );
   573         from->Des().Copy( user );
   589         from->Des().Append( KAt() );
   574         from->Des().Append( KAt() );
   590         from->Des().Append( host );
   575         from->Des().Append( host );
   591         
   576         
       
   577         CleanupStack::PushL( aTransaction ); // CS: 2
   592         CSIPResponseElements* respElem = CSIPResponseElements::NewLC( // CS: 3
   578         CSIPResponseElements* respElem = CSIPResponseElements::NewLC( // CS: 3
   593             KSimpleOK, SIPStrings::StringF( SipStrConsts::EPhraseOk ) );
   579             KSimpleOK, SIPStrings::StringF( SipStrConsts::EPhraseOk ) );
   594         
   580         
   595         // Use the transaction to send 200 OK
   581         // Use the transaction to send 200 OK
   596         aTransaction->SendResponseL( respElem );
   582         aTransaction->SendResponseL( respElem );
   597         
   583         
   598         CleanupStack::Pop( respElem );     // CS: 2
   584         CleanupStack::Pop( respElem );     // CS: 2
   599 
   585         CleanupStack::Pop( aTransaction ); // CS: 1
       
   586         
   600         iCallback.HandleReceivedMessage( *from, content );
   587         iCallback.HandleReceivedMessage( *from, content );
   601         CleanupStack::PopAndDestroy( from ); // CS: 1
   588         CleanupStack::PopAndDestroy( from ); // CS: 0
   602         CleanupStack::Pop( aTransaction ); // CS: 0
       
   603         }
   589         }
   604     
   590     
   605     // We no longer need aTransaction. Just delete it.
   591     // We no longer need aTransaction. Just delete it.
   606     delete aTransaction;
   592     delete aTransaction;
   607     aTransaction = NULL;
   593     aTransaction = NULL;