Recuperando o número de chamada usando CTelephony
Dados do artigo
Exemplo de código
Código fonte: Media:RetrieveNumber.zip
Artigo
Tradução:
Originado de Getting call number with CTelephony
Por ivocalado
Última alteração feita por hamishwillee
em 16 Dec 2011
O seguinte trecho de código ilustra como recuperar o número do telefone remote tanto nas chamadas iniciadas pelo dispositivo como nas recebidas.
Cabeçalhos requeridos:
#include <Etel3rdParty.h>Bibliotecas requeridas:
LIBRARY Etel3rdParty.libCódigo-fonte:
TBuf<100> CallerNumber;
if(iCurrentStatus.iStatus == CTelephony::EStatusRinging
|| iCurrentStatus.iStatus == CTelephony::EStatusDialling)
{
CTelephony::TRemotePartyInfoV1 RemInfoUse;
CTelephony::TCallInfoV1 CallInfoUse;
CTelephony::TCallSelectionV1 CallSelectionUse;
CallSelectionUse.iLine = CTelephony::EVoiceLine;
CallSelectionUse.iSelect = CTelephony::EInProgressCall;
CTelephony::TRemotePartyInfoV1Pckg RemParty(RemInfoUse);
CTelephony::TCallInfoV1Pckg CallInfo(CallInfoUse);
CTelephony::TCallSelectionV1Pckg CallSelection(CallSelectionUse);
iTelephony->GetCallInfo(CallSelection,CallInfo,RemParty);
if(iCurrentStatus.iStatus == CTelephony::EStatusRinging)
{
CallerNumber.Copy(RemInfoUse.iRemoteNumber.iTelNumber);
}
else if(iCurrentStatus.iStatus == CTelephony::EStatusDialling)
{
CallerNumber.Copy(CallInfoUse.iDialledParty.iTelNumber);
}
}


(no comments yet)