Developers guide

Chapter 22: Wireless Wide-Area Networking
Processing Voice Calls
Psion Teklogix Mobile Devices SDK Developers Guide 225
22.12.7 Processing Voice Calls
This section outlines the voice call states.
Incoming Call
An incoming call generates a VoiceCallManager incoming call event with a voice call state of
Incoming if it is the only call being received.
Call Waiting
Call waiting must be available from the WWAN network provider and enabled on the
Psion Teklogix computer before an incoming call can be placed in this state. Use
GetCallWaitingEnabled to check this status. If call waiting is not already enabled, use
SetCallWaitingEnabled to enable call waiting.
An incoming call generates a VoiceCallManager incoming call event with a voice call state of
Call waiting if another call is in the voice call state of Active. There can be only one call at a time
in the call waiting state.
Placing The Active Call On Hold And Answering The Waiting Call
If there is an active call, use AnswerIncoming to place the active call on hold, and to answer the
waiting call.
incomingCall.GetOtherPartyCallerId().c_str());
// Please note: It is not recomended that you block this thread,
// the next event will not be received untill this handler returns.
// This blocking message box is here to keep this demo app simple.
int rc = MessageBox(0, messageBuffer, L"Incoming Call",
(MB_YESNOCANCEL | MB_TOPMOST | MB_SETFOREGROUND));
// The user responded, don't need to play the ring tone any more.
// From the PsionTeklogix::Sound namespace.
StopRepeatingWave();
if (rc == IDYES)
{
// answer the incoming call
incomingCall.AnswerIncoming();
}
else if (rc == IDNO)
{
// reject the incoming call
incomingCall.RejectIncoming();
}
else
{
// call was ignored
}
}
catch(std::runtime_error&)
{
// If we are here, the call was probably terminated before the user resp
onded
// to the messagebox, the object is no longer valid.
}
}
};
Example 22.18 Answering a Phone Call in C++ (Continued)