C#实现IVR(基于东进的语音卡)-5
/**//// <summary>
/// 语音资源操作类型
/// </summary>
public enum VoiceOperatorType
{
/**//// <summary>
/// //没有语音操作
/// </summary>
OP_NoOperator = 0,
/**//// <summary>
/// //普通放音
/// </summary>
OP_Play = 1,
/**//// <summary>
/// //循环放音
/// </summary>
OP_LoopPlay = 2,
};
/**//// <summary>
/// 用户状态类型
/// </summary>
public enum USER_STATE
{
/**//// <summary>
/// 未摘机
/// </summary>
USR_OFFHOOK=0,
/**//// <summary>
/// 等待拨号
/// </summary>
USR_WAITDIAL=1,
/**//// <summary>
/// 拨号
/// </summary>
USR_DIAL=2,
/**//// <summary>
/// 结束
/// </summary>
USR_ENDSESSION=3,
/**//// <summary>
/// 等待语音
/// </summary>
USR_WAITONHOOK=4,
/**//// <summary>
/// 振铃
/// </summary>
USR_RING=5,
/**//// <summary>
/// 通话
/// </summary>
USR_CONNECT=6,
/**//// <summary>
/// 摘机中
/// </summary>
USR_ONHOOK = 50,
/**//// <summary>
/// 取消振铃
/// </summary>
USR_EXRING=51,
/**//// <summary>
/// 退出通话
/// </summary>
USR_EXCONNECT=52
};
/**//// <summary>
/// 中继信道状态
/// </summary>
public enum TRUNK_ST
{
/**//// <summary>
/// 空闲状态
/// </summary>
TRK_FREE=0, //free state
/**//// <summary>
/// 准备状态
/// </summary>
TRK_READY=1, //mfc stop state
/**//// <summary>
/// 振铃状态
/// </summary>
TRK_RING=2, //ring user
/**//// <summary>
/// 拨号状态
/// </summary>
TRK_CALLOUT=3, //user dial over, callout
/**//// <summary>
/// 等待摘机
/// </summary>
TRK_WAITUSEROFFHOOK=4, //ring user, wait offhok
/**//// <summary>
/// 摘机状态
/// </summary>
TRK_WAITUSERONHOOK=5,
/**//// <summary>
/// 结束谈话
/// </summary>
TRK_ENDSESSION=6, //end a talk
/**//// <summary>
/// 链接状态
/// </summary>
TRK_CONNECT=7,
/**//// <summary>
/// 为初始化状态
/// </summary>
TRK_NULLSTATE=8,
/**//// <summary>
/// 播放状态
/// </summary>
TRK_PLAY=9,
/**//// <summary>
/// 呼入状态
/// </summary>
TRK_CALLIN=10,
/**//// <summary>
/// 摘机状态
/// </summary>
TRK_ONHOOK=11,
/**//// <summary>
/// 挂机状态
/// </summary>
TRK_HANGUP=12,
};
/**//// <summary>
/// 用户状态
/// </summary>
public struct UR_ST
{
public int ConnUrID;
public USER_STATE ST;
public int ConnTrID;
}
/**//// <summary>
/// 对收到的ISUP消息,获取其中的原因值
/// </summary>
public enum CAUSE_VALUE:int
{
/**//// <summary>
/// 中继通道的范围越界
/// </summary>
RSN_PCMNULL_CALLER=-1,
/**//// <summary>
/// 收到的消息中不含有原因指示码,或没有新的ISUP消息到达
/// </summary>
RSN_UNKOWNNUM_ISUP=0,
/**//// <summary>
/// //空号
/// </summary>
RSN_UNALLOCATED_NUMBER = 0x01,
/**//// <summary>
/// //正常的呼叫清除
/// </summary>
RSN_NORMAL_CALL_CLEARING = 0x10,
/**//// <summary>
/// //用户忙
/// </summary>
RSN_USER_BUSY = 0x11,
/**//// <summary>
/// //无用户响应
/// </summary>
RSN_NO_USER_RESPONDING = 0x12,
/**//// <summary>
/// //被叫无应答,超时未摘机
/// </summary>
RSN_USER_ALERTING_NO_ANSWER = 0x13,
/**//// <summary>
/// //呼叫拒绝
/// </summary>
RSN_CALL_REJECTED = 0x15,
/**//// <summary>
/// //不完整的号码
/// </summary>
RSN_INCOMPLETE_NUMBER = 0x1c,
/**//// <summary>
/// //正常,未规定
/// </summary>
RSN_NORMAL_NO_SET = 0x1f,
/**//// <summary>
/// //无可用的电路
/// </summary>
RSN_NO_CIRCUIT_CHANNELAVAILABLE = 0x22,
/**//// <summary>
/// //请求的电路不可用
/// </summary>
RSN_REQUESTEDCIRCUIT_CHANNEL_NOTAVAILABLE = 0x2c,
/**//// <summary>
/// //定时器超时恢复
/// </summary>
RSN_RECOVERY_ON_TIME_EXPIRY = 0x66,
/**//// <summary>
/// //本地释放电路
/// </summary>
RSN_LOCAL_RLC = 0x20,
/**//// <summary>
/// //电路复原
/// </summary>
RSN_RECEIVE_RSC = 0x21,
};
/**//// <summary>
/// 信道状态
/// </summary>
public struct TRK_ST
{
public TRUNK_ST ST;
public int ConnUrID;
public int ConnTrID;
public string DialNum;
}
public struct PR
{
[MarshalAs(UnmanagedType.ByValArray,SizeConst=32)]
public char[] TelarrChar;
public char[] CallarrChar;
}
public struct TelNum
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] arrTelNum;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] arrCallNum;
}
}
原作地址:http://www.cnblogs.com/cnherman/archive/2008/07/08/1237937.html
总结
以上是生活随笔为你收集整理的C#实现IVR(基于东进的语音卡)-5的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 二进制法表示集合
- 下一篇: DotNet(C#)自定义运行时窗体设计