lineSetupTransfer failing with LINEERR_OPERATIONFAILED


I'm using ATAPI.NET on an Avaya IP Office setup and I was getting OPERATIONFAILED on lineSetupTransfer. I believe the problem is in Interop.WriteByteArray. which appears to be used only in ProcessCallParams . I was able to get my consultation transfer to work by making the following modification:

Original (failing):
            Marshal.Copy(buff, 0, dataPtr, buff.Length);
            Marshal.WriteIntPtr(ptr, offset, dataPtr);
Working version:
            //Marshal.Copy(buff, 0, dataPtr, buff.Length);
            //Marshal.WriteIntPtr(ptr, offset, dataPtr);
            IntPtr destPtr = new IntPtr(ptr.ToInt64() + offset);
            Marshal.Copy(buff, 0, destPtr, buff.Length);
The first method writes the value of dataPtr into ptr+offset. Basically the first method is storing the pointer to the dialing number. What needs to happen is the ASCII number to dial needs to be written immediately following the LINECALLPARAMS structure, not a pointer to the ASCII number. The second method does that.