private static DV_TPT[] GetTerminationConditions(int numberOfDigits, string terminators, int timeoutInMilliseconds) { var tpts = new List <DV_TPT>(); var tpt = new DV_TPT { tp_type = IO_CONT, tp_termno = DX_MAXDTMF, tp_length = (ushort)numberOfDigits, tp_flags = TF_MAXDTMF, tp_nextp = IntPtr.Zero }; tpts.Add(tpt); var bitMask = DefineDigits(terminators); if (bitMask != 0) { tpt = new DV_TPT { tp_type = IO_CONT, tp_termno = DX_DIGMASK, tp_length = (ushort)bitMask, tp_flags = TF_DIGMASK, tp_nextp = IntPtr.Zero }; tpts.Add(tpt); } if (timeoutInMilliseconds != 0) { tpt = new DV_TPT { tp_type = IO_CONT, tp_termno = DX_IDDTIME, tp_length = (ushort)(timeoutInMilliseconds / 100), tp_flags = TF_IDDTIME, tp_nextp = IntPtr.Zero }; tpts.Add(tpt); } tpt = new DV_TPT { tp_type = IO_EOT, tp_termno = DX_LCOFF, tp_length = 3, tp_flags = TF_LCOFF | TF_10MS, tp_nextp = IntPtr.Zero }; tpts.Add(tpt); return(tpts.ToArray()); }
private static extern int dx_reciottdata(int ChDev, ref DX_IOTT iottp, ref DV_TPT tptp, ref DX_XPB xpbp, ushort mode);
private static extern int dx_play(int ChDev, ref DX_IOTT iottp, ref DV_TPT tptp, ushort mode);
private static extern int dx_getdig(int chdev, ref DV_TPT tptp, out DV_DIGIT digitp, ushort mode);
private static extern int dx_recf(int chDev, string fNamep, ref DV_TPT tptp, int mode);
private static extern int dx_clrtpt(ref DV_TPT tptp, int size);