×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Ending the incoming call from my application

    Hi,

    I have tried out the all of the following :-

    TRawEvent ev1;
    ev1.Set(TRawEvent::EKeyDown, EStdKeyNo);
    UserSvr::AddEvent(ev1); // SwEvent

    User::After(90000);
    UserSvr::AddEvent(ev1); // SwEvent

    User::After(90000);
    UserSvr::AddEvent(ev1); // SwEvent

    TRawEvent ev2;
    ev2.Set(TRawEvent::EKeyUp, EStdKeyNo);
    UserSvr::AddEvent(ev2); // SwEvent*/

    Then this ------

    //sending keydown event event
    TRawEvent ev3;
    ev1.Set(TRawEvent::EKeyDown, EStdKeyNo );
    err = UserSvr::AddEvent(ev3);

    //Sending keyup event event
    TRawEvent ev4;
    ev2.Set(TRawEvent::EKeyUp, EStdKeyNo );
    err = UserSvr::AddEvent(ev4);

    Then This-------------

    RWsSession& wsSession=iCoeEnv->WsSession();
    TKeyEvent keyEvent;
    keyEvent.iCode = EKeyNo; // member of TKeyCode
    keyEvent.iScanCode = EKeyNo;
    keyEvent.iModifiers = 0;
    keyEvent.iRepeats = 0;
    wsSession.SimulateKeyEvent(keyEvent);
    wsSession.Flush();

    And lastly this----------

    const TUid KPhoneAppUid = { 0x100058B3 };
    TApaTaskList tlist(iEikonEnv->WsSession());
    TApaTask app(tlist.FindApp(KPhoneAppUid));

    // send a keypress to the phone app
    if (app.Exists())
    {
    TKeyEvent keyEvent;
    keyEvent.iCode = EKeyNo; // member of TKeyCode
    keyEvent.iScanCode = EKeyNo;
    keyEvent.iModifiers = 0;
    keyEvent.iRepeats = 0;
    app.SendKey(keyEvent);
    }

    To hangup the call from my application directly without accepting the call..i mean i just want to send the red key to the phone app..so that the call gets DC..but none of them seem to be working..

    I have the NetworkServices and SwEvent capability..and my test device is Nokia E61(S60 3rd Edition).

    I know that CTelephony Hangup wont work as for that i need to be the owner of the call..!

    Can someone please tell me what i am missing out here to end the call..?

    Cheers
    mayank

  2. #2
    Registered User
    Join Date
    Mar 2007
    Posts
    32

    Re: Ending the incoming call from my application

    hi,
    try the following code , it worked for me.....

    Simulation of Red Key Press:

    include the following header file
    #include <e32event.h>

    code:
    TRawEvent lEventDown;
    lEventDown.Set(TRawEvent::EKeyDown, EStdKeyNo);
    UserSvr::AddEvent(lEventDown);
    User::After(100000);
    TRawEvent lEventUp;
    lEventUp.Set(TRawEvent::EKeyUp, EStdKeyNo);
    UserSvr::AddEvent(lEventUp);

    regards,
    vijay

  3. #3
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: Ending the incoming call from my application

    So you call this code from your program when u get notification for an incoming call..?

    Did it work for you on a S60 3rd Edition device..?

    Cheers
    mayank

  4. #4
    Registered User
    Join Date
    Mar 2007
    Posts
    32

    Re: Ending the incoming call from my application

    So you call this code from your program when u get notification for an incoming call..?
    *yeah,l am calling this code in the RunL() of my app for a particular status ("Ringing" or when attended the call ("Connected") based on the requirement)


    Did it work for you on a S60 3rd Edition device..?
    *yes, it worked on s60 3rd Edition devices ( i tested it on E60)

    regards,
    vijay

  5. #5
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: Ending the incoming call from my application

    Cool this works..my mistake earlier..coz in the codebase i had..i was also capturing the keys..and since i forgot to cancel the capture keys when my app comes to the foreground..i end up consuming the keys even when there is a key simulation..due to which the key doesnt get passed on to the phone app..!

    Thanks for your help buddy..

    cheers
    mayank

  6. #6
    Super Contributor
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: Ending the incoming call from my application

    Thanks, too.

    included:

    #include <e32event.h>
    #include <e32keys.h>
    #include <e32svr.h>


    & SwEvent


    are needed!

  7. #7
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,079

    Re: Ending the incoming call from my application

    hi, i am also facing the same issue, the following code is not working on S60 3rd FP2 devices, but it works fine for MR,FP1 & 5th edition as well.

    TRawEvent lEventDown;
    lEventDown.Set(TRawEvent::EKeyDown, EStdKeyNo);
    UserSvr::AddEvent(lEventDown);
    User::After(100000);
    TRawEvent lEventUp;
    lEventUp.Set(TRawEvent::EKeyUp, EStdKeyNo);
    UserSvr::AddEvent(lEventUp);

    is this some known issue or what.I have found one link regarding an issue of non capturing of key on FP2 devices:

    http://wiki.forum.nokia.com/index.ph...d_Edition,_FP2

    but is this true for simulation also? if yes then is there any work out for it?

    I have tried the ways mentioned in this thread but none of them seems to be working

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

    Re: Ending the incoming call from my application

    in general the key simulations are workaround, that is not really reliable way on doing the hangup. Better way would be to use some actual API that can do the hangup, and AFAIK AT commands would work with all platform versions.

  9. #9
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: Ending the incoming call from my application

    You should try looking up RCall:Hangup, here http://wiki.forum.nokia.com/index.ph..._RCall::HangUp

    or as Yucca pointed out even an AT command like http://www.newlc.com/en/topic-13421.

    Either of them should do the job.
    Cheers,
    Mayank

Similar Threads

  1. Bring App to foreground on incoming call
    By ag24master in forum Symbian
    Replies: 3
    Last Post: 2006-06-30, 13:00
  2. Replies: 1
    Last Post: 2005-12-01, 23:57
  3. Some of the importatnt link for Incoming Call related queries
    By umesh.roy in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-01-25, 10:27
  4. Replies: 1
    Last Post: 2005-01-21, 08:04
  5. Incoming call, 7650 and iPAQ
    By paller in forum Bluetooth Technology
    Replies: 0
    Last Post: 2003-03-19, 08:14

Posting Permissions

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