×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Regular Contributor
    Join Date
    Mar 2008
    Location
    Bangalore, India
    Posts
    204

    Lightbulb Detecting OutGoing Call.

    Hi,
    I am developing a symbian application for detecting an outgoing call which is native phone outgoing call.
    My application will run background, when ever a outgoing voice call is made from phone, my application should detect and add additional digits to the dialed number and dial it again.
    for example,
    dialed no: 123456789
    my app should add : xyz to the number and dial it back
    so finally xyz123456789 is the no dialed.

    Here i dont know how to detect an outgoing call made from phone?
    is this is possible to do as specified above?

    Pls anyone help me in doing it.

    Thanks,
    Srivatsan.D

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

    Re: Detecting OutGoing Call.

    have a look into Wiki & SDK docs for API called CTelephony.

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

    Re: Detecting OutGoing Call.

    Hi,
    Check this link for CTelephony
    http://wiki.forum.nokia.com/index.ph...ith_CTelephony
    btw what is the SDK version you are working with.CTelephony is for 3.0 and onwards before that you will have to use class RCall.
    Maximus
    S60 Developer
    Impossible is nothing

  4. #4
    Regular Contributor
    Join Date
    Mar 2008
    Location
    Bangalore, India
    Posts
    204

    Re: Detecting OutGoing Call.

    Hi,
    Thanks for the reply.
    I am using s60 3rd edition device.

    is it possible to add digits to number dialed from phone and call back again by the application running in background?

    Thanks,
    Srivatsan

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

    Re: Detecting OutGoing Call.

    Not really, you would need to catch the number, then hang up the outgoing call, and then do a redial with the modified number.

  6. #6
    Regular Contributor
    Join Date
    Mar 2008
    Location
    Bangalore, India
    Posts
    204

    Re: Detecting OutGoing Call.

    Hi symbianyucca,
    Thanks for the reply.
    Can u please post any reference link / code for detecting a outgoing call?

    One more query .. after redialing the number, the control of the call will be with my application or phone red key will have it?

    Thanks,
    Srivatsan

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

    Re: Detecting OutGoing Call.

    Hi,
    Check out this link(I have already forwarded this link in previous reply)
    http://wiki.forum.nokia.com/index.ph...ith_CTelephony
    here you can listen to both incoming as well as outgoing call.
    After you have redialled the number from your application you can control the call but Red Key also has the control for the call which means if you press Red key it will still have its behaviour of disconnecting the call.
    Maximus
    S60 Developer
    Impossible is nothing

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

    Re: Detecting OutGoing Call.

    I think it would not take too long of your time to do a bit of searching in the Wiki. And for future purposes, it would be great if you would learn to search, since it can save days on any of the projects you would be doing.

  9. #9
    Regular Contributor
    Join Date
    Mar 2008
    Location
    Bangalore, India
    Posts
    204

    Re: Detecting OutGoing Call.

    Thanks all for the valuable information.

    Regards,
    Srivatsan

  10. #10
    Regular Contributor
    Join Date
    Mar 2008
    Location
    Bangalore, India
    Posts
    204

    Re: Detecting OutGoing Call.

    Hi yogpan,

    After redialing the number from my app running in background, it is possible to put call hold / resume / mute / add new call from the phone..
    I mean my application should become dummy in that case.

    number dialed from phone ------------------> modified number
    hang up add digits
    and redial and give
    control back to phone

    Thanks
    Srivatsan

  11. #11
    Regular Contributor
    Join Date
    Mar 2008
    Location
    Bangalore, India
    Posts
    204

    Re: Detecting OutGoing Call.

    Hi symbianyucca,

    Searching wiki i made an application which detects incoming and outgoing call.
    It notifies the incoming call by giving voice line status changed.
    But i am unable to detect outgoing call from the phone because to make call i have to close the app.

    How can i run the application in the back ground ? such that it can detect the call status and notify me for further proceedings.

    Please help me.

    Thanks,
    Srivatsan

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

    Re: Detecting OutGoing Call.

    Hi,
    I didnt understand why u need to close your app if you want to make an outgoing call from Phone. You can just put your application in background by Menu key and make a call from Telephony Idle where in which your application,which is running in the background, will detect it and will execute your required functionality. Is that not what your requriement is??
    Maximus
    S60 Developer
    Impossible is nothing

  13. #13
    Regular Contributor
    Join Date
    Mar 2008
    Location
    Bangalore, India
    Posts
    204

    Re: Detecting OutGoing Call.

    Hi yogpan,

    Ya you are right. Now i can detect the outgoing call and also the incoming call.

    But i dont know how to get the outgoing number in the application.
    My plan is to get the number, hang up the call, process the number and dial the modified number again.

    With this method i able to get the incoming number,

    void CCallMonitor::GetIncomingNumber()
    {
    CTelephony::TCallInfoV1Pckg callInfoV1Pckg(callInfoV1);
    CTelephony::TCallSelectionV1Pckg callSelectionV1Pckg(callSelectionV1);
    CTelephony::TRemotePartyInfoV1Pckg remotePartyInfoV1Pckg(remotePartyInfoV1);
    callSelectionV1.iLine = CTelephony::EVoiceLine;
    callSelectionV1.iSelect = CTelephony::EInProgressCall;

    // Get the call info
    User::LeaveIfError(iTelephony->GetCallInfo(callSelectionV1Pckg,
    callInfoV1Pckg, remotePartyInfoV1Pckg));
    aPhoneNumber.Copy(remotePartyInfoV1Pckg().iRemoteNumber.iTelNumber);

    iCallBack.WriteLog(aPhoneNumber);
    }

    But how can i get the number which is getting dialed.
    Please help me.

    Thanks,
    Srivatsan

  14. #14
    Regular Contributor
    Join Date
    Mar 2008
    Location
    Bangalore, India
    Posts
    204

    Re: Detecting OutGoing Call.

    Hi,

    I found a link in wiki for retrieving incoming and outgoing numbers.

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

    Thanks for all for providing me support.

    Thanks,
    Srivatsan

  15. #15
    Regular Contributor
    Join Date
    Mar 2008
    Location
    Bangalore, India
    Posts
    204

    Re: Detecting OutGoing Call.

    Hi,

    Now i can get the dialed number and modify it, and also hanged up the call initiated by phone.

    But i am unable to dial the modified number.

    This is the engine class.

    #include "CallMonitor.h"

    CCallMonitor::CCallMonitor(MCallCallBack& aCallBack) :
    CActive(0), iCallBack(aCallBack), iCurrentStatusPckg(iCurrentStatus),
    iCallSelectionPckg(iCallSelection)
    {
    }

    CCallMonitor::~CCallMonitor()
    {
    Cancel();
    delete iTelephony;
    }

    void CCallMonitor::ConstructL(void)
    {
    CActiveScheduler::Add(this);

    iTelephony = CTelephony::NewL();

    StartListening();
    }

    void CCallMonitor::CancelOperation(void)
    {
    Cancel();
    }

    void CCallMonitor:oCancel()
    {
    iTelephony->CancelAsync(CTelephony::EDialNewCallCancel);
    iTelephony->CancelAsync(CTelephony::EVoiceLineStatusChangeCancel);
    }

    void CCallMonitor::StartListening()
    {
    Cancel();
    iCurrentStatus.iStatus = CTelephony::EStatusUnknown;
    iTelephony->NotifyChange(iStatus, CTelephony::EVoiceLineStatusChange,iCurrentStatusPckg);
    SetActive();
    }

    void CCallMonitor::RunL()
    {
    iCallBack.CallStatusChangedL(iCurrentStatus.iStatus, iStatus.Int());

    // Check Call Status
    // if status is dialing , get the dialed no
    if (iCurrentStatus.iStatus == CTelephony::EStatusDialling)
    {
    _LIT8( KDialing, "*** Dialing ***");
    iCallBack.WriteLog(KDialing());
    //Getting dialed number
    GetNumber();
    // Hangup the outgoing call initiated by mobile.
    HangUpOnGoingCall();
    // Dialing new call
    // DialNewCall();
    }
    else
    if (iCurrentStatus.iStatus == CTelephony::EStatusRinging)
    {
    _LIT8( KDialing, "*** Ringing ***");
    iCallBack.WriteLog(KDialing());
    //Getting Incoming number
    GetNumber();
    }
    else
    if (iCurrentStatus.iStatus == CTelephony::EStatusConnected)
    {
    _LIT8( KDialing, "*** Connected ***");
    iCallBack.WriteLog(KDialing());
    }
    else
    if (iCurrentStatus.iStatus == CTelephony::EStatusConnecting)
    {
    _LIT8( KDialing, "*** Connecting ***");
    iCallBack.WriteLog(KDialing());
    }
    else
    if (iCurrentStatus.iStatus
    == CTelephony::EStatusDisconnecting)
    {
    _LIT8( KDialing, "*** DisConnecting ***");
    iCallBack.WriteLog(KDialing());
    }
    else
    {
    _LIT8( KDialing, "*** Unknown Event ***");
    iCallBack.WriteLog(KDialing());
    }

    if (iStatus != KErrCancel)
    {
    StartListening();
    }
    }

    void CCallMonitor::GetNumber()
    {
    CTelephony::TCallInfoV1Pckg callInfoV1Pckg(callInfoV1);
    CTelephony::TCallSelectionV1Pckg callSelectionV1Pckg(callSelectionV1);
    CTelephony::TRemotePartyInfoV1Pckg remotePartyInfoV1Pckg(remotePartyInfoV1);
    callSelectionV1.iLine = CTelephony::EVoiceLine;
    callSelectionV1.iSelect = CTelephony::EInProgressCall;

    // Get the call info
    User::LeaveIfError(iTelephony->GetCallInfo(callSelectionV1Pckg,
    callInfoV1Pckg, remotePartyInfoV1Pckg));

    if (remotePartyInfoV1.iRemoteIdStatus
    == CTelephony::ERemoteIdentityAvailable)
    {
    if (remotePartyInfoV1.iRemoteNumber.iTelNumber.Length() > 0)
    {
    // Incoming call number can be read from
    aPhoneNumber.Copy(remotePartyInfoV1.iRemoteNumber.iTelNumber);
    }
    }
    if (callInfoV1.iDialledParty.iTelNumber.Length() > 0)
    {
    // Outgoing call number can be read from
    aPhoneNumber.Copy(callInfoV1.iDialledParty.iTelNumber);
    }
    iCallBack.WriteLog(aPhoneNumber);
    }

    void CCallMonitor::HangUpOnGoingCall()
    {
    RWsSession ws;
    ws.Connect();
    TRawEvent ev1;
    ev1.Set(TRawEvent::EKeyDown, EStdKeyNo);
    ws.SimulateRawEvent(ev1);
    User::After(1000000);
    TRawEvent ev2;
    ev2.Set(TRawEvent::EKeyUp, EStdKeyNo);
    ws.SimulateRawEvent(ev2);
    ws.Close();
    }

    void CCallMonitor:ialNewCall()
    {
    TBuf<20> aPhone;
    aPhone.Append(_L("+91"));
    aPhone.Append(aPhoneNumber);

    CTelephony::TTelNumber telNumber(aPhone);

    CTelephony::TCallParamsV1 callParams;
    callParams.iIdRestrict = CTelephony::ESendMyId;
    CTelephony::TCallParamsV1Pckg callParamsPckg(callParams);

    iTelephony->DialNewCall(iStatus, callParamsPckg, telNumber, iCallId, CTelephony::EVoiceLine);
    }


    After call gets hanged up i am trying to dial the modified number, but exactly at this line
    iTelephony->DialNewCall(iStatus, callParamsPckg, telNumber, iCallId, CTelephony::EVoiceLine);

    the app gets crashed.

    Please anyone can help me.

    Thanks,
    Srivatsan

Similar Threads

  1. Replies: 3
    Last Post: 2008-02-13, 09:24
  2. Ending outgoing call using CTelephony?
    By go4jas in forum Symbian
    Replies: 13
    Last Post: 2007-09-13, 04:19
  3. Replies: 1
    Last Post: 2006-11-10, 08:09
  4. Hide call number when make outgoing call ,how to?
    By sibaschian in forum Symbian
    Replies: 1
    Last Post: 2006-10-30, 05:43
  5. Detecting Incoming call Activity.
    By Utk in forum Symbian
    Replies: 1
    Last Post: 2004-04-16, 14:03

Posting Permissions

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