Developers guide

Chapter 22: Wireless Wide-Area Networking
Initializing Voice Over WWAN
Psion Teklogix Mobile Devices SDK Developers Guide 219
default:
break;
}
if ( (newFlags & VoiceCallFlags_LastEvent) != 0 )
{
// This voice call is finished. Its now safe to deallocate
// the VoiceCall object, instantiated earlier and referenced
// by changedCall).
//
}
}
};
static VoiceCallManager *callManager = NULL;
static MyVoiceCallManagerListener *incomingCall = NULL;
static CallListener *callStatus = NULL;
bool InitWwanVoiceApi()
{
// Initialize the WWAN namespace and wait for the driver/modem to be ready.
// (see previous example of this function at the beginning of WWAN API
// documentation).
if(InitializeWWANAndWait())
{
// Create an instance of the VoiceCallManager object
callManager = new VoiceCallManager();
// Create the listener
incomingCall = new MyVoiceCallManagerListener();
// Register for call manager events (Namely incoming call notification).
callManager->RegisterListener(*incomingCall);
// Create a listener for phone calls (general).
callStatus = new CallListener();
// The PsionTeklogix WWAN UI application will generate notifications to
// the user about incoming voice calls. To suppress the notifications
// the following access flag should be set. (works on WWAN UI versions
// 1.10047 and later)
DWORD currentAccessFlags = 0;
WirelessWAN::GetCurrentAccessFlags(currentAccessFlags);
currentAccessFlags |= AccessFlags_SuppressCallNotifications;
WirelessWAN::SetCurrentAccessFlags(currentAccessFlags);
return true;
}
return false;
}
Example 22.14 Initializing Voice Over WWAN In C++ (Continued)