1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
14 // |
14 // |
15 |
15 |
16 |
16 |
17 |
17 |
18 //INCLUDE FILES |
18 //INCLUDE FILES |
19 |
|
20 #include "OstTraceDefinitions.h" |
|
21 #ifdef OST_TRACE_COMPILER_IN_USE |
|
22 #include "cmmfaxcalltsyTraces.h" |
|
23 #endif |
|
24 |
|
25 #include "cmmfaxcalltsy.h" |
19 #include "cmmfaxcalltsy.h" |
26 #include "cmmfaxlinetsy.h" |
20 #include "cmmfaxlinetsy.h" |
27 #include "cmmphonetsy.h" |
21 #include "cmmphonetsy.h" |
28 #include "cmmtsyreqhandlestore.h" |
22 #include "cmmtsyreqhandlestore.h" |
29 #include "cmmcalllist.h" |
23 #include "cmmcalllist.h" |
46 CMmPhoneTsy* aMmPhone, CMmFaxLineTsy* aMmLine, |
40 CMmPhoneTsy* aMmPhone, CMmFaxLineTsy* aMmLine, |
47 RMobilePhone::TMobileService aMode, |
41 RMobilePhone::TMobileService aMode, |
48 TDes& aName, |
42 TDes& aName, |
49 CMmMessageManagerBase* aMessageManager ) |
43 CMmMessageManagerBase* aMessageManager ) |
50 { |
44 { |
51 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_NEWL_1, "TSY: CMmFaxCallTsy::NewL. Call name: %S", aName); |
45 TFLOGSTRING2("TSY: CMmFaxCallTsy::NewL. Call name: %S", &aName); |
52 |
46 |
53 CMmFaxCallTsy* mmCall = NULL; |
47 CMmFaxCallTsy* mmCall = NULL; |
54 |
48 |
55 //check input parameters |
49 //check input parameters |
56 if ( aMmPhone != NULL && aMmLine != NULL && |
50 if ( aMmPhone != NULL && aMmLine != NULL && |
70 return mmCall; |
64 return mmCall; |
71 } |
65 } |
72 |
66 |
73 CMmFaxCallTsy::~CMmFaxCallTsy() |
67 CMmFaxCallTsy::~CMmFaxCallTsy() |
74 { |
68 { |
75 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_DTOR_1, "TSY: CMmFaxCallTsy::~CMmFaxCallTsy. Call deleted \iCallId:%d iCallName:%S", iCallId, iCallName); |
69 TFLOGSTRING3("TSY: CMmFaxCallTsy::~CMmFaxCallTsy. Call deleted \ |
|
70 iCallId:%d iCallName:%S", iCallId, &iCallName); |
76 |
71 |
77 // If Dial fails, Symbian CSD agent will close the call immediately. |
72 // If Dial fails, Symbian CSD agent will close the call immediately. |
78 // This means that TSY has not yet received call status indications, |
73 // This means that TSY has not yet received call status indications, |
79 // where call status changes to idle. Thus responses from modem are |
74 // where call status changes to idle. Thus responses from modem are |
80 // passed to call object. |
75 // passed to call object. |
204 TInt CMmFaxCallTsy::DoExtFuncL( |
199 TInt CMmFaxCallTsy::DoExtFuncL( |
205 const TTsyReqHandle aTsyReqHandle, |
200 const TTsyReqHandle aTsyReqHandle, |
206 const TInt aIpc, |
201 const TInt aIpc, |
207 const TDataPackage& aPackage ) |
202 const TDataPackage& aPackage ) |
208 { |
203 { |
209 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_DOEXTFUNCL_1, "TSY: CMmFaxCallTsy::DoExtFuncL. IPC:%d Handle:%d", aIpc, aTsyReqHandle); |
204 TFLOGSTRING3("TSY: CMmFaxCallTsy::DoExtFuncL. IPC:%d Handle:%d", aIpc, |
|
205 aTsyReqHandle); |
210 |
206 |
211 TInt ret( KErrNone ); |
207 TInt ret( KErrNone ); |
212 |
208 |
213 TAny* dataPtr = aPackage.Ptr1(); |
209 TAny* dataPtr = aPackage.Ptr1(); |
214 |
210 |
308 // --------------------------------------------------------------------------- |
304 // --------------------------------------------------------------------------- |
309 // |
305 // |
310 CTelObject::TReqMode CMmFaxCallTsy::ReqModeL( |
306 CTelObject::TReqMode CMmFaxCallTsy::ReqModeL( |
311 const TInt aIpc ) |
307 const TInt aIpc ) |
312 { |
308 { |
313 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_REQMODEL_1, "TSY: CMmFaxCallTsy::ReqModeL. IPC:%d",aIpc); |
309 TFLOGSTRING2("TSY: CMmFaxCallTsy::ReqModeL. IPC:%d",aIpc); |
314 |
310 |
315 CTelObject::TReqMode ret( 0 ); // default return value |
311 CTelObject::TReqMode ret( 0 ); // default return value |
316 |
312 |
317 switch ( aIpc ) |
313 switch ( aIpc ) |
318 { |
314 { |
551 // |
547 // |
552 TInt CMmFaxCallTsy::CancelService( |
548 TInt CMmFaxCallTsy::CancelService( |
553 const TInt aIpc, |
549 const TInt aIpc, |
554 const TTsyReqHandle aTsyReqHandle ) |
550 const TTsyReqHandle aTsyReqHandle ) |
555 { |
551 { |
556 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_CANCELSERVICE_1, "TSY: CMmFaxCallTsy::CancelService. IPC: %d, Req handle: %d",aIpc, aTsyReqHandle); |
552 TFLOGSTRING3("TSY: CMmFaxCallTsy::CancelService. IPC: %d, Req handle: %d", |
|
553 aIpc, aTsyReqHandle); |
557 |
554 |
558 TInt ret( KErrNone ); |
555 TInt ret( KErrNone ); |
559 |
556 |
560 //When the clients close their sub-sessions (eg. by calling RPhone::Close) |
557 //When the clients close their sub-sessions (eg. by calling RPhone::Close) |
561 //they may not have cancelled all their outstanding asynchronous requests |
558 //they may not have cancelled all their outstanding asynchronous requests |
655 CCallDataPackage* callDataPackage = |
652 CCallDataPackage* callDataPackage = |
656 reinterpret_cast<CCallDataPackage*>(aDataPackage); |
653 reinterpret_cast<CCallDataPackage*>(aDataPackage); |
657 |
654 |
658 callDataPackage->UnPackData( callStatus ); |
655 callDataPackage->UnPackData( callStatus ); |
659 |
656 |
660 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_COMPLETENOTIFYSTATUSCHANGE_1, "TSY: CMmFaxCallTsy::CompleteNotifyStatusChange. aResult:%d",aResult ); |
657 TFLOGSTRING2("TSY: CMmFaxCallTsy::CompleteNotifyStatusChange. aResult:%d", |
661 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_COMPLETENOTIFYSTATUSCHANGE_2, "TSY: CMmFaxCallTsy::CompleteNotifyStatusChange. \Call status:%d Call name:%S", callStatus, iCallName); |
658 aResult ); |
|
659 TFLOGSTRING3("TSY: CMmFaxCallTsy::CompleteNotifyStatusChange. \ |
|
660 Call status:%d Call name:%S", callStatus, &iCallName); |
662 |
661 |
663 switch( callStatus ) |
662 switch( callStatus ) |
664 { |
663 { |
665 case RMobileCall::EStatusIdle: |
664 case RMobileCall::EStatusIdle: |
666 //reset caps. |
665 //reset caps. |
972 TInt CMmFaxCallTsy::Dial( |
971 TInt CMmFaxCallTsy::Dial( |
973 const TTsyReqHandle aTsyReqHandle, |
972 const TTsyReqHandle aTsyReqHandle, |
974 const TDesC8* aCallParams, |
973 const TDesC8* aCallParams, |
975 TDesC* aTelNumber ) |
974 TDesC* aTelNumber ) |
976 { |
975 { |
977 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_DIAL_1, "TSY: CMmFaxCallTsy::Dial. Req handle: %u, Call name: %S", aTsyReqHandle, iCallName); |
976 TFLOGSTRING3("TSY: CMmFaxCallTsy::Dial. Req handle: %d, Call name: %S", |
|
977 aTsyReqHandle, &iCallName); |
978 |
978 |
979 CMmCallList* callList = iMmPhone->CallList(); |
979 CMmCallList* callList = iMmPhone->CallList(); |
980 TBool dialFlag( EFalse ); |
980 TBool dialFlag( EFalse ); |
981 |
981 |
982 for(TInt i=0; i< callList->GetNumberOfObjects();i++) |
982 for(TInt i=0; i< callList->GetNumberOfObjects();i++) |
1001 //reset finished data call flag |
1001 //reset finished data call flag |
1002 iIsFinishedDataCall = EFalse; |
1002 iIsFinishedDataCall = EFalse; |
1003 |
1003 |
1004 if ( ERfsStateInfoInactive == iMmPhone->GetRfStateInfo() ) |
1004 if ( ERfsStateInfoInactive == iMmPhone->GetRfStateInfo() ) |
1005 { |
1005 { |
1006 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_DIAL_2, "TSY: Offline mode ON, Dial request is not allowed" ); |
1006 TFLOGSTRING("TSY: Offline mode ON, Dial request is not allowed" ); |
1007 TInt ret = CMmCommonStaticUtility::EpocErrorCode( |
1007 TInt ret = CMmCommonStaticUtility::EpocErrorCode( |
1008 KErrGeneral, KErrGsmOfflineOpNotAllowed ); |
1008 KErrGeneral, KErrGsmOfflineOpNotAllowed ); |
1009 |
1009 |
1010 //Complete the request with appropiate error |
1010 //Complete the request with appropiate error |
1011 ReqCompleted ( aTsyReqHandle, ret ); |
1011 ReqCompleted ( aTsyReqHandle, ret ); |
1016 { |
1016 { |
1017 //The request cannot be forwarded since this call object |
1017 //The request cannot be forwarded since this call object |
1018 //is still in use. |
1018 //is still in use. |
1019 //Complete request with status value informing the client |
1019 //Complete request with status value informing the client |
1020 //about the situation. |
1020 //about the situation. |
1021 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_DIAL_3, "TSY: CMmFaxCallTsy::Dial - KErrNotReady"); |
1021 TFLOGSTRING("TSY: CMmFaxCallTsy::Dial - KErrNotReady"); |
1022 ReqCompleted( aTsyReqHandle, KErrNotReady ); |
1022 ReqCompleted( aTsyReqHandle, KErrNotReady ); |
1023 } |
1023 } |
1024 else if ( 0 < dialHandle ) |
1024 else if ( 0 < dialHandle ) |
1025 { |
1025 { |
1026 //The request is already in processing because of previous request |
1026 //The request is already in processing because of previous request |
1027 //Complete request with status value informing the client about |
1027 //Complete request with status value informing the client about |
1028 //the situation. |
1028 //the situation. |
1029 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_DIAL_4, "TSY: CMmFaxCallTsy::Dial - KErrServerBusy"); |
1029 TFLOGSTRING("TSY: CMmFaxCallTsy::Dial - KErrServerBusy"); |
1030 ReqCompleted( aTsyReqHandle, KErrServerBusy ); |
1030 ReqCompleted( aTsyReqHandle, KErrServerBusy ); |
1031 } |
1031 } |
1032 else |
1032 else |
1033 { |
1033 { |
1034 TInt ret( KErrNone ); |
1034 TInt ret( KErrNone ); |
1115 // --------------------------------------------------------------------------- |
1115 // --------------------------------------------------------------------------- |
1116 // |
1116 // |
1117 TInt CMmFaxCallTsy::DialCancel( |
1117 TInt CMmFaxCallTsy::DialCancel( |
1118 const TTsyReqHandle aTsyReqHandle ) |
1118 const TTsyReqHandle aTsyReqHandle ) |
1119 { |
1119 { |
1120 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_DIALCANCEL_1, "TSY: CMmFaxCallTsy::DialCancel. Req handle: %u, Call name: %S", aTsyReqHandle, iCallName); |
1120 TFLOGSTRING3("TSY: CMmFaxCallTsy::DialCancel. Req handle: %d, Call name: %S", |
|
1121 aTsyReqHandle, &iCallName); |
1121 |
1122 |
1122 TInt ret( KErrGeneral ); |
1123 TInt ret( KErrGeneral ); |
1123 |
1124 |
1124 if (iMmFaxExt) |
1125 if (iMmFaxExt) |
1125 { |
1126 { |
1141 // |
1142 // |
1142 TInt CMmFaxCallTsy::AnswerIncomingCall( |
1143 TInt CMmFaxCallTsy::AnswerIncomingCall( |
1143 const TTsyReqHandle aTsyReqHandle, |
1144 const TTsyReqHandle aTsyReqHandle, |
1144 const TDesC8* /*aCallParams*/ ) |
1145 const TDesC8* /*aCallParams*/ ) |
1145 { |
1146 { |
1146 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_ANSWERINCOMINGCALL_1, "TSY: CMmFaxCallTsy::AnswerIncomingCall. \n\t\t\t Handle:%d",aTsyReqHandle); |
1147 TFLOGSTRING2("TSY: CMmFaxCallTsy::AnswerIncomingCall. \n\t\t\t Handle:%d", |
|
1148 aTsyReqHandle); |
1147 |
1149 |
1148 TTsyReqHandle iAnswerCallHandle = iTsyReqHandleStore-> |
1150 TTsyReqHandle iAnswerCallHandle = iTsyReqHandleStore-> |
1149 GetTsyReqHandle( EMultimodeCallAnswer ); |
1151 GetTsyReqHandle( EMultimodeCallAnswer ); |
1150 |
1152 |
1151 if ( 0 < iAnswerCallHandle ) |
1153 if ( 0 < iAnswerCallHandle ) |
1223 // --------------------------------------------------------------------------- |
1225 // --------------------------------------------------------------------------- |
1224 // |
1226 // |
1225 TInt CMmFaxCallTsy::HangUp( |
1227 TInt CMmFaxCallTsy::HangUp( |
1226 const TTsyReqHandle aTsyReqHandle ) |
1228 const TTsyReqHandle aTsyReqHandle ) |
1227 { |
1229 { |
1228 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_HANGUP_1, "TSY: CMmFaxCallTsy::HangUp. Req handle: %u, Call name: %S", aTsyReqHandle, iCallName); |
1230 TFLOGSTRING3("TSY: CMmFaxCallTsy::HangUp. Req handle: %d, Call name: %S", |
|
1231 aTsyReqHandle, &iCallName); |
1229 |
1232 |
1230 TInt hangUpCause( KErrNone ); |
1233 TInt hangUpCause( KErrNone ); |
1231 TInt ret( KErrNone ); |
1234 TInt ret( KErrNone ); |
1232 TInt trapError ( KErrNone ); |
1235 TInt trapError ( KErrNone ); |
1233 |
1236 |
1279 //If the call is ringing e.g. MT call, we do not have ownership |
1282 //If the call is ringing e.g. MT call, we do not have ownership |
1280 //yet. So let the client reject the call without checking |
1283 //yet. So let the client reject the call without checking |
1281 //ownership. |
1284 //ownership. |
1282 if ( RCall::EStatusRinging == iCallStatus ) |
1285 if ( RCall::EStatusRinging == iCallStatus ) |
1283 { |
1286 { |
1284 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_HANGUP_2, "TSY: CMmFaxCallTsy::HangUp - Reject incoming call"); |
1287 TFLOGSTRING("TSY: CMmFaxCallTsy::HangUp - Reject incoming call"); |
1285 } |
1288 } |
1286 //Phone Application is the first client that is started, it |
1289 //Phone Application is the first client that is started, it |
1287 //will always be the priority client and thus able to hangup calls |
1290 //will always be the priority client and thus able to hangup calls |
1288 //Owner of the call is also able to hangup the call. |
1291 //Owner of the call is also able to hangup the call. |
1289 else if ( CCallBase::CheckPriorityClient( aTsyReqHandle ) || |
1292 else if ( CCallBase::CheckPriorityClient( aTsyReqHandle ) || |
1727 // |
1730 // |
1728 TInt CMmFaxCallTsy::LoanDataPort( |
1731 TInt CMmFaxCallTsy::LoanDataPort( |
1729 const TTsyReqHandle aTsyReqHandle, |
1732 const TTsyReqHandle aTsyReqHandle, |
1730 RCall::TCommPort* aCommPort ) |
1733 RCall::TCommPort* aCommPort ) |
1731 { |
1734 { |
1732 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_LOANDATAPORT_1, "TSY: CMmFaxCallTsy::LoanDataPort - Client taking control: %S",iCallName ); |
1735 TFLOGSTRING2("TSY: CMmFaxCallTsy::LoanDataPort - Client taking control: %S", |
|
1736 &iCallName ); |
1733 |
1737 |
1734 TInt ret( KErrNone ); |
1738 TInt ret( KErrNone ); |
1735 |
1739 |
1736 // Check if the port is loaned! |
1740 // Check if the port is loaned! |
1737 if ( iLoanedCommPort.iPort.Compare( KNullDesC) == 0 ) |
1741 if ( iLoanedCommPort.iPort.Compare( KNullDesC) == 0 ) |
1833 // --------------------------------------------------------------------------- |
1837 // --------------------------------------------------------------------------- |
1834 // |
1838 // |
1835 TInt CMmFaxCallTsy::RecoverDataPort( |
1839 TInt CMmFaxCallTsy::RecoverDataPort( |
1836 const TTsyReqHandle aTsyReqHandle ) |
1840 const TTsyReqHandle aTsyReqHandle ) |
1837 { |
1841 { |
1838 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_RECOVERDATAPORT_1, "TSY: CMmFaxCallTsy::RecoverDataPort - Client returning control: %S",iCallName ); |
1842 TFLOGSTRING2("TSY: CMmFaxCallTsy::RecoverDataPort - Client returning control: %S", |
|
1843 &iCallName ); |
1839 |
1844 |
1840 TInt ret( KErrNone ); |
1845 TInt ret( KErrNone ); |
1841 |
1846 |
1842 // Check if the port is loaned! |
1847 // Check if the port is loaned! |
1843 if ( iLoanedCommPort.iPort.Compare( KNullDesC) != 0 ) |
1848 if ( iLoanedCommPort.iPort.Compare( KNullDesC) != 0 ) |
1888 // (other items were commented in a header). |
1893 // (other items were commented in a header). |
1889 // --------------------------------------------------------------------------- |
1894 // --------------------------------------------------------------------------- |
1890 // |
1895 // |
1891 TInt CMmFaxCallTsy::RecoverDataPortAndRelinquishOwnership() |
1896 TInt CMmFaxCallTsy::RecoverDataPortAndRelinquishOwnership() |
1892 { |
1897 { |
1893 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMFAXCALLTSY_RECOVERDATAPORTANDRELINQUISHOWNERSHIP_1, "TSY: CMmFaxCallTsy::RecoverDataPortAndRelinquishOwnership - \Client returning control: %S", iCallName ); |
1898 TFLOGSTRING2("TSY: CMmFaxCallTsy::RecoverDataPortAndRelinquishOwnership - \ |
|
1899 Client returning control: %S", &iCallName ); |
1894 |
1900 |
1895 TInt ret( KErrNone ); |
1901 TInt ret( KErrNone ); |
1896 |
1902 |
1897 // Check if the port is loaned! |
1903 // Check if the port is loaned! |
1898 if ( iLoanedCommPort.iPort.Compare( KNullDesC) != 0 ) |
1904 if ( iLoanedCommPort.iPort.Compare( KNullDesC) != 0 ) |