Rejecting call with RCall::HangUp doesn't work

Login to reply to this topic.
Mon, 2008-06-23 14:47
Joined: 2008-06-23
Forum posts: 85

Hi,

I have recently been up to reject incoming calls (S60 3rd FP1). First I was playing with CTelephony but I wasn't quite satisfied with the first-answer-then-hangup way it offers so I tried using the ETEL API for rejection parallelly with CTelephony for other tasks. Here is an excerpt of the code:

void CFooBar::RejectL()
    {
    if ( iCallStatus == CTelephony::EStatusRinging )
        {
        User::LeaveIfError(iTelServer.Connect());
        RTelServer::TPhoneInfo phoneInfo;
        User::LeaveIfError(iTelServer.GetPhoneInfo(0, phoneInfo));

        User::LeaveIfError(iPhone.Open(iTelServer, phoneInfo.iName));
        RPhone::TLineInfo lineInfo;
        User::LeaveIfError(iPhone.GetLineInfo(0, lineInfo));

        User::LeaveIfError(iLine.Open(iPhone, lineInfo.iName));
        RLine::TCallInfo callInfo;
        User::LeaveIfError(iLine.GetCallInfo(0,callInfo));

        User::LeaveIfError( iIncomingCall.OpenExistingCall( iLine, callInfo.iCallName) );
        User::LeaveIfError( iIncomingCall.HangUp() );

        iIncomingCall.Close();
        iLine.Close();
        iPhone.Close();
        iTelServer.Close();
        }
    }

The scenario is the following: an incoming call arrives at this phone, the call enters CTelephony::EStatusRinging state, we are notified of the call status change, finally RejectL() is called.

What here happens is somewhat strange: although the function returns (i.e. does not leave), it does so with an exactly 10-second delay. Same is true if I use the asynchronous RCall::HangUp(). But what I like less is that the call is not terminated. There isn't any notification about call status change either.

My questions are:
- Can I use both CTelephony and ETEL APIs at the same time?
- What can be the cause of this 10-second delay?
- Why isn't the call hung up?

Thanks a lot in advance.
Br


Thu, 2008-06-26 07:58
Joined: 2008-06-23
Forum posts: 85
Re: Rejecting call with RCall::HangUp doesn't work

Update: finally I managed to reject the call without having to answer it first. The problem was that I tried to HangUp() a call name other than that of the actual incoming call. So if you want to spare some hours in vain, always open a new RCall handle to RLine::TLineInfo::iNameOfCallForAnswering! (and don't forget to do an RCall::Close() just before, otherwise it crashes...)

Thu, 2008-06-26 11:17
Joined: 2008-06-26
Forum posts: 1
Re: Rejecting call with RCall::HangUp doesn't work

Hi Ivsti,
I am having same problem trying to hangup an outgoing call. Can you please show us some sample codes on how you manage to fix this problem?

Thanks
Aires

Fri, 2008-06-27 07:01
Joined: 2008-06-23
Forum posts: 85
Re: Rejecting call with RCall::HangUp doesn't work

Well, it depends on whether you are the originator of the call and which API you are using...

  • Login to reply to this topic.