End Call Event
Hi,
Is there a way for an application running on a smartphone (ex: SMT5600) to get a callback when a call ends? I would like to write the code in C#, but if I need to I would be happy to use C++. Any advice would be appreciated.
thanks,
Jake
You can do this using the State and Notification Broker APIs in Windows Mobile 5.0, but unfortunately there's no simple way to do this in earlier releases. You can probably find some sort of TAPI call that will do the trick, but you'll have to do it in C++ and it'll be messy.
Neil
Hi, I am looking for this event (using the SNAPI) but I couldn't find it in the SystemProperty.. what is the name of the 'call end' event...?
thank's
Oren
State and Notification broker provide notifications when properties (states) change. All you need to do is to monitor the changes of the PhoneCallTalking bit in the Phone/Status
Hi,
It's possible too if you use RIL for this notification!
What .NET language you are using ? I can help with managed C# Wrapper for RIL
Regards
Tihomir Ignatov
Hi Alex, as I understood, I have callback to the incoming call event (and just for that..).
my construction in my test app looks like this:
SystemState incomingCall = new SystemState(SystemProperty.PhoneIncomingCall, true);
incomingCall.Changed += new ChangeEventHandler(incomingCall_Changed);
and I noticed that the function 'incomingCall_Changed' is call only once before the incoming call.
the PhoneCallTalking property that u mention, how do I now if the device in an active call?
is the currentValue of the property have some special vale?
Tihomir, I use the c# with native, but I can do porting from VB or others langue’s.. :)I don't now what’s RIL is.. :S
I will now go to google it.
Thank's guys!
after few tests, I understand how to be notified via callbacks about any changes.
my question is if there is a way to check the value of the property and from that to know if I am in an active call.
also, I want to knwo when the call is over, the callback is calling but with the same systemProperty as PhoneIncomingCall... :S
I thought that SystemState.CurrentValue will give me the answer, but every time I get a different value…
any thought, answers will be more than appricate… J
What are the values you are getting from reading the property? Keep in mind that it is a bitmask, e.g. for Phone incoming call the property is the registry value at HKLM\System\State\Phone\Status and the mask is 0x10000
Hi Alex, the values I get from SystemProperty.PhoneCallTalking in the callback function is systemState.CurrentValue = 1051296, I get the same value for incoming call and for end of call (also for OnHold).
also, as I understand from you I have to mask it in order to get the first bit,does the first bit that in this registry entry point me to the state of the line? (1 == on call, 0 == !OnCall or vice versa)
This value (1051296) is Hex 100AA0 which means the following state bits:
PhoneGprsCoverage
PhoneMissedCall
PhoneRoaming
PhoneLine1Selected
PhoneRadioPresent
Could you post a snippet of your code?
sorry if my next question sounds something obviously , but I didn’t understood how to retrieved those stats from the hex result, if for example I transfer this hex to binary data.. how did you know those parameters?
--8<-
// here I register my app for state changes
private void SystemStateRegister()
{
systemState = new SystemState(SystemProperty.PhoneIncomingCall);
systemState.Changed += new ChangeEventHandler(SystemState_Changed);
}
// the callback function, called when one of the states we register to has been change
private void SystemState_Changed(object sender, ChangeEventArgs args)
{
SystemState state = (SystemState)sender;
switch (state.Property)
{
case SystemProperty.PhoneIncomingCall:
DoSomething();
break;
default:
break;
}
}
--8<-
thanks a lot J
oren