ShoreTel Forums  

Go Back   ShoreTel Forums > Other > Shoretel Forums Updates, Bugs, and Suggestions

Reply
 
LinkBack Thread Tools Display Modes
Old 02-19-2010, 05:58 AM   #1
Junior Member
 
Join Date: Feb 2010
Location: London
Posts: 1
Question 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
{
public:
_bstr_t m_strTargetDN;
_bstr_t m_strSipCallID;
_bstr_t m_strRecDestDN;
_bstr_t m_strRecMailBox;
bool bStart;
};

CRecordData cRecData;
CRecordData* pRecordData;
LPSTLINERECORD pRecordReq;
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"));
free(pBuffer);
}
}

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.

Regards,
Mudassir Saeed
m_mudassir_saeed is offline   Reply With Quote
Old 02-19-2010, 09:54 AM   #2
Senior Member
 
Join Date: Dec 2007
Location: Germany
Posts: 192

Looks like a bug with the forum...
Bobby_Digital is offline   Reply With Quote
Old 03-16-2010, 09:19 PM   #3
Member
 
Join Date: Mar 2008
Location: Los Angeles, CA
Posts: 98

Can you post more info about your program? Does this program run on the Director or does it run on the desktop?
__________________
Catatonique

Shoretel Installer Par Excellente!

Location:
Beverly Hills, CA 90210
GMT-8 hours
catatonique is offline   Reply With Quote
Reply

Tags
call recording, linedevspecifiv, tapi, tapi 2 wav

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:28 AM.


Powered by vBulletin® Version 3.7.0 Release Candidate 2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0