×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    269

    How to check call status in symbian 2nd edition

    Hi all,

    I am trying to track the status of a call. Means if i am calling a number then my will application will show, the line is connecting, dialling, terminated all this thing.

    I started working on it. I found some post like

    http://wiki.forum.nokia.com/index.php/Call_Handling

    But not getting how can i know that i am calling a number. Please guide me, how can i get the status of the call, from dialling till the termination of the call.

    With regards,
    Santu
    Last edited by santu.paul@gmail.com; 2008-10-16 at 12:54.

  2. #2
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: How to check call status in symbian 2nd edition

    Hi,
    Well you have found the right example from wiki.
    You can have an active object which is listening for the line status continuously now once you get the notification that there is a call either dialing or incoming then you can open call handler for that call and monitor that call through another active object using the RCall class and API like NotifyStatusChange().
    Maximus
    S60 Developer
    Impossible is nothing

  3. #3
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    269

    Re: How to check call status in symbian 2nd edition

    Hi yogpan,

    Thanks for your quick reply. You mean to say, i have to track that i am calling, from a thread. And then i have to check the status from another thread. That i got. Can you please tell me how can i know that the call ended.

    I only know i have to use RCall::NotifyStatusChange, but cant getting how to use it. Is there any checking value like EStatusDialling, EStatusConnected.

    With regards,
    santu

  4. #4
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: How to check call status in symbian 2nd edition

    Hi,
    NotifyStatusChange() is an asynchronous call so everytime the call status changes suppose from Ringing to Connected or from Connected to disconnecting it will invoke RunL where you can get the status from the member variable TCallStatus that you have passed in NotifyStatusChange() and in RunL() again you have to start listening for next status change in call like
    Code:
    void CClass::RunL()
    {
    if(iStatus == KErrNone)
     {
     switch(iCallStatus)
     {
     case RCall::ERinging:
     ....
     case RCall::EConnected:
     ....
     case RCall::EDisconnecting:
     ....
     case RCall::EDisconnected:
     ....
    
     }
    iCall.NotifyStatusChange(iStatus, iCallStatus);
    SetActive();
    }
    Maximus
    S60 Developer
    Impossible is nothing

  5. #5
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    269

    Re: How to check call status in symbian 2nd edition

    Hi yogpan,

    There is nothing like EDisconnecting and EDisconnected. So how can i know the call ended? Any idea please tell me.

    With regards,
    Santu

  6. #6
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: How to check call status in symbian 2nd edition

    Hi,
    I am sorry for the wrong enums in place of that there are
    EStatusHangingUp and EStatusIdle.
    In case the call is disconnected your call listener will give status as EStatusHangingUp and then EStatusIdle.Try this out. For more information you need to use etel.h
    Maximus
    S60 Developer
    Impossible is nothing

  7. #7
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    269

    Re: How to check call status in symbian 2nd edition

    Its ok Yogpan... I am trying to get the status of the call..

    CODE:

    #include "DropCall.h"
    #include <f32file.h>
    _LIT(KTSY,"phonetsy");
    DropCall* DropCall::NewLC()
    {
    DropCall* self = new (ELeave) DropCall();
    CleanupStack::PushL(self);
    self->ConstructL();
    return self;
    }
    DropCall* DropCall::NewL()
    {
    DropCall* self = DropCall::NewLC();
    CleanupStack::Pop(self);
    return self;
    }
    void DropCall::ConstructL()
    {
    TInt numberPhones = 0;
    User::LeaveIfError(iSession.Connect());
    // load the appropriate tsy
    User::LeaveIfError(iSession.LoadPhoneModule(KTSY));
    User::LeaveIfError(iSession.EnumeratePhones(numberPhones));
    if (!numberPhones)
    {
    User::Leave(KErrNotFound);
    }
    // use the 1st available phone
    RTelServer::TPhoneInfo phoneInfo;
    User::LeaveIfError(iSession.GetPhoneInfo(0, phoneInfo));
    User::LeaveIfError(iPhone.Open(iSession, phoneInfo.iName));
    TInt numberLines = 0;
    User::LeaveIfError(iPhone.EnumerateLines(numberLines));
    RPhone::TLineInfo lineInfo;
    TBool foundLine = EFalse;
    for (TInt a = 0; a < numberLines; a++)
    {
    User::LeaveIfError(iPhone.GetLineInfo(a, lineInfo));
    if (lineInfo.iLineCapsFlags & RLine::KCapsVoice)
    {
    foundLine = ETrue;
    break;
    }
    }
    if (!foundLine)
    {
    User::Leave(KErrNotFound);
    }
    User::LeaveIfError(iLine.Open(iPhone, lineInfo.iName));
    }
    DropCall:ropCall():CActive(CActive::EPriorityStandard)
    {
    CActiveScheduler::Add(this);
    CheckStatus();
    }
    DropCall::~DropCall()
    {
    Cancel();
    iCall.NotifyCapsChangeCancel();
    }
    void DropCall::RunL()
    {
    if(iCallStatus == RCall::EStatusIdle)
    {
    SetActive();
    }
    else if (iCallStatus == RCall::EStatusDialling)
    {
    SetActive();
    }
    else if(iCallStatus == RCall::EStatusConnecting)
    {
    SetActive();
    }
    else if(iCallStatus == RCall::EStatusConnected)
    {
    SetActive();
    }
    else if(iCallStatus == RCall::EStatusHangingUp)
    {
    CActiveScheduler::Stop();
    }
    }
    void DropCall:oCancel()
    {
    Cancel();
    }
    TInt DropCall::RunError(TInt aError)
    {
    return aError;
    }
    void DropCall::CheckStatus()
    {
    iCall.NotifyStatusChange(iStatus, iCallStatus);
    SetActive();
    }

    When i am trying to call a number, checking the logclient i call the function CheckStatus.. But my application crash here. Can you please help me to find out where i am doing wrong.

    With regards,
    Santu

  8. #8
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: How to check call status in symbian 2nd edition

    Hi,
    It is crashing because you dont have a vaild iCall handler with you yet,
    See first you need to listen for the line usign RLine object then once you get that there is a call then you have to open the handler (iCall) for that call. Now using that iCall handler you can start listening for that call using iCall.NotifyStatusChange().
    Did you get my point, in case of any problem mention it.
    Maximus
    S60 Developer
    Impossible is nothing

  9. #9
    Registered User
    Join Date
    Jun 2006
    Location
    Lahore, Pakistan
    Posts
    162

    Re: How to check call status in symbian 2nd edition

    Actually problem is not with the iLine intiialization, the problem is with your RUNL code , you are calling SetActive() at wrong place,

    void DropCall::RunL()
    {

    if(iCallStatus == RCall::EStatusIdle)
    {

    }
    else if (iCallStatus == RCall::EStatusDialling)
    {

    }
    else if(iCallStatus == RCall::EStatusConnecting)
    {

    }
    else if(iCallStatus == RCall::EStatusConnected)
    {

    }
    else if(iCallStatus == RCall::EStatusHangingUp)
    {

    }

    CheckStatus();
    }
    Sajid Iqbal
    ASD, Accredited S60 Developer
    [EMAIL]saji.iq@gmail.com[/EMAIL]

  10. #10
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    269

    Re: How to check call status in symbian 2nd edition

    Hi saji_iq, the problem is not there where you told. I tried as you told but its the same.

    With Regards,
    santu

  11. #11
    Regular Contributor
    Join Date
    Feb 2008
    Posts
    269

    Re: How to check call status in symbian 2nd edition

    Hi yogpan, i am not getting anything. Can you please explain it with some code. Eagerly waiting for your reply.

    With regards,
    Santu

  12. #12
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: How to check call status in symbian 2nd edition

    Hi,
    Lets start by listening for a new call.
    Have one active object listening for a new call whether outgoing/incoming.
    iLine.NotifyCallAdded(iStatus,iCallName);
    SetActive()
    once it hits RunL()
    then iCallName will be filled.Using this iCallName open a new RCall handle
    using iCall.OpenExistingCall(icallName); in a separate active object
    and start listening on this handler
    by
    iCall.NotifyStatusChange(iStatus, iCallStatus);
    SetActive();
    Maximus
    S60 Developer
    Impossible is nothing

  13. #13
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    416

    Re: How to check call status in symbian 2nd edition

    Quote Originally Posted by santu.paul@gmail.com View Post
    Hi yogpan, i am not getting anything. Can you please explain it with some code. Eagerly waiting for your reply.

    With regards,
    Santu
    Hello santu.paul,

    can you drop here startL, runL methods for both call managing class and the line managing class? I'm trying to catch a call and hang it up before it does any sound but still there is a detail I have omitted or so. I have followed the thread here.

  14. #14
    Regular Contributor
    Join Date
    Dec 2006
    Location
    Noida, India
    Posts
    115

    Re: How to check call status in symbian 2nd edition

    Hi,


    Please use this example. You can also extract the header and class file form there.

    http://www.forum.nokia.com/info/sw.n..._v1_0.zip.html
    Thanks and Regards,
    Ravi

Similar Threads

  1. Replies: 7
    Last Post: 2008-07-30, 15:14
  2. Porting call recorder example from 2nd to 3rd edition
    By narabe in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2008-07-24, 19:04
  3. S60 2nd OR 3rd edition for new software development
    By patil_ruturaj in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2006-06-30, 09:30
  4. S60 2nd OR 3rd edition for new software development
    By patil_ruturaj in forum Mobile Java Tools & SDKs
    Replies: 3
    Last Post: 2006-06-30, 08:57

Posting Permissions

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