
Chapter 19: Wireless Wide-Area Networking
Closing Voice Over WWAN
Psion Mobile Devices Developers Guide
218
19.13.3 Closing Voice Over WWAN
The following steps close voice over WWAN:
1. Free all allocated resources.
2. If the application has been controlling the call notifications, return control to the GUI applet. See
Section 19.8 Access Flags on page 211 for details.
3. Call Shutdown.
19.13.4 Making a Phone Call
Use DialNumber to initiate a phone call.
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 Section 19.13.5 Voice Call States on page 219 for definitions.
void DeInitWwanVoiceApi()
{
if (callManager != NULL)
{
// make sure there are no active voice calls since you will lose
// control of them after deleting the objects.
callManager->HangUpAll();
delete callManager;
callManager = NULL;
}
// Delete the VoiceCallManager object before the listener, or deregister
// the listener object first (just in case an event is generated).
if (incomingCall != NULL)
{
delete incomingCall;
incomingCall = NULL;
}
// Re-enable the WWAN UI notifications:
DWORD currentAccessFlags = 0;
WirelessWAN::GetCurrentAccessFlags(currentAccessFlags);
currentAccessFlags &= ~AccessFlags_SuppressCallNotifications;
WirelessWAN::SetCurrentAccessFlags(currentAccessFlags);
// Shutdown WWAN namespace (assuming no other code is using it)
WirelessWAN::Shutdown();
}
// NOTE: GetComboEntry is NOT part of the Mobile Devices SDK WWAN API, but is a
// fictional function designed to get a Phonebook entry object
// from a fictional combo box.
PhonebookEntry *entry = GetComboEntry();
VoiceCall *newCall = new VoiceCall(VoiceCall::DialNumber(entry->GetPhoneNumber()));
newCall->RegisterListener(*callStatus);
class CallListener : public VoiceCall::Listener
{
public:
void OnStatusChangedEvent(VoiceCall &changedCall,
VoiceCallStatus newStatus,
VoiceCallFlags newFlags)
{
Kommentare zu diesen Handbüchern