Aracılığıyla paylaş


Arama Alma

Aşağıdaki kod örneği, medyayı işlemek için uygun terminalleri bulma veya oluşturma gibi yeni çağrı bildirimlerinin işlenmesini gösterir. Bu örnek, bir uygulamanın olay işleme için uygulaması gereken switch deyiminin bir bölümüdür. Kodun kendisi ITTAPIEventNotification::Eventuygulamasında yer alabilir veya Olay yöntemi anahtarı içeren bir çalışan iş parçacığına ileti gönderebilir.

Bu kod örneğini kullanmadan önce, TAPIBaşlat AdresSeçme ve olayları kaydetme işlemlerini gerçekleştirmeniz gerekir.

Ayrıca, ITBasicCallControl alınıp ITAddressarabirim işaretçilerinisonra Terminal seçin bölümünde gösterilen işlemleri gerçekleştirmeniz gerekir.

Not

Bu örnekte hata denetimi yoktur ve üretim kodu için uygun sürümler vardır.

 

// 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. 
}

olayları

ITTAPIEventNotification

ITTAPI::RegisterCallNotifications

ITCallNotificationEvent

ITCallInfo

ITBasicCallControl

ITTerminalSupport