×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    16

    No RunL after DialNewCall

    Hi all,
    I have a code to dial calls on 5th edition. The problem is that no RunL execution after I call DialNewCall. The call is performed but no execution of RunL start at any moment.

    This is the code:

    Code:
    CCallDialer* CCallDialer::NewL(MDialObserver& aCallBack)
    {
        CCallDialer* self = CCallDialer::NewLC(aCallBack);
        CleanupStack::Pop(self);
        return self;
    }
     
    CCallDialer* CCallDialer::NewLC(MDialObserver& aCallBack)
    {
        CCallDialer* self = new (ELeave) CCallDialer(aCallBack);
        CleanupStack::PushL(self);
        self->ConstructL();
        return self;
    }
     
     
    CCallDialer::~CCallDialer()
    {
        Cancel();
        delete iTelephony;
    }
     
    void CCallDialer::ConstructL()
    {
        iTelephony = CTelephony::NewL();    
        
    }
     
    CCallDialer::CCallDialer(MDialObserver& aObserver)
    : CActive(EPriorityNormal),iObserver(aObserver), iCallParamsPckg(iCallParams)
    {
        CActiveScheduler::Add(this);
    }
    
    void CCallDialer::MakeCall(const TDesC& aNumber)
    	{	
    	    CTelephony::TTelNumber telNumber(aNumber);
    	 
    	    iCallParams.iIdRestrict = CTelephony::ESendMyId;
    	    LogWrite(_L("Making a call..."));
    	    callState = Dialing;
    	    iTelephony->DialNewCall(iStatus, iCallParamsPckg, telNumber, iCallId);
    	    SetActive();
    	    LogWrite(_L("Making a call... SCHEDULED"));
    	
    	}
    void CCallDialer::TerminateCall()
        {
        if(callState==Establish){
    		LogWrite(_L("Terminating an established call..."));
    		callState = HangingUp;
    		LogWriteFormat(_L("iCallId=%d"),iCallId);
        	iTelephony->Hangup(iStatus, iCallId);
        	SetActive();  
        	LogWrite(_L("Terminating an established call... SCHEDULED"));
        	}
        else if(callState==Dialing){
    		LogWrite(_L("Terminating an non established call..."));
    		Cancel();
    		}
        
        }
    
    void CCallDialer::RunL()
    {	
    	if(iStatus==KErrNone){
    		if(callState==Dialing){
    			LogWrite(_L("Making a call... DONE"));
    			LogWriteFormat(_L("iCallId=%d"),iCallId);
    			callState = Establish;
    			iObserver.CallDialedL(iStatus.Int());
    		}
    		else if(callState==HangingUp){
    			LogWrite(_L("Terminating a call... DONE"));
    			callState = NoCallInProgress;
    			iObserver.CallHungUpL(iStatus.Int());
    		}
    	}
    }
    
    void CCallDialer::DoCancel()
    {
        iTelephony->CancelAsync(CTelephony::EDialNewCallCancel);
        iObserver.CallHungUpL(iStatus.Int());
        LogWrite(_L("Terminating a call... DONE"));
    }
    Any ideas??

    Thank you in advance,
    Alex

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: No RunL after DialNewCall

    Put logging on entering RunL and check it again.
    Code:
    void CCallDialer::RunL()
    {	
    LogWrite(_L("In RunL..."));
    ...
    }
    Nokia Developer Wiki Moderation team

  3. #3
    Registered User
    Join Date
    Oct 2009
    Posts
    16

    Re: No RunL after DialNewCall

    Please don´t understimate me
    I have already tried those and some others things but nothing.

    Anyway thank you for the interest.

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

    Re: No RunL after DialNewCall

    So is the actual dialing successfull, i.e are you actually answering in the other end ?

  5. #5
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,987

    Re: No RunL after DialNewCall

    In your MakeCall function call Cancel() first

  6. #6
    Registered User
    Join Date
    Oct 2009
    Posts
    16

    Re: No RunL after DialNewCall

    Hi all,
    Thanks for your replies.
    I have just tried to call Cancel() in MakeCall() but I have the same result, no RunL execution when the call is dialed or when is ansewered by the peer.
    Is very odd and I can´t imagine what the problem is. The only lead I can provide is that I am a newbie in Symbian and this call is performed from another active object. Probably I misunderstand the use of active objects.

    Rgds,
    Alex

  7. #7
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: No RunL after DialNewCall

    You're probably making some mistake somewhere in your code. Either try adding more logging (as already suggested) or set some breakpoints in different parts of your code (been a while since I used CTelephony, but IIRC the emulator should provide the minimal expected behaviour), or otherwise debug on target. Also check existing examples, both the in the wiki and the sdk. Use them and compare them with your code.

  8. #8
    Registered User
    Join Date
    Oct 2009
    Posts
    16

    Re: No RunL after DialNewCall

    I have used the example from the wiki for the dialer, that´s more I haven´t change class name . I have only added some calls and variables for my own purposes.
    The more strange thing (at least from my newbie point of view) is that the call is performed but I have no feedback via RunL function.
    I´ll continue digging into this, any suggestion will be welcome.

    Rgds,
    Alex

  9. #9
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,987

    Re: No RunL after DialNewCall

    in the example of wiki , follwoing statement is written on top:

    The call dialing starts automatically after the construction. In case the process is successful and the callee answers the call, RunL() will be called with KErrNone

    So what happens if you pick up phone which you have dialed successfully, does it goes into RunL() under the call answering case?

  10. #10
    Registered User
    Join Date
    Oct 2009
    Posts
    16

    Re: No RunL after DialNewCall

    No, it doesn´t go into RunL() when you answer the call.

  11. #11
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,987

    Re: No RunL after DialNewCall

    show the code where you have instantited the Activescheduler

  12. #12
    Registered User
    Join Date
    Oct 2009
    Posts
    16

    Re: No RunL after DialNewCall

    I have solved the problem, as expected there were mistakes on my code. Now I use a CActiveSchedulerWait to have a better control. Now it goes into RunL() when the call is answered.
    The final code for call functions is this:

    Code:
    void CCallDialer::MakeCall(const TDesC& aNumber)
    	{	
    		if(IsActive())
    		{
    			Cancel(); 
    		} // Cancel any request, just to be sure
    		
    	    CTelephony::TTelNumber telNumber(aNumber);
    	 
    	    iCallParams.iIdRestrict = CTelephony::ESendMyId;
    	    LogWrite(_L("Making a call..."));
    	    callState = Dialing;
    	    iTelephony->DialNewCall(iStatus, iCallParamsPckg, telNumber, iCallId);
    	    SetActive();
    	    iActiveSchedulerWait.Start(); // Tell scheduler a request is active	    
    	}
    
    void CCallDialer::TerminateCall()
        {
        if(callState==Establish){
    		LogWrite(_L("Terminating an established call..."));
    		callState = HangingUp;
    		LogWriteFormat(_L("iCallId=%d"),iCallId);
        	iTelephony->Hangup(iStatus, iCallId);
        	SetActive();  
        	iActiveSchedulerWait.Start(); // Tell scheduler a request is active	    
        	}
        else if(callState==Dialing){
    		LogWrite(_L("Terminating an non established call..."));
    		Cancel();
    		}    
        }
    
    void CCallDialer::RunL()
    {	
    	LogWrite(_L("In CCallDialer::RunL()"));
    	if (iActiveSchedulerWait.IsStarted())
    	{
    		iActiveSchedulerWait.AsyncStop();
    		if(iStatus == KErrNone) // SUCCESS
    		{
    			if(callState==Dialing){
    				LogWrite(_L("Making a call... DONE"));
    				LogWriteFormat(_L("iCallId=%d"),iCallId);
    				callState = Establish;
    				iObserver.CallDialedL(iStatus.Int());
    			}
    			else if(callState==HangingUp){
    				LogWrite(_L("Terminating a call... DONE"));
    				callState = NoCallInProgress;
    				iObserver.CallHungUpL(iStatus.Int());
    			}
    		}
    		else
    		{
    			LogWrite(_L("ERROR performing the call."));
    		}
    	}
    }
    P.D.: I only call CActiveScheduler::Add(this) on the constructor.

    Thank you,
    Alex

  13. #13
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,987

    Re: No RunL after DialNewCall

    actually this the line , which if you doesn't mention, then you active scheduler won't get any callbacks:

    iActiveSchedulerWait.Start(); // Tell scheduler a request is active

  14. #14
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,987

    Re: No RunL after DialNewCall

    Also i hope you are doing the following:

    CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
    CleanupStack::PushL(scheduler);
    CActiveScheduler::Install(scheduler);

    & Then start it as well:

    scheduler->Start();

  15. #15
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: No RunL after DialNewCall

    Quote Originally Posted by yunert View Post
    I have solved the problem, as expected there were mistakes on my code. Now I use a CActiveSchedulerWait to have a better control. Now it goes into RunL() when the call is answered.
    The final code for call functions is this:

    P.D.: I only call CActiveScheduler::Add(this) on the constructor.

    Thank you,
    Alex
    I'd advise you to tackle the real issue instead of easy patches like the above. Your problem seems to indicate there is some error somewhere, and certainly using CActiveSchedulerWait is not the way to really fix it.

Similar Threads

  1. Replies: 106
    Last Post: 2009-05-11, 05:53
  2. Using DialNewCall being self signed
    By wirefree in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2007-08-12, 14:42
  3. Replies: 6
    Last Post: 2007-06-15, 09:16
  4. ActiveObject RunL is called just once
    By lskmao in forum Symbian
    Replies: 3
    Last Post: 2007-01-18, 15:15
  5. Replies: 2
    Last Post: 2006-08-30, 21:33

Posting Permissions

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