×

Discussion Board

Results 1 to 11 of 11

Thread: Notify on Event

  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    21

    Question Notify on Event

    A very frequent question as I saw during searching the forum but unfortunately all these posts did not solve my problem. I'm developing on a S60 2nd Ed. FP2 Device and need to be notified on some special events like incomming/outgoing call, sending/receiving SMS/MMS, establishing data connection, etc. I need to handle each of these events - if possible - in real time, so reading out a log or something like that is not really what I'm looking for.
    I tried CLogEvent and RSystemAgent but was unable to use these ones in the way I need. Did I something wrong, is there any other class to solve this problem or is something like that impossible with my device?

    Thanks for your help.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175

    Re: Notify on Event

    CTelephony would be right for call monitoring. Message could be monitored like this: http://wiki.forum.nokia.com/index.php/SMS_Receiver

    And for network connections, you could try connection monitor: http://wiki.forum.nokia.com/index.ph...on_Example.zip

  3. #3
    Registered User
    Join Date
    Aug 2008
    Posts
    21

    Re: Notify on Event

    CTelephony is not available on 8.0a devices, isn't it?
    My application does not start when trying to use CTelephony. It just closes immediately without a panic or other notifications.

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175

    Re: Notify on Event

    sorry, missed that this was for 2nd ed.. Anyway, then you would need to use non-public Etelmm APIs.

  5. #5
    Registered User
    Join Date
    Aug 2008
    Posts
    21

    Re: Notify on Event

    So I have to become a premium partner to do this? Isn't there another solution to this?

  6. #6
    Registered User
    Join Date
    Aug 2008
    Posts
    21

    Re: Notify on Event

    I decided to use RSystemAgent now. But the problem is that it seems to never get into ESACallDialling, ESACallAnswering or ESACallAlternating state. Other states like ESACallVoice or ESACallAlerting are working as expected.

    Do you have any suggestions to this?

  7. #7
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    105

    Re: Notify on Event

    I have the same problem . I use elemm ,and can get telephone state.
    but it not stateble ,and sometimes it close, with no reason. I want it to long running stable, I.m finding if can use RSystemAgent to get ,outcoming /incoming call event and number. l'm work on s60 2rd FP2 too.

  8. #8
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175

    Re: Notify on Event

    when it closes, it most likely crashes, thus you should check what the error was that causes the crash..

  9. #9
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    105

    Re: Notify on Event

    I can't ,only can run on device , I don't know how to get the soft runnig state . when call incoming , or ,out call. it crashed , but not ervertime crashed . sometimes ,so ,i want get some stable RSystemAgent code ,to change my etelmm code .

    http://www.forum.nokia.com/info/sw.n..._v1_0.zip.html
    there have a phoneobserver.cpp

    code is :
    Code:
    /*
    * ============================================================================
    *  Name     : Phoneobserver.cpp
    *  Part of  : RecorderExample
    *  Created  : 20.03.2005 by Forum Nokia
    *  Version  : 1.0.0
    *  Copyright: Nokia Corporation
    * ============================================================================
    */
    
    
    //INCLUDES
    #include <e32base.h>
    
    #include <e32std.h> 
    
    #include <etel.h>
    
    #include "phoneobserver.h"
    #include "recorderview.h"
    #include "recorder.hrh"
    
    // ---------------------------------------------------------
    // CPhoneObserver::CPhoneObserver()
    // C++ default constructor
    // ---------------------------------------------------------
    CPhoneObserver::CPhoneObserver(): CActive(EPriorityStandard)
    {
    }
    
    // ---------------------------------------------------------
    // CPhoneObserver::~CPhoneObserver()
    // C++ destructor
    // ---------------------------------------------------------
    CPhoneObserver::~CPhoneObserver()
    {
    	Cancel();
    }
    
    
    // ---------------------------------------------------------
    // CPhoneObserver::NewL()
    // Two phase constructor
    // ---------------------------------------------------------
    CPhoneObserver* CPhoneObserver::NewL(CRecorderView* aRecView, RLine* aLine)
    {
        CPhoneObserver* self = NewLC(aRecView, aLine);
        CleanupStack::Pop(self); 
        return self;
    }
    
    // ---------------------------------------------------------
    // CPhoneObserver::NewLC()
    // ---------------------------------------------------------
    CPhoneObserver* CPhoneObserver::NewLC(CRecorderView* aRecView, RLine* aLine)
    {
        CPhoneObserver* self = new (ELeave) CPhoneObserver();
        CleanupStack::PushL(self);
        self->ConstructL(aRecView, aLine);
        return self;
    }
    
    // ---------------------------------------------------------
    // CPhoneObserver::RunL()
    // Called by active object framework when line event occurs
    // ---------------------------------------------------------
    void CPhoneObserver::RunL()
    {
    	if (iStatus.Int() == KErrNone)
    	{
    		if (iLineStatus == RCall::EStatusConnected)
    		{
    			//If line is connected, recording may start.
    			iRecView -> HandleCommandL(EProgCmdRecord);
    		}
    		else if (iLineStatus == RCall::EStatusHangingUp)
    		{
    			//If line is hanging up, recorder must stop.
    			iRecView -> HandleCommandL(EProgCmdStop);
    		}
    		
    		Start();
    	}
    	
    	
    	else
    	{
    		Cancel();
    	}
    }
    
    // ---------------------------------------------------------
    // CPhoneObserver::RunError()
    // Called by active object framework when error occurs
    // ---------------------------------------------------------
    TInt CPhoneObserver::RunError(TInt Error)
    {
    	return Error;		
    }
    
    // ---------------------------------------------------------
    // CPhoneObserver::DoCancel()
    // Cancels active objects callback request
    // ---------------------------------------------------------
    void CPhoneObserver::DoCancel()
    {
    	iLine -> NotifyStatusChangeCancel();
    }
    
    
    // ---------------------------------------------------------
    // CPhoneObserver::ConstructL()
    // 
    // ---------------------------------------------------------
    void CPhoneObserver::ConstructL(CRecorderView* aRecView, RLine* aLine)
    {
    	iRecView = aRecView;
    	iLine = aLine;
    	
        CActiveScheduler::Add(this);
    }
    
     
     // ---------------------------------------------------------
     // CPhoneObserver::Start()
     // Active object is activated
     // ---------------------------------------------------------
    void CPhoneObserver::Start()
    {
    	Cancel();
    			
    	iLine -> NotifyStatusChange(iStatus, iLineStatus);
    	SetActive();
    }
    
    // ---------------------------------------------------------
    // CPhoneObserver::Deactivate()
    // Active object is canceled outside of this class.
    // ---------------------------------------------------------
    void CPhoneObserver::Deactivate()
    {
    	DoCancel();
    }
       
       
    // End of File
    my code is like this ,
    Last edited by wjcrr; 2009-06-21 at 10:11.

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,752

    Re: Notify on Event

    http://wiki.forum.nokia.com/index.ph...ded_panic_code

    EDIT: Hmm, the unfortunate thing is that it probably will not work on S60 2nd FP2 devices. A thing you can experiment with could be RThread::Logon (telephony stuff should work in a secondary thread as far as I know), or RProcess::Logon. Then check ExitType/Reason/Category. Obviously from an other thread/process.
    Last edited by wizard_hu_; 2009-06-21 at 10:46.

  11. #11
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175

    Re: Notify on Event

    for 2nd edition check TaskSpy from David: http://www.pushl.com/taskspy/

Similar Threads

  1. how to notify the event of camera on event
    By krgvs in forum Symbian
    Replies: 2
    Last Post: 2009-03-04, 09:09
  2. [moved] How to active Notify Event?
    By mysilversir in forum Symbian
    Replies: 5
    Last Post: 2009-03-04, 08:45
  3. Replies: 2
    Last Post: 2009-01-21, 05:13
  4. SIP NOTIFY Problem
    By Olive in forum VoIP
    Replies: 8
    Last Post: 2007-09-09, 11:06
  5. CLogEvent problem
    By silviuccia in forum Symbian
    Replies: 2
    Last Post: 2006-12-22, 15:28

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×