satengine/satserver/Commands/CallControlCmd/src/CCallControlHandler.cpp
changeset 48 78df25012fda
parent 33 8d5d7fcf9b59
equal deleted inserted replaced
46:2fa1fa551b0b 48:78df25012fda
     1 /*
     1 /*
     2 * Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    28 #include    "SatLog.h"
    28 #include    "SatLog.h"
    29 
    29 
    30 // USSD DCS coding.
    30 // USSD DCS coding.
    31 const TUint8 KSatDcs7Bit( 0x40 );
    31 const TUint8 KSatDcs7Bit( 0x40 );
    32 
    32 
       
    33  /** 
       
    34   * USSD messages coded as a packed string within 160 octets, as defined for a 
       
    35   * ussd-String within GSM 04.80 and GSM 03.38. if the Dcs is 7 bit, a ussd 
       
    36   * string can have 182 charactor
       
    37   */
       
    38 const TInt   KSatMaxUSSDString( 182 );
       
    39 
    33 // ============================ MEMBER FUNCTIONS ===============================
    40 // ============================ MEMBER FUNCTIONS ===============================
    34 
    41 
    35 // -----------------------------------------------------------------------------
    42 // -----------------------------------------------------------------------------
    36 // CCallControlHandler::CCallControlHandler
    43 // CCallControlHandler::CCallControlHandler
    37 // C++ default constructor can NOT contain any code, that
    44 // C++ default constructor can NOT contain any code, that
   539     {
   546     {
   540     LOG( SIMPLE, "CALLCONTROL: CCallControlHandler::SendUssd calling" )
   547     LOG( SIMPLE, "CALLCONTROL: CCallControlHandler::SendUssd calling" )
   541     TInt err( KErrNone );
   548     TInt err( KErrNone );
   542     RSat::TUssdString ussdString;
   549     RSat::TUssdString ussdString;
   543     err = iCallControlData.GetSendUssdDetails ( ussdString );
   550     err = iCallControlData.GetSendUssdDetails ( ussdString );
       
   551     //If the Dcs or string length is not valid we should not send the ussd.
       
   552     if( !err )
       
   553         {
       
   554         if( !( iUtils->MultiModeApi().IsValidUssdDcs( ussdString.iDcs ) )
       
   555             || ( KSatMaxUSSDString < ussdString.iUssdString.Length() ) )
       
   556             {   
       
   557             err = KErrArgument;
       
   558             }
       
   559         }
       
   560     
   544     if ( !err )
   561     if ( !err )
   545         {
   562         {
   546         LOG2( NORMAL, "CALLCONTROL: CCallControlHandler::SendUssd string %S",
   563         LOG2( NORMAL, "CALLCONTROL: CCallControlHandler::SendUssd string %S",
   547             &ussdString.iUssdString )
   564             &ussdString.iUssdString )
   548          
   565          
   549         LOG2( NORMAL, "CALLCONTROL: CCallControlHandler::SendUssd schema %d",
       
   550             ussdString.iDcs )
       
   551 
       
   552         RMobileUssdMessaging::TMobileUssdAttributesV1 ussdAttr;
   566         RMobileUssdMessaging::TMobileUssdAttributesV1 ussdAttr;
   553         
       
   554         
       
   555         if ( KSatDcs7Bit == ussdString.iDcs )
   567         if ( KSatDcs7Bit == ussdString.iDcs )
   556             {
   568             {
   557             ussdAttr.iFormat= RMobileUssdMessaging::EFormatPackedString;
   569             ussdAttr.iFormat= RMobileUssdMessaging::EFormatPackedString;
   558             }
   570             }
   559         else
   571         else
   581         else
   593         else
   582             {
   594             {
   583             err = KErrNoMemory;
   595             err = KErrNoMemory;
   584             }    
   596             }    
   585         }
   597         }
   586 
   598     
   587     LOG2( NORMAL, "CALLCONTROL: CCallControlHandler::SendUssd exiting %d",
   599     LOG2( NORMAL, "CALLCONTROL: CCallControlHandler::SendUssd exiting %d",
   588           err)
   600           err)
   589     return err;
   601     return err;
   590     }
   602     }
   591 
       
   592 
   603 
   593 // -----------------------------------------------------------------------------
   604 // -----------------------------------------------------------------------------
   594 // CCallControlHandler::DispatchCcRequestComplete
   605 // CCallControlHandler::DispatchCcRequestComplete
   595 // (other items were commented in a header).
   606 // (other items were commented in a header).
   596 // -----------------------------------------------------------------------------
   607 // -----------------------------------------------------------------------------