Why I can hear only one (calling) side using TAPI and H.323?

Discussion in 'VOIP' started by semaphore, Jun 18, 2009.

  1. semaphore

    semaphore

    Joined:
    Feb 24, 2009
    Messages:
    2
    Hello
    I am beginner in VOIP.I try to make simple calling and answering application.
    Here i face this problem -I can hear only one side(calling).

    Please check this following code.

    //Calling-Ip Calling Function
    gpAddress->CreateCall(bstr,LINEADDRESSTYPE_IPADDRESS,TAPIMEDIATYPE_AUDIO,&gpCall);
    hr=SelectTerminalsOnCall(gpCall);
    hr=gpCall->Connect(0);

    //Answer -I add Answer method in event.

    LRESULT CVOIPCallDlg::OnTAPIEvent(WPARAM wParam, LPARAM lParam)
    {
    CString csName;
    switch(wParam)
    {
    case TE_CALLNOTIFICATION:
    {
    AddLog("call notification event has occured");
    // Get the ITCallNotification interface.
    IDispatch* pEvent=(IDispatch *)lParam;
    <b>Answer(pEvent);</b>
    }
    break;
    case TE_CALLSTATE:
    ITCallStateEvent *a=(ITCallStateEvent *)lParam;
    ITCallInfo *b;
    if(a->get_Call(&b) != S_OK)
    AddLog("get_Call()",hr);

    CALL_STATE pCallState;

    if(a->get_State(&pCallState)!= S_OK)
    AddLog("get_State()",hr);

    switch(pCallState)
    {
    case CS_INPROGRESS:
    AddLog("dialing");
    break;
    case CS_CONNECTED:
    AddLog("Connected");
    break;
    case CS_DISCONNECTED:
    AddLog("Disconnected");
    break;
    case CS_OFFERING:
    AddLog("A party wants to communicate with you!");
    break;
    case CS_IDLE:
    AddLog("Call is created!");
    break;
    }
    break;
    }
    pEvent->Release();
    return 0;
    }
    LRESULT CVOIPCallDlg::Answer(IDispatch* pEvent)
    {
    HRESULT hr;
    ITCallNotificationEvent * pNotify;
    pEvent->QueryInterface( IID_ITCallNotificationEvent,(void **)&pNotify);
    ITCallInfo * pCallInfo;
    pNotify->get_Call(&pCallInfo);

    ITBasicCallControl * pBasicCall;
    hr = pCallInfo->QueryInterface(IID_ITBasicCallControl,(void**)&pBasicCall);

    hr = pCallInfo->get_Address(&gpAddress);
    ITStreamControl * pStreamControl;
    pBasicCall->QueryInterface(IID_ITStreamControl,(void **) &pStreamControl);

    IEnumStream * pEnumStreams;
    ITStream * pStream;
    hr = pStreamControl->EnumerateStreams(&pEnumStreams);
    pEnumStreams->Next(1, &pStream, NULL);
    long lMediaType;
    TERMINAL_DIRECTION dir;
    pStream->get_MediaType(&lMediaType);
    hr = pStream->get_Direction( &dir );
    ITTerminal * pTerminal;
    ITTerminalSupport * pTerminalSupport;

    gpAddress->QueryInterface(IID_ITTerminalSupport,(void **)&pTerminalSupport);

    hr = pTerminalSupport->GetDefaultStaticTerminal(lMediaType,dir,&pTerminal);
    hr = pStream->SelectTerminal(pTerminal);
    hr = pBasicCall->Answer();
    return hr;
    }

    Can you help me how it resolve.

    Thanks
    Mahendra
    semaphore, Jun 18, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. binand@gmail.com
    Replies:
    1
    Views:
    643
    Walter Roberson
    Dec 15, 2004
  2. Akarama

    ATAT 186, CallManager and TAPI

    Akarama, Feb 5, 2004, in forum: VOIP
    Replies:
    0
    Views:
    1,549
    Akarama
    Feb 5, 2004
  3. GwG
    Replies:
    7
    Views:
    1,030
    hairydog@despammed.com
    Dec 24, 2005
  4. estella aguilar

    hear ye, hear ye.help is needed.......

    estella aguilar, Aug 27, 2006, in forum: Digital Photography
    Replies:
    55
    Views:
    1,109
    estella aguilar via PhotoKB.com
    Sep 1, 2006
  5. Hermes
    Replies:
    0
    Views:
    396
    Hermes
    Mar 26, 2007
Loading...

Share This Page