东进语音卡C#拨号的问题!!
用VB的拨号例子拨号一切正常,然后仿照VB的例子写了个C#的,但拨号没反映,部分拨号的代码:
D080A.PUSH_PLAY();
SHORT i=0;
IF(DO80A.CheckChType(i)==1)
{
DO80A.OffHook(i);
DO80A.SendDtmfBuf(i,"150*********");
}
上边代码执行完毕后后面的代码能检测到拨号以完毕但信号信检测函数返回的结果是没有任何信号音。同时手机也没反映
做过类似开发的请帮忙
语音卡是东进的模拟卡
------解决方案--------------------
很早之前写的一个可以看一下:
public delegate void FeedBackCall(bool bSuccess, string test);
public class Call
{
public event FeedBackCall FeedBackCallHandle;
public Call()
{ }
#region Variable && Struct
private long m_LoadDriveFlag;
//private short m_TotalLine;
private LINESTRUCT[] m_Lines;
private string sFilePath;
private string sWelFile;
private string sFeedbackFile;
/// <summary>
/// 找到第一条可用的线路
/// </summary>
short wUseLine = -1;
//检测极性翻转
private bool bSate1;
private bool bSate2;
private Timer tim;
private struct LINESTRUCT
{
public CHANNEL_TYPE nType;
public CHANNEL_STATE State;
public string CallerID;
public string Dtmf;
public int nTimeElapse;
}
/// <summary>
/// The main entry point for the application.
/// </summary>
private enum CHANNEL_STATE : short
{
CH_FREE,
CH_DIAL,
CH_CHECKSIG,
CH_BUSY,
CH_NOSIGNAL,
CH_NOBODY,
CH_NODIALTONE,
CH_CONNECT,
CH_OFFHOOK,
CH_PLAY,
CH_ONHOOK,
CH_FAIL
}
private enum SIG_STATE : int
{
S_NODIALTONE = 0x0F,
S_BUSY = 0x11,
S_NOBODY = 0x13,
S_CONNECT = 0x14,
S_NOSIGNAL = 0x15,
S_DIALSIG = 0x30
}
private enum CHANNEL_TYPE : short
{
User,
Trunk,
Empty
}
#endregion
#region InitiDriver
public void IniDrv()
{
try
{
m_LoadDriveFlag = Voice.LoadDRV();
if (m_LoadDriveFlag == 1)
{
throw new Exception("Load Voice Card Fail!");
}
short m_TotalLine = Voice.CheckValidCh();
m_Lines = new LINESTRUCT[m_TotalLine];
if (Voice.EnableCard(m_TotalLine, 8 * 512) == (long)1)
{
Voice.FreeDRV();
throw new Exception("Enable Card Fail!");
}
m_Lines = new LINESTRUCT[m_TotalLine];
for (short i = 0; i < m_TotalLine; i++)
{
m_Lines[i].State = CHANNEL_STATE.CH_FREE;
m_Lines[i].nType = (CHANNEL_TYPE)Voice.CheckChType(i);
m_Lines[i].CallerID = "";
m_Lines[i].Dtmf = "";
if (m_Lines[i].nType == CHANNEL_TYPE.Trunk)
{
wUseLine = i;
break;
}
}
if (wUseLine == -1)
{
Voice.FreeDRV();
throw new Exception("No active line!");
}
Voice.Se