S60 3rd Edition SDK for Symbian OS
Example Applications Guide

CIsvTelCallAppTelephony Class Reference

#include <IsvTelCallAppTelephony.h>

List of all members.

Public Member Functions

 ~CIsvTelCallAppTelephony ()
void SetTelephonyPtr (CTelephony *aTel)
CTelephony * GetTelephonyPtr ()
void CreateTelephonyPtrL ()
 CIsvTelCallAppTelephony (MIsvTelCallAppTelephonyNotify &aNotify)
void ConstructL ()
void RegisterForAsyncNotification (TInt)
void TelApiWrapperMakeNewCallL (CTelephony::TCallId aCallId, TBuf< CTelephony::KMaxTelNumberSize > aTelNumber)
void TelApiWrapperGetCallStatusL (CTelephony::TCallId aCallId)
void TelApiWrapperHangupL (CTelephony::TCallId aCallId)
void TelApiWrapperHoldL (CTelephony::TCallId aCallId)
void TelApiWrapperResumeL (CTelephony::TCallId aCallId)
void TelApiWrapperSwapL ()
void TelApiWrapperGetVoiceLineStatusL ()
void TelApiWrapperGetDataLineStatusL ()
void TelApiWrapperGetFaxLineStatusL ()
void TelApiWrapperSendDTMFL (CTelephony::TCallId aCallId, TBuf< KMaxDTMFLength > aDtmfSeq)
void TelApiWrapperAnswerInCallL ()
void LoadErrorStringsFromResource ()
void GeneralErrorMessage (TInt aStatus, TBuf16< KMaxErrMsgSize > *aErrMsgBuffer)
void StartWait ()

Static Public Member Functions

static CIsvTelCallAppTelephony * NewL (MIsvTelCallAppTelephonyNotify &aNotify)

Public Attributes

CTelephony * iTel
CTelephony::TCallStatusV1 iCallStatus
CTelephony::TCallStatusV1Pckg iCallStatusPckg

Protected Member Functions

void RunL ()
void DoCancel ()

Private Types

enum  TETelApiCmd {
  EMakeNewCall = 0, EHangup, EHold, EResume,
  ESwap, EGetCallStatus, EGetVoiceLineStatus, EGetDataLineStatus,
  EGetFaxLineStatus, ESendDTMF, EAnswerIncomingCall, EAsyncEvent,
  EMaxCommands, ECommandNone
}

Private Attributes

TETelApiCmd iTelApiCmd
CTelephony::TCallId iCallId
CActiveSchedulerWait iWait
CTelephony::TNotificationEvent iEvent
MIsvTelCallAppTelephonyNotify & iNotify
TBuf< CTelephony::KMaxTelNumberSize > iTelNum
TBuf8< KMaxCmdSize > iCallId1Str
TBuf8< KMaxCmdSize > iCallId2Str
TBuf16< KMaxErrMsgSize > iErrStrNotFound
TBuf16< KMaxErrMsgSize > iErrStrGeneral
TBuf16< KMaxErrMsgSize > iErrStrCancel
TBuf16< KMaxErrMsgSize > iErrStrNoMemory
TBuf16< KMaxErrMsgSize > iErrStrNotSupported
TBuf16< KMaxErrMsgSize > iErrStrArgument
TBuf16< KMaxErrMsgSize > iErrStrTotalLossOfPrecision
TBuf16< KMaxErrMsgSize > iErrStrBadHandle
TBuf16< KMaxErrMsgSize > iErrStrOverflow
TBuf16< KMaxErrMsgSize > iErrStrUnderflow
TBuf16< KMaxErrMsgSize > iErrStrAlreadyExists
TBuf16< KMaxErrMsgSize > iErrStrInUse
TBuf16< KMaxErrMsgSize > iErrStrServerTerminated
TBuf16< KMaxErrMsgSize > iErrStrServerBusy
TBuf16< KMaxErrMsgSize > iErrStrUnknown
TBuf16< KMaxErrMsgSize > iErrStrCorrupt
TBuf16< KMaxErrMsgSize > iErrStrAccessDenied
TBuf16< KMaxErrMsgSize > iErrStrCommsLineFail
TBuf16< KMaxErrMsgSize > iErrStrTimedOut
TBuf16< KMaxErrMsgSize > iErrStrCouldNotConnect
TBuf16< KMaxErrMsgSize > iErrStrCouldNotDisconnect
TBuf16< KMaxErrMsgSize > iErrStrHardwareNotAvailable
TBuf16< KMaxErrMsgSize > iErrStrSessionClosed
TBuf16< KMaxErrMsgSize > iErrStrPermissionDenied
TBuf16< KMaxErrMsgSize > iErrStrDefault
TBuf16< KMaxErrMsgSize > iEmuApiNotSupported
CTelephony::TPhoneIdV1 iPhoneId


Detailed Description

CIsvTelCallAppTelephony: This class derives from CActive and wraps the CTelephony class. Provides a command table based execution for telephony commands with command specific parsing capabilities.

Definition at line 41 of file IsvTelCallAppTelephony.h.


Member Enumeration Documentation

enum CIsvTelCallAppTelephony::TETelApiCmd [private]
 

Command Table.

Enumerator:
EMakeNewCall  Dial new call.
EHangup  Terminate call.
EHold  Place call on hold.
EResume  Moves call from Hold to Active state.
ESwap  Moves the call under to hold to active and the call that is active to hold.
EGetCallStatus  Get Call Status.
EGetVoiceLineStatus  Get Voice line status.
EGetDataLineStatus  Get Data line status.
EGetFaxLineStatus  Get Fax line status.
ESendDTMF  Send DTMF.
EAnswerIncomingCall  Answer Incoming Call.
EAsyncEvent  Async commands.
EMaxCommands  Maximum number of commands.
ECommandNone  Command None

Definition at line 196 of file IsvTelCallAppTelephony.h.

00197             {
00198             /** 
00199             Dial new call.
00200             */
00201             EMakeNewCall = 0,
00202             /** 
00203             Terminate call.
00204             */
00205             EHangup,
00206             /** 
00207             Place call on hold.
00208             */
00209             EHold,
00210             /** 
00211             Moves call from Hold to Active state. 
00212             */
00213             EResume,
00214             /** 
00215             Moves the call under to hold to active and 
00216             * the call that is active to hold.
00217             */
00218             ESwap,
00219             /** 
00220             Get Call Status.
00221             */
00222             EGetCallStatus,
00223             /** 
00224             Get Voice line status.
00225             */
00226             EGetVoiceLineStatus,
00227             /** 
00228             Get Data line status.
00229             */
00230             EGetDataLineStatus,
00231             /** 
00232             Get Fax line status.
00233             */
00234             EGetFaxLineStatus,
00235             /** 
00236             Send DTMF.
00237             */
00238             ESendDTMF,
00239             /** 
00240             Answer Incoming Call.
00241             */
00242             EAnswerIncomingCall,
00243             /** 
00244             Async commands.
00245             */
00246                         EAsyncEvent,
00247             /** 
00248             Maximum number of commands.
00249             */
00250             EMaxCommands,
00251             /**
00252             Command None
00253             */
00254             ECommandNone
00255             };


Constructor & Destructor Documentation

CIsvTelCallAppTelephony::~CIsvTelCallAppTelephony (   ) 
 

Destructor.

Definition at line 48 of file IsvTelCallAppTelephony.cpp.

00049     {
00050     Cancel();
00051     }

CIsvTelCallAppTelephony::CIsvTelCallAppTelephony (  MIsvTelCallAppTelephonyNotify &  aNotify  ) 
 

Default constructor.

Parameters:
aNotify reference to the object that implements the MIsvTelCallAppTelephonyNotify interface.

Definition at line 282 of file IsvTelCallAppTelephony.cpp.

00284     :CActive( EPriorityStandard ),
00285     iNotify( aNotify ), 
00286     iCallStatusPckg( iCallStatus )
00287     { 
00288     CActiveScheduler::Add( this );
00289     }


Member Function Documentation

CIsvTelCallAppTelephony * CIsvTelCallAppTelephony::NewL (  MIsvTelCallAppTelephonyNotify &  aNotify  )  [static]
 

Two-phased constructor.

Parameters:
aNotify Reference to an object implementing the MIsvTelCallAppTelephonyNotify interface

Definition at line 33 of file IsvTelCallAppTelephony.cpp.

00034     {
00035     CIsvTelCallAppTelephony* selfWrapperClass = 
00036         new ( ELeave ) CIsvTelCallAppTelephony( aNotify );
00037     CleanupStack::PushL( selfWrapperClass );
00038     selfWrapperClass->ConstructL();
00039     CleanupStack::Pop();
00040     return selfWrapperClass;
00041     }

void CIsvTelCallAppTelephony::SetTelephonyPtr (  CTelephony *  aTel  ) 
 

Set the pointer to CTelephony class object

Parameters:
aTel Pointer to CTelephony class object

Definition at line 360 of file IsvTelCallAppTelephony.cpp.

References iTel.

00361     {
00362     iTel = aTel;
00363     }

CTelephony * CIsvTelCallAppTelephony::GetTelephonyPtr (   ) 
 

Get the pointer to CTelephony class object

Definition at line 370 of file IsvTelCallAppTelephony.cpp.

References iTel.

00371     {
00372     return(iTel);
00373     }

void CIsvTelCallAppTelephony::CreateTelephonyPtrL (   ) 
 

Create a CTelephony class object

Definition at line 380 of file IsvTelCallAppTelephony.cpp.

References iTel.

00381     {
00382    //Creating Telephony object. 
00383     iTel = CTelephony::NewL();
00384     }

void CIsvTelCallAppTelephony::RunL (   )  [protected]
 

From CActive, RunL. Handles the active object’s request completion event

Definition at line 58 of file IsvTelCallAppTelephony.cpp.

References MIsvTelCallAppTelephonyNotify::AnswerIncomingCallApiCompleteL(), EAnswerIncomingCall, EAsyncEvent, EHangup, EHold, EMakeNewCall, EResume, ESendDTMF, ESwap, GeneralErrorMessage(), MIsvTelCallAppTelephonyNotify::GetCallStatusCompleteL(), MIsvTelCallAppTelephonyNotify::GetVoiceLineStatusCompleteL(), MIsvTelCallAppTelephonyNotify::HangupCompleteL(), MIsvTelCallAppTelephonyNotify::HoldCompleteL(), iCallId, iCallStatus, iCallStatusPckg, iEvent, iNotify, iTel, iTelApiCmd, iTelNum, iWait, MIsvTelCallAppTelephonyNotify::MakeNewCallApiCompleteL(), MIsvTelCallAppTelephonyNotify::ResumeCompleteL(), MIsvTelCallAppTelephonyNotify::SendDTMFApiCompleteL(), and MIsvTelCallAppTelephonyNotify::SwapCompleteL().

00059     {
00060     if ( (iTelApiCmd == EAsyncEvent ) || 
00061        ( iTelApiCmd == EAnswerIncomingCall))
00062         {
00063         }
00064     else
00065         {
00066             iWait.AsyncStop();
00067         }
00068         
00069     TBuf16<KMaxErrMsgSize> errMsgBuffer;
00070     
00071     //Find the type of error message and store in errMsgBuffer.
00072     GeneralErrorMessage( iStatus.Int(), &errMsgBuffer );
00073     
00074     switch( iTelApiCmd )
00075         {
00076         case EMakeNewCall :
00077             {
00078             iNotify.MakeNewCallApiCompleteL( iStatus.Int(), iCallId, 
00079                iTelNum, errMsgBuffer );
00080             }
00081             break;            
00082         case EHangup :
00083             {
00084             iNotify.HangupCompleteL( iStatus.Int(), errMsgBuffer );
00085             }
00086             break;            
00087         case EHold :
00088             {
00089             iNotify.HoldCompleteL( iStatus.Int(), errMsgBuffer );
00090             }
00091             break;
00092             
00093         case EResume :
00094             {
00095             iNotify.ResumeCompleteL( iStatus.Int(), errMsgBuffer );
00096             }
00097             break;
00098             
00099         case ESwap :
00100             {
00101             iNotify.SwapCompleteL( iStatus.Int(), errMsgBuffer );
00102             }
00103             break;
00104 
00105         case ESendDTMF :
00106             {
00107             iNotify.SendDTMFApiCompleteL( iStatus.Int(), errMsgBuffer );
00108             }
00109             break;
00110             
00111        case EAnswerIncomingCall :
00112             {
00113             iNotify.AnswerIncomingCallApiCompleteL( iStatus.Int(),
00114                 iCallId,
00115                 errMsgBuffer );
00116 
00117                     if ( iStatus.Int() != KErrNone )
00118                         {
00119                         }
00120                     else
00121                         {
00122                         iTelApiCmd = EAnswerIncomingCall;
00123                     iTel->AnswerIncomingCall( iStatus, 
00124                         iCallId, 
00125                         CTelephony::EVoiceLine );
00126                     SetActive();                
00127                         }
00128             }
00129             break;
00130             
00131                 case EAsyncEvent :
00132                     {
00133                     switch (iEvent)
00134                         {
00135                         case CTelephony::EOwnedCall1StatusChange :
00136                             {
00137                         iCallId = CTelephony::EISVCall1;
00138                     iNotify.GetCallStatusCompleteL(iStatus.Int(), 
00139                        iCallId, 
00140                        iCallStatus,
00141                        errMsgBuffer);
00142                        
00143                     if ( iStatus.Int() != KErrNone)   
00144                         {
00145                         }
00146                     else
00147                         {
00148                         iEvent = CTelephony::EOwnedCall1StatusChange;
00149                                 iTel->NotifyChange(iStatus, iEvent, iCallStatusPckg);
00150                                     SetActive();  
00151                         }
00152                             }
00153                             break;
00154                         case CTelephony::EOwnedCall2StatusChange :
00155                             {
00156                             iCallId = CTelephony::EISVCall2;
00157                     iNotify.GetCallStatusCompleteL( iStatus.Int(), iCallId, 
00158                         iCallStatus,
00159                         errMsgBuffer );
00160                             if ( iStatus.Int() != KErrNone )
00161                                 {
00162                                 }
00163                             else
00164                                 {
00165                                     iEvent = CTelephony::EOwnedCall2StatusChange;
00166                                 iTel->NotifyChange(iStatus, iEvent, iCallStatusPckg);
00167                                     SetActive();                       
00168                                 }
00169                             }
00170                             break;
00171                         
00172                         case CTelephony::EVoiceLineStatusChange :
00173                             {
00174                     iNotify.GetVoiceLineStatusCompleteL( iStatus.Int(), 
00175                        errMsgBuffer,
00176                        iCallStatus );
00177                     if ( iStatus.Int() != KErrNone )    
00178                         {
00179                         }
00180                     else
00181                         {
00182                                         iEvent = CTelephony::EVoiceLineStatusChange;
00183                                     iTel->NotifyChange(iStatus, iEvent, iCallStatusPckg);
00184                                         SetActive();
00185                         }
00186                             }
00187                             break;
00188                         default:
00189                    {
00190                    _LIT(inforMsg, "Default Notify Complete");
00191                    CAknErrorNote* errorNote = new (ELeave) CAknErrorNote;
00192                    errorNote->ExecuteLD(inforMsg);
00193                            }
00194                            break;
00195                         }
00196                     }
00197                     break;
00198                     
00199         default :
00200             break;
00201         }
00202     return;
00203     }

void CIsvTelCallAppTelephony::DoCancel (   )  [protected]
 

From CActive, DoCancel. Implements cancellation of an outstanding request.

Definition at line 210 of file IsvTelCallAppTelephony.cpp.

References EMakeNewCall, iTel, and iTelApiCmd.

00211     {
00212     //Based on the command, invoke the appropriate CancelAsync APIs
00213     switch( iTelApiCmd )
00214         {
00215         case EMakeNewCall :
00216             {
00217             iTel->CancelAsync( CTelephony::EDialNewCallCancel );
00218             }
00219             break;
00220 
00221         case EHangup :
00222             {
00223             iTel->CancelAsync( CTelephony::EHangupCancel );
00224             }    
00225             break;
00226 
00227         case EHold :
00228             {
00229             iTel->CancelAsync( CTelephony::EHoldCancel );
00230             }    
00231             break;
00232 
00233         case EResume :
00234             {
00235             iTel->CancelAsync( CTelephony::EResumeCancel );
00236             }    
00237             break;
00238 
00239         case EAnswerIncomingCall :
00240             {
00241             iTel->CancelAsync( CTelephony::EAnswerIncomingCallCancel );
00242             }
00243             break;
00244 
00245         case EAsyncEvent:
00246             {
00247                 switch( iEvent )
00248                     {
00249                         case CTelephony::EOwnedCall1StatusChange :
00250                             {
00251                             iTel->CancelAsync( 
00252                                 CTelephony::EOwnedCall1StatusChangeCancel );
00253                             }
00254                             break;
00255                         case CTelephony::EOwnedCall2StatusChange :
00256                             {
00257                             iTel->CancelAsync( 
00258                                  CTelephony::EOwnedCall2StatusChangeCancel );
00259                             }
00260                             break;
00261                     
00262                         case CTelephony::EVoiceLineStatusChange :
00263                             {
00264                             iTel->CancelAsync( 
00265                                 CTelephony::EVoiceLineStatusChangeCancel );
00266                             }
00267                             break;
00268                         default :
00269                                 break;
00270                         }
00271             }
00272         default :
00273             break;
00274         }
00275     }

void CIsvTelCallAppTelephony::ConstructL (   ) 
 

Second-phase constructor.

Definition at line 297 of file IsvTelCallAppTelephony.cpp.

References iCallId1Str, iCallId2Str, and LoadErrorStringsFromResource().

00298     {
00299 
00300     //----------------------------------------------------------------------
00301     // Load Error strings from resource file
00302     //----------------------------------------------------------------------
00303     LoadErrorStringsFromResource();
00304 
00305     //Load call id strings from resource
00306     TBuf16<KMaxCmdSize> callIdStr;
00307     CCoeEnv::Static()->ReadResource(callIdStr, 
00308         R_ISVTELCALLAPP_TELSTR_CALLID1);
00309     iCallId1Str.Copy(callIdStr);
00310 
00311     CCoeEnv::Static()->ReadResource(callIdStr, 
00312         R_ISVTELCALLAPP_TELSTR_CALLID2);
00313     iCallId2Str.Copy(callIdStr);
00314 
00315     }

void CIsvTelCallAppTelephony::RegisterForAsyncNotification (  TInt   ) 
 

Register for notification change

Definition at line 322 of file IsvTelCallAppTelephony.cpp.

References EAsyncEvent, iCallStatus, iEvent, and iTelApiCmd.

00323     {
00324     if (IsActive())
00325         {
00326         return;
00327         }
00328         iTelApiCmd = EAsyncEvent;    
00329         switch(aAsyncEvent)
00330             {
00331                 case CTelephony::EOwnedCall1StatusChange :
00332                     {
00333                         iEvent = CTelephony::EOwnedCall1StatusChange;
00334             iCallStatus.iStatus = CTelephony::EStatusUnknown;
00335                     }
00336                     break;
00337                 case CTelephony::EOwnedCall2StatusChange :
00338                     {
00339                         iEvent = CTelephony::EOwnedCall2StatusChange;                                   
00340             iCallStatus.iStatus = CTelephony::EStatusUnknown;
00341                     }
00342                     break;
00343                 case CTelephony::EVoiceLineStatusChange :
00344                     {
00345                         iEvent = CTelephony::EVoiceLineStatusChange;
00346                     }
00347                     break;
00348                 default :
00349                     break;      
00350             }
00351                 iTel->NotifyChange(iStatus, iEvent, iCallStatusPckg);
00352         SetActive();
00353     }

void CIsvTelCallAppTelephony::TelApiWrapperMakeNewCallL (  CTelephony::TCallId  aCallId,
TBuf< CTelephony::KMaxTelNumberSize >  aTelNumber
) 
 

Wrapper function that calls DialNewCall of CTelephony class.

Parameters:
CTelephony::TCallId aCallId either Call1 or Call2.
aTelNumber Called party's mobile number.

Definition at line 391 of file IsvTelCallAppTelephony.cpp.

References EMakeNewCall, iCallId, iEmuApiNotSupported, iTel, iTelApiCmd, iTelNum, and StartWait().

00394     {
00395     if ( IsActive() )
00396         {
00397         return;
00398         }
00399     
00400     iTelApiCmd = EMakeNewCall;
00401     CTelephony::TCallParamsV1 callParams;
00402     CTelephony::TCallParamsV1Pckg callParamPckg( callParams );
00403     iCallId = aCallId;
00404     iTelNum = aTelNumber;
00405     
00406 #ifdef __WINS__
00407     CAknErrorNote* errorNoteMsg = new (ELeave) CAknErrorNote;
00408     errorNoteMsg->ExecuteLD(iEmuApiNotSupported);
00409 #else
00410     iTel->DialNewCall( iStatus, callParamPckg, iTelNum, 
00411         iCallId, CTelephony::EVoiceLine );
00412     SetActive();
00413     StartWait();
00414 #endif
00415     }

void CIsvTelCallAppTelephony::TelApiWrapperGetCallStatusL (  CTelephony::TCallId  aCallId  ) 
 

Wrapper function that calls GetCallStatus of CTelephony class.

Parameters:
CTelephony::TCallId aCallId either Call1 or Call2.

Definition at line 422 of file IsvTelCallAppTelephony.cpp.

References EGetCallStatus, GeneralErrorMessage(), MIsvTelCallAppTelephonyNotify::GetCallStatusCompleteL(), iCallId, iCallStatus, iCallStatusPckg, iEmuApiNotSupported, iNotify, iTel, and iTelApiCmd.

00424     {
00425     if ( IsActive() )
00426         {
00427         return;
00428         }
00429     
00430     if ( ( TInt )aCallId == KErrNotFound )
00431         {
00432         return;
00433         }
00434         iCallId = aCallId;
00435     iTelApiCmd = EGetCallStatus;
00436     
00437 #ifdef __WINS__
00438     CAknErrorNote* errorNoteMsg = new (ELeave) CAknErrorNote;
00439     errorNoteMsg->ExecuteLD(iEmuApiNotSupported);
00440 #else
00441     TInt retCode;
00442     iCallStatus.iStatus = CTelephony::EStatusUnknown;
00443     retCode = iTel->GetCallStatus( iCallId, iCallStatusPckg );
00444 
00445     TBuf16<KMaxErrMsgSize> errMsgBuffer;
00446     
00447     //Find the type of error message and store in errMsgBuffer.
00448     GeneralErrorMessage( retCode, &errMsgBuffer );
00449 
00450     iNotify.GetCallStatusCompleteL( retCode, iCallId, iCallStatus,
00451         errMsgBuffer);
00452 #endif
00453     }

void CIsvTelCallAppTelephony::TelApiWrapperHangupL (  CTelephony::TCallId  aCallId  ) 
 

Wrapper function that calls Hangup of CTelephony class.

Parameters:
CTelephony::TCallId aCallId either Call1 or Call2.

Definition at line 460 of file IsvTelCallAppTelephony.cpp.

References EHangup, iCallId, iEmuApiNotSupported, iTel, iTelApiCmd, and StartWait().

00461     {
00462     if ( IsActive() )
00463         {
00464         return;
00465         }
00466 
00467     if ( ( TInt )aCallId == KErrNotFound )
00468         {
00469         return;
00470         }
00471         iCallId = aCallId;
00472     iTelApiCmd = EHangup;
00473     
00474 #ifdef __WINS__
00475     CAknErrorNote* errorNoteMsg = new (ELeave) CAknErrorNote;
00476     errorNoteMsg->ExecuteLD(iEmuApiNotSupported);
00477 #else
00478     iTel->Hangup( iStatus, iCallId );
00479     SetActive();
00480     StartWait();
00481 #endif
00482     }

void CIsvTelCallAppTelephony::TelApiWrapperHoldL (  CTelephony::TCallId  aCallId  ) 
 

Wrapper function that calls Hold of CTelephony class.

Parameters:
CTelephony::TCallId aCallId either Call1 or Call2.

Definition at line 489 of file IsvTelCallAppTelephony.cpp.

References EHold, iCallId, iEmuApiNotSupported, iTel, iTelApiCmd, and StartWait().

00490     {
00491     if ( IsActive() )
00492         {
00493         return;
00494         }
00495     
00496     if ( ( TInt )aCallId == KErrNotFound )
00497         {
00498         return;
00499         }
00500         iCallId = aCallId;
00501     iTelApiCmd = EHold;
00502     
00503 #ifdef __WINS__
00504     CAknErrorNote* errorNoteMsg = new (ELeave) CAknErrorNote;
00505     errorNoteMsg->ExecuteLD(iEmuApiNotSupported);
00506 #else
00507     iTel->Hold( iStatus, iCallId );
00508     SetActive();
00509     StartWait();
00510 #endif
00511     }

void CIsvTelCallAppTelephony::TelApiWrapperResumeL (  CTelephony::TCallId  aCallId  ) 
 

Wrapper function that calls Resume of CTelephony class.

Parameters:
CTelephony::TCallId aCallId either Call1 or Call2.

Definition at line 518 of file IsvTelCallAppTelephony.cpp.

References EResume, iCallId, iEmuApiNotSupported, iTel, iTelApiCmd, and StartWait().

00519     {
00520     if ( IsActive() )
00521         {
00522         return;
00523         }
00524 
00525     if ( ( TInt )aCallId == KErrNotFound )
00526         {
00527         return;
00528         }
00529         iCallId = aCallId;
00530     iTelApiCmd = EResume;
00531     
00532 #ifdef __WINS__
00533     CAknErrorNote* errorNoteMsg = new (ELeave) CAknErrorNote;
00534     errorNoteMsg->ExecuteLD(iEmuApiNotSupported);
00535 #else
00536     iTel->Resume( iStatus, iCallId );
00537     SetActive();
00538     StartWait();
00539 #endif
00540     }

void CIsvTelCallAppTelephony::TelApiWrapperSwapL (   ) 
 

Wrapper function that calls Swap of CTelephony class.

Definition at line 547 of file IsvTelCallAppTelephony.cpp.

References ESwap, iCallId, iEmuApiNotSupported, iTel, iTelApiCmd, and StartWait().

00548     {
00549     if ( IsActive() )
00550         {
00551         return;
00552         }
00553 
00554     //Set the call id
00555     iCallId = CTelephony::EISVCall1;
00556     CTelephony::TCallId swapCallId = CTelephony::EISVCall2;
00557 
00558     iTelApiCmd = ESwap;
00559     
00560 #ifdef __WINS__
00561     CAknErrorNote* errorNoteMsg = new (ELeave) CAknErrorNote;
00562     errorNoteMsg->ExecuteLD(iEmuApiNotSupported);
00563 #else
00564     iTel->Swap( iStatus, iCallId, swapCallId );
00565     SetActive();
00566     StartWait();
00567 #endif
00568     }

void CIsvTelCallAppTelephony::TelApiWrapperGetVoiceLineStatusL (   ) 
 

Wrapper function that calls GetLineStatus of CTelephony class

Definition at line 575 of file IsvTelCallAppTelephony.cpp.

References EGetVoiceLineStatus, GeneralErrorMessage(), MIsvTelCallAppTelephonyNotify::GetVoiceLineStatusCompleteL(), iCallStatus, iCallStatusPckg, iEmuApiNotSupported, iNotify, iTel, and iTelApiCmd.

00576     {
00577     if ( IsActive() )
00578         {
00579         return;
00580         }
00581     
00582     iTelApiCmd = EGetVoiceLineStatus;
00583 
00584 #ifdef __WINS__
00585     CAknErrorNote* errorNoteMsg = new (ELeave) CAknErrorNote;
00586     errorNoteMsg->ExecuteLD(iEmuApiNotSupported);
00587 #else    
00588     //Call GetLineStatus with EVoiceLine to get the status of voice line.
00589     TInt aStatus = iTel->GetLineStatus(CTelephony::EVoiceLine, 
00590         iCallStatusPckg);
00591     TBuf16<KMaxErrMsgSize> errMsgBuffer;
00592     GeneralErrorMessage( aStatus, &errMsgBuffer );
00593     iNotify.GetVoiceLineStatusCompleteL( aStatus, errMsgBuffer, iCallStatus );
00594 #endif        
00595     }

void CIsvTelCallAppTelephony::TelApiWrapperGetDataLineStatusL (   ) 
 

Wrapper function that calls GetLineStatus of CTelephony class

Definition at line 602 of file IsvTelCallAppTelephony.cpp.

References EGetDataLineStatus, GeneralErrorMessage(), MIsvTelCallAppTelephonyNotify::GetDataLineStatusCompleteL(), iCallStatus, iCallStatusPckg, iEmuApiNotSupported, iNotify, iTel, and iTelApiCmd.

00603     {
00604     if ( IsActive() )
00605         {
00606         return;
00607         }
00608     
00609     iTelApiCmd = EGetDataLineStatus;
00610     
00611 #ifdef __WINS__
00612     CAknErrorNote* errorNoteMsg = new (ELeave) CAknErrorNote;
00613     errorNoteMsg->ExecuteLD(iEmuApiNotSupported);
00614 #else    
00615     //Call GetLineStatus with EDataLine to get the status of data line.
00616     TInt aStatus = iTel->GetLineStatus( 
00617         CTelephony::EDataLine, iCallStatusPckg );
00618     TBuf16<KMaxErrMsgSize> errMsgBuffer;
00619     GeneralErrorMessage( aStatus, &errMsgBuffer );
00620     iNotify.GetDataLineStatusCompleteL( aStatus, errMsgBuffer, iCallStatus );
00621 #endif    
00622     }

void CIsvTelCallAppTelephony::TelApiWrapperGetFaxLineStatusL (   ) 
 

Wrapper function that calls GetLineStatus of CTelephony class

Definition at line 629 of file IsvTelCallAppTelephony.cpp.

References EGetFaxLineStatus, GeneralErrorMessage(), MIsvTelCallAppTelephonyNotify::GetFaxLineStatusCompleteL(), iCallStatus, iCallStatusPckg, iEmuApiNotSupported, iNotify, iTel, and iTelApiCmd.

00630     {
00631     if ( IsActive() )
00632         {
00633         return;
00634         }
00635         
00636     iTelApiCmd = EGetFaxLineStatus;
00637     
00638 #ifdef __WINS__
00639     CAknErrorNote* errorNoteMsg = new (ELeave) CAknErrorNote;
00640     errorNoteMsg->ExecuteLD(iEmuApiNotSupported);
00641 #else    
00642     //Call GetLineStatus with EFaxLine to get the status of fax line.
00643     TInt aStatus = iTel->GetLineStatus(
00644         CTelephony::EFaxLine, iCallStatusPckg );
00645     
00646     TBuf16<KMaxErrMsgSize> errMsgBuffer;
00647     GeneralErrorMessage( aStatus, &errMsgBuffer );
00648     iNotify.GetFaxLineStatusCompleteL( aStatus, errMsgBuffer, iCallStatus );
00649 #endif    
00650     }

void CIsvTelCallAppTelephony::TelApiWrapperSendDTMFL (  CTelephony::TCallId  aCallId,
TBuf< KMaxDTMFLength >  aDtmfSeq
) 
 

Wrapper function that calls SendDTMFTones of CTelephony class.

Parameters:
CTelephony::TCallId aCallId either Call1 or Call2.
aDtmfSeq DTMF sequence to be sent.

Definition at line 657 of file IsvTelCallAppTelephony.cpp.

References ESendDTMF, iCallStatus, iCallStatusPckg, iEmuApiNotSupported, iNotify, iTel, iTelApiCmd, MIsvTelCallAppTelephonyNotify::SendDTMFApiCompleteL(), and StartWait().

00660     {
00661     if ( IsActive() )
00662         {
00663         return;
00664         }
00665 
00666         CTelephony::TCallId callId = aCallId;
00667         TBuf<KMaxDTMFLength> dtmfSeq = aDtmfSeq;
00668         
00669     iTelApiCmd = ESendDTMF;
00670 
00671 #ifdef __WINS__
00672     CAknErrorNote* errorNoteMsg = new (ELeave) CAknErrorNote;
00673     errorNoteMsg->ExecuteLD(iEmuApiNotSupported);
00674 #else   
00675     iTel->GetCallStatus( callId, iCallStatusPckg );
00676     
00677     //If the call status, for which DTMF tones is to be passed 
00678     //is not active, then return error.
00679     if ( iCallStatus.iStatus != CTelephony::EStatusConnected )
00680         {
00681         TBuf16<KMaxErrMsgSize> KError;
00682         CCoeEnv::Static()->ReadResource(KError,
00683             R_ISVTELCALLAPP_TELSTR_CALLNOTACTIVE);
00684         iNotify.SendDTMFApiCompleteL( ( TInt )KErrNotFound, KError );
00685         return;
00686         }
00687     iTel->SendDTMFTones( iStatus, dtmfSeq );
00688     SetActive();
00689     StartWait();
00690 #endif    
00691     }

void CIsvTelCallAppTelephony::TelApiWrapperAnswerInCallL (   ) 
 

Answers Incoming Call

Definition at line 698 of file IsvTelCallAppTelephony.cpp.

References EAnswerIncomingCall, iCallId, iEmuApiNotSupported, iTel, and iTelApiCmd.

00699     {
00700     iTelApiCmd = EAnswerIncomingCall;
00701 #ifdef __WINS__
00702     CAknErrorNote* errorNote = new (ELeave) CAknErrorNote;
00703     errorNote->ExecuteLD(iEmuApiNotSupported);
00704 #else    
00705     iTel->AnswerIncomingCall( iStatus, iCallId, CTelephony::EVoiceLine );
00706     SetActive();
00707 #endif    
00708     }

void CIsvTelCallAppTelephony::LoadErrorStringsFromResource (   ) 
 

Loads error strings from resource files

Definition at line 733 of file IsvTelCallAppTelephony.cpp.

References iEmuApiNotSupported, iErrStrAccessDenied, iErrStrAlreadyExists, iErrStrArgument, iErrStrBadHandle, iErrStrCancel, iErrStrCommsLineFail, iErrStrCorrupt, iErrStrCouldNotConnect, iErrStrCouldNotDisconnect, iErrStrDefault, iErrStrGeneral, iErrStrHardwareNotAvailable, iErrStrInUse, iErrStrNoMemory, iErrStrNotFound, iErrStrNotSupported, iErrStrOverflow, iErrStrPermissionDenied, iErrStrServerBusy, iErrStrServerTerminated, iErrStrSessionClosed, iErrStrTimedOut, iErrStrTotalLossOfPrecision, iErrStrUnderflow, and iErrStrUnknown.

00734     {
00735     CCoeEnv::Static()->ReadResource(iErrStrNotFound,
00736         R_ISVTELCALLAPP_TELSTR_ERRNOTFOUND);
00737     CCoeEnv::Static()->ReadResource(iErrStrGeneral,
00738         R_ISVTELCALLAPP_TELSTR_ERRGENERAL);
00739     CCoeEnv::Static()->ReadResource(iErrStrCancel,
00740         R_ISVTELCALLAPP_TELSTR_ERRCANCEL);
00741     CCoeEnv::Static()->ReadResource(iErrStrNoMemory,
00742         R_ISVTELCALLAPP_TELSTR_ERRNOMEMORY);
00743     CCoeEnv::Static()->ReadResource(iErrStrNotSupported,
00744         R_ISVTELCALLAPP_TELSTR_ERRNOTSUPPORTED);
00745     CCoeEnv::Static()->ReadResource(iErrStrArgument,
00746         R_ISVTELCALLAPP_TELSTR_ERRARGUMENT);
00747     CCoeEnv::Static()->ReadResource(iErrStrTotalLossOfPrecision,
00748         R_ISVTELCALLAPP_TELSTR_ERRTOTALLOSSOFPRECISION);
00749     CCoeEnv::Static()->ReadResource(iErrStrBadHandle,
00750         R_ISVTELCALLAPP_TELSTR_ERRBADHANDLE);
00751     CCoeEnv::Static()->ReadResource(iErrStrOverflow,
00752         R_ISVTELCALLAPP_TELSTR_ERROVERFLOW);
00753     CCoeEnv::Static()->ReadResource(iErrStrUnderflow,
00754         R_ISVTELCALLAPP_TELSTR_ERRUNDERFLOW);
00755     CCoeEnv::Static()->ReadResource(iErrStrAlreadyExists,
00756         R_ISVTELCALLAPP_TELSTR_ERRALREADYEXISTS);
00757     CCoeEnv::Static()->ReadResource(iErrStrInUse,
00758         R_ISVTELCALLAPP_TELSTR_ERRINUSE);
00759     CCoeEnv::Static()->ReadResource(iErrStrServerTerminated,
00760         R_ISVTELCALLAPP_TELSTR_ERRSERVERTERMINATED);
00761     CCoeEnv::Static()->ReadResource(iErrStrServerBusy,
00762         R_ISVTELCALLAPP_TELSTR_ERRSERVERBUSY);
00763     CCoeEnv::Static()->ReadResource(iErrStrUnknown,
00764         R_ISVTELCALLAPP_TELSTR_ERRUNKNOWN);
00765     CCoeEnv::Static()->ReadResource(iErrStrCorrupt,
00766         R_ISVTELCALLAPP_TELSTR_ERRCORRUPT);
00767     CCoeEnv::Static()->ReadResource(iErrStrAccessDenied,
00768         R_ISVTELCALLAPP_TELSTR_ERRACCESSDENIED);
00769     CCoeEnv::Static()->ReadResource(iErrStrCommsLineFail,
00770         R_ISVTELCALLAPP_TELSTR_ERRCOMMSLINEFAIL);
00771     CCoeEnv::Static()->ReadResource(iErrStrTimedOut,
00772         R_ISVTELCALLAPP_TELSTR_ERRTIMEDOUT);
00773     CCoeEnv::Static()->ReadResource(iErrStrCouldNotConnect,
00774         R_ISVTELCALLAPP_TELSTR_ERRCOULDNOTCONNECT);
00775     CCoeEnv::Static()->ReadResource(iErrStrCouldNotDisconnect,
00776         R_ISVTELCALLAPP_TELSTR_ERRCOULDNOTDISCONNECT);
00777     CCoeEnv::Static()->ReadResource(iErrStrHardwareNotAvailable,
00778         R_ISVTELCALLAPP_TELSTR_ERRHARDWARENOTAVAILABLE);
00779     CCoeEnv::Static()->ReadResource(iErrStrSessionClosed,
00780         R_ISVTELCALLAPP_TELSTR_ERRSESSIONCLOSED);
00781     CCoeEnv::Static()->ReadResource(iErrStrPermissionDenied,
00782         R_ISVTELCALLAPP_TELSTR_ERRPERMISSIONDENIED);
00783     CCoeEnv::Static()->ReadResource(iErrStrDefault,
00784         R_ISVTELCALLAPP_TELSTR_ERRORDEFAULT);
00785         CCoeEnv::Static()->ReadResource(iEmuApiNotSupported,
00786             R_ISVTELCALLAPP_ERR_EMUAPINOTSUPPORTED);        
00787     }

void CIsvTelCallAppTelephony::GeneralErrorMessage (  TInt  aStatus,
TBuf16< KMaxErrMsgSize > *  aErrMsgBuffer
) 
 

Finds the system wide error.

Parameters:
aStatus The system wide error.
aErrMsgBuffer The buffer containing the error message.

Definition at line 795 of file IsvTelCallAppTelephony.cpp.

References iErrStrNotFound.

00797     {
00798     switch( aStatus )
00799         {
00800         case KErrNotFound:
00801             {
00802             (*aErrMsgBuffer).Copy(iErrStrNotFound);
00803             }
00804             break;
00805         case KErrGeneral:
00806             {    
00807             (*aErrMsgBuffer).Copy(iErrStrGeneral);
00808             }
00809             break;
00810         case KErrCancel:
00811             {
00812             (*aErrMsgBuffer).Copy(iErrStrCancel);
00813             }
00814             break;
00815         case KErrNoMemory:
00816             {
00817             (*aErrMsgBuffer).Copy(iErrStrNoMemory);
00818             }
00819             break;
00820         case KErrNotSupported:
00821             {
00822             (*aErrMsgBuffer).Copy(iErrStrNotSupported);
00823             }
00824             break;
00825         case KErrArgument:
00826             {
00827             (*aErrMsgBuffer).Copy(iErrStrArgument);
00828             }
00829             break;
00830         case KErrTotalLossOfPrecision:
00831             {
00832             (*aErrMsgBuffer).Copy(iErrStrTotalLossOfPrecision);
00833             }
00834             break;
00835         case KErrBadHandle:
00836             {
00837             (*aErrMsgBuffer).Copy(iErrStrBadHandle);
00838             }
00839             break;
00840         case KErrOverflow:
00841             {
00842             (*aErrMsgBuffer).Copy(iErrStrOverflow);
00843             }
00844             break;
00845         case KErrUnderflow:
00846             {
00847             (*aErrMsgBuffer).Copy(iErrStrUnderflow);
00848             }
00849             break;
00850         case KErrAlreadyExists:
00851             {
00852             (*aErrMsgBuffer).Copy(iErrStrAlreadyExists);
00853             }
00854             break;
00855         case KErrInUse:
00856             {
00857             (*aErrMsgBuffer).Copy(iErrStrInUse);
00858             }
00859             break;
00860         case KErrServerTerminated:
00861             {
00862             (*aErrMsgBuffer).Copy(iErrStrServerTerminated);
00863             }
00864             break;
00865         case KErrServerBusy:
00866             {
00867             (*aErrMsgBuffer).Copy(iErrStrServerBusy);
00868             }
00869             break;
00870         case KErrUnknown:
00871             {
00872             (*aErrMsgBuffer).Copy(iErrStrUnknown);
00873             }
00874             break;
00875         case KErrCorrupt:
00876             {
00877             (*aErrMsgBuffer).Copy(iErrStrCorrupt);
00878             }
00879             break;
00880         case KErrAccessDenied:
00881             {
00882             (*aErrMsgBuffer).Copy(iErrStrAccessDenied);
00883             }
00884             break;
00885         case KErrCommsLineFail:
00886             {
00887             (*aErrMsgBuffer).Copy(iErrStrCommsLineFail);
00888             }
00889             break;
00890         case KErrTimedOut:
00891             {
00892             (*aErrMsgBuffer).Copy(iErrStrTimedOut);
00893             }
00894             break;
00895         case KErrCouldNotConnect:
00896             {
00897             (*aErrMsgBuffer).Copy(iErrStrCouldNotConnect);
00898             }
00899             break;
00900         case KErrCouldNotDisconnect:
00901             {
00902             (*aErrMsgBuffer).Copy(iErrStrCouldNotDisconnect);
00903             }
00904             break;
00905         case KErrHardwareNotAvailable:
00906             {
00907             (*aErrMsgBuffer).Copy(iErrStrHardwareNotAvailable);
00908             }
00909             break;
00910         case KErrSessionClosed:
00911             {
00912             (*aErrMsgBuffer).Copy(iErrStrSessionClosed);
00913             }
00914             break;
00915         case KErrPermissionDenied:
00916             {
00917             (*aErrMsgBuffer).Copy(iErrStrPermissionDenied);
00918             }
00919             break;
00920         default:
00921             {
00922             (*aErrMsgBuffer).Copy(iErrStrDefault);
00923             }
00924             break;
00925         }
00926     }

void CIsvTelCallAppTelephony::StartWait (   ) 
 

Starts the active scheduler wait after testing if it is already started

Definition at line 716 of file IsvTelCallAppTelephony.cpp.

References iWait.

00717     {
00718     if ( iWait.IsStarted() == (TInt)ETrue )
00719         {
00720         return;
00721         }
00722     else
00723         {
00724         iWait.Start();
00725         }
00726     return;
00727     }


© Nokia 2006

Back to top