How to terminate call

This is done using CTelephony using CTelephony::Hangup().

Pass the call ID to CTelephony::Hangup() to terminate the call. The ID is the CTelephony::TCallId returned when you dialled or answered the call.

  • Asynchronous call


Libraries Needed:

LIBRARY Etel3rdParty.lib euser.lib

Since, this is done using an asynchronous call, one can cancel this using CTelephony::EHangupCancel.

#include <e32base.h>
#include <Etel3rdParty.h>
 
class CClientApp : public CActive
    {
 
private :
    CTelephony* iTelephony;
    CTelephony:: TCallId iCallId;
 
public :
    CClientApp( CTelephony* aTelephony, CTelephony:: TCallId aCallId) ;
    void TerminateCall() ;
 
private :
    void RunL() ;
    void DoCancel() ;
   } ;
 
CClientApp:: CClientApp ( CTelephony* aTelephony, CTelephony:: TCallId aCallId)
    : CActive( EPriorityStandard) ,
      iTelephony( aTelephony) ,
      iCallId( aCallId)
    {
    //Constructor
    }
 
void CClientApp:: TerminateCall ()
    {
    iTelephony- > Hangup( iStatus, iCallId) ;
    SetActive() ;
    }
 
void CClientApp:: RunL ()
    {
    if ( iStatus== KErrNone)
       {
         //The call has been terminated successfully;
       }
    }
 
void CClientApp:: DoCancel ()
    {
    iTelephony- > CancelAsync( CTelephony:: EHangupCancel ) ;
    }

 

 

阅读更多
文章标签: asynchronous
个人分类: Symbian
想对作者说点什么? 我来说一句

Subroutines in batch files

2017年11月30日 141B 下载

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭