telephonyserverplugins/multimodetsy/hayes/CALL.CPP
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:40:21 +0100
branchRCL_3
changeset 66 07a122eea281
parent 65 630d2f34d719
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201035 Kit: 201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
// All rights reserved.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
// Initial Contributors:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
// Contributors:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
// Description:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
#include <commsdattypesv1_1.h>
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
#include "CALL.H"		// Header file for this source file
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#include "NOTIFY.H"
66
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    19
#include "FAX.H"
0
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include "ATDIAL.H"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include "ATANSWER.H"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include "ATCONNCT.H"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include "ATHANGUP.H"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include "ATO.H"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include "ATNOCARR.H"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include "LINE.H"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
#include "ATINIT.H"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
#include "mSLOGGER.H"	// for LOGTEXT untilities
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
#include "ATIO.H"		// For CATIO class
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
#include "PHONE.H"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
#include <et_clsvr.h>
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
#include "ATBASE.H"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
#include "Matstd.h"		// For AT command string constants 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
#include "set_cbst.h"		// for CATSetCBST class
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
#include "et_struct.h"
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
66
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    37
_LIT(KFaxServerName,"FaxSvr.dll");
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
    38
0
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
// CAcquireEntry class
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
CAcquireEntry* CAcquireEntry::NewL(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
// Create new request entry
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
	return new(ELeave) CAcquireEntry(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
CAcquireEntry::CAcquireEntry(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
// Constructor
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
	iTsyReqHandle=aTsyReqHandle;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
CAcquireEntry::~CAcquireEntry()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
// Destructor
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
	{}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
void CAcquireEntry::Deque()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
// Deque List
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
	iLink.Deque();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
	iLink.iPrev=iLink.iNext=NULL;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
CAcquireOwnerList::CAcquireOwnerList()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
	{}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
CAcquireOwnerList::~CAcquireOwnerList()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
	{}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
CAcquireOwnerList* CAcquireOwnerList::NewL()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
//	Static function to create new acquire owner list
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
	CAcquireOwnerList* self=new(ELeave) CAcquireOwnerList();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
	CleanupStack::PushL(self);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
	self->ConstructL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
	CleanupStack::Pop(self);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
	return self;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
void CAcquireOwnerList::ConstructL()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
	iAcquireList.SetOffset(_FOFF(CAcquireEntry,iLink));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
CAcquireEntry* CAcquireOwnerList::FindByTsyReqHandle(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
//	Searches for client interested in taking ownership of call, by its TsyReqHandle
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
	CAcquireEntry* entry;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
	TDblQueIter<CAcquireEntry> iter(iAcquireList);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
	while(entry = iter++, entry!=NULL)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
		if(entry->iTsyReqHandle==aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
			return entry;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
	return NULL;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
void CAcquireOwnerList::Remove(CAcquireEntry* aEntry)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
	aEntry->Deque();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
	delete aEntry;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
//	CHeartbeatRunner - periodic class to count seconds from beginning of call
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
CHeartbeatRunner* CHeartbeatRunner::NewL(CCallHayes* aCallHayes,CNotifications* aNotificationStore)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
	CHeartbeatRunner* self=new (ELeave) CHeartbeatRunner(aCallHayes,aNotificationStore);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
	CleanupStack::PushL(self);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
    self->ConstructL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
	CleanupStack::Pop();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
    return self;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
CHeartbeatRunner::CHeartbeatRunner(CCallHayes* aCallHayes,CNotifications* aNotificationStore)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
	:iCallHayes(aCallHayes), iNotificationStore(aNotificationStore)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
	{}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
void CHeartbeatRunner::ConstructL()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
	iHeartbeat=CHeartbeat::NewL(0); // neutral priority
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
CHeartbeatRunner::~CHeartbeatRunner()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
	if (iHeartbeat != NULL)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
		iHeartbeat->Cancel();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
    delete iHeartbeat;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
void CHeartbeatRunner::Start()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
	iStartTime.UniversalTime();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   149
	iHeartbeat->Start(ETwelveOClock,this);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   151
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   152
void CHeartbeatRunner::Stop()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   154
	iHeartbeat->Cancel();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   155
	iTicks=0;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   156
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   157
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
TTimeIntervalSeconds CHeartbeatRunner::CallDuration() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   159
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   160
	TTimeIntervalSeconds duration(iTicks);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   161
	return duration;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   162
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   163
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
// private functions
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   165
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
void CHeartbeatRunner::Beat()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
	iTicks++;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   169
	iNotificationStore->CheckNotification(iCallHayes,ETimePeriodElapsed);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   171
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
void CHeartbeatRunner::Synchronize()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   173
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
	TInt ticksMissed = 0;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
	TTime desiredTime = iStartTime + TTimeIntervalMicroSeconds(iTicks * KCallTimerInterval);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   176
	TTime currentTime; // set current time to now
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   177
	currentTime.UniversalTime();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
	TTimeIntervalMicroSeconds missedTime = currentTime.MicroSecondsFrom(desiredTime);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
	// Calculate the ticks missed (quickly!)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   180
	TInt64 missedTimeInt = missedTime.Int64(); // convert the missed time interval to an Int64
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   181
	ticksMissed = I64INT(missedTimeInt / KCallTimerInterval);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
	// The following loop increments the ticks missed by the same amount, but takes much longer
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   183
	// while (desiredTime < currentTime)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   184
	//	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   185
	//	desiredTime = desiredTime - TTimeIntervalMicroSeconds(iTickInterval);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   186
	//	ticksMissed++;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   187
	//	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
	iTicks = iTicks + ticksMissed;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   189
	LOGTEXT3(_L8("Heartbeat function synchronising - from %d to %d"),iTicks-ticksMissed,iTicks);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   190
	if (ticksMissed!=0)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   191
		iNotificationStore->CheckNotification(iCallHayes,ETimePeriodElapsed);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   192
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   193
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
// CCallHayes - General Call Functionality
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
void CCallHayes::CloseCall(TAny* aObj)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   199
// Utility func for cleanup stack
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   200
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   201
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
	((CObject*)aObj)->Close();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   203
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
CCallHayes::CCallHayes(CATIO* aIo,CATInit* aInit,CPhoneGlobals* aPhoneGlobals) 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
			: iPhoneGlobals(aPhoneGlobals),iIo(aIo),iInit(aInit)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
	{}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   208
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
void CCallHayes::ConstructL(const TName& aName)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   211
//	Initialise Call Information
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   212
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   213
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   214
	LOGTEXT(_L8("Entered CCallHayes::ConstructL()"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   215
	iCallInfo.iCallName = aName;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   216
	iCallInfo.iBearerService.iBearerCaps = RCall::KBearerCapsCompressionUnknown | RCall::KBearerCapsProtocolUnknown;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
	iCallInfo.iBearerService.iBearerSpeed = RCall::EBearerDataUnknown;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   218
	iCallInfo.iHookStatus = RCall::EHookStatusOn;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   219
	iCallInfo.iClientPanicOccurred = ENoPanicOccurred;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   220
	//	Read default call preferences from database
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   221
	GetDefaultCallParams();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   222
	iCallInfo.iLoanedToClient = EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
	if (iPhoneGlobals->iPhoneStatus.iLineStatus == RCall::EStatusRinging)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   224
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   225
		iCallInfo.iMobileStatus = RMobileCall::EStatusRinging;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   226
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   227
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   228
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   229
		iCallInfo.iMobileStatus = RMobileCall::EStatusIdle;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   230
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   231
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   232
	iQuickInit=CATQuickInit::NewL(iIo,this,iPhoneGlobals);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
	iWaitForNoCarrier=CATWaitForNoCarrier::NewL(iIo,this,iPhoneGlobals);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
	iList=CAcquireOwnerList::NewL();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   235
	iCallTimer = CHeartbeatRunner::NewL(this,iPhoneGlobals->iNotificationStore);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   236
	LOGTEXT2(_L8("iCallTimer = %x"),iCallTimer);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   237
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
CCallHayes::~CCallHayes()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
	LOGTEXT(_L8("Entered CCallHayes destructor"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   242
	if (Owner())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   243
		REINTERPRET_CAST(CLineHayes*,Owner())->RemoveCall(this);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   244
	iPhoneGlobals->iNotificationStore->RemoveClientFromLastEvents(this);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
	delete iWaitForNoCarrier;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   246
	delete iList;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247
	delete iQuickInit;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   248
	delete iCallTimer;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   249
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   250
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   251
CTelObject::TReqMode CCallHayes::ReqModeL(const TInt aIpc)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   253
	TReqMode reqMode = CCallBase::ReqModeL(aIpc);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   254
	if ((reqMode & KReqModeFlowControlObeyed || aIpc==EEtelCallAnswer) && iPhoneGlobals->iPhoneStatus.iDataPortLoaned)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   255
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   256
		LOGTEXT2(_L8("ReqModeL Leaving with KErrInUse as data port is loaned (aIpc=%d)"),aIpc);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   257
		User::Leave(KErrInUse);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   259
	return reqMode;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   260
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   261
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   262
TInt CCallHayes::RegisterNotification(const TInt /*aIpc*/)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   263
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   264
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   265
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   266
TInt CCallHayes::DeregisterNotification(const TInt /*aIpc*/)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   267
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   268
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   269
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   270
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   271
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   272
void CCallHayes::Init()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   273
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   274
//	Only CPhoneHayes::Init() is implemented as that is called first
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   275
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   276
	{}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   277
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   278
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   279
TInt CCallHayes::NotifyCapsChange(const TTsyReqHandle aTsyReqHandle, RCall::TCaps* aCaps)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   280
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   281
	LOGTEXT(_L8("Call:\tCaps Change Notification lodged"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   282
	iPhoneGlobals->iNotificationStore->RegisterNotification(ECallCaps,aTsyReqHandle,this,aCaps);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   283
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   284
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   285
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   286
TInt CCallHayes::NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   287
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   288
	LOGTEXT(_L8("Call:\tCaps Change Notification cancelled"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   289
	iPhoneGlobals->iNotificationStore->RemoveNotification(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   290
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   291
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   292
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   293
TInt CCallHayes::NotifyHookChange(const TTsyReqHandle aTsyReqHandle, RCall::THookStatus* aHookStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   294
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   295
	LOGTEXT(_L8("Call:\tHook Change Notification lodged"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   296
	iPhoneGlobals->iNotificationStore->RegisterNotification(ECallHookChange,aTsyReqHandle,this,aHookStatus);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   297
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   298
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   299
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   300
TInt CCallHayes::NotifyHookChangeCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   301
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   302
	LOGTEXT(_L8("Call:\tHook Change Notification cancelled"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   303
	iPhoneGlobals->iNotificationStore->RemoveNotification(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   304
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   305
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   306
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   307
TInt CCallHayes::NotifyStatusChange(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   308
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   309
	LOGTEXT(_L8("Call:\tStatus Change Notification lodged"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   310
	iPhoneGlobals->iNotificationStore->RegisterNotification(ECallStatusChange,aTsyReqHandle,this,aStatus);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   311
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   312
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   313
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   314
TInt CCallHayes::NotifyStatusChangeCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   315
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   316
	LOGTEXT(_L8("Call:\tStatus Change Notification cancelled"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   317
	iPhoneGlobals->iNotificationStore->RemoveNotification(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   318
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   319
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   320
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   321
TInt CCallHayes::NotifyDurationChange(const TTsyReqHandle aTsyReqHandle,TTimeIntervalSeconds* aTime)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   322
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   323
	LOGTEXT(_L8("Call:\tDuration Change Notification lodged"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   324
	iPhoneGlobals->iNotificationStore->RegisterNotification(ECallDurationChange,aTsyReqHandle,this,aTime);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   325
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   326
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   327
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   328
TInt CCallHayes::NotifyDurationChangeCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   329
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   330
	LOGTEXT(_L8("Call:\tDuration Change Notification cancelled"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   331
	iPhoneGlobals->iNotificationStore->RemoveNotification(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   332
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   333
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   334
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   335
TInt CCallHayes::GetInfo(const TTsyReqHandle aTsyReqHandle, RCall::TCallInfo* aCallInfo)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   336
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   337
	aCallInfo->iCallName = iCallInfo.iCallName;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   338
	aCallInfo->iStatus = GetCoreCallStatus();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   339
	aCallInfo->iHookStatus = iCallInfo.iHookStatus;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   340
	aCallInfo->iLineName = Owner()->Name();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   341
	GetCallDuration(aCallInfo->iDuration);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   342
	ReqCompleted(aTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   343
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   344
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   345
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   346
TInt CCallHayes::GetStatus(const TTsyReqHandle aTsyReqHandle, RCall::TStatus* aCallStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   347
    {
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   348
	LOGTEXT(_L8("Call:\tGetStatus() called"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   349
	*aCallStatus = GetCoreCallStatus();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   350
	ReqCompleted(aTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   351
    return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   352
    }
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   353
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   354
TInt CCallHayes::TransferOwnership(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   355
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   356
// Transfer call ownership
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   357
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   358
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   359
	LOGTEXT(_L8("Call:\tTransferOwnership called"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   360
	if (CheckOwnership(aTsyReqHandle)!=CCallBase::EOwnedTrue)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   361
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   362
		ReqCompleted(aTsyReqHandle,KErrEtelNotCallOwner);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   363
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   364
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   365
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   366
	if(iList->iAcquireList.IsEmpty()) // no one interested in this call !
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   367
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   368
		ReqCompleted(aTsyReqHandle,KErrEtelNoClientInterestedInThisCall);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   369
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   370
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   371
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   372
	CAcquireEntry* entry=iList->iAcquireList.First();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   373
	if (entry) // someone interested in this call
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   374
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   375
		LOGTEXT(_L8("Call:\tTransferOwnership successful"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   376
		(void)SetOwnership(entry->iTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   377
		ReqCompleted(entry->iTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   378
		iList->Remove(entry);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   379
		ReqCompleted(aTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   380
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   381
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   382
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   383
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   384
TInt CCallHayes::AcquireOwnership(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   385
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   386
//	Acquire call Ownership (server has already checked client does not own it)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   387
//	If call is unowned and idle, this request is completed with CallNotActive.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   388
//  A call must never be owned and idle concurrently.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   389
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   390
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   391
	LOGTEXT(_L8("Call:\tAcquireOwnership called"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   392
	if (CheckOwnership(aTsyReqHandle)==CCallBase::EOwnedUnowned)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   393
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   394
		LOGTEXT(_L8("Call:\tAcquireOwnership unsuccessful as call is not owned already"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   395
		ReqCompleted(aTsyReqHandle,KErrEtelCallNotActive);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   396
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   397
	else 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   398
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   399
		if(iList->iAcquireList.IsEmpty())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   400
			// List is empty. Client is the first one to request ownership of the call.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   401
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   402
			CAcquireEntry* entry=NULL;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   403
			TRAPD(err,entry=CAcquireEntry::NewL(aTsyReqHandle));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   404
			if(err==KErrNone)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   405
				iList->iAcquireList.AddLast(*entry);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   406
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   407
				return err;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   408
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   409
		else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   410
			// List is not empty. Another client has already requested to acquire ownership of the call.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   411
			// Only one client can be waiting to acquire ownership at any one time.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   412
			return KErrInUse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   413
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   414
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   415
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   416
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   417
TInt CCallHayes::AcquireOwnershipCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   418
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   419
//	Cancel Acquire call Ownership
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   420
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   421
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   422
	CAcquireEntry* entry=iList->FindByTsyReqHandle(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   423
	__ASSERT_ALWAYS(entry!=NULL,Panic(EAcquirerNotFound));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   424
	if (entry != NULL)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   425
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   426
		iList->Remove(entry);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   427
		ReqCompleted(aTsyReqHandle, KErrCancel);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   428
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   429
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   430
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   431
		ReqCompleted(aTsyReqHandle, KErrNotFound);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   432
		}					
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   433
	return KErrNone;		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   434
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   435
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   436
TInt CCallHayes::GetBearerServiceInfo(const TTsyReqHandle aTsyReqHandle,RCall::TBearerService* aBearerService)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   437
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   438
	*aBearerService = iCallInfo.iBearerService;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   439
	ReqCompleted(aTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   440
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   441
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   442
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   443
TInt CCallHayes::GetCallParams(const TTsyReqHandle aTsyReqHandle, TDes8* aParams)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   444
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   445
// Call parameters are only set when connecting a call, so there have no meaning when a 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   446
// call is not in progress.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   447
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   448
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   449
	if (RMobileCall::EStatusIdle != iCallInfo.iMobileStatus  &&
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   450
		RMobileCall::EStatusUnknown != iCallInfo.iMobileStatus )
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   451
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   452
		TPckg<RCall::TCallParams>* paramsPckg = (TPckg<RCall::TCallParams>*)aParams;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   453
		RCall::TCallParams& callparams = (*paramsPckg)();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   454
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   455
		//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   456
		// Configure basic TCallParams parameters
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   457
		callparams.iSpeakerControl = iCallInfo.iSpeakerControl;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   458
		callparams.iSpeakerVolume = iCallInfo.iSpeakerVolume;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   459
		callparams.iInterval = iCallInfo.iInterval;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   460
		callparams.iWaitForDialTone = iCallInfo.iWaitForDialTone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   461
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   462
		//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   463
		// Configure additional params as required
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   464
		if(callparams.ExtensionId()==RMobileCall::KETelMobileCallParamsV1)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   465
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   466
			//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   467
			// Configure RMobileCall::TMobileCallParamsV1 parameters
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   468
			RMobileCall::TMobileCallParamsV1Pckg* pckg = (RMobileCall::TMobileCallParamsV1Pckg*)aParams;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   469
			RMobileCall::TMobileCallParamsV1& params = (*pckg)();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   470
			params.iIdRestrict=iCallInfo.iCallParams.iIdRestrict;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   471
			params.iCug=iCallInfo.iCallParams.iCug;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   472
			params.iAutoRedial=iCallInfo.iCallParams.iAutoRedial;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   473
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   474
		else if(callparams.ExtensionId()==RMobileCall::KETelMobileDataCallParamsV1)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   475
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   476
			//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   477
			// Configure RMobileCall::TMobileDataCallParamsV1 parameters
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   478
			RMobileCall::TMobileDataCallParamsV1Pckg* pckg = (RMobileCall::TMobileDataCallParamsV1Pckg*)aParams;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   479
			RMobileCall::TMobileDataCallParamsV1& params = (*pckg)();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   480
			params.iService=iCallInfo.iCallParams.iService;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   481
			params.iSpeed=iCallInfo.iCallParams.iSpeed;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   482
			params.iProtocol=iCallInfo.iCallParams.iProtocol;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   483
			params.iQoS=iCallInfo.iCallParams.iQoS;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   484
			params.iRLPVersion=iCallInfo.iCallParams.iRLPVersion;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   485
			params.iModemToMSWindowSize=iCallInfo.iCallParams.iModemToMSWindowSize;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   486
			params.iMSToModemWindowSize=iCallInfo.iCallParams.iMSToModemWindowSize;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   487
			params.iAckTimer=iCallInfo.iCallParams.iAckTimer;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   488
			params.iRetransmissionAttempts=iCallInfo.iCallParams.iRetransmissionAttempts;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   489
			params.iResequencingPeriod=iCallInfo.iCallParams.iResequencingPeriod;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   490
			params.iV42bisReq=iCallInfo.iCallParams.iV42bisReq;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   491
			params.iV42bisCodewordsNum=iCallInfo.iCallParams.iV42bisCodewordsNum;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   492
			params.iV42bisMaxStringLength=iCallInfo.iCallParams.iV42bisMaxStringLength;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   493
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   494
		else if(callparams.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV1)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   495
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   496
			//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   497
			// Configure RMobileCall::TMobileHscsdCallParamsV1 parameters
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   498
			RMobileCall::TMobileHscsdCallParamsV1Pckg* pckg = (RMobileCall::TMobileHscsdCallParamsV1Pckg*)aParams;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   499
			RMobileCall::TMobileHscsdCallParamsV1& params = (*pckg)();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   500
			params.iWantedAiur=iCallInfo.iCallParams.iWantedAiur;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   501
			params.iWantedRxTimeSlots=iCallInfo.iCallParams.iWantedRxTimeSlots;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   502
			params.iMaxTimeSlots=iCallInfo.iCallParams.iMaxTimeSlots;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   503
			params.iCodings=iCallInfo.iCallParams.iCodings;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   504
			params.iAsymmetry=iCallInfo.iCallParams.iAsymmetry;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   505
			params.iUserInitUpgrade=iCallInfo.iCallParams.iUserInitUpgrade;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   506
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   507
		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   508
		//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   509
		// Complete the clients request
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   510
		ReqCompleted(aTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   511
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   512
	else 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   513
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   514
		ReqCompleted(aTsyReqHandle,KErrUnknown);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   515
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   516
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   517
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   518
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   519
TInt CCallHayes::GetCallDuration(const TTsyReqHandle aTsyReqHandle, TTimeIntervalSeconds* aTime)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   520
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   521
	if ( RMobileCall::EStatusConnected != iCallInfo.iMobileStatus && 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   522
		 RMobileCall::EStatusDisconnecting != iCallInfo.iMobileStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   523
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   524
		ReqCompleted(aTsyReqHandle,KErrEtelCallNotActive);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   525
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   526
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   527
	*aTime = iCallTimer->CallDuration();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   528
	ReqCompleted(aTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   529
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   530
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   531
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   532
void CCallHayes::GetCallDuration(TTimeIntervalSeconds& aTime) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   533
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   534
	aTime = iCallTimer->CallDuration();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   535
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   536
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   537
void CCallHayes::GetDefaultCallParams()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   538
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   539
	iPhoneGlobals->iConfiguration->GetIntervalPref(iCallInfo.iInterval);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   540
	iPhoneGlobals->iConfiguration->GetSpeakerSettingPref(iCallInfo.iSpeakerControl);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   541
	iPhoneGlobals->iConfiguration->GetSpeakerVolumePref(iCallInfo.iSpeakerVolume);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   542
	iPhoneGlobals->iConfiguration->GetWaitForDialTonePref(iCallInfo.iWaitForDialTone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   543
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   544
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   545
void CCallHayes::SetCallParams(const TDesC8* aParams)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   546
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   547
	if ((*aParams).Length()==0)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   548
		// Always returns KErrNone
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   549
		GetDefaultCallParams();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   550
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   551
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   552
		TPckg<RCall::TCallParams>* paramsPckg = (TPckg<RCall::TCallParams>*)aParams;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   553
		RCall::TCallParams& callparams = (*paramsPckg)();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   554
		iCallInfo.iSpeakerControl = callparams.iSpeakerControl;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   555
		iCallInfo.iSpeakerVolume = callparams.iSpeakerVolume;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   556
		iCallInfo.iInterval = callparams.iInterval;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   557
		iCallInfo.iWaitForDialTone = callparams.iWaitForDialTone; 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   558
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   559
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   560
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   561
TInt CCallHayes::ValidateRequest(const TTsyReqHandle aTsyReqHandle, RCall::TStatus aLineStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   562
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   563
//  Validating a request
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   564
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   565
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   566
	CCallBase::TCallOwnership owned = CheckOwnership(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   567
	if (owned==CCallBase::EOwnedFalse)	// call owned by another client
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   568
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   569
		return KErrEtelNotCallOwner;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   570
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   571
	if (iPhoneGlobals->iPhoneStatus.iLineStatus != aLineStatus) 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   572
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   573
		if (aLineStatus==RCall::EStatusIdle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   574
		// implies that this call is already active (assuming an owned call is 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   575
		// an active call) or ringing or unknown
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   576
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   577
			return KErrInUse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   578
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   579
		else if (aLineStatus==RCall::EStatusRinging)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   580
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   581
			return KErrNotReady;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   582
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   583
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   584
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   585
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   586
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   587
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   588
RCall::TStatus CCallHayes::GetCoreCallStatus()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   589
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   590
	RCall::TStatus coreStatus;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   591
	if (iCallInfo.iMobileStatus <= RMobileCall::EStatusDisconnecting)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   592
		//coreStatus = static_cast<RCall::TStatus>(iCallInfo.iMobileStatus);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   593
		coreStatus = (RCall::TStatus)iCallInfo.iMobileStatus;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   594
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   595
		switch (iCallInfo.iMobileStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   596
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   597
		case RMobileCall::EStatusReconnectPending:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   598
		case RMobileCall::EStatusHold:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   599
			coreStatus = RCall::EStatusConnected;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   600
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   601
		case RMobileCall::EStatusWaitingAlternatingCallSwitch:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   602
			coreStatus = RCall::EStatusIdle;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   603
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   604
		default:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   605
			coreStatus = RCall::EStatusUnknown;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   606
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   607
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   608
	return coreStatus;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   609
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   610
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   611
TInt CCallHayes::ChangeCallStatus(RMobileCall::TMobileCallStatus aCallStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   612
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   613
	if (iCallInfo.iMobileStatus != aCallStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   614
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   615
		iCallInfo.iMobileStatus = aCallStatus;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   616
		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   617
		if (aCallStatus == RMobileCall::EStatusIdle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   618
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   619
			iCallInfo.iHookStatus = RCall::EHookStatusOn;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   620
			iPhoneGlobals->iNotificationStore->CheckNotification(this,EBecomeIdle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   621
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   622
		else if (aCallStatus != RMobileCall::EStatusUnknown && aCallStatus != RMobileCall::EStatusRinging)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   623
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   624
			iCallInfo.iHookStatus = RCall::EHookStatusOff;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   625
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   626
		if (aCallStatus == RMobileCall::EStatusConnected)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   627
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   628
			iPhoneGlobals->iNotificationStore->CheckNotification(this,EConnected);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   629
			iIo->Cancel();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   630
			TCommConfig aConfigPckg;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   631
			TInt ret = iPhoneGlobals->iConfiguration->PortConfig(aConfigPckg,EConfigTypeConnect);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   632
			if (ret==KErrNone)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   633
				ret = iIo->ConfigurePort(aConfigPckg);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   634
//			if (!(iIo->ReadPending()))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   635
//				iIo->Read();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   636
			iCallInfo.iTimeCallBegan.UniversalTime();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   637
			return ret;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   638
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   639
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   640
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   641
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   642
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   643
void CCallHayes::ChangeLineStatus(RCall::TStatus aLineStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   644
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   645
	iPhoneGlobals->iPhoneStatus.iLineStatus = aLineStatus;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   646
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   647
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   648
void CCallHayes::SetToIdle()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   649
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   650
	iWaitForNoCarrier->StopWait();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   651
	// Always returns KErrNone
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   652
	(void)SetUnowned();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   653
	iPhoneGlobals->iPhoneStatus.iMode = RPhone::EModeIdle;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   654
	ChangeLineStatus(RCall::EStatusIdle);	// line status should be changed first because 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   655
											// ChangeCallStatus is the function which sends
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   656
											// the new event to the Notification Handler,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   657
											// and this will complete both line and call status
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   658
											// notifications, taking the new statuses from the
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   659
											// CLineHayes and CCallHayes objects.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   660
	// EStatusIdle always results in KErrNone return value
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   661
	(void)ChangeCallStatus(RMobileCall::EStatusIdle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   662
	StopCallTicker();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   663
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   664
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   665
void CCallHayes::SetToIdleAndCompleteReq(TTsyReqHandle aTsyReqHandle,TInt aStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   666
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   667
	SetToIdle();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   668
	ReqCompleted(aTsyReqHandle, aStatus);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   669
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   670
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   671
void CCallHayes::GetCallInfo(TCallInfoIndex* aCallInfoIndex)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   672
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   673
//	Copied field by field since TCallInfoTSY is different to TCallInfoIndex
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   674
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   675
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   676
	aCallInfoIndex->iInfo.iCallName = iCallInfo.iCallName;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   677
	aCallInfoIndex->iInfo.iStatus = GetCoreCallStatus();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   678
	aCallInfoIndex->iInfo.iCallCapsFlags = 0;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   679
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   680
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   681
TBool CCallHayes::CheckName(const TDesC& aName) const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   682
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   683
//	Return TRUE if name is the same as the name of this call
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   684
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   685
	if (iCallInfo.iCallName.CompareF(aName))	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   686
		return EFalse;		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   687
	else 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   688
		return ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   689
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   690
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   691
TCallInfoTSY* CCallHayes::CallInfo()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   692
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   693
	return &iCallInfo;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   694
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   695
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   696
void CCallHayes::StartCallTicker() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   697
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   698
	iCallTimer->Start();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   699
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   700
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   701
void CCallHayes::StopCallTicker() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   702
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   703
	iCallTimer->Stop();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   704
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   705
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   706
void CCallHayes::ResetIsForIncomingCall()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   707
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   708
	iIsForIncomingCall=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   709
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   710
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   711
TBool CCallHayes::IsForIncomingCall() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   712
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   713
	return iIsForIncomingCall;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   714
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   715
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   716
void CCallHayes::SetOwnedByTSY() 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   717
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   718
	iIsOwnedByTSY=ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   719
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   720
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   721
void CCallHayes::SetUnownedByTSY()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   722
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   723
	iIsOwnedByTSY=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   724
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   725
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   726
TBool CCallHayes::IsOwnedByTSY() const
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   727
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   728
	return iIsOwnedByTSY;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   729
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   730
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   731
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   732
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   733
//	Functions which are supported in one line but not the other
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   734
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   735
TInt CCallHayes::LoanDataPort(const TTsyReqHandle,RCall::TCommPort*)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   736
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   737
	return KErrNotSupported;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   738
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   739
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   740
TInt CCallHayes::LoanDataPortCancel(const TTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   741
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   742
	return KErrNotSupported;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   743
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   744
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   745
TInt CCallHayes::RecoverDataPort(const TTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   746
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   747
	return KErrNotSupported;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   748
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   749
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   750
TInt CCallHayes::RecoverDataPortAndRelinquishOwnership()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   751
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   752
	return KErrNotSupported;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   753
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   754
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   755
TInt CCallHayes::GetFaxSettings(const TTsyReqHandle,RCall::TFaxSessionSettings*)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   756
	{	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   757
	return KErrNotSupported;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   758
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   759
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   760
TInt CCallHayes::SetFaxSettings(const TTsyReqHandle,const RCall::TFaxSessionSettings*)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   761
	{	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   762
	return KErrNotSupported;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   763
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   764
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   765
CTelObject* CCallHayes::OpenNewObjectByNameL(const TDesC& /*aName*/)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   766
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   767
	User::Leave(KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   768
	return NULL;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   769
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   770
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   771
CTelObject* CCallHayes::OpenNewObjectL(TDes& /*aNewName*/)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   772
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   773
	User::Leave(KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   774
	return NULL;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   775
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   776
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   777
TInt CCallHayes::CheckAndSetRegistrationParams(const TInt /*aIpc*/,const TDes8* /*aDes1*/,const TDes8* /*aDes2*/)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   778
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   779
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   780
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   781
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   782
TInt CCallHayes::ExtFunc(const TTsyReqHandle,const TInt, const TDataPackage&)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   783
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   784
// Unsupported in this TSY
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   785
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   786
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   787
	return KErrNotSupported;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   788
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   789
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   790
/*
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   791
 *  CCallMobile class that implements Multimode ETel Mobile Call requests
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   792
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   793
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   794
CCallMobile::CCallMobile(CATIO* aIo,CATInit* aInit,CPhoneGlobals* aPhoneGlobals) 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   795
			: CCallHayes(aIo, aInit, aPhoneGlobals)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   796
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   797
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   798
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   799
CCallMobile::~CCallMobile()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   800
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   801
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   802
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   803
CTelObject::TReqMode CCallMobile::ReqModeL(const TInt aIpc)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   804
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   805
	// ReqModeL is called from the server's CTelObject::ReqAnalyserL
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   806
	// in order to check the type of request it has
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   807
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   808
	CTelObject::TReqMode ret=0;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   809
	switch (aIpc)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   810
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   811
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   812
// No Flow Control NOR Multiple Completion
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   813
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   814
	case EMobileCallGetMobileCallCaps:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   815
	case EMobileCallGetMobileCallStatus:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   816
		break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   817
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   818
	case EMobileCallGetMobileDataCallCaps: 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   819
		break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   820
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   821
// Multiple Completion Services with Immediate Server Repost
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   822
// (Usually Notifications)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   823
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   824
	case EMobileCallNotifyMobileCallStatusChange:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   825
	case EMobileCallNotifyMobileCallCapsChange:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   826
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   827
		ret=KReqModeMultipleCompletionEnabled | KReqModeRePostImmediately;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   828
		break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   829
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   830
// 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   831
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   832
	default:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   833
		ret=CCallHayes::ReqModeL(aIpc);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   834
		break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   835
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   836
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   837
	return ret;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   838
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   839
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   840
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   841
TInt CCallMobile::NumberOfSlotsL(const TInt aIpc)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   842
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   843
	// NumberOfSlotsL is called by the server when it is registering a new notification
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   844
	// It enables the TSY to tell the server how many buffer slots to allocate for
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   845
	// "repost immediately" notifications that may trigger before clients collect them
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   846
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   847
	TInt numberOfSlots=1;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   848
	switch (aIpc)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   849
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   850
	case EMobileCallNotifyMobileCallStatusChange:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   851
	case EMobileCallNotifyMobileCallCapsChange:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   852
		LOGTEXT(_L8("CCallMobile: Registered with 5 slots"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   853
		numberOfSlots=5;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   854
		break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   855
	default:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   856
		numberOfSlots = CCallBase::NumberOfSlotsL(aIpc);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   857
		break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   858
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   859
	return numberOfSlots;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   860
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   861
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   862
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   863
TInt CCallMobile::ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   864
					 	  const TDataPackage& aPackage)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   865
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   866
	// ExtFunc is called by the server when it has a "extended", i.e. non-core ETel request 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   867
	// for the TSY to process
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   868
	// A request handle, request type and request data are passed to the TSY
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   869
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   870
	TAny* dataPtr=aPackage.Ptr1();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   871
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   872
	// The request data has to extracted from TDataPackage and the TAny* pointers have to
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   873
	// be "cast" to the expected request data type
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   874
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   875
	switch (aIpc)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   876
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   877
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   878
// No Flow Control NOR Multiple Completion
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   879
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   880
	case EMobileCallGetMobileCallCaps:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   881
		return GetMobileCallCaps(aTsyReqHandle, aPackage.Des1n());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   882
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   883
	case EMobileCallGetMobileCallStatus:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   884
		return GetMobileCallStatus(aTsyReqHandle,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   885
			REINTERPRET_CAST(RMobileCall::TMobileCallStatus*,dataPtr));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   886
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   887
// Multiple Completion Services with Immediate Server Repost
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   888
// (Usually Notifications)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   889
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   890
	case EMobileCallNotifyMobileCallStatusChange:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   891
		return NotifyMobileCallStatusChange(aTsyReqHandle,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   892
			REINTERPRET_CAST(RMobileCall::TMobileCallStatus*, dataPtr));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   893
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   894
	case EMobileCallNotifyMobileCallCapsChange:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   895
		return NotifyMobileCallCapsChange(aTsyReqHandle, aPackage.Des1n());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   896
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   897
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   898
// Cancels
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   899
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   900
	case EMobileCallNotifyMobileCallStatusChangeCancel:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   901
		return NotifyMobileCallStatusChangeCancel(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   902
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   903
	case EMobileCallNotifyMobileCallCapsChangeCancel:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   904
		return NotifyMobileCallCapsChangeCancel(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   905
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   906
	default:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   907
		return KErrNotSupported;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   908
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   909
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   910
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   911
TInt CCallMobile::CancelService(const TInt aIpc, const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   912
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   913
	// CancelService is called by the server when it is "cleaning-up" any still outstanding
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   914
	// asynchronous requests before closing a client's sub-session.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   915
	// This will happen if a client closes its R-class handle without cancelling outstanding
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   916
	// asynchronous requests.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   917
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   918
	switch (aIpc)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   919
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   920
	case EMobileCallNotifyMobileCallStatusChange:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   921
		return NotifyMobileCallStatusChangeCancel(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   922
	case EMobileCallNotifyMobileCallCapsChange:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   923
		return NotifyMobileCallCapsChangeCancel(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   924
	default:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   925
		return CCallBase::CancelService(aIpc,aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   926
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   927
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   928
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   929
TInt CCallMobile::GetMobileCallCaps(const TTsyReqHandle aTsyReqHandle, TDes8* aCaps)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   930
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   931
	LOGTEXT(_L8("CCallMobile:	:GetMobileCallCaps called"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   932
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   933
	RMobileCall::TMobileCallCapsV1Pckg *capsPckg = REINTERPRET_CAST(RMobileCall::TMobileCallCapsV1Pckg *,aCaps);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   934
	RMobileCall::TMobileCallCapsV1& caps = (*capsPckg)();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   935
	// Always returns KErrNone
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   936
	(void)CollateCurrentMobileCaps(aTsyReqHandle, &caps.iCallControlCaps);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   937
	caps.iCallEventCaps=0;  // no call events are supported
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   938
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   939
	ReqCompleted(aTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   940
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   941
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   942
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   943
TInt CCallMobile::GetCaps(const TTsyReqHandle aTsyReqHandle,RCall::TCaps* aCallCaps)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   944
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   945
	(void)CollateCurrentCoreCaps(aTsyReqHandle, reinterpret_cast<TUint32*>(&aCallCaps->iFlags));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   946
	ReqCompleted(aTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   947
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   948
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   949
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   950
TBool CCallMobile::CollateCurrentMobileCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   951
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   952
	CollateCoreCaps(aTsyReqHandle, aCallCaps);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   953
	if (iMobileCaps.iCallControlCaps != *aCallCaps)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   954
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   955
		iMobileCaps.iCallControlCaps = *aCallCaps;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   956
		return ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   957
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   958
	return EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   959
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   960
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   961
TBool CCallMobile::CollateCurrentCoreCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   962
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   963
	CollateCoreCaps(aTsyReqHandle, aCallCaps);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   964
	if (iCaps.iFlags != *aCallCaps)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   965
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   966
		iCaps.iFlags = *aCallCaps;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   967
		return ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   968
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   969
	return EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   970
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   971
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   972
TInt CCallMobile::NotifyMobileCallCapsChange(const TTsyReqHandle aTsyReqHandle, TDes8* aCaps)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   973
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   974
	LOGTEXT(_L8("CCallMobile::NotifyMobileCallCapsChange lodged"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   975
	iPhoneGlobals->iNotificationStore->RegisterNotification(ECallMobileCaps,aTsyReqHandle,this,aCaps);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   976
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   977
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   978
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   979
TInt CCallMobile::NotifyMobileCallCapsChangeCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   980
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   981
	LOGTEXT(_L8("CCallMobile::NotifyMobileCallCapsChangeCancel called"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   982
	iPhoneGlobals->iNotificationStore->RemoveNotification(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   983
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   984
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   985
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   986
TInt CCallMobile::GetMobileCallStatus(const TTsyReqHandle aTsyReqHandle,RMobileCall::TMobileCallStatus* aStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   987
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   988
	LOGTEXT(_L8("CCallMobile::GetMobileCallStatus called"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   989
	*aStatus=iCallInfo.iMobileStatus;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   990
	ReqCompleted(aTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   991
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   992
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   993
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   994
TInt CCallMobile::NotifyMobileCallStatusChange(const TTsyReqHandle aTsyReqHandle,RMobileCall::TMobileCallStatus* aStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   995
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   996
	LOGTEXT(_L8("CCallMobile::NotifyMobileCallStatusChange lodged"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   997
	iPhoneGlobals->iNotificationStore->RegisterNotification(EMobileCallStatusChange,aTsyReqHandle,this,aStatus);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   998
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   999
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1000
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1001
TInt CCallMobile::NotifyMobileCallStatusChangeCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1002
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1003
	LOGTEXT(_L8("CCallMobile::NotifyMobileCallStatusChangeCancel called"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1004
	iPhoneGlobals->iNotificationStore->RemoveNotification(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1005
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1006
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1007
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1008
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1009
// CCallMobileVoice - Voice Specific Call Functionality
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1010
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1011
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1012
CCallMobileVoice* CCallMobileVoice::NewL(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aPhoneGlobals,const TName& aName)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1013
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1014
	CCallMobileVoice* voiceCall=new(ELeave) CCallMobileVoice(aATIO,aInit,aPhoneGlobals);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1015
	TCleanupItem newCallVoiceHayesClose(CloseCall,voiceCall);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1016
	CleanupStack::PushL(newCallVoiceHayesClose);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1017
	voiceCall->ConstructL(aName);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1018
	CleanupStack::Pop();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1019
	return voiceCall;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1020
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1021
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1022
CCallMobileVoice::CCallMobileVoice(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aPhoneGlobals)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1023
	: CCallMobile(aATIO,aInit,aPhoneGlobals)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1024
	{}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1025
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1026
void CCallMobileVoice::ConstructL(const TName& aName)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1027
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1028
	CCallHayes::ConstructL(aName);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1029
	iCallInfo.iLineOwnerName = KVoiceLineName;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1030
	iDialVoice=CATDialVoice::NewL(iIo,this,iInit,iPhoneGlobals);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1031
	iAnswerVoice=CATAnswerVoice::NewL(iIo,this,iInit,iPhoneGlobals);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1032
	iHangUpVoice=CATHangUpVoice::NewL(iIo,this,iInit,iPhoneGlobals);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1033
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1034
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1035
CCallMobileVoice::~CCallMobileVoice()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1036
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1037
//	Removes itself from array of calls in CLineMobileVoice
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1038
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1039
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1040
	delete iDialVoice;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1041
	delete iAnswerVoice;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1042
	delete iHangUpVoice;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1043
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1044
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1045
void CCallMobileVoice::CollateCoreCaps(const TTsyReqHandle /*aTsyReqHandle*/, TUint32* aCallCaps)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1046
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1047
	*aCallCaps = RCall::KCapsVoice;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1048
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1049
	// Voice calls can be manipulated by any client, not just owner so set as many caps as possible
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1050
	if (iPhoneGlobals->iPhoneStatus.iModemDetected==RPhone::EDetectedPresent)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1051
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1052
		*aCallCaps |= (RCall::KCapsDial | RCall::KCapsConnect);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1053
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1054
		TInt ret=KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1055
		if (!iIsForIncomingCall)	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1056
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1057
			if (REINTERPRET_CAST(CPhoneHayes*,Owner()->Owner())->CheckForOutstandingAnswer())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1058
				ret=KErrEtelAnswerAlreadyOutstanding;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1059
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1060
		else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1061
			ret=KErrEtelAnswerAlreadyOutstanding;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1062
		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1063
		if (ret==KErrNone && (iCallInfo.iMobileStatus==RMobileCall::EStatusIdle || iCallInfo.iMobileStatus==RMobileCall::EStatusRinging))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1064
			*aCallCaps |= RCall::KCapsAnswer;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1065
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1066
		if (iCallInfo.iMobileStatus==RMobileCall::EStatusConnected)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1067
			*aCallCaps |= RCall::KCapsHangUp;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1068
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1069
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1070
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1071
TInt CCallMobileVoice::Dial(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams,TDesC* aTelNumber)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1072
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1073
//	Dial a voice call
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1074
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1075
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1076
	SetCallParams(aCallParams);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1077
	LOGTEXT(_L8("VoiceCall:\tSubmitting Dial command for Voice call"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1078
	if (iPhoneGlobals->iPhoneStatus.iLineStatus == RCall::EStatusIdle)	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1079
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1080
		(void)SetOwnership(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1081
		iDialVoice->ExecuteCommand(aTsyReqHandle,aTelNumber,&iCallInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1082
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1083
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1084
	else 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1085
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1086
		return KErrInUse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1087
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1088
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1089
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1090
TInt CCallMobileVoice::DialCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1091
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1092
 *	Cancel the dial request if possible
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1093
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1094
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1095
	LOGTEXT(_L8("VoiceCall:\tSubmitting Cancel Dial command for Voice call"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1096
	iDialVoice->CancelCommand(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1097
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1098
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1099
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1100
TInt CCallMobileVoice::AnswerIncomingCall(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1101
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1102
 *	If there is no waiting call, will wait for one and then answer it. If there is, it will
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1103
 *	answer immediately.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1104
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1105
 	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1106
	CCallBase::TCallOwnership owned = CheckOwnership(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1107
	TInt ret=KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1108
	if (owned==CCallBase::EOwnedFalse)	// call owned by another client
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1109
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1110
		ret=KErrEtelNotCallOwner;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1111
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1112
	else 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1113
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1114
		if (!iIsForIncomingCall)	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1115
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1116
			if (REINTERPRET_CAST(CPhoneHayes*,Owner()->Owner())->CheckForOutstandingAnswer())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1117
				ret=KErrEtelAnswerAlreadyOutstanding;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1118
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1119
		else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1120
			ret=KErrEtelAnswerAlreadyOutstanding;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1121
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1122
	if (ret==KErrNone)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1123
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1124
		CLineHayes* line = STATIC_CAST(CLineHayes*,Owner());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1125
		STATIC_CAST(CPhoneHayes*,line->Owner())->CancelOtherRingingCall(line);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1126
		line->FreePreAllocCallIfNecessary();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1127
		SetCallParams(aCallParams);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1128
		if (iCallInfo.iMobileStatus==RMobileCall::EStatusRinging)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1129
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1130
			(void)SetOwnership(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1131
			LOGTEXT(_L8("VoiceCall:\tSubmitting Answer command"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1132
			iAnswerVoice->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1133
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1134
		else	// This call is now a client-designated Incoming Call object.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1135
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1136
			iIsForIncomingCall=ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1137
			iAnswerTsyReqHandle = aTsyReqHandle;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1138
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1139
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1140
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1141
	ReqCompleted(aTsyReqHandle,ret);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1142
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1143
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1144
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1145
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1146
TInt CCallMobileVoice::AnswerIncomingCallCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1147
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1148
	LOGTEXT(_L8("VoiceCall:\tSubmitting Cancel Answer command"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1149
	if (iIsForIncomingCall)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1150
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1151
		iIsForIncomingCall=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1152
		ReqCompleted(aTsyReqHandle,KErrCancel);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1153
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1154
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1155
		iAnswerVoice->CancelCommand(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1156
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1157
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1158
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1159
void CCallMobileVoice::AnswerImmediately()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1160
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1161
	(void)SetOwnership(iAnswerTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1162
	// EStatusRinging always results in KErrNone return value
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1163
	(void) ChangeCallStatus(RMobileCall::EStatusRinging);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1164
	iPhoneGlobals->iNotificationStore->CheckNotification(this,ERingOccurred);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1165
	iIsForIncomingCall=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1166
	// this must be after the check notification as CNotifications
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1167
	// asks line for info about the call which Is For Incoming Call
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1168
	LOGTEXT(_L8("VoiceCall:\tSubmitting Answer command"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1169
	iAnswerVoice->ExecuteCommand(iAnswerTsyReqHandle,NULL,&iCallInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1170
	}		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1171
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1172
TInt CCallMobileVoice::Connect(const TTsyReqHandle aTsyReqHandle,const TDesC8* /*aCallParams*/)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1173
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1174
	ReqCompleted(aTsyReqHandle,KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1175
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1176
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1177
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1178
TInt CCallMobileVoice::ConnectCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1179
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1180
	ReqCompleted(aTsyReqHandle,KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1181
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1182
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1183
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1184
TInt CCallMobileVoice::HangUp(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1185
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1186
	if (CheckOwnership(aTsyReqHandle)==CCallBase::EOwnedFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1187
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1188
		ReqCompleted(aTsyReqHandle,KErrEtelNotCallOwner);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1189
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1190
		}	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1191
	if ((iCallInfo.iMobileStatus!=RMobileCall::EStatusIdle) &&
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1192
		(iCallInfo.iMobileStatus!=RMobileCall::EStatusDisconnecting))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1193
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1194
		LOGTEXT(_L8("VoiceCall:\tSubmitting Hang Up command"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1195
		iHangUpVoice->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1196
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1197
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1198
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1199
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1200
		// Call not in a state to be terminated - but return KErrNone
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1201
		ReqCompleted(aTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1202
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1203
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1204
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1205
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1206
TInt CCallMobileVoice::HangUpCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1207
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1208
//	Cancel the hang up command. 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1209
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1210
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1211
	LOGTEXT(_L8("VoiceCall:\tSubmitting Cancel Hang Up command"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1212
	iHangUpVoice->Stop(aTsyReqHandle);	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1213
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1214
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1215
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1216
TInt CCallMobileVoice::RelinquishOwnership()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1217
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1218
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1219
//	Called by server to tell TSY to either pass ownership on to another interested client
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1220
//	or hang up immediately. If call is currently connecting, RelinquishOwnershipComplete 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1221
//	will be called once cancelling has finished.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1222
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1223
	LOGTEXT(_L8("VoiceCall:\tRelinquish Ownership"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1224
	if(iList->iAcquireList.IsEmpty()) 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1225
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1226
		if (iDialVoice->IsPreConnectInProgress())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1227
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1228
			iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1229
			return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1230
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1231
		switch(iCallInfo.iMobileStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1232
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1233
		case RMobileCall::EStatusConnected:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1234
			iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1235
			iHangUpVoice->ExecuteCommand(0, NULL, &iCallInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1236
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1237
		case RMobileCall::EStatusDialling:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1238
		case RMobileCall::EStatusConnecting:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1239
		case RMobileCall::EStatusAnswering:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1240
		case RMobileCall::EStatusDisconnecting:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1241
			iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1242
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1243
		default:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1244
			if (iPhoneGlobals->iPhoneStatus.iInitStatus==EPhoneInitialising)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1245
				iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1246
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1247
				RelinquishOwnershipCompleted(KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1248
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1249
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1250
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1251
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1252
	CAcquireEntry* entry=iList->iAcquireList.First();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1253
	if (entry) 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1254
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1255
		(void)SetOwnership(entry->iTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1256
		ReqCompleted(entry->iTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1257
		iList->Remove(entry);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1258
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1259
	RelinquishOwnershipCompleted(KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1260
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1261
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1262
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1263
TInt CCallMobileVoice::RecoverDataPortAndRelinquishOwnership()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1264
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1265
	RecoverDataPortAndRelinquishOwnershipCompleted(KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1266
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1267
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1268
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1269
TInt CCallMobileVoice::LoanDataPort(const TTsyReqHandle aTsyReqHandle, RCall::TCommPort* /* aCommPort*/)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1270
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1271
	ReqCompleted(aTsyReqHandle,KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1272
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1273
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1274
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1275
TInt CCallMobileVoice::LoanDataPortCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1276
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1277
	ReqCompleted(aTsyReqHandle,KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1278
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1279
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1280
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1281
TInt CCallMobileVoice::RecoverDataPort(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1282
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1283
	ReqCompleted(aTsyReqHandle,KErrNotSupported);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1284
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1285
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1286
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1287
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1288
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1289
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1290
// CCallMobileData - Data Specific Call Functionality
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1291
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1292
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1293
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1294
CCallMobileData* CCallMobileData::NewL(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aPhoneGlobals,const TName& aName)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1295
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1296
	CCallMobileData* dataCall=new(ELeave) CCallMobileData(aATIO,aInit,aPhoneGlobals);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1297
	TCleanupItem newCallDataHayesClose(CloseCall,dataCall);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1298
	CleanupStack::PushL(newCallDataHayesClose);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1299
	dataCall->ConstructL(aName);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1300
	CleanupStack::Pop();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1301
	return dataCall;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1302
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1303
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1304
CCallMobileData::CCallMobileData(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aPhoneGlobals)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1305
	: CCallMobile(aATIO,aInit,aPhoneGlobals)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1306
	{}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1307
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1308
void CCallMobileData::ConstructL(const TName& aName)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1309
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1310
	CCallHayes::ConstructL(aName);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1311
	iCallInfo.iLineOwnerName = KDataLineName;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1312
	iDialData=CATDialData::NewL(iIo,this,iInit,iPhoneGlobals);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1313
	iAnswerData=CATAnswerData::NewL(iIo,this,iInit,iPhoneGlobals);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1314
	iSetCBST=CATSetCBST::NewL(iIo,this,iInit,iPhoneGlobals);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1315
	iConnectData=CATConnectData::NewL(iIo,this,iInit,iPhoneGlobals);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1316
	iHangUpData=CATHangUpData::NewL(iIo,this,iInit,iPhoneGlobals);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1317
	iATSetToOnlineDataMode=CATSetToOnlineDataMode::NewL(iIo,this,iInit,iPhoneGlobals);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1318
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1319
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1320
CCallMobileData::~CCallMobileData()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1321
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1322
//	Removes itself from array of calls in CLineMobileData
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1323
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1324
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1325
	delete iDialData;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1326
	delete iSetCBST;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1327
	delete iAnswerData;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1328
	delete iConnectData;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1329
	delete iHangUpData;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1330
	delete iATSetToOnlineDataMode;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1331
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1332
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1333
TInt CCallMobileData::ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1334
					 		  const TDataPackage& aPackage)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1335
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1336
 * Process the IPC locally, otherwise delegate to our base class.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1337
 */	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1338
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1339
	switch (aIpc)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1340
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1341
	case EMobileCallGetMobileDataCallCaps: 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1342
		return GetMobileDataCallCaps(aTsyReqHandle, aPackage.Des1n());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1343
	default:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1344
		// Delegate the processing of the IPC to our base class
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1345
		return CCallMobile::ExtFunc(aTsyReqHandle,aIpc,aPackage);		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1346
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1347
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1348
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1349
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1350
TInt CCallMobileData::GetMobileDataCallCaps(const TTsyReqHandle aTsyReqHandle, TDes8* aCaps)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1351
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1352
	LOGTEXT(_L8("CCallMobileData::GetMobileDataCallCaps called"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1353
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1354
	//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1355
	// This is a synchronous client request so this method must complete quickly.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1356
	// The call caps returned are those which were discovered during the 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1357
	// intialisation of the TSY (see ATINIT.CPP).
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1358
	TPckg<RMobileCall::TMobileCallDataCapsV1>* pckg = (TPckg<RMobileCall::TMobileCallDataCapsV1>*)aCaps;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1359
	RMobileCall::TMobileCallDataCapsV1& caps = (*pckg)();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1360
	caps=iPhoneGlobals->iCallDataCaps;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1361
	ReqCompleted(aTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1362
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1363
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1364
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1365
void CCallMobileData::CollateCoreCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1366
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1367
	*aCallCaps = RCall::KCapsData;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1368
	if (iPhoneGlobals->iPhoneStatus.iModemDetected==RPhone::EDetectedPresent)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1369
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1370
		CCallBase::TCallOwnership owner = CheckOwnership(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1371
		if (ValidateRequest(aTsyReqHandle,RCall::EStatusIdle)==KErrNone)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1372
			*aCallCaps |= (RCall::KCapsDial | RCall::KCapsConnect);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1373
		TInt ret=KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1374
		if (owner==CCallBase::EOwnedFalse)	// call owned by another client
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1375
			ret=KErrEtelNotCallOwner;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1376
		else 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1377
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1378
			if (!iIsForIncomingCall)	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1379
				{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1380
				if (REINTERPRET_CAST(CPhoneHayes*,Owner()->Owner())->CheckForOutstandingAnswer())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1381
					ret=KErrEtelAnswerAlreadyOutstanding;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1382
				}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1383
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1384
				ret=KErrEtelAnswerAlreadyOutstanding;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1385
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1386
		if (ret==KErrNone && (iCallInfo.iMobileStatus==RMobileCall::EStatusIdle || iCallInfo.iMobileStatus==RMobileCall::EStatusRinging))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1387
			*aCallCaps |= RCall::KCapsAnswer;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1388
		if ((owner==CCallBase::EOwnedTrue || owner==CCallBase::EOwnedPriorityClient)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1389
			&& iCallInfo.iMobileStatus==RMobileCall::EStatusConnected)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1390
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1391
			*aCallCaps |= RCall::KCapsHangUp;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1392
			if (iCallInfo.iLoanedToClient==EFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1393
				*aCallCaps |= RCall::KCapsLoanDataPort;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1394
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1395
				*aCallCaps |= RCall::KCapsRecoverDataPort;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1396
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1397
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1398
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1399
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1400
TInt CCallMobileData::AssembleCBSTSetString(TBuf8<KGenericBufferSize>& aTxBuffer)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1401
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1402
 * This funciton assembles a +CBST= string ready to be sent to the modem using 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1403
 * the values from CCallHayes::iCallInfo.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1404
 * This utility funciton is used by objects created and owned by this class.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1405
 * This has been done to reduce code size.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1406
 * @return KErrNone if and only if CBST string assembled
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1407
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1408
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1409
	TInt ret(KErrNone);		// Return value of this function
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1410
	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1411
	TInt speed(0); // these are the names that etsi use
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1412
	TInt name(0);  // these are the names that etsi use
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1413
	TInt ce(0); // these are the names that etsi use
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1414
	TBool speedSet(ETrue);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1415
	TBool nameSet(ETrue);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1416
	TBool ceSet(ETrue);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1417
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1418
	switch (iCallInfo.iCallParams.iService)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1419
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1420
		case RMobileCall::EServiceDataCircuitAsync:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1421
			name = 0;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1422
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1423
		case RMobileCall::EServiceDataCircuitAsyncRdi:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1424
			name = 4;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1425
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1426
		case RMobileCall::EServiceDataCircuitSync:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1427
			name = 1;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1428
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1429
		case RMobileCall::EServiceDataCircuitSyncRdi:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1430
			name = 5;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1431
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1432
		case RMobileCall::EServicePADAsyncUDI:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1433
			name = 2;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1434
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1435
		case RMobileCall::EServicePADAsyncRDI:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1436
			name = 6;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1437
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1438
		case RMobileCall::EServicePacketAccessSyncUDI:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1439
			name = 3;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1440
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1441
		case RMobileCall::EServicePacketAccessSyncRDI:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1442
			name = 7;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1443
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1444
		case RMobileCall::EServiceUnspecified:  // taking the default value of 0
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1445
		default:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1446
			nameSet=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1447
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1448
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1449
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1450
	switch(iCallInfo.iCallParams.iQoS)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1451
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1452
		case RMobileCall::EQoSTransparent:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1453
			ce = 0;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1454
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1455
		case RMobileCall::EQosTransparentPreferred:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1456
			ce = 2;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1457
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1458
		case RMobileCall::EQoSNonTransparent:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1459
			ce = 1;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1460
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1461
		case RMobileCall::EQosNonTransparentPreferred:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1462
			ce = 3;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1463
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1464
		case RMobileCall::EQoSUnspecified:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1465
		default:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1466
			ceSet=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1467
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1468
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1469
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1470
	switch(iCallInfo.iCallParams.iSpeed)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1471
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1472
		case RMobileCall::ESpeedAutobauding:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1473
			speed = 0;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1474
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1475
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1476
		case RMobileCall::ESpeed2400:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1477
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1478
			if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV22bis)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1479
				speed = 4;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1480
			else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1481
				speed = 36;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1482
			else if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) || 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1483
				(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1484
				speed = 68;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1485
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1486
				speedSet=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1487
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1488
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1489
		case RMobileCall::ESpeed4800:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1490
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1491
			if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV32)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1492
				speed = 6;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1493
			else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1494
				speed = 38;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1495
			else if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) || 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1496
				(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1497
				speed = 70;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1498
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1499
				speedSet=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1500
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1501
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1502
		case RMobileCall::ESpeed9600:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1503
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1504
			if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV32)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1505
				speed = 7;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1506
			else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV34)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1507
				speed = 12;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1508
			else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1509
				speed = 39;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1510
			else if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) || 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1511
				(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1512
				speed = 71;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1513
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1514
				speedSet=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1515
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1516
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1517
		case RMobileCall::ESpeed14400:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1518
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1519
			if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV34)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1520
				speed = 14;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1521
			else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1522
				speed = 43;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1523
			else if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) || 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1524
				(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1525
				speed = 75;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1526
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1527
				speedSet=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1528
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1529
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1530
		case RMobileCall::ESpeed19200:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1531
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1532
			if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV34)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1533
				speed = 15;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1534
			else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1535
				speed = 47;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1536
			else if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) || 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1537
				(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1538
				speed = 79;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1539
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1540
				speedSet=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1541
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1542
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1543
		case RMobileCall::ESpeed28800:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1544
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1545
			if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV34)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1546
				speed = 16;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1547
			else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1548
				speed = 48;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1549
			else if ((iCallInfo.iCallParams.iProtocol ==RMobileCall:: EProtocolV110) || 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1550
				(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1551
				speed = 80;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1552
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1553
				speedSet=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1554
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1555
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1556
		case RMobileCall::ESpeed38400:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1557
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1558
			if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) || 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1559
				(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1560
				speed = 81;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1561
			else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1562
				speed = 49;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1563
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1564
				speedSet=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1565
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1566
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1567
		case RMobileCall::ESpeed48000:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1568
			if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1569
				speed = 50;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1570
			else if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) || 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1571
				(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1572
				speed = 82;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1573
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1574
				speedSet=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1575
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1576
		case RMobileCall::ESpeed56000:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1577
			if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV120)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1578
				speed = 51;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1579
			else if ((iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolV110) || 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1580
				(iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolX31FlagStuffing))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1581
				speed = 83;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1582
			else if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolBitTransparent)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1583
				speed = 115;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1584
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1585
				speedSet=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1586
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1587
		case RMobileCall::ESpeed64000:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1588
			if (iCallInfo.iCallParams.iProtocol == RMobileCall::EProtocolBitTransparent)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1589
				speed = 116;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1590
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1591
				speedSet=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1592
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1593
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1594
		case RMobileCall::ESpeed33600:  // this baud rate is not currently used in the etsi table
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1595
		case RMobileCall::ESpeedUnspecified:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1596
		default:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1597
			speedSet=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1598
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1599
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1600
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1601
	//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1602
	// Try to assemble as much of the +CBST= command as we can.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1603
	// If we do not have a <speed> value we can not send the command.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1604
	// If we do not have a <ce> value then we can send a command giving only <speed> and <name>.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1605
	// etc...
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1606
	if(speedSet)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1607
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1608
		aTxBuffer.Zero();		// Clear tx buffer
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1609
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1610
		// Append +CBST= and the <speed> parameter
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1611
		aTxBuffer.Append(KDataCallBearerServiceType);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1612
		aTxBuffer.AppendNum(speed);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1613
		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1614
		if(nameSet)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1615
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1616
			// Append the <name> parameter
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1617
			aTxBuffer.Append(TChar(',')); 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1618
			aTxBuffer.AppendNum(name);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1619
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1620
			if(ceSet)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1621
				{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1622
				// Append the <ce> parameter
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1623
				aTxBuffer.Append(TChar(',')); 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1624
				aTxBuffer.AppendNum(ce); 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1625
				}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1626
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1627
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1628
		// Append final \r char to AT command
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1629
		aTxBuffer.Append(TChar('\r'));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1630
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1631
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1632
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1633
		// We have not have enough info to create a +CBST= string 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1634
		ret=KErrArgument;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1635
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1636
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1637
	return ret;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1638
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1639
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1640
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1641
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1642
TInt CCallMobileData::Dial(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams,TDesC* aTelNumber)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1643
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1644
//	Dial a data call
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1645
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1646
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1647
	TInt ret(KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1648
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1649
	SetDataCallParams(aCallParams);	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1650
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1651
	ret=ValidateRequest(aTsyReqHandle,RCall::EStatusIdle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1652
	if (ret==KErrNone)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1653
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1654
		(void)SetOwnership(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1655
		LOGTEXT(_L8("DataCall:\tSubmitting Dial command for Data call"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1656
		iDialData->ExecuteCommand(aTsyReqHandle,aTelNumber,&iCallInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1657
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1658
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1659
		ReqCompleted(aTsyReqHandle,ret);		// An error occurred
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1660
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1661
	return KErrNone;	// Real return code is returned to client thru request completion
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1662
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1663
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1664
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1665
TInt CCallMobileData::DialCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1666
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1667
//	Cancel the dial request if possible
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1668
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1669
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1670
	LOGTEXT(_L8("DataCall:\tSubmitting Cancel Dial command for Data call"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1671
	iDialData->CancelCommand(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1672
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1673
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1674
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1675
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1676
void CCallMobileData::SetDataCallParams(const TDesC8* aCallParams)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1677
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1678
 * Utility function which unpacks the call parameters supplied by the client
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1679
 * and saves their values in iPhoneGlobals.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1680
 * If the client did not supply parameters then default ones are used.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1681
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1682
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1683
	if(aCallParams->Length()==0)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1684
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1685
		//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1686
		// Client did not supply parameters, so we use default ones
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1687
		LOGTEXT(_L8("CCallMobileData::SetDataCallParams  Using default parameters"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1688
		CCallHayes::SetCallParams(aCallParams); 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1689
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1690
		//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1691
		// Ensure the speed parameter is undefined so that we prevent the
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1692
		// +CBST=... command being sent to the phone when dialling a CSD data call.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1693
		iCallInfo.iCallParams.iService = RMobileCall::EServiceUnspecified;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1694
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1695
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1696
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1697
		//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1698
		// Use call parameters that client supplied us
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1699
		LOGTEXT(_L8("CCallMobileData::SetDataCallParams  Using clients parameters"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1700
		RCall::TCallParamsPckg* paramsPckgV1 = (RCall::TCallParamsPckg*)aCallParams;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1701
		RCall::TCallParams& paramsV1 = (*paramsPckgV1)();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1702
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1703
		CCallHayes::SetCallParams(aCallParams); 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1704
		if (paramsV1.ExtensionId()==RMobileCall::KETelMobileCallParamsV1)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1705
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1706
			RMobileCall::TMobileCallParamsV1Pckg* mmParamsPckgV1 = (RMobileCall::TMobileCallParamsV1Pckg*)aCallParams;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1707
			RMobileCall::TMobileCallParamsV1& mmParamsV1 = (*mmParamsPckgV1)();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1708
			iCallInfo.iCallParams.iIdRestrict = mmParamsV1.iIdRestrict;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1709
			iCallInfo.iCallParams.iCug = mmParamsV1.iCug;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1710
			iCallInfo.iCallParams.iAutoRedial = mmParamsV1.iAutoRedial;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1711
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1712
		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1713
		if((paramsV1.ExtensionId()==RMobileCall::KETelMobileDataCallParamsV1) ||
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1714
		   (paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV1))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1715
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1716
			RMobileCall::TMobileDataCallParamsV1Pckg* dataParamsPckgV1 = (RMobileCall::TMobileDataCallParamsV1Pckg*)aCallParams;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1717
			RMobileCall::TMobileDataCallParamsV1& dataParamsV1 = (*dataParamsPckgV1)();	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1718
			iCallInfo.iCallParams.iService=dataParamsV1.iService;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1719
			iCallInfo.iCallParams.iSpeed=dataParamsV1.iSpeed;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1720
			iCallInfo.iCallParams.iProtocol=dataParamsV1.iProtocol;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1721
			iCallInfo.iCallParams.iQoS=dataParamsV1.iQoS;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1722
			iCallInfo.iCallParams.iRLPVersion=dataParamsV1.iRLPVersion;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1723
			iCallInfo.iCallParams.iModemToMSWindowSize=dataParamsV1.iModemToMSWindowSize;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1724
			iCallInfo.iCallParams.iMSToModemWindowSize=dataParamsV1.iMSToModemWindowSize;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1725
			iCallInfo.iCallParams.iAckTimer=dataParamsV1.iAckTimer;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1726
			iCallInfo.iCallParams.iRetransmissionAttempts=dataParamsV1.iRetransmissionAttempts;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1727
			iCallInfo.iCallParams.iResequencingPeriod=dataParamsV1.iResequencingPeriod;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1728
			iCallInfo.iCallParams.iV42bisReq=dataParamsV1.iV42bisReq;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1729
			iCallInfo.iCallParams.iV42bisCodewordsNum=dataParamsV1.iV42bisCodewordsNum;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1730
			iCallInfo.iCallParams.iV42bisMaxStringLength=dataParamsV1.iV42bisMaxStringLength;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1731
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1732
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1733
		if (paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV1)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1734
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1735
			RMobileCall::TMobileHscsdCallParamsV1Pckg* hscsdParamsPckgV1 = (RMobileCall::TMobileHscsdCallParamsV1Pckg*)aCallParams;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1736
			RMobileCall::TMobileHscsdCallParamsV1& hscsdParamsV1 = (*hscsdParamsPckgV1)();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1737
			iCallInfo.iCallParams.iWantedAiur = hscsdParamsV1.iWantedAiur;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1738
			iCallInfo.iCallParams.iWantedRxTimeSlots = hscsdParamsV1.iWantedRxTimeSlots;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1739
			iCallInfo.iCallParams.iMaxTimeSlots = hscsdParamsV1.iMaxTimeSlots;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1740
			iCallInfo.iCallParams.iCodings = hscsdParamsV1.iCodings;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1741
			iCallInfo.iCallParams.iAsymmetry = hscsdParamsV1.iAsymmetry;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1742
			iCallInfo.iCallParams.iUserInitUpgrade = hscsdParamsV1.iUserInitUpgrade;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1743
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1744
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1745
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1746
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1747
TInt CCallMobileData::AnswerIncomingCall(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1748
/**
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1749
 * If there is no waiting call, will wait for one and then answer it.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1750
 * If there is a waiting call, will answer immediatly.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1751
 * Regardless of if there is a waiting call or not, the +CBST= command is sent immediatly.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1752
 */
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1753
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1754
	const CCallBase::TCallOwnership owned = CheckOwnership(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1755
	TInt ret=KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1756
	if (owned==CCallBase::EOwnedFalse)	// call owned by another client
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1757
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1758
		ret=KErrEtelNotCallOwner;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1759
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1760
	else 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1761
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1762
		if (!iIsForIncomingCall)	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1763
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1764
			if (REINTERPRET_CAST(CPhoneHayes*,Owner()->Owner())->CheckForOutstandingAnswer())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1765
				ret=KErrEtelAnswerAlreadyOutstanding;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1766
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1767
		else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1768
			ret=KErrEtelAnswerAlreadyOutstanding;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1769
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1770
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1771
	if (ret==KErrNone)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1772
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1773
		CLineHayes* line = STATIC_CAST(CLineHayes*,Owner());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1774
		STATIC_CAST(CPhoneHayes*,line->Owner())->CancelOtherRingingCall(line);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1775
		line->FreePreAllocCallIfNecessary();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1776
		SetDataCallParams(aCallParams);	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1777
		if (iCallInfo.iMobileStatus==RMobileCall::EStatusRinging)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1778
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1779
			(void)SetOwnership(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1780
			LOGTEXT(_L8("DataCall:\tSubmitting Answer command"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1781
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1782
			// Start the 'send CBST to phone' AT machine and pass the 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1783
			// CATAnswerData object, so that the call is answered after 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1784
			// the CBST is sent.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1785
			iSetCBST->ExecuteCommand(aTsyReqHandle,iAnswerData,&iCallInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1786
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1787
		else	// This call is now a client-designated Incoming Call object.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1788
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1789
			iIsForIncomingCall=ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1790
			iAnswerTsyReqHandle = aTsyReqHandle;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1791
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1792
			// Start the 'send CBST to phone' AT machine. This state machine 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1793
			// will not complete any client request.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1794
			iSetCBST->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1795
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1796
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1797
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1798
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1799
	ReqCompleted(aTsyReqHandle,ret);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1800
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1801
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1802
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1803
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1804
TInt CCallMobileData::AnswerIncomingCallCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1805
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1806
	LOGTEXT(_L8("DataCall:\tSubmitting Cancel Answer command"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1807
	if (iIsForIncomingCall)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1808
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1809
		iIsForIncomingCall=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1810
		ReqCompleted(aTsyReqHandle,KErrCancel);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1811
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1812
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1813
		iAnswerData->CancelCommand(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1814
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1815
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1816
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1817
void CCallMobileData::AnswerImmediately()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1818
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1819
	(void)SetOwnership(iAnswerTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1820
	// EStatusRinging always results in KErrNone return
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1821
	(void) ChangeCallStatus(RMobileCall::EStatusRinging);	// new 14/1/99
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1822
	iPhoneGlobals->iNotificationStore->CheckNotification(this,ERingOccurred);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1823
	iIsForIncomingCall=EFalse;	// this must be after the check notification as CNotifications
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1824
								// asks line for info about the call which Is For Incoming Call
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1825
	LOGTEXT(_L8("DataCall:\tSubmitting Answer command"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1826
	iAnswerData->ExecuteCommand(iAnswerTsyReqHandle,NULL,&iCallInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1827
	}		
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1828
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1829
TInt CCallMobileData::Connect(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1830
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1831
//	Connect to an already dialled call
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1832
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1833
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1834
	TInt ret = ValidateRequest(aTsyReqHandle,RCall::EStatusIdle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1835
	if (ret==KErrNone)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1836
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1837
		(void)SetOwnership(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1838
		SetCallParams(aCallParams);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1839
		LOGTEXT(_L8("DataCall:\tSubmitting Immediate Connect command"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1840
		iConnectData->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1841
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1842
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1843
		ReqCompleted(aTsyReqHandle,ret);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1844
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1845
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1846
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1847
TInt CCallMobileData::ConnectCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1848
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1849
//	Cancel immediate connect command
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1850
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1851
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1852
	LOGTEXT(_L8("DataCall:\tSubmitting Cancel Connect command"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1853
	iConnectData->CancelCommand(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1854
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1855
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1856
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1857
TInt CCallMobileData::HangUp(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1858
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1859
//	Terminate a data call. If someone else owns call complete with error, but if no-one owns
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1860
//	it send an ATH anyway, as the connection may have failed and the user wants to ensure
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1861
//	call has hung up. Call Start() instead of ExecuteCommand() because there is no need to
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1862
//	initialise before doing this or to send the escape sequence - the hang up sequence drops
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1863
//	DTR anyway.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1864
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1865
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1866
	if (CheckOwnership(aTsyReqHandle)==CCallBase::EOwnedFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1867
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1868
		ReqCompleted(aTsyReqHandle,KErrEtelNotCallOwner);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1869
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1870
		}	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1871
	if ((iCallInfo.iMobileStatus!=RMobileCall::EStatusIdle) &&
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1872
		(iCallInfo.iMobileStatus!=RMobileCall::EStatusDisconnecting))
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1873
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1874
		LOGTEXT(_L8("DataCall:\tSubmitting Hang Up command"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1875
		iHangUpData->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1876
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1877
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1878
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1879
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1880
		// Call not in a state to be terminated - but return KErrNone
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1881
		ReqCompleted(aTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1882
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1883
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1884
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1885
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1886
TInt CCallMobileData::HangUpCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1887
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1888
//	Cancel the hang up command. 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1889
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1890
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1891
	LOGTEXT(_L8("DataCall:\tSubmitting Cancel Hang Up command"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1892
	iHangUpData->Stop(aTsyReqHandle);	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1893
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1894
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1895
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1896
TInt CCallMobileData::RelinquishOwnership()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1897
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1898
//	Called by server to tell TSY to either pass ownership on to another interested client
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1899
//	or hang up immediately. If call is currently connecting, RelinquishOwnershipComplete 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1900
//	will be called once cancelling has finished.
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1901
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1902
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1903
	LOGTEXT(_L8("DataCall:\tRelinquish Ownership"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1904
	if(iList->iAcquireList.IsEmpty()) 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1905
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1906
		if (iDialData->IsPreConnectInProgress() ||
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1907
			iConnectData->IsPreConnectInProgress() ||
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1908
			iAnswerData->IsPreConnectInProgress())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1909
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1910
			iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1911
			return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1912
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1913
		switch(iCallInfo.iMobileStatus)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1914
			{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1915
		case RMobileCall::EStatusConnected:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1916
			iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1917
			//iHangUpData->ExecuteCommand(0,NULL,&iCallInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1918
			iQuickInit->CancelAndHangUp(&iCallInfo,iHangUpData);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1919
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1920
		case RMobileCall::EStatusDialling:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1921
		case RMobileCall::EStatusConnecting:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1922
		case RMobileCall::EStatusAnswering:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1923
		case RMobileCall::EStatusDisconnecting:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1924
			iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1925
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1926
		default:
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1927
			if (iPhoneGlobals->iPhoneStatus.iInitStatus==EPhoneInitialising)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1928
				iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1929
			else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1930
				RelinquishOwnershipCompleted(KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1931
			break;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1932
			}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1933
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1934
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1935
	CAcquireEntry* entry=iList->iAcquireList.First();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1936
	if (entry) 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1937
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1938
		(void)SetOwnership(entry->iTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1939
		ReqCompleted(entry->iTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1940
		iList->Remove(entry);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1941
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1942
	RelinquishOwnershipCompleted(KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1943
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1944
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1945
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1946
TInt CCallMobileData::RecoverDataPortAndRelinquishOwnership()
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1947
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1948
//	Called by server to tell TSY to either pass ownership on to another interested client
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1949
//	after regaining control of the port and performing a swift initialisation,
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1950
//	or hang up immediately
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1951
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1952
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1953
	LOGTEXT(_L8("DataPort Recover and Relinquish Ownership"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1954
	iCallInfo.iLoanedToClient=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1955
	iPhoneGlobals->iPhoneStatus.iDataPortLoaned = EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1956
	if(iList->iAcquireList.IsEmpty())
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1957
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1958
		(void)SetUnowned();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1959
		iCallInfo.iClientPanicOccurred = EPanicOccurredDuringDataPortLoan;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1960
		iIo->Read();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1961
		iHangUpData->ExecuteCommand(0,NULL,&iCallInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1962
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1963
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1964
	CAcquireEntry* entry=iList->iAcquireList.First();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1965
	if (entry) 
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1966
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1967
		(void)SetOwnership(entry->iTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1968
		ReqCompleted(entry->iTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1969
		iList->Remove(entry);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1970
		iQuickInit->StartQuickInit();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1971
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1972
	RecoverDataPortAndRelinquishOwnershipCompleted(KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1973
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1974
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1975
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1976
TInt CCallMobileData::LoanDataPort(const TTsyReqHandle aTsyReqHandle, RCall::TCommPort* aCommPort)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1977
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1978
//	Get the port info
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1979
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1980
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1981
	LOGTEXT(_L8(" DataPort Loan"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1982
	if (CheckOwnership(aTsyReqHandle)!=CCallBase::EOwnedTrue)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1983
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1984
		ReqCompleted(aTsyReqHandle,KErrEtelNotCallOwner);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1985
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1986
		}	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1987
	if (iCallInfo.iMobileStatus != RMobileCall::EStatusConnected)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1988
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1989
		ReqCompleted(aTsyReqHandle,KErrEtelCallNotActive);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1990
		return KErrNone;	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1991
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1992
	TInt ret = iPhoneGlobals->iConfiguration->ConfigModemString(TPtrC(KCDTypeNameCsyName),aCommPort->iCsy);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1993
	if (!ret)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1994
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1995
		ret = iPhoneGlobals->iConfiguration->ConfigModemString(TPtrC(KCDTypeNamePortName),aCommPort->iPort);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1996
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1997
	if (ret)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1998
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1999
		ReqCompleted(aTsyReqHandle,ret);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2000
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2001
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2002
	iCallInfo.iLoanedToClient = ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2003
	iPhoneGlobals->iPhoneStatus.iDataPortLoaned = ETrue;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2004
	iPhoneGlobals->iNotificationStore->CheckNotification(this,EDataPortLoaned);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2005
	iWaitForNoCarrier->StopWait();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2006
	if (iPhoneGlobals->iPhoneStatus.iMode==RPhone::EModeOnlineCommand)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2007
		iATSetToOnlineDataMode->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2008
	else
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2009
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2010
		iIo->Cancel();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2011
		TCommConfig aConfigPckg;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2012
		TInt ret = iPhoneGlobals->iConfiguration->PortConfig(aConfigPckg,EConfigTypeFull);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2013
		if (ret==KErrNone)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2014
			ret = iIo->ConfigurePort(aConfigPckg);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2015
		ReqCompleted(aTsyReqHandle,ret);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2016
		}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2017
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2018
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2019
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2020
TInt CCallMobileData::LoanDataPortCancel(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2021
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2022
	iATSetToOnlineDataMode->CancelCommand(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2023
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2024
	}
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2025
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2026
TInt CCallMobileData::RecoverDataPort(const TTsyReqHandle aTsyReqHandle)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2027
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2028
//	Take back control of data port
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2029
//	Check that call had been loaned to client
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2030
//
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2031
	{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2032
	if (iCallInfo.iLoanedToClient==EFalse)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2033
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2034
		ReqCompleted(aTsyReqHandle,KErrEtelPortNotLoanedToClient);	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2035
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2036
		}	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2037
	TCallOwnership owner = CheckOwnership(aTsyReqHandle);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2038
	if (owner!=CCallBase::EOwnedTrue && owner!=CCallBase::EOwnedPriorityClient)
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2039
		{
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2040
		ReqCompleted(aTsyReqHandle,KErrEtelNotCallOwner);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2041
		return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2042
		}	
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2043
	LOGTEXT(_L8("DataPort Recover"));
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2044
	iCallInfo.iLoanedToClient=EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2045
	iPhoneGlobals->iPhoneStatus.iDataPortLoaned = EFalse;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2046
	LOGTEXT2(_L8("Comm signals : %x"),iIo->Signals());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2047
 	iIo->ResetReadAndWriteBuffers();	// in case client has left RxBuffer non-empty
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2048
	LOGTEXT2(_L8("Comm signals after ResetBuffers : %x"),iIo->Signals());
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2049
	FlowControlSuspend();			// Defect fix for MPO-4ZECUN
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2050
	iQuickInit->StartQuickInit();
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2051
	ReqCompleted(aTsyReqHandle,KErrNone);
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2052
	return KErrNone;
3553901f7fa8 Revision: 201005
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2053
	}
66
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2054
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2055
// local function needed below
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2056
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2057
LOCAL_C void SetFaxSessionSettings(RCall::TFaxSessionSettings& aTrg, const RCall::TFaxSessionSettings& aSrc)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2058
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2059
	aTrg.iMode=aSrc.iMode;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2060
	aTrg.iFaxRetrieveType=aSrc.iFaxRetrieveType;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2061
	aTrg.iFaxClass=aSrc.iFaxClass;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2062
	aTrg.iFaxId=aSrc.iFaxId;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2063
	aTrg.iMaxSpeed=aSrc.iMaxSpeed;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2064
	aTrg.iMinSpeed=aSrc.iMinSpeed;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2065
	aTrg.iPreferredECM=aSrc.iPreferredECM;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2066
	aTrg.iFaxOnDemandDelay=aSrc.iFaxOnDemandDelay;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2067
	aTrg.iTxResolution=aSrc.iTxResolution;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2068
	aTrg.iTxCompression=aSrc.iTxCompression;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2069
	aTrg.iTxPages=aSrc.iTxPages;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2070
	aTrg.iRxResolution=aSrc.iRxResolution;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2071
	aTrg.iRxResolution=aSrc.iRxResolution;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2072
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2073
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2074
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2075
//	CCallMobileFax - fax call functionality
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2076
//	At construction, phone init sequence may not have yet determined phone's capabilities so
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2077
//	create object anyway and check in the function calls whether fax is supported by phone
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2078
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2079
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2080
CCallMobileFax* CCallMobileFax::NewL(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aPhoneGlobals,const TName& aName)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2081
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2082
	CCallMobileFax* faxCall=new(ELeave) CCallMobileFax(aATIO,aInit,aPhoneGlobals);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2083
	TCleanupItem newCallFaxHayesClose(CloseCall,faxCall);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2084
	CleanupStack::PushL(newCallFaxHayesClose);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2085
	faxCall->ConstructL(aName);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2086
	CleanupStack::Pop();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2087
	return faxCall;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2088
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2089
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2090
CCallMobileFax::CCallMobileFax(CATIO* aATIO,CATInit* aInit,CPhoneGlobals* aPhoneGlobals)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2091
	: CCallMobile(aATIO,aInit,aPhoneGlobals),iFaxSession(NULL),iFax(NULL)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2092
	{}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2093
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2094
void CCallMobileFax::ConstructL(const TName& aName)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2095
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2096
	CCallHayes::ConstructL(aName);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2097
	iCallInfo.iLineOwnerName = KFaxLineName;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2098
	iDialFax=CATDialFax::NewL(iIo,this,iInit,iPhoneGlobals);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2099
	iConnectFax=CATConnectFax::NewL(iIo,this,iInit,iPhoneGlobals);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2100
	iAnswerFax=CATAnswerFax::NewL(iIo,this,iInit,iPhoneGlobals);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2101
	iHangUpFax=CATHangUpFax::NewL(iIo,this,iInit,iPhoneGlobals);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2102
	iFaxSettings.iMode = RCall::ETransmit;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2103
	iFaxSettings.iFaxRetrieveType = RCall::EFaxOnDemand;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2104
	iFaxSettings.iFaxClass = EClassAuto;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2105
	iFaxSettings.iMaxSpeed = 9600;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2106
	iFaxSettings.iMinSpeed = 2400;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2107
	iFaxSettings.iPreferredECM = EFalse;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2108
	iFaxSettings.iFaxOnDemandDelay = 20;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2109
	iFaxSettings.iTxResolution = EFaxNormal;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2110
	iFaxSettings.iTxCompression = EModifiedHuffman;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2111
	iFaxSettings.iTxPages = 0;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2112
	iFaxSettings.iRxResolution = EFaxNormal;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2113
	iFaxSettings.iRxCompression = EModifiedHuffman;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2114
	iFaxCompletion = new (ELeave) CFaxCompletion();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2115
	iFaxProgress=CreateFaxProgressChunk();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2116
	if(iFaxProgress==NULL)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2117
		User::Leave(KErrEtelFaxChunkNotCreated);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2118
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2119
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2120
CCallMobileFax::~CCallMobileFax()
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2121
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2122
//	Removes itself from array of calls in CLineMobileData
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2123
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2124
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2125
	__ASSERT_DEBUG(iFaxSession==NULL,Panic(EFaxServerNotNull));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2126
	DeleteFaxProgressChunk();		// This deallocates the memory pointed to by iFaxProgress
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2127
	delete iDialFax;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2128
	delete iConnectFax;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2129
	delete iAnswerFax;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2130
	delete iHangUpFax;	
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2131
	delete iFaxCompletion;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2132
	delete iFileHandles;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2133
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2134
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2135
void CCallMobileFax::CollateCoreCaps(const TTsyReqHandle aTsyReqHandle, TUint32* aCallCaps)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2136
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2137
	*aCallCaps = RCall::KCapsFax;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2138
	if (ValidateFaxClass(iFaxSettings.iFaxClass)==KErrNone
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2139
		 && (!(REINTERPRET_CAST(CLineMobileFax*,Owner())->iFaxOpened==TRUE && iFax==NULL))
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2140
		 && iPhoneGlobals->iPhoneStatus.iModemDetected==RPhone::EDetectedPresent)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2141
		 //	check that fax class is OK and that no other fax call has opened a fax object
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2142
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2143
		TCallOwnership owner = CheckOwnership(aTsyReqHandle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2144
		if (ValidateRequest(aTsyReqHandle,RCall::EStatusIdle)==KErrNone)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2145
			*aCallCaps |= (RCall::KCapsDial | RCall::KCapsConnect);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2146
		TInt ret=KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2147
		if (owner==CCallBase::EOwnedFalse)	// call owned by another client
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2148
			ret=KErrEtelNotCallOwner;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2149
		else 
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2150
			{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2151
			if (!iIsForIncomingCall)	
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2152
				{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2153
				if (REINTERPRET_CAST(CPhoneHayes*,Owner()->Owner())->CheckForOutstandingAnswer())
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2154
					ret=KErrEtelAnswerAlreadyOutstanding;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2155
				}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2156
			else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2157
				ret=KErrEtelAnswerAlreadyOutstanding;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2158
			}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2159
		if (ret==KErrNone && (iCallInfo.iMobileStatus==RMobileCall::EStatusIdle || iCallInfo.iMobileStatus==RMobileCall::EStatusRinging))
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2160
			*aCallCaps |= RCall::KCapsAnswer;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2161
		if (owner==CCallBase::EOwnedTrue && iCallInfo.iMobileStatus==RMobileCall::EStatusConnected)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2162
			{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2163
			*aCallCaps |= RCall::KCapsHangUp;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2164
			}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2165
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2166
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2167
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2168
TInt CCallMobileFax::OpenFax(TDesC* aTelNumber,TFaxMode aFaxMode)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2169
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2170
//	Open CETelFaxHayes object with desired settings
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2171
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2172
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2173
	TFaxServerSessionSettings faxSettings;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2174
	faxSettings.iPhoneNumber.Copy(*aTelNumber);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2175
	faxSettings.iLogging = ETrue;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2176
	TInt ret = iPhoneGlobals->iConfiguration->ConfigModemString(TPtrC(KCDTypeNameFaxInitString),faxSettings.iFaxInitString);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2177
	if (!ret)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2178
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2179
		ret = iPhoneGlobals->iConfiguration->ConfigModemString(TPtrC(KCDTypeNameCsyName),faxSettings.iPortDriverName);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2180
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2181
	if (!ret)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2182
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2183
		ret = iPhoneGlobals->iConfiguration->ConfigModemString(TPtrC(KCDTypeNamePortName),faxSettings.iCommPortName);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2184
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2185
	if (ret)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2186
		return ret;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2187
	if(faxSettings.iFaxInitString.Length()==0)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2188
		faxSettings.iFaxInitString=KAT2Command;			
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2189
	faxSettings.iMode = aFaxMode;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2190
	faxSettings.iFaxClass = iFaxSettings.iFaxClass;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2191
	faxSettings.iFaxId = iFaxSettings.iFaxId;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2192
	faxSettings.iMaxSpeed = iFaxSettings.iMaxSpeed;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2193
	faxSettings.iMinSpeed = iFaxSettings.iMinSpeed;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2194
	faxSettings.iPreferredECM = iFaxSettings.iPreferredECM;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2195
	faxSettings.iFaxOnDemandDelay = iFaxSettings.iFaxOnDemandDelay;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2196
	faxSettings.iTxResolution = iFaxSettings.iTxResolution;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2197
	faxSettings.iTxCompression = iFaxSettings.iTxCompression;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2198
	faxSettings.iTxPages = iFaxSettings.iTxPages;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2199
	faxSettings.iRxResolution = iFaxSettings.iRxResolution;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2200
	faxSettings.iRxCompression = iFaxSettings.iRxCompression;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2201
	return iFaxSession->FxOpen(faxSettings,iFaxProgress);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2202
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2203
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2204
TInt CCallMobileFax::ValidateFaxClass(TFaxClass& aFaxClass)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2205
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2206
	if ((iPhoneGlobals->iPhoneStatus.iDataAndFaxFlags & KFaxCaps) == 0)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2207
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2208
		return KErrNotSupported;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2209
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2210
	switch (aFaxClass)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2211
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2212
	case EClassAuto:		// TSY decides what class "AUTO" refers to!
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2213
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2214
		if ((iPhoneGlobals->iPhoneStatus.iDataAndFaxFlags & RPhone::KCapsFaxClassTwoPointZero))
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2215
			aFaxClass =  EClass2point0;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2216
		else if ((iPhoneGlobals->iPhoneStatus.iDataAndFaxFlags & RPhone::KCapsFaxClassTwo)) 
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2217
			aFaxClass = EClass2;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2218
		else if ((iPhoneGlobals->iPhoneStatus.iDataAndFaxFlags & RPhone::KCapsFaxClassOne))
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2219
			aFaxClass = EClass1;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2220
		break;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2221
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2222
	case EClass1:
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2223
		if ((iPhoneGlobals->iPhoneStatus.iDataAndFaxFlags & RPhone::KCapsFaxClassOne)==0)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2224
			return KErrEtelWrongModemType;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2225
		break;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2226
	case EClass1point0:
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2227
		if ((iPhoneGlobals->iPhoneStatus.iDataAndFaxFlags & RPhone::KCapsFaxClassOnePointZero)==0)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2228
			return KErrEtelWrongModemType;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2229
		break;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2230
	case EClass2:
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2231
		if ((iPhoneGlobals->iPhoneStatus.iDataAndFaxFlags & RPhone::KCapsFaxClassTwo)==0)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2232
			return KErrEtelWrongModemType;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2233
		break;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2234
	case EClass2point0:
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2235
		if ((iPhoneGlobals->iPhoneStatus.iDataAndFaxFlags & RPhone::KCapsFaxClassTwoPointZero)==0)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2236
			return KErrEtelWrongModemType;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2237
		break;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2238
	case EClass2point1:
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2239
		if ((iPhoneGlobals->iPhoneStatus.iDataAndFaxFlags & RPhone::KCapsFaxClassTwoPointOne)==0)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2240
			return KErrEtelWrongModemType;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2241
		break;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2242
	default:
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2243
		return KErrEtelWrongModemType;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2244
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2245
	return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2246
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2247
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2248
typedef CFaxSession* (*TFaxServerEntry)();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2249
void CCallMobileFax::GetFaxBaseL()
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2250
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2251
	__ASSERT_DEBUG(iFaxCompletion,Panic(EFaxCompletionPtrNull));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2252
	RFs fs;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2253
	(void)User::LeaveIfError(fs.Connect());
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2254
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2255
	TInt r=iFaxServerLib.Load(KFaxServerName);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2256
	if (r==KErrNone)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2257
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2258
		// Check the Uid2
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2259
#if defined (_UNICODE)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2260
		if(iFaxServerLib.Type()[1]!=TUid::Uid(KUidUnicodeDynamicFaxServer))
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2261
			r = KErrBadLibraryEntryPoint;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2262
#else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2263
		if(iFaxServerLib.Type()[1]!=TUid::Uid(KUidDynamicFaxServer))
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2264
			r = KErrBadLibraryEntryPoint;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2265
#endif
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2266
		if (r==KErrNone)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2267
			{	
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2268
			TFaxServerEntry libEntry=(TFaxServerEntry)iFaxServerLib.Lookup(1);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2269
			if (libEntry!=NULL)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2270
				{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2271
				TRAP(r,iFaxSession=(*libEntry)());	// libEntry may leave.
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2272
				if (r==KErrNone)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2273
					{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2274
					LOGTEXT(_L8("Loaded Fax Server"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2275
					iFaxSession->SetCallBack(iFaxCompletion);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2276
					}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2277
				else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2278
					iFaxServerLib.Close();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2279
				}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2280
			else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2281
				{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2282
				r = KErrBadLibraryEntryPoint;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2283
				iFaxServerLib.Close();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2284
				}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2285
			}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2286
		else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2287
			iFaxServerLib.Close();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2288
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2289
	fs.Close();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2290
	(void)User::LeaveIfError(r);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2291
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2292
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2293
TInt CCallMobileFax::FaxConnectHandler(const TTsyReqHandle aTsyReqHandle)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2294
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2295
	TInt ret = ValidateFaxClass(iFaxSettings.iFaxClass);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2296
	if (ret!=KErrNone)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2297
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2298
		(void)SetUnowned();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2299
		ReqCompleted(aTsyReqHandle,ret);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2300
		return ret;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2301
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2302
	if (REINTERPRET_CAST(CLineMobileFax*,Owner())->iFaxOpened==TRUE && iFax==NULL)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2303
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2304
		(void)SetUnowned();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2305
		ReqCompleted(aTsyReqHandle,KErrEtelNotFaxOwner);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2306
		return ret;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2307
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2308
	
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2309
	TRAPD(res,GetFaxBaseL());
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2310
	if (res!=KErrNone)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2311
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2312
		(void)SetUnowned();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2313
		ReqCompleted(aTsyReqHandle,res);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2314
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2315
	iPhoneGlobals->iEventSignalActive = EFalse; 
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2316
	return res;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2317
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2318
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2319
void CCallMobileFax::FaxDial(const TTsyReqHandle aTsyReqHandle,TDesC* aTelNumber)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2320
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2321
//	Called once any initialising has been done. Checks here that modem supports fax,
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2322
//	and that no other CCallHayes has opened a fax object
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2323
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2324
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2325
	if (FaxConnectHandler(aTsyReqHandle)!=KErrNone)	// ReqCompleted is called inside FaxConnectHandler
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2326
													// if there is an error
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2327
		return;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2328
	TFaxMode faxMode;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2329
	if (iFaxSettings.iMode==RCall::ETransmit)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2330
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2331
		faxMode = EDialAndTransmit;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2332
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2333
	else	// we're receiving
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2334
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2335
		if (iFaxSettings.iFaxRetrieveType==RCall::EFaxPoll)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2336
			faxMode = EDialAndReceivePoll;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2337
		else 
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2338
			faxMode = EDialAndReceiveFaxBack;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2339
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2340
	TInt res = OpenFax(aTelNumber,faxMode);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2341
	if (res!=KErrNone)	// make sure cleaned up.
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2342
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2343
		ReqCompleted(aTsyReqHandle,res);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2344
		return;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2345
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2346
	ChangeLineStatus(RCall::EStatusDialling);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2347
	// EStatusDialling always results in KErrNone return
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2348
	(void) ChangeCallStatus(RMobileCall::EStatusDialling);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2349
	iPhoneGlobals->iNotificationStore->CheckNotification(this,EBegunConnecting);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2350
	iFaxCompletion->Configure(aTsyReqHandle,this);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2351
	iIo->Cancel();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2352
	iPhoneGlobals->iPhoneStatus.iPortAccess = EPortAccessDenied; // so CATIO won't queue a read
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2353
	
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2354
	if (faxMode == EDialAndTransmit)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2355
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2356
		LOGTEXT(_L8("About to call CETelFaxBase::TxConnect"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2357
		//this transfers ownership of the file handles object to the fax session object.
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2358
		iFaxSession->SetFaxHeaderFile(iFileHandles);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2359
		//we now aren't resonsible for its deletion.
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2360
		iFileHandles = NULL;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2361
		iFaxSession->TxConnect();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2362
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2363
	else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2364
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2365
		LOGTEXT(_L8("About to call CETelFaxBase::RxConnect"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2366
		iFaxSession->RxConnect();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2367
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2368
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2369
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2370
TInt CCallMobileFax::Dial(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams,TDesC* aTelNumber)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2371
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2372
//	Dial a fax call
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2373
//	Check that call is not owned by another client, and line is idle  
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2374
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2375
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2376
	TInt ret = ValidateRequest(aTsyReqHandle,RCall::EStatusIdle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2377
	if (ret==KErrNone)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2378
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2379
		(void)SetOwnership(aTsyReqHandle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2380
		SetCallParams(aCallParams);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2381
		LOGTEXT(_L8("FaxCall:\tSubmitting Dial Command"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2382
		iDialFax->ExecuteCommand(aTsyReqHandle,aTelNumber,&iCallInfo);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2383
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2384
	else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2385
		ReqCompleted(aTsyReqHandle,ret);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2386
	return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2387
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2388
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2389
void CCallMobileFax::FaxCancelCommand(const TTsyReqHandle aTsyReqHandle)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2390
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2391
//	Cancels the fax session (for ConnectCancel and AnswerCancel as well)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2392
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2393
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2394
	LOGTEXT(_L8("FaxCall:\tCancel Fax call and Unload module"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2395
	if(!iFaxSession)							// if iFaxSession is NULL
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2396
		{										// then CleanUpFaxServer has already been called
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2397
		LOGTEXT(_L8("FaxCall:\tModule already unloaded, completing..."));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2398
		ReqCompleted(aTsyReqHandle,KErrCancel);	// so return without further processing
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2399
		return;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2400
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2401
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2402
	LOGTEXT(_L8("FaxCall:\tClosing down fax server module"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2403
	iFaxSession->Cancel();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2404
	CleanUpFaxServer();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2405
	iIo->Read();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2406
	SetToIdle();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2407
	ReqCompleted(aTsyReqHandle,KErrCancel);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2408
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2409
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2410
TInt CCallMobileFax::DialCancel(const TTsyReqHandle aTsyReqHandle)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2411
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2412
	LOGTEXT2(_L8("FaxCall:\tDialCancel(%d) called"),aTsyReqHandle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2413
	iDialFax->CancelCommand(aTsyReqHandle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2414
	return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2415
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2416
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2417
void CCallMobileFax::FaxConnect(const TTsyReqHandle aTsyReqHandle)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2418
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2419
//	Called once any initialising has been done. Checks here that modem supports fax.
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2420
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2421
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2422
	if (FaxConnectHandler(aTsyReqHandle)!=KErrNone)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2423
		return;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2424
	TFaxMode faxMode;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2425
	if (iFaxSettings.iMode==RCall::ETransmit)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2426
		faxMode = EImmediateTransmit;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2427
	else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2428
		faxMode = EImmediateReceive;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2429
	TBuf<1> null;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2430
	null.Zero();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2431
	TInt res = OpenFax(&null,faxMode);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2432
	if (res!=KErrNone)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2433
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2434
		ReqCompleted(aTsyReqHandle,res);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2435
		return;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2436
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2437
	ChangeLineStatus(RCall::EStatusConnecting);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2438
	// EStatusConnecting always returns KErrNone
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2439
	(void)ChangeCallStatus(RMobileCall::EStatusConnecting);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2440
	iPhoneGlobals->iNotificationStore->CheckNotification(this,EBegunConnecting);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2441
	iFaxCompletion->Configure(aTsyReqHandle,this);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2442
	iIo->Cancel();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2443
	iPhoneGlobals->iPhoneStatus.iPortAccess = EPortAccessDenied; // so CATIO won't queue a read
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2444
	if (faxMode == EImmediateTransmit)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2445
		iFaxSession->TxConnect();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2446
	else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2447
		iFaxSession->RxConnect();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2448
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2449
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2450
TInt CCallMobileFax::Connect(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2451
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2452
//	Immediate connect to a fax call
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2453
//	Check that call is not owned by another client, and line is idle  
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2454
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2455
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2456
	TInt ret = ValidateRequest(aTsyReqHandle,RCall::EStatusIdle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2457
	if (ret==KErrNone)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2458
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2459
		(void)SetOwnership(aTsyReqHandle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2460
		SetCallParams(aCallParams);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2461
		LOGTEXT(_L8("FaxCall:\tSubmitting Connect Command"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2462
		iConnectFax->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2463
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2464
	else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2465
		ReqCompleted(aTsyReqHandle,ret);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2466
	return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2467
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2468
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2469
TInt CCallMobileFax::ConnectCancel(const TTsyReqHandle aTsyReqHandle)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2470
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2471
	LOGTEXT2(_L8("FaxCall:\tConnectCancel(%d) called"),aTsyReqHandle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2472
	iConnectFax->CancelCommand(aTsyReqHandle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2473
	return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2474
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2475
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2476
void CCallMobileFax::FaxAnswer(const TTsyReqHandle aTsyReqHandle)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2477
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2478
	if (FaxConnectHandler(aTsyReqHandle)!=KErrNone)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2479
		return;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2480
	TFaxMode faxMode;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2481
	if (iFaxSettings.iMode==RCall::ETransmit)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2482
		faxMode = EWaitForRingAndTransmit;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2483
	else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2484
		faxMode = EWaitForRingAndReceive;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2485
	TBuf<1> null;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2486
	null.Zero();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2487
	TInt res = OpenFax(&null,faxMode);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2488
	if (res!=KErrNone)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2489
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2490
		ReqCompleted(aTsyReqHandle,res);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2491
		return;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2492
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2493
	LOGTEXT(_L8("FaxCall:\tAnswering Fax call"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2494
	ChangeLineStatus(RCall::EStatusAnswering);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2495
	// EStatusAnswering always results in KerrNone return
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2496
	(void)ChangeCallStatus(RMobileCall::EStatusAnswering);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2497
	CPhoneHayes* phone=STATIC_CAST(CPhoneHayes*,Owner()->Owner());
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2498
	phone->StopRingCounter();		// RING should no longer come in
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2499
	iPhoneGlobals->iNotificationStore->CheckNotification(this,EBegunConnecting);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2500
	iFaxCompletion->Configure(aTsyReqHandle,this);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2501
	iIo->Cancel();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2502
	iPhoneGlobals->iPhoneStatus.iPortAccess = EPortAccessDenied; // so CATIO won't queue a read
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2503
	if (faxMode == EWaitForRingAndTransmit)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2504
		iFaxSession->TxConnect();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2505
	else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2506
		iFaxSession->RxConnect();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2507
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2508
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2509
TInt CCallMobileFax::AnswerIncomingCall(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2510
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2511
//	Answer a fax call
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2512
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2513
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2514
	TInt ret=KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2515
	CCallBase::TCallOwnership owned = CheckOwnership(aTsyReqHandle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2516
	if (owned==CCallBase::EOwnedFalse)	// call owned by another client
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2517
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2518
		ret=KErrEtelNotCallOwner;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2519
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2520
	else if (REINTERPRET_CAST(CPhoneHayes*,Owner()->Owner())->CheckForOutstandingAnswer())
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2521
		ret=KErrEtelAnswerAlreadyOutstanding;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2522
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2523
	if (ret==KErrNone)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2524
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2525
		CLineHayes* line = STATIC_CAST(CLineHayes*,Owner());
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2526
		CPhoneHayes* phone=STATIC_CAST(CPhoneHayes*,line->Owner());
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2527
		phone->CancelOtherRingingCall(line);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2528
		line->FreePreAllocCallIfNecessary();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2529
		SetCallParams(aCallParams);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2530
		if (iCallInfo.iMobileStatus==RMobileCall::EStatusRinging)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2531
			{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2532
			LOGTEXT(_L8("FaxCall:\tSubmitting Answer Command"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2533
			iAnswerFax->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2534
			}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2535
		else	// This call is now a client-designated Incoming Call object.
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2536
			{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2537
			iIsForIncomingCall=ETrue;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2538
			iAnswerTsyReqHandle = aTsyReqHandle;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2539
			}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2540
		return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2541
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2542
	ReqCompleted(aTsyReqHandle,ret);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2543
	return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2544
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2545
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2546
TInt CCallMobileFax::AnswerIncomingCallCancel(const TTsyReqHandle aTsyReqHandle)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2547
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2548
//	Cancel the answer command if possible
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2549
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2550
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2551
	LOGTEXT2(_L8("FaxCall:\tAnswerCancel(%d) called"),aTsyReqHandle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2552
	if (iIsForIncomingCall)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2553
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2554
		iIsForIncomingCall=EFalse;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2555
		ReqCompleted(aTsyReqHandle,KErrCancel);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2556
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2557
	else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2558
		iAnswerFax->CancelCommand(aTsyReqHandle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2559
	return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2560
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2561
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2562
void CCallMobileFax::AnswerImmediately()
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2563
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2564
	(void)SetOwnership(iAnswerTsyReqHandle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2565
	// EStatusRinging always results in KErrNone return
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2566
	(void)ChangeCallStatus(RMobileCall::EStatusRinging);// new 14/1/99
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2567
	iPhoneGlobals->iNotificationStore->CheckNotification(this,ERingOccurred);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2568
	iIsForIncomingCall=EFalse;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2569
	LOGTEXT(_L8("FaxCall:\tSubmitting Answer command"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2570
	iAnswerFax->ExecuteCommand(iAnswerTsyReqHandle,NULL,&iCallInfo);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2571
	}		
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2572
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2573
void CCallMobileFax::FaxHangUp(const TTsyReqHandle aTsyReqHandle)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2574
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2575
//	Fax server reconfigures port so no need to here.
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2576
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2577
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2578
	if (iFaxSession)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2579
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2580
		// EStatusDisconnecting always results in KErrNone return
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2581
		(void)ChangeCallStatus(RMobileCall::EStatusDisconnecting);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2582
		ChangeLineStatus(RCall::EStatusHangingUp);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2583
		iPhoneGlobals->iNotificationStore->CheckNotification(this,EBegunHangingUp);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2584
		CleanUpFaxServer();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2585
		iIo->Read();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2586
		SetToIdle();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2587
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2588
	ReqCompleted(aTsyReqHandle,KErrNone);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2589
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2590
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2591
TInt CCallMobileFax::HangUp(const TTsyReqHandle aTsyReqHandle)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2592
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2593
//	Terminate a fax call. Checks fax capability, call ownership and line status.
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2594
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2595
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2596
	if ((iPhoneGlobals->iPhoneStatus.iDataAndFaxFlags & KFaxCaps) == 0)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2597
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2598
		ReqCompleted(aTsyReqHandle,KErrNotSupported);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2599
		return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2600
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2601
	if (CheckOwnership(aTsyReqHandle)==CCallBase::EOwnedFalse)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2602
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2603
		ReqCompleted(aTsyReqHandle,KErrEtelNotCallOwner);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2604
		return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2605
		}	
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2606
	if (iPhoneGlobals->iPhoneStatus.iLineStatus != RCall::EStatusConnected)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2607
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2608
		ReqCompleted(aTsyReqHandle,KErrNone);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2609
		return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2610
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2611
	LOGTEXT(_L8("FaxCall:\tHanging up"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2612
	iHangUpFax->ExecuteCommand(aTsyReqHandle,NULL,&iCallInfo);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2613
	return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2614
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2615
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2616
TInt CCallMobileFax::HangUpCancel(const TTsyReqHandle aTsyReqHandle)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2617
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2618
	iHangUpFax->CancelCommand(aTsyReqHandle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2619
	return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2620
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2621
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2622
TInt CCallMobileFax::RelinquishOwnership()
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2623
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2624
//	Called by server to tell TSY to either pass ownership on to another interested client
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2625
//	or hang up immediately
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2626
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2627
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2628
	LOGTEXT(_L8("FaxCall:\tRelinquish Ownership"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2629
	if(iList->iAcquireList.IsEmpty()) 
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2630
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2631
		if (iDialFax->IsPreConnectInProgress()	  ||
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2632
			iConnectFax->IsPreConnectInProgress() ||
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2633
			iAnswerFax->IsPreConnectInProgress())	// fax server has not yet been started
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2634
			{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2635
			iCallInfo.iClientPanicOccurred = EPanicOccurredWithoutDataPortLoan;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2636
			return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2637
			}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2638
		(void)SetUnowned();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2639
		TInt ret = KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2640
		if (iCallInfo.iMobileStatus==RMobileCall::EStatusDialling		||
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2641
			 iCallInfo.iMobileStatus==RMobileCall::EStatusConnecting	||
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2642
			 iCallInfo.iMobileStatus==RMobileCall::EStatusAnswering		||
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2643
			 iCallInfo.iMobileStatus==RMobileCall::EStatusConnected		||
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2644
			 iCallInfo.iMobileStatus==RMobileCall::EStatusDisconnecting
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2645
			 )
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2646
			{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2647
			LOGTEXT(_L8("FaxCall:\tHanging up"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2648
			ChangeLineStatus(RCall::EStatusHangingUp);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2649
			// EStatusDisconnecting always results in KErrNone return
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2650
			(void)ChangeCallStatus(RMobileCall::EStatusDisconnecting);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2651
			CleanUpFaxServer();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2652
			ChangeLineStatus(RCall::EStatusIdle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2653
			// EStatusIdle always results in KErrNone return
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2654
			(void)ChangeCallStatus(RMobileCall::EStatusIdle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2655
			iPhoneGlobals->iPhoneStatus.iMode = RPhone::EModeIdle;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2656
			iIo->Cancel();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2657
			TCommConfig aConfigPckg;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2658
			TInt ret = iPhoneGlobals->iConfiguration->PortConfig(aConfigPckg,EConfigTypeInit);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2659
			if (ret==KErrNone)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2660
				ret = iIo->ConfigurePort(aConfigPckg);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2661
			if (ret)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2662
				iPhoneGlobals->iPhoneStatus.iInitStatus = EPhoneNotInitialised;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2663
			else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2664
				iIo->Read();			// should a read be queued in this case?
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2665
			}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2666
		RelinquishOwnershipCompleted(ret);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2667
		return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2668
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2669
	CAcquireEntry* entry=iList->iAcquireList.First();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2670
	if (entry) 
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2671
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2672
		(void)SetOwnership(entry->iTsyReqHandle);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2673
		ReqCompleted(entry->iTsyReqHandle,KErrNone);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2674
		iList->Remove(entry);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2675
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2676
	RelinquishOwnershipCompleted(KErrNone);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2677
	return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2678
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2679
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2680
TInt CCallMobileFax::GetFaxSettings(const TTsyReqHandle aTsyReqHandle,RCall::TFaxSessionSettings* aSettings)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2681
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2682
//	Which are stored privately in CCallMobileFax
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2683
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2684
	{	
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2685
	LOGTEXT(_L8("FaxCall:\tGetting fax settings"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2686
	SetFaxSessionSettings(*aSettings,iFaxSettings);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2687
	ReqCompleted(aTsyReqHandle,KErrNone);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2688
	return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2689
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2690
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2691
TInt CCallMobileFax::SetFaxSettings(const TTsyReqHandle aTsyReqHandle,const RCall::TFaxSessionSettings* aSettings)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2692
	{	
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2693
	LOGTEXT(_L8("FaxCall:\tSetting fax settings"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2694
	TUint phoneCaps = iPhoneGlobals->iPhoneStatus.iDataAndFaxFlags;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2695
	if (aSettings->iFaxClass==EClass1 && (phoneCaps&RPhone::KCapsFaxClassOne) ||
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2696
		aSettings->iFaxClass==EClass2 && (phoneCaps&RPhone::KCapsFaxClassTwo) ||
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2697
		aSettings->iFaxClass==EClass2point0 && (phoneCaps&RPhone::KCapsFaxClassTwoPointZero) ||
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2698
		aSettings->iFaxClass==EClass1point0 && (phoneCaps&RPhone::KCapsFaxClassOnePointZero) ||
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2699
		aSettings->iFaxClass==EClass2point1 && (phoneCaps&RPhone::KCapsFaxClassTwoPointOne)  ||
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2700
		aSettings->iFaxClass==EClassAuto)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2701
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2702
		SetFaxSessionSettings(iFaxSettings,*aSettings);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2703
		ReqCompleted(aTsyReqHandle,KErrNone);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2704
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2705
	else if (iPhoneGlobals->iPhoneStatus.iInitStatus!=EPhoneInitialised)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2706
		ReqCompleted(aTsyReqHandle,KErrEtelUnknownModemCapability);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2707
	else
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2708
		ReqCompleted(aTsyReqHandle,KErrNotSupported);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2709
	return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2710
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2711
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2712
TInt CCallMobileFax::SetFaxSharedHeaderFile(const TTsyReqHandle aTsyReqHandle, CFaxSharedFileHandles* aFaxSharedFileHandles)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2713
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2714
	//if we already own an object delete and re-point to new one.
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2715
	if(iFileHandles)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2716
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2717
		delete iFileHandles;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2718
		iFileHandles = NULL;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2719
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2720
	iFileHandles = aFaxSharedFileHandles;	
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2721
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2722
	ReqCompleted(aTsyReqHandle,KErrNone);	
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2723
	return KErrNone;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2724
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2725
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2726
CTelObject* CCallMobileFax::OpenNewObjectByNameL(const TDesC& /*aName*/)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2727
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2728
//	Only want one CFaxHayes object to be opened per phone.
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2729
//	Previously only the connected call could open a CFaxHayes object, so it was easy to check
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2730
//	whether one had already been opened. Now a fax call can open a fax object at any time
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2731
//	making it less clear how to check that no other call has opened one.
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2732
//
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2733
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2734
	if (iPhoneGlobals->iPhoneStatus.iLineStatus != GetCoreCallStatus())
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2735
		{	// ie another fax call is in progress so this call cannot open a fax object
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2736
		User::Leave(KErrEtelNotCallOwner);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2737
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2738
	TBool& faxOpened = REINTERPRET_CAST(CLineMobileFax*,Owner())->iFaxOpened;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2739
	if (faxOpened==TRUE)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2740
		{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2741
		User::Leave(KErrAlreadyExists);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2742
		}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2743
	faxOpened=ETrue;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2744
	iFax = CFaxHayes::NewL(this,iPhoneGlobals);
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2745
	return iFax;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2746
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2747
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2748
void CCallMobileFax::RemoveFax(CFaxHayes* aFaxHayes)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2749
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2750
	if (iFax == aFaxHayes)
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2751
		iFax=NULL;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2752
	REINTERPRET_CAST(CLineMobileFax*,Owner())->iFaxOpened=EFalse;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2753
	}
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2754
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2755
void CCallMobileFax::CleanUpFaxServer()
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2756
	{
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2757
	LOGTEXT(_L8("Closing down Fax Server"));
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2758
	(void)iFaxSession->FxClose();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2759
	iFaxServerLib.Close();
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2760
	iFaxSession = NULL;
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2761
	iPhoneGlobals->iPhoneStatus.iPortAccess = EPortAccessAllowed; 
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2762
	iPhoneGlobals->iEventSignalActive = EFalse;				
07a122eea281 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 65
diff changeset
  2763
	}