mmshplugins/mmshaoplugin/src/muscallmonitorbase.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:31:01 +0100
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201032 Kit: 201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:  Monitor the events of CS call
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include "mussesseioninformationapi.h"
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include "muscallmonitorbase.h"
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include "muslogger.h"
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    22
#include "mussettings.h"
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include <etel.h>
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include <etelmm.h>
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include <e32svr.h>
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
#include <mmtsy_names.h>
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
#include <e32property.h>
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    30
_LIT( KDoNotSendOwnNumber, "#31#" );
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    31
_LIT( KDoSendOwnNumber, "*31#" );
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    32
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
// -----------------------------------------------------------------------------
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
// C++ destructor.
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
// -----------------------------------------------------------------------------
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
//
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
CMusCallMonitorBase::~CMusCallMonitorBase()
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
    {
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
    MUS_LOG( "mus: [MUSAO]  -> CMusCallMonitorBase::~CMusCallMonitorBase" )        
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
    MUS_LOG( "mus: [MUSAO]  <- CMusCallMonitorBase::~CMusCallMonitorBase" )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
    }
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
// -----------------------------------------------------------------------------
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
// C++ constructor.
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
// -----------------------------------------------------------------------------
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
//
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    48
CMusCallMonitorBase::CMusCallMonitorBase(const RMobileCall& aCall, MMusTsyPropertyObserver& aObserver ) 
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    49
        : CActive( EPriorityNormal ),iCall(aCall),iTsyObserver( aObserver )
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
        
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
    {   
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
	// Intialize the remote call event state to Resume , means connected.
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
    iRemoteCallEvent = RMobileCall::ERemoteResume;
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
    // Intialize the local call event state to Resume , means connected.
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
    iLocalCallEvent = RMobileCall::ELocalResume;
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
    }
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
// -----------------------------------------------------------------------------
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
// CMusCallMonitorBase::SetStateL( TInt aError )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
// Sets the Call State to Property
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
// -----------------------------------------------------------------------------
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
//
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
void CMusCallMonitorBase::SetStateL(NMusSessionInformationApi::TMusCallEvent aVal)
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
    {
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
    MUS_LOG1( "mus: [MUSAO]  -> CMusCallMonitorBase::SetStateL, aVal %d", aVal )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
    TInt callCount = 0;
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
    User::LeaveIfError(RProperty::Get( NMusSessionInformationApi::KCategoryUid,
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
                            NMusSessionInformationApi::KMusCallCount,callCount));
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
    MUS_LOG1( "mus: [MUSAO]  - CallCount = %d",callCount )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
    /*
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
    * CountOfCallMonitors is number of CallMonitor Objects.Static Reference Count.
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
    * = No of active calls . 
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
    * React one and only if one call is present -> Mush Call criteria.
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
    * if call count is more than one , should be taken care by conference call or
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
    * multicall criteria.
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
    */
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    77
     if( callCount == 1) 
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
        {
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
        TInt currentVal;
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
        User::LeaveIfError(RProperty::Get( NMusSessionInformationApi::KCategoryUid,
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
                            NMusSessionInformationApi::KMusCallEvent,currentVal));
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
        MUS_LOG1( "mus: [MUSAO]  - Remote State = %d",iRemoteCallEvent )
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    83
        
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    84
        
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    85
        /*
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    86
         If Call is Connected then set the Call info.
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    87
         */
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    88
        if( aVal==NMusSessionInformationApi::ECallConnected ) 
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    89
            {
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    90
            SetCallInfoL();
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    91
            }
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
    92
        
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
        /* If current event is callconnected and remote is not in hold set the
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
           property value to CallConnected.Else set it to CallHold.
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
           Note : We can be sure about Local is connected when it goes to
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
                  CallConnected State. But remote call events are just notified
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
                  in call event monitor. So this stores the last remotecall event
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
                  and checks it now.
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
        */        
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
        if( aVal==NMusSessionInformationApi::ECallConnected 
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
            && iRemoteCallEvent!=RMobileCall::ERemoteHold)
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
            {
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
            /* If the current property value is same of new value, there is no
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
               point of setting it since it will cause lot of other processes.               
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
            */
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
            if(currentVal != (TInt)aVal)
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
                {
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
                User::LeaveIfError(RProperty::Set( NMusSessionInformationApi::KCategoryUid,
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
                                                 NMusSessionInformationApi::KMusCallEvent,
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
                                                 aVal ));    
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
                }
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   112
            }
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   113
    	else if( aVal==NMusSessionInformationApi::EConferenceCall)
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   114
    			{
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   115
                User::LeaveIfError(RProperty::Set( NMusSessionInformationApi::KCategoryUid,
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   116
                                                   NMusSessionInformationApi::KMusCallEvent,
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   117
                                                   NMusSessionInformationApi::EConferenceCall   ));  
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   118
    			}
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
        else if( aVal==NMusSessionInformationApi::ECallHold || iRemoteCallEvent==RMobileCall::ERemoteHold )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
            {            
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
            User::LeaveIfError(RProperty::Set( NMusSessionInformationApi::KCategoryUid,
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
                                               NMusSessionInformationApi::KMusCallEvent,
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
                                               NMusSessionInformationApi::ECallHold   ));  
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
            }          
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   125
        if( aVal != NMusSessionInformationApi::ENoCall)
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
            {
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   127
            RMobileCall::TMobileCallInfoV3 callInfo;
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   128
            RMobileCall::TMobileCallInfoV3Pckg pckg( callInfo );
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   129
    
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   130
            User::LeaveIfError(iCall.GetMobileCallInfo( pckg ));  
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   131
            if( callInfo.iEmergency )
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   132
                    {
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   133
                    User::LeaveIfError(RProperty::Set( NMusSessionInformationApi::KCategoryUid,
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   134
                                             NMusSessionInformationApi::KMusCallEvent,
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   135
                                             ( TInt ) NMusSessionInformationApi::ENoCall ));
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   136
                    }
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
            }
31
33a5d2bbf6fc Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 18
diff changeset
   138
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
        }   
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
 
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
    MUS_LOG( "mus: [MUSAO]  <- CMusCallMonitorBase::SetStateL" )    
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
    }
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
///-----------------------------------------------------------------------------
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
// CMusCallMonitorBase::SetCallInfoL( TInt aError )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
// -----------------------------------------------------------------------------
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
//
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
void CMusCallMonitorBase::SetCallInfoL()
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   149
    {
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
    MUS_LOG( "mus: [MUSAO]  -> CMusCallMonitorBase::SetCallInfoL ")           
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   151
    RMobileCall::TMobileCallInfoV3 callInfo;
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   152
    RMobileCall::TMobileCallInfoV3Pckg callInfoPckg( callInfo );
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
    User::LeaveIfError(iCall.GetMobileCallInfo( callInfoPckg ));    
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   154
    RMobilePhone::TMobileAddress remoteNumber = 
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   155
                                           callInfo.iRemoteParty.iRemoteNumber;
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   156
     // Set telephone number
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   157
    HBufC* telNo( NULL );
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   158
    HBufC* cleanTelNo( NULL );
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   159
    if( remoteNumber.iTelNumber.Length() > 0 )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   160
        {
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   161
        MUS_LOG( "mus: [MUSAO]     remoteNumber.iTelNumber.Lenght > 0" )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   162
        telNo = remoteNumber.iTelNumber.AllocLC();
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   163
        }
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
    else
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   165
        {
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   166
        MUS_LOG( "mus: [MUSAO]     remoteNumber.iTelNumber.Lenght =< 0" )
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
        RMobilePhone::TMobileAddress dialledParty = callInfo.iDialledParty;
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
        telNo = dialledParty.iTelNumber.AllocLC();
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   169
        
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
        }
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   171
    if ( MultimediaSharingSettings::PrivacySetting() )
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   172
        {
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   173
        SetClirSetting( *telNo );
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   174
        }
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   175
    cleanTelNo = RemovePrefix( *telNo );
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   176
    CleanupStack::PushL( cleanTelNo );  
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   177
    
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
    User::LeaveIfError(RProperty::Set( 
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
                                      NMusSessionInformationApi::KCategoryUid,
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   180
                                      NMusSessionInformationApi::KMusTelNumber,
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   181
                                      *cleanTelNo ));  
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   182
    MUS_LOG_TDESC("mus: [MUSAO]     telNo = ", (*cleanTelNo))
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   183
    CleanupStack::PopAndDestroy(cleanTelNo);
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   184
    CleanupStack::PopAndDestroy(telNo);
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   185
    
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   186
    // Set call direction.
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   187
    RMobileCall::TMobileCallDirection direction =
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
                                            callInfo.iRemoteParty.iDirection;
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   189
    MUS_LOG1( "mus: [MUSAO]  Call Direction = %d",direction )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   190
    if( direction == RMobileCall::EMobileOriginated )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   191
        {
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   192
        User::LeaveIfError(RProperty::Set( 
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   193
                        NMusSessionInformationApi::KCategoryUid,
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
                        NMusSessionInformationApi::KMusCallDirection,
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
                        ( TInt ) NMusSessionInformationApi::ECallOrginated ));
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
        }
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
    else if ( direction  == RMobileCall::EMobileTerminated )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
        {
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   199
        SetTerminatingPrivacy( iCall );
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   200
        User::LeaveIfError(RProperty::Set( 
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   201
                        NMusSessionInformationApi::KCategoryUid,
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
                        NMusSessionInformationApi::KMusCallDirection,
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   203
                        ( TInt ) NMusSessionInformationApi::ECallTerminated ));
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
        }
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
    else
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
        {
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
        User::LeaveIfError(RProperty::Set( 
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   208
                        NMusSessionInformationApi::KCategoryUid,
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
                        NMusSessionInformationApi::KMusCallDirection,
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
                        ( TInt ) NMusSessionInformationApi::ENoDirection ));
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   211
        }
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   212
    
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   213
    
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   214
    MUS_LOG( "mus: [MUSAO]  <- CMusCallMonitorBase::SetCallInfoL" )  
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   215
    }
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   216
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
// -----------------------------------------------------------------------------
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   218
// CMusCallMonitorBase::RunError( TInt aError )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   219
// Implemented for CActive.
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   220
// Will be called automatically by framework when RunL Leaves.
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   221
// -----------------------------------------------------------------------------
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   222
//
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   224
TInt CMusCallMonitorBase::RunError( TInt aError )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   225
    {
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   226
    MUS_LOG1( "mus: [MUSAO]  -> CMusCallMonitorBase::RunError, aError %d",\
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   227
                                                                      aError )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   228
    aError = KErrNone; // just to avoid warnings.
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   229
    MUS_LOG( "mus: [MUSAO]  <- CMusCallMonitorBase::RunError" )    
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   230
    return aError;
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   231
    }
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   232
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
// -----------------------------------------------------------------------------
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
// CMusCallMonitorBase::NotifyCallStateChanged()
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   235
// Notify TSYobserver that our call status or call event state changed
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   236
// -----------------------------------------------------------------------------
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   237
//
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
void CMusCallMonitorBase::NotifyCallStateChanged( NMusSessionInformationApi::TMusCallEvent aVal )
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
    {
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
    RCall::TCallInfo callInfo;
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
    iCall.GetInfo(callInfo);
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   242
    iTsyObserver.NotifyCallStateChanged( aVal, callInfo.iCallName );
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   243
    }
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   244
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   245
// --------------------------------------------------------------------------
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   246
// void CMusCallMonitorBase::SetClirSetting()
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   247
// Determine CLIR setting from dialled digits
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   248
// --------------------------------------------------------------------------
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   249
//
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   250
void CMusCallMonitorBase::SetClirSetting( const TDesC& aDialledNumber ) const
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   251
    {
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   252
    MUS_LOG( "mus: [MUSAO]  -> CMusCallMonitorBase::SetClirSetting" );
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   253
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   254
    NMusSessionInformationApi::TMusClirSetting 
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   255
        sendNumber( NMusSessionInformationApi::ESendOwnNumber );
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   256
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   257
    TPtrC prefix = aDialledNumber.Left( KDoNotSendOwnNumber().Length() );
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   258
    if ( prefix == KDoNotSendOwnNumber() )
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   259
        {
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   260
        sendNumber = NMusSessionInformationApi::EDoNotSendOwnNumber;
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   261
        }
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   262
    RProperty::Set( NMusSessionInformationApi::KCategoryUid, 
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   263
                    NMusSessionInformationApi::KMusClirSetting, sendNumber );
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   264
    MUS_LOG1( "mus: [MUSAO]  <- CMusCallMonitorBase::SetClirSetting send nbr=%d",
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   265
    sendNumber == NMusSessionInformationApi::ESendOwnNumber );
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   266
    }
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   267
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   268
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   269
// --------------------------------------------------------------------------
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   270
// void CMusCallMonitorBase::RemovePrefix()
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   271
// --------------------------------------------------------------------------
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   272
//
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   273
HBufC* CMusCallMonitorBase::RemovePrefix( const TDesC& aOriginator ) const
32
73a1feb507fb Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
   274
    {
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   275
    MUS_LOG( "mus: [MUSAO]  -> CMusCallMonitorBase::removePrefix" );
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   276
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   277
    HBufC * withoutPrefix(NULL);
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   278
    
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   279
    TPtrC prefix = aOriginator.Left( KDoNotSendOwnNumber().Length() );
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   280
    if ( prefix == KDoNotSendOwnNumber()|| prefix == KDoSendOwnNumber() )
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   281
        {
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   282
        MUS_LOG( "Number have a prefix" );
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   283
        withoutPrefix = aOriginator.AllocL();
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   284
        *withoutPrefix = aOriginator;
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   285
        TPtr ptr = withoutPrefix->Des();
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   286
        ptr.Delete(0,KDoNotSendOwnNumber().Length());
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   287
        }
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   288
    else
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   289
        {
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   290
        withoutPrefix = aOriginator.AllocL();
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   291
        }
32
73a1feb507fb Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 31
diff changeset
   292
    
33
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   293
    MUS_LOG( "mus: [MUSAO]  <- CMusCallMonitorBase::RemovePrefix" );
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   294
    return withoutPrefix;
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   295
    }
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   296
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   297
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   298
// --------------------------------------------------------------------------
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   299
// void CMusCallMonitorBase::SetTerminatingPrivacy()
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   300
// --------------------------------------------------------------------------
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   301
//
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   302
void CMusCallMonitorBase::SetTerminatingPrivacy( const RMobileCall& aCall ) const
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   303
    {
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   304
    MUS_LOG( "mus: [MUSAO]  -> CMusCallMonitorBase::SetTerminatingPrivacy" )
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   305
    RMobileCall::TMobileCallInfoV3 callInfo;
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   306
    RMobileCall::TMobileCallInfoV3Pckg callInfoPckg( callInfo );
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   307
    if( aCall.GetMobileCallInfo( callInfoPckg ) != KErrNone )
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   308
        {
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   309
        return; // error cannot do
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   310
        }
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   311
    MUS_LOG( "mus: [MUSAO] Get remote status" )
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   312
    RMobileCall::TMobileCallRemoteIdentityStatus remoteStatus = 
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   313
                    callInfo.iRemoteParty.iRemoteIdStatus;
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   314
            
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   315
    if( remoteStatus == RMobileCall::ERemoteIdentitySuppressed )
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   316
        {
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   317
         RProperty::Set( NMusSessionInformationApi::KCategoryUid,
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   318
                        NMusSessionInformationApi::KMUSPrivacy,
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   319
                        ( TInt ) NMusSessionInformationApi::EPrivacyOn );
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   320
        }
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   321
    else
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   322
        {
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   323
        RProperty::Set( NMusSessionInformationApi::KCategoryUid,
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   324
                        NMusSessionInformationApi::KMUSPrivacy,
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   325
                        ( TInt ) NMusSessionInformationApi::EPrivacyOff );
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   326
        }
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   327
    MUS_LOG1( "mus: [MUSAO] Remote status = %d",remoteStatus )
bc78a40cd63c Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 32
diff changeset
   328
    MUS_LOG( "mus: [MUSAO]  <- CMusCallMonitorBase::SetTerminatingPrivacy" )
0
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   329
    }
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   330
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   331
// End of file
f0cf47e981f9 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   332