sipvoipprovider/src/svpuriparser.cpp
branchRCL_3
changeset 10 ed1e38b404e5
parent 0 a4daefaec16c
equal deleted inserted replaced
9:bddb6d4447db 10:ed1e38b404e5
   152     const TDesC8& aUri, const TDesC8& aAOR, TBool aIsEmergency ) const
   152     const TDesC8& aUri, const TDesC8& aAOR, TBool aIsEmergency ) const
   153     {
   153     {
   154     SVPDEBUG1( "CSVPUriParser::CompleteSipUriL In" )
   154     SVPDEBUG1( "CSVPUriParser::CompleteSipUriL In" )
   155     
   155     
   156     // Copy the parameter to a new buffer.
   156     // Copy the parameter to a new buffer.
   157     HBufC8* uri = aUri.AllocLC();
   157     HBufC8* uri = aUri.AllocLC();   // CS: 1
       
   158     
       
   159 #ifdef _DEBUG
       
   160     TBuf<KSvpMaxDebugBufferSize> tmpStr;
       
   161     tmpStr.Copy( aAOR );
       
   162     SVPDEBUG2( "CSVPUriParser::CompleteSipUriL IN aAOR: %S", &tmpStr )
       
   163     tmpStr.Copy( aUri );
       
   164     SVPDEBUG2( "CSVPUriParser::CompleteSipUriL IN aURI: %S", &tmpStr )
       
   165 #endif // _DEBUG
   158     
   166     
   159     // Trim ALL white space from URI, even if used as an user name
   167     // Trim ALL white space from URI, even if used as an user name
   160     uri->Des().TrimAll();
   168     uri->Des().TrimAll();
   161 
   169 
   162     if ( uri )
   170     if ( uri )
   164         //First check is this tel-uri. Domain part is not allowed in tel-uri.
   172         //First check is this tel-uri. Domain part is not allowed in tel-uri.
   165         if ( uri->Length() >= KTelPrefixLength &&
   173         if ( uri->Length() >= KTelPrefixLength &&
   166              KErrNotFound != uri->Des().Left( KTelPrefixLength ).Find( KTelPrefix ) &&
   174              KErrNotFound != uri->Des().Left( KTelPrefixLength ).Find( KTelPrefix ) &&
   167              KErrNotFound == uri->Des().Find( KSVPAt ) )
   175              KErrNotFound == uri->Des().Find( KSVPAt ) )
   168             {
   176             {
   169             CleanupStack::Pop( uri );
   177             CleanupStack::Pop( uri );  // CS:0
   170             return uri;
   178             return uri;
   171             }
   179             }
   172         
   180         
   173         // parse display name if exists
   181         // parse display name if exists
   174         while ( KErrNotFound != uri->Find( KSVPSipPrefix ) )
   182         while ( KErrNotFound != uri->Find( KSVPSipPrefix ) )
   248         }
   256         }
   249     else
   257     else
   250         {
   258         {
   251         SVPDEBUG1( "    CSVPUriParser::CompleteSipUriL uri null" )
   259         SVPDEBUG1( "    CSVPUriParser::CompleteSipUriL uri null" )
   252         }
   260         }
   253 
   261     
       
   262 #ifdef _DEBUG
       
   263     tmpStr.Copy( *uri );
       
   264     SVPDEBUG2( "CSVPUriParser::CompleteSipUriL OUT: %S", &tmpStr )
       
   265 #endif // _DEBUG
       
   266     
   254     CleanupStack::Pop( 1 ); // uri
   267     CleanupStack::Pop( 1 ); // uri
   255     
       
   256     SVPDEBUG1( "CSVPUriParser::CompleteSipUriL Out" )
       
   257     return uri;
   268     return uri;
   258     }
   269     }
   259 
   270 
   260 // ---------------------------------------------------------------------------
   271 // ---------------------------------------------------------------------------
   261 // CSVPUriParser::AddUserEqualsPhone
   272 // CSVPUriParser::AddUserEqualsPhone
   284     {
   295     {
   285     SVPDEBUG1( "CSVPUriParser::CompleteSecureSipUriL In" )
   296     SVPDEBUG1( "CSVPUriParser::CompleteSecureSipUriL In" )
   286     
   297     
   287     // Copy the parameter to a new buffer.
   298     // Copy the parameter to a new buffer.
   288     HBufC8* uri = aUri.AllocLC();
   299     HBufC8* uri = aUri.AllocLC();
       
   300 
       
   301 #ifdef _DEBUG
       
   302     TBuf<KSvpMaxDebugBufferSize> tmpStr;
       
   303     tmpStr.Copy( aAOR );
       
   304     SVPDEBUG2( "CSVPUriParser::CompleteSecureSipUriL IN aAOR: %S", &tmpStr )
       
   305     tmpStr.Copy( aUri );
       
   306     SVPDEBUG2( "CSVPUriParser::CompleteSecureSipUriL IN aURI: %S", &tmpStr )
       
   307 #endif // _DEBUG
   289     
   308     
   290     // Trim ALL white space from URI, even if used as an user name 
   309     // Trim ALL white space from URI, even if used as an user name 
   291     uri->Des().TrimAll();
   310     uri->Des().TrimAll();
   292 
   311 
   293     if ( uri )
   312     if ( uri )
   361         }
   380         }
   362     else
   381     else
   363         {
   382         {
   364         SVPDEBUG1( "    CSVPUriParser::CompleteSecureSipUriL uri null" )
   383         SVPDEBUG1( "    CSVPUriParser::CompleteSecureSipUriL uri null" )
   365         }
   384         }
   366 
   385     
       
   386 #ifdef _DEBUG
       
   387     tmpStr.Copy( *uri );
       
   388     SVPDEBUG2( "CSVPUriParser::CompleteSecureSipUriL OUT: %S", &tmpStr )
       
   389 #endif // _DEBUG
       
   390     
   367     CleanupStack::Pop( 1 ); // uri
   391     CleanupStack::Pop( 1 ); // uri
   368     
       
   369     SVPDEBUG1( "CSVPUriParser::CompleteSecureSipUriL Out" )
       
   370     return uri;
   392     return uri;
   371     }
   393     }
   372 
   394 
   373 // ---------------------------------------------------------------------------
   395 // ---------------------------------------------------------------------------
   374 // CSVPUriParser::CompleteEventSipUriL
   396 // CSVPUriParser::CompleteEventSipUriL
   418 //
   440 //
   419 TBool CSVPUriParser::CheckSipsPrefix( const TDesC8& aUri ) const
   441 TBool CSVPUriParser::CheckSipsPrefix( const TDesC8& aUri ) const
   420     {
   442     {
   421     SVPDEBUG1( "CSVPUriParser::CheckSipsPrefix" )
   443     SVPDEBUG1( "CSVPUriParser::CheckSipsPrefix" )
   422     
   444     
   423     // The "sip:" prefix is expected to be at the beginning of the URI.
   445     // The "sips:" prefix is expected to be at the beginning of the URI.
   424     return ( 0 == aUri.Find( KSVPSipsPrefix ) );
   446     return ( 0 == aUri.Find( KSVPSipsPrefix ) );
   425     }
   447     }
   426 
   448 
   427 // ---------------------------------------------------------------------------
   449 // ---------------------------------------------------------------------------
   428 // CSVPUriParser::CheckAt
   450 // CSVPUriParser::CheckAt
   557     // Copy the domain to the domain buffer.
   579     // Copy the domain to the domain buffer.
   558     domainBuf->Des().Append( aAOR.Mid( atPos + 1 ) );
   580     domainBuf->Des().Append( aAOR.Mid( atPos + 1 ) );
   559     
   581     
   560     // Re-allocate the URI
   582     // Re-allocate the URI
   561     aUri = aUri->ReAllocL( aUri->Length() + domainBuf->Length() );
   583     aUri = aUri->ReAllocL( aUri->Length() + domainBuf->Length() );
   562     aUri->Des().Append( domainBuf->Des() ); // Append the domain.
   584     aUri->Des().Append( *domainBuf ); // Append the domain.
   563     
   585     
   564     CleanupStack::PopAndDestroy( domainBuf ); // CS : 0
   586     CleanupStack::PopAndDestroy( domainBuf ); // CS : 0
   565     
   587     
   566     SVPDEBUG1( "CSVPUriParser::AddDomainL Out" )
   588     SVPDEBUG1( "CSVPUriParser::AddDomainL Out" )
   567     }
   589     }