Developers guide

Chapter 22: Wireless Wide-Area Networking
Making A Phone Call
Psion Teklogix Mobile Devices SDK Developers Guide 221
DialNumber returns a VoiceCall object in dialing state. Continue as follows:
1. Create a new object, to ensure persistence, by passing this VoiceCall object to a
copy constructor. This is necessary if this call is within a Windows procedure.
2. Immediately, use RegisterListener to register a listener to monitor the state of the phone
call. See “Voice Call States” on page 222
for definitions.
Example 22.17 C++ Voice Call Listener
class CallListener : public VoiceCall::Listener
{
public:
void OnStatusChangedEvent(VoiceCall &changedCall,
VoiceCallStatus newStatus,
VoiceCallFlags newFlags)
{
switch(newStatus)
{
case VoiceCallStatus_Active:
break;
case VoiceCallStatus_Held:
break;
case VoiceCallStatus_Dialing:
break;
case VoiceCallStatus_Alerting:
break;
case VoiceCallStatus_Incoming:
break;
case VoiceCallStatus_Waiting:
break;
case VoiceCallStatus_NoAnswer:
break;
case VoiceCallStatus_NoCarrier:
break;
case VoiceCallStatus_Busy:
break;
case VoiceCallStatus_SupplementaryAccepted:
break;
case VoiceCallStatus_NormalTermination:
break;
default:
break;
}
if ( (newFlags & VoiceCallFlags_LastEvent) != 0 )
{
//
// This voice call is finished. Its now safe to deallocate
// the VoiceCall object you instantiated earlier ( referenced
// by changedCall).
//
}
}
};