ccallanswerer.cpp 871 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include "ccallanswerer.h"
  2. #include <w32std.h>
  3. #include <QDebug>
  4. CCallAnswerer::CCallAnswerer(MAnswerObserver& aObserver, CTelephony* aTelephony)
  5. : CActive(EPriorityStandard)
  6. ,iObserver(aObserver)
  7. ,iTelephony(aTelephony)
  8. {
  9. CActiveScheduler::Add( this );
  10. }
  11. CCallAnswerer::~CCallAnswerer() {
  12. Cancel();
  13. }
  14. void CCallAnswerer::Answer() {
  15. iTelephony->AnswerIncomingCall(iStatus, iCallId);
  16. SetActive();
  17. }
  18. void CCallAnswerer::RunL()
  19. {
  20. if(iStatus==KErrNone){
  21. qDebug() << "[CCallAnswerer::RunL()] chiamata risposta correttamente";
  22. iObserver.CallAnsweredL( iStatus.Int() );
  23. } else {
  24. qDebug() << "[CCallAnswerer::RunL()] errore: "<< QString::number(iStatus.Int());
  25. }
  26. }
  27. void CCallAnswerer::DoCancel()
  28. {
  29. iTelephony->CancelAsync(CTelephony::EAnswerIncomingCallCancel);
  30. }