Nota
O acesso a esta página requer autorização. Podes tentar iniciar sessão ou mudar de diretório.
O acesso a esta página requer autorização. Podes tentar mudar de diretório.
O exemplo de código a seguir demonstra a manipulação de novas notificações de chamada, como localizar ou criar terminais apropriados para renderizar a mídia. Este exemplo é uma parte da instrução switch que um aplicativo deve implementar para manipulação de eventos. O código em si pode estar contido na implementação do ITTAPIEventNotification::Eventou o método Event pode postar uma mensagem em um thread de trabalho que contém a opção.
Antes de usar este exemplo de código, você deve executar as operações em Initialize TAPI, Select an Addresse Register Events.
Além disso, você deve executar as operações ilustradas em Selecione um Terminal após a recuperação doITBasicCallControle ponteiros de interface ITAddress.
Observação
Este exemplo não tem a verificação de erros e liberações apropriadas para o código de produção.
// pEvent is an IDispatch pointer for the ITCallNotificationEvent interface of the
// call object created by TAPI, and is passed into the event handler by TAPI.
case TE_CALLNOTIFICATION:
{
// Get the ITCallNotification interface.
ITCallNotificationEvent * pNotify;
hr = pEvent->QueryInterface(
IID_ITCallNotificationEvent,
(void **)&pNotify
);
// If ( hr != S_OK ) process the error here.
// Get the ITCallInfo interface.
ITCallInfo * pCallInfo;
hr = pNotify->get_Call( &pCallInfo);
// If ( hr != S_OK ) process the error here.
// Get the ITBasicCallControl interface.
ITBasicCallControl * pBasicCall;
hr = pCallInfo->QueryInterface(
IID_ITBasicCallControl,
(void**)&pBasicCall
);
// If ( hr != S_OK ) process the error here.
// Get the ITAddress interface.
ITAddress * pAddress;
hr = pCallInfo->get_Address( &pAddress );
// If ( hr != S_OK ) process the error here.
// Create the required terminals for this call.
{
// See the Select a Terminal code example.
}
// Complete incoming call processing.
hr = pBasicCall->Answer();
// If ( hr != S_OK ) process the error here.
}
Tópicos relacionados