Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Hang up voice calls
Hanging up Phone calls
There are several ways on hanging up the phone calls, here’s a list on what is available for S60 in public space:
1. CTelephony 2. AT commands 3. CPhCltCommandHandler
Call can only be hang up in certain call states, thus you should also have a look into call state monitoring example
Hanging up with CTelephony
With CTelephony you can only hang up calls that you own and which are connected. Thus hanging up with CTelephony is only usable if you either: Dialed the call with DialNewCall() or answrered the call with AnswerIncomingCall() functions.
With both of these functions you get CTelephony::TCallId parameter, which you need to pass to the CTelephony’s Hangup() function. The actual code is this simple:
The full code is also shown in How to terminate call
Hanging up with At Commands
AT commands sending example can be found from File:Send AT Commands.zip.
With the example you just send AT+CHUP while having call in dialing,ringing or connected state.
Hanging up with CPhCltCommandHandler
First you need to construct a instance of CPhCltCommandHandler, this can be done with following code:
_LIT( KPhCltExtLib, "PhoneClientExt.dll" );
User::LeaveIfError( iLibrary.Load( KPhCltExtLib ) ); // Load PhoneClientExt dll
TInt res = 0; TInt err=0;
TRAP(err,res = iLibrary.Lookup( 1 )());
if (err == KErrNone)
iFactory = reinterpret_cast< CPhCltExtFactory * >( res );
if ( iFactory )
iHandler = iFactory->CPhCltCommandHandlerLD();
After using the instance, you can close and delete it as follows:
iHandler = NULL;
The actual hanging up is handled with following active object function call:
Note:CPhCltCommandHandler will not work from 3rd ed FP2 onwards