views:

214

answers:

1

Hello, I am am new to mobile app development. But i would like to know if this is possible to intercept incoming calls on my N73 using code like Java or C++?

My second question is if this is possible then can we prevent the phone from ringing with a specified phone number from a black listed contact???

I've seen a lot of apps doing this task but i am interested in knowing if this is feasible & how this is accomplished.

Thanks in Advance.

+2  A: 

In C++ you can use CTelephony from etel3rdparty. Use NotifyChange() to subscribe to EVoiceLineStatusChange events. On an EStatusRinging event you can call GetCallInfo() to retrieve the remote party information, including phone number, and then decide whether to reject the call or let it keep ringing.

As far as I know, the CTelephony API does not have a direct method of rejecting a call but you can achieve almost the same with AnswerIncomingCall() followed by HangUp(). Your executable will need the NetworkServices capability.

A more hackish way to reject the call could be to use RWsSession to simulate pressing the red key (end key): call SimulateRawEvent() to send TRawEvent::EKeyDown and EKeyUp events on EStdKeyNo, with some delay between the events. In this case your executable will also need the SwEvent capability.

laalto
thx for the clear ) but is this possible with Java also?
Suraj
As far as I know, no, but since I wasn't sure, I did not include that in my answer.
laalto
OK thx between where can i find the 'etel3rdparty' dll? I cannot find it!
Suraj
It comes with the SDK. Include `etel3rdparty.h` (under epoc32/include), link against `etel3rdparty.lib` (under target-specific directory such as epoc32/release/winscw/udeb or epoc32/release/armv5/lib). Never mind the location, the toolchain will pick the right version for the target you are building for.
laalto
I can confirm that JavaME doesn't have a standard telephony API. Symbian OS C++ is the way to go here.
QuickRecipesOnSymbianOS
There's a big difference between rejecting a call and answering it then hanging up. In the first case the caller doesn't get diverted to voice mail and in the second case they do. Depends what you want!
Mark Wilcox