Wolfgang Falk | Hello, i try to use the devspecific function for whispering and monitoring calls. on a 32bit platform (32 bit tsp) the application works like a charm, but when moving to a 64bit platform i always get a tsp error "dwSize mismatch". version is 8.6 i guess there is some problem in converting the struct to the byte array, here is the relevant source code in c#, maybe someone has an idea. the struct: public struct CiscoLineDevSpecificStartCallMonitoring { public int m_MsgType; public int m_PermanentLineID; public int m_MonitorMode; //0= NONE, 1=SILENT, 2=WHISPER, 3=ACTIVE public int m_ToneDirection; //0=LOCALONLY, 1=REMOTEONLY, 2=BOTH, 3=NOTLOCALORREMOTE } here is the initialization:
var cisco = new CiscoLineDevSpecificStartCallMonitoring { m_MsgType =(int) CiscoLineDevSpecificType.SLDST_START_CALL_MONITORING, m_PermanentLineID = agentLine.PermanentId, m_MonitorMode = 2, m_ToneDirection = 2 };
and here is the calculation to get the parameter byte array (where i assume the problem):
private static byte[] GetBytes(CiscoLineDevSpecificStartCallMonitoring msgMonitoring) { var size = Marshal.SizeOf(msgMonitoring); var arr = new byte; var ptr = Marshal.AllocHGlobal(size); Marshal.StructureToPtr(msgMonitoring, ptr, true); Marshal.Copy(ptr, arr, 0, size); Marshal.FreeHGlobal(ptr); return arr; }
Thanks for all suggestions, would like to avoid to go back to a 32bit machine... rgds Wolfgang |