
Chapter 19: Wireless Wide-Area Networking
Receiving a Phone Call
221
Psion Mobile Devices Developers Guide
Supplementary Accepted
Applies to: outgoing calls
Supplementary services can be configured using codes entered on the keypad of a telephone. These codes
are numerals preceded by *#. An application can insert these codes into a dialing string. This status indi-
cates that the network accepted one of these codes.
For a list of supplementary services see Section 19.12 WWAN Supplementary Services on page 214. For a list
of codes, consult your network provider.
Normal Termination
Applies to: incoming, and outgoing, calls
The voice call terminated. This is returned by any call where the modem detects that a call, that has been
active, no longer exists.
19.13.6 Receiving a Phone Call
The VoiceCallManager object is responsible for answering incoming phone calls through the listener that
was registered during initialization—see Section 19.13.2 Initializing Voice Over WWAN on page 216 for details.
An incoming call generates an incoming call event that is processed by the VoiceCallManager object.
The following example shows how to receive incoming phone calls:
1. Play a ring tone.
2. Ask if the user wants to answer the call—includes displaying the caller ID of the incoming
phone call.
3. Either activate the incoming call or reject it.
class MyVoiceCallManagerListener : public VoiceCallManager::Listener
{
public:
// OnIncomingCallEvent
//
// Description:
// This method is invoked by a VoiceCallManager object when there is an incoming
// voice call (including waiting calls). A MessageBox is then displayed asking the
// user if the call should be answered. The new status is displayed in the event
// window in the dialog.
//
// Parameters:
// incomingCall - The new incoming call.
void OnIncomingCallEvent(VoiceCall incomingCall)
{
//
// Instantiate a new VoiceCall object, and register a listner.
// The listener is responsible for determining when/how to
// free up this memory.
//
VoiceCall *newCall = new VoiceCall(incomingCall);
newCall->RegisterListener(*callStatus);
try
{
try
{
// Play a ring tone to notify the user of an incoming call.
// From PsionTeklogix::Sound namespace.
PlayRepeatingWave(std::wstring(L"\\windows\\ring.wav"), 3000 );
}
catch(std::runtime_error ex)
{
/* unable to play the ringtone, does the file exist? */
}
// Ask the user if they want to answer the call.
WCHAR messageBuffer[1024];
wsprintf(messageBuffer,
Comentarios a estos manuales