Welcome to

Welcome to!

This site was created as a place to share stories, tips, and troubleshooting help with ShoreTel/Mitel systems. ShoreTel/Mitel is obviously the MOST exciting VoiP platform on the market right now, and we realized there was no centralized place to discuss this platform, but now there is. Please feel free to join and share your experiences.

Please Note: This site IS NOT owned, funded, or managed by ShoreTel/Mitel, Inc. although you may find ShoreTel/Mitel employees sharing there experiences and expertise. If you would like more information on ShoreTel/Mitel systems, contact BTX at [email protected]

As always please support the advertisers that help support our site.

Thank You,
See more
See less
  • Filter
  • Time
  • Show
Clear All
new posts

  • ShoreTel Call Recording using TAPI 2 WAV

    Dear All,

    I am trying to do call recording on ShoreTel 9.2 Build 14.41.1108.0 and need help. lineDevSpecific(...) works fine and return positive number but getting the LINEERR_INVALCALLHANDLE in dwParam2 of corresponding LINE_REPLY, below is the source code.

    class CRecordData
    _bstr_t m_strTargetDN;
    _bstr_t m_strSipCallID;
    _bstr_t m_strRecDestDN;
    _bstr_t m_strRecMailBox;
    bool bStart;

    CRecordData cRecData;
    CRecordData* pRecordData;
    BYTE* pBuffer;
    DWORD dwSize;

    And after receving the event of STLINECALLSTATE_CONNECTED_FAREND_ANSWERED, I am sending call recordrequest in lineDevSpecific as below.

    hCallHandle = (HCALL)oLineMessage.hDevice;
    status = lineSetCallPrivilege(hCallHandle, LINECALLPRIVILEGE_OWNER);

    if(status) _tprinf(_T("lineSetCallPrivilege didn't set call privileges to owner."));

    LPTSTR szCallId = _T("359A8559-6457-48a7-A600-DBF18973D2B1");
    TCHAR CallId[33];
    StrCpy(CallId, szCallId);

    cRecData.bStart = true;
    cRecData.m_strSipCallID = CallId;
    cRecData.m_strTargetDN = L"753";
    cRecData.m_strRecDestDN = L"114";
    cRecData.m_strRecMailBox = L"";

    pRecordData = &cRecData;

    _bstr_t strRecParams ;
    strRecParams = L"T=";
    strRecParams = strRecParams + pRecordData->m_strTargetDN;
    strRecParams = strRecParams + L";R=";
    strRecParams = strRecParams + pRecordData->m_strRecDestDN;
    strRecParams = strRecParams + L";CT=";
    strRecParams = strRecParams + pRecordData->m_strRecMailBox;
    strRecParams = strRecParams + L";";

    DWORD dwSize = sizeof(*pRecordReq) + (strRecParams.length() + 1) * sizeof(WCHAR);

    pBuffer = (BYTE*) malloc(dwSize);
    pRecordReq = (LPSTLINERECORD) pBuffer;

    pRecordReq->dwFunction = STLINE_RECORD;
    *((GUID*)&pRecordReq->extensionID) = __uuidof(STLINERECORD);

    pRecordReq->bStart = pRecordData->bStart;

    if (strRecParams.length())
    pRecordReq->dwRecordParamsSize = (strRecParams.length() + 1) * sizeof(WCHAR);
    pRecordReq->dwRecordParamsOffset = sizeof(*pRecordReq);
    ::wcscpy((LPWSTR)(pBuffer + pRecordReq->dwRecordParamsOffset), strRecParams);

    if(pRecordData->m_strSipCallID.length() > 0)
    if (UuidFromString(pRecordData->m_strSipCallID,&(pRecordReq->guidCallID)) != RPC_S_OK)
    _tprintf(_T("Call Record: Error parsing the Sip CallID to GUI\r\n"));

    lDeviceStatus = lineDevSpecific (hLineChannel, 0, hCallHandle, (LPVOID) pRecordReq, dwSize);

    if(lDeviceStatus > 0)
    _tprintf(_T("StartRecording request successfully sent to ShoreTel PBX."));

    TAPI function lineDevSpecific(...) is working good and returns positive number but corresponding LINE_REPLY is giving the LINEERR_INVALCALLHANDLE in dwParam2.

    Thanks for your help.

    Mudassir Saeed

  • #2
    Looks like a bug with the forum...


    • #3
      Can you post more info about your program? Does this program run on the Director or does it run on the desktop?