mfm1992

来自「一个基于五岳鑫语音卡的语音系统,对开发语音系统的人来说有借鉴作用」· 代码 · 共 1,407 行 · 第 1/3 页

TXT
1,407
字号
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: sbcx - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\WINDOWS\TEMP\RSP42E5.TMP" with contents
[
/nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Fp"Debug/sbcx.pch" /Yu"stdafx.h" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c 
"F:\ctyyk\sbcxView.cpp"
]
Creating command line "cl.exe @C:\WINDOWS\TEMP\RSP42E5.TMP" 
<h3>Output Window</h3>
Compiling...
sbcxView.cpp



<h3>Results</h3>
sbcxView.obj - 0 error(s), 0 warning(s)
</pre>
</body>
</html>
CAboutDlg
ControlCount=1
Control1=IDOK,button,1342373889

[MNU:IDR_MAINFRAME]
Type=1
Class=CMainFrame
Command1=ID_APP_EXIT
Command2=ID_VIEW_STATUS_BAR
Command3=ID_APP_ABOUT
CommandCount=3

[ACL:IDR_MAINFRAME]
Type=1
Class=CMainFrame
Command1=ID_FILE_NEW
Command2=ID_FILE_OPEN
Command3=ID_FILE_SAVE
Command4=ID_FILE_PRINT
Command5=ID_EDIT_UNDO
Command6=ID_EDIT_CUT
Command7=ID_EDIT_COPY
Command8=ID_EDIT_PASTE
Command9=ID_EDIT_UNDO
Command10=ID_EDIT_CUT
Command11=ID_EDIT_COPY
Command12=ID_EDIT_PASTE
Command13=ID_NEXT_PANE
Command14=ID_PREV_PANE
CommandCount=14

[TB:IDR_MAINFRAME]
Type=1
Class=?
Command1=ID_FILE_NEW
Command2=ID_FILE_OPEN
Command3=ID_FILE_SAVE
Command4=ID_EDIT_CUT
Command5=ID_EDIT_COPY
Command6=ID_EDIT_PASTE
Command7=ID_FILE_PRINT
Command8=ID_APP_ABOUT
CommandCount=8

[CLS:CTsnumSet]
Type=0
HeaderFile=TsnumSet.h
ImplementationFile=TsnumSet.cpp
BaseClass=CRecordset
Filter=N
VirtualFilter=r

[DB:CTsnumSet]
DB=1
DBType=ODBC
ColumnCount=11
Column1=[no], 2, 8
Column2=[ts0], 2, 8
Column3=[ts1], 2, 8
Column4=[ts2], 2, 8
Column5=[ts3], 2, 8
Column6=[ts4], 2, 8
Column7=[ts5], 2, 8
Column8=[ts6], 2, 8
Column9=[ts7], 2, 8
Column10=[ts8], 2, 8
Column11=[ts9], 2, 8

ount,SigLen;
	if(ChHangUp(pCh)) return;
	if(TV_TimerElapsed(ms_j) == -1)//超过40秒未结束
	{
		pCh->nWS = WS_WAITCALL;
		if(pCh->nChType == CT_EXTERNAL) {
			TV_HangUpCtrl(pCh->nChNo);
			pCh->nChbuye = 0;
		}
		GetListCtrl().SetItemText(pCh->nChNo,2,"等待呼入");
		GetListCtrl().SetItemText(pCh->nChNo,3,"");
		return;
	}
	if (TV_MonitorOffHook(ms_j,25) != 0 ){
		
		TV_ConnectChannels(pCh->nChNo,ms_j);
		GetListCtrl().SetItemText(pCh->nChNo,2,"对话");
		GetListCtrl().SetItemText(ms_j,2,"对话");
		pCh->nWS = WS_DIAL2;
	}	
	return;

}

void CSbcxView::Dial2(CH_STRUCT *pCh)
{
	int Sig,SigCount,SigLen;
	Sig = TV_CheckSignal (ms_j, &SigCount, &SigLen);
	if (((Sig == SIG_BUSY1 || Sig == SIG_BUSY2) && SigCount >= 3)) {
		pCh->nWS = WS_WAITCALL;
		if(pCh->nChType == CT_EXTERNAL) {
			TV_HangUpCtrl(pCh->nChNo);
			pCh->nChbuye = 0;
		}
		GetListCtrl().SetItemText(pCh->nChNo,2,"等待呼入");
		GetListCtrl().SetItemText(pCh->nChNo,3,"");
		return ;
	}
}

void CSbcxView::PlayDepart(CH_STRUCT *pCh)
{
	if(ChHangUp(pCh)) return;
	if(pCh->bOnPlay)
	{
		if(TV_PlaySentenceRest(pCh->nChNo) <= 0)
		{
			pCh->nWS = WS_DOMENU1;
			GetListCtrl().SetItemText(pCh->nChNo,2,"提示选择功能");
			pCh->nPlayCount = 0;
			pCh->strSentence = "";
			pCh->strSentence += CN_VMENU1;
		}
	}
	int nChar = TV_GetDTMFChar(pCh->nChNo);
	if(nChar == -1) return;	
	if(pCh->bOnPlay)
	{
		TV_StopPlayFile(pCh->nChNo);
		pCh->bOnPlay = FALSE;
	}
	if(nChar >= '0' && nChar <= '9')
	{
		if(pCh->bOnPlay)
		{
			TV_StopPlayFile(pCh->nChNo);
			pCh->bOnPlay = FALSE;
		}
		pCh->strdepart = "";
		pCh->strdepart += nChar;
		pCh->nWS = WS_GETDEPART;
		TV_StartTimer(pCh->nChNo,40);
		GetListCtrl().SetItemText(pCh->nChNo,2,"等待部门号输入完毕");
		return;
	}
	if (nChar == '*'){
		pCh->nWS = WS_DOMENU1;
		GetListCtrl().SetItemText(pCh->nChNo,2,"提示选择功能");
		pCh->nPlayCount = 0;
		pCh->strSentence = "";
		pCh->strSentence += CN_VMENU1;
	}
	pCh->bOnPlay = TRUE;
	TV_PlaySentence(pCh->nChNo,(unsigned char *)(LPCSTR)pCh->strSentence);
}

void CSbcxView::GetDepart(CH_STRUCT *pCh)
{
	if(ChHangUp(pCh)) return;
	if(TV_TimerElapsed(pCh->nChNo) == -1)
	{
		pCh->nWS = WS_WAITCALL;
		if(pCh->nChType == CT_EXTERNAL) TV_HangUpCtrl(pCh->nChNo);
		GetListCtrl().SetItemText(pCh->nChNo,2,"等待呼入");
		GetListCtrl().SetItemText(pCh->nChNo,3,"");
		return;
	}
	
	int nChar = TV_GetDTMFChar(pCh->nChNo);
	if(nChar == -1) return;
	if(nChar >= '0' && nChar <= '9')
	{
		pCh->strdepart += nChar;return;
	}
	if(nChar == '#')
	{
		CSbcxDoc*  pDoc = GetDocument();
		CString strSQL;
		if(pCh->strdepart.GetLength() == 2){
			if (pCh->strdepart == "00"){
				CString ls_rz;
				int i;
				ls_rz = pDoc->GetRZ(); 
				if (ls_rz == "1"){//人工
					for(i = 0; i < pDoc->m_nChNum; i++){
						if (pDoc->m_pCh[i].nChType == CT_EXTERNAL || pDoc->m_pCh[i].nChType == CT_EMPTY || TV_OffHookDetect(i) != 0)continue;
						ms_i = i;
						TV_StopPlayFile(pCh->nChNo);
						TV_StopPlayFile(ms_i);
						TV_GenerateRing(ms_i);			//内线产生响铃
						pCh->nWS = WS_RING;
						return;
					}
				}else if(ls_rz == "0"){//自动
				pCh->nWS = WS_TS0;
				pCh->strSentence += CN_VTS0;
				pCh->strSentence += CN_RETURN;
				GetListCtrl().SetItemText(pCh->nChNo,2,"投诉选择");
				}				
			}else{
				pCh->nWS = WS_DIAL_1;
			}
		}

	}
	pCh->strSentence = "";
	pCh->strSentence += CN_ERR;
	pCh->strSentence += CN_DEPART;
	pCh->nWS = WS_DEPART;
	GetListCtrl().SetItemText(pCh->nChNo,2,"提示部门号输入错误");
	TV_PlaySentence(pCh->nChNo,(unsigned char *)(LPCSTR)pCh->strSentence);
	pCh->bOnPlay = TRUE;
	pCh->nPlayCount = -1;
}

void CSbcxView::Dial_1(CH_STRUCT *pCh)
{
	CSbcxDoc*  pDoc = GetDocument();
	for(int j = 0; j < pDoc->m_nChNum; j++){
		if (pDoc->m_pCh[j].nChType == CT_EMPTY || pDoc->m_pCh[j].nChType == CT_INTERNAL || pDoc->m_pCh[j].nChbuye == 1)continue;
			TV_OffHookCtrl(j);
			pDoc->m_pCh[j].nChbuye = 1;//该通道处于忙状态
			ms_j = j;
			TV_ConnectChannels(pCh->nChNo,j);
			TV_StopPlayFile(pCh->nChNo);
			TV_StopPlayFile(j);
			TV_StartTimer (ms_j, 2);
			pCh->nWS = WS_DIAL0;
			return;
		}
}
		GetListCtrl().SetItemText(pCh->nChNo,2,"等待呼入");
			}else if(pCh->nPlayCount == 0){
					pCh->strSentence = "";
					pCh->strSentence += CN_PUBLIC;
					GetListCtrl().SetItemText(pCh->nChNo,2,"第二层" + ch + "提示");
					TV_PlaySentence(pCh->nChNo,(unsigned char *)(LPCSTR)pCh->strSentence);
					pCh->bOnPlay = TRUE;
				}
		}
	}
	int nChar = TV_GetDTMFChar(pCh->nChNo);
	if(nChar == -1) return;	
	if(pCh->bOnPlay)
	{
		TV_StopPlayFile(pCh->nChNo);
		pCh->bOnPlay = FALSE;
	}
	CString ls_decr;
	if (nChar != '*' && nChar != '#') {
		ls_decr = pDoc->GetData_decr_3(ch.Left(1),ch.Right(1),nChar);
		ms_decr = ls_decr;
	}
	switch(nChar)
	{
		case '0':	
			v_s = ".\\voice\\v" + ch + "0.tw";
			if (pDoc->GetData_checked_3( ch.Left(1),ch.Right(1) ,'0') == '1')
					{
						Faxlb = 1000 + i * 10;//表示
						ms_fax = pDoc->GetData_Fax_3(ch.Left(1),ch.Right(1),'0');
				//////////////////记录查询该信息的人数///////////////////
					pDoc->ms_cx_num = pDoc->GetData_cx_num_1('0');
					pDoc->ms_tele_no = "0";
				/////////////////////////////////////////////////
						goto Play;
				}else
					goto Err;
				break;
			case '1':
				v_s = ".\\voice\\v" + ch + "1.tw";
				if (pDoc->GetData_checked_3( ch.Left(1),ch.Right(1) ,'1') == '1')
						{
							Faxlb = 1000 + i * 10 + 1;//表示
							ms_fax = pDoc->GetData_Fax_3(ch.Left(1),ch.Right(1),'1');
				//////////////////记录查询该信息的人数///////////////////
					pDoc->ms_cx_num = pDoc->GetData_cx_num_1('1');
					pDoc->ms_tele_no = "1";
				/////////////////////////////////////////////////
							goto Play;
					}else
						goto Err;
				break;
			case '2':
				v_s = ".\\voice\\v" + ch + "2.tw";
				if (pDoc->GetData_checked_3( ch.Left(1),ch.Right(1) ,'2') == '1')
						{
							Faxlb = 1000 + i * 10 + 2;//表示
							ms_fax = pDoc->GetData_Fax_3(ch.Left(1),ch.Right(1),'2');
				//////////////////记录查询该信息的人数///////////////////
					pDoc->ms_cx_num = pDoc->GetData_cx_num_1('2');
					pDoc->ms_tele_no = "2";
				/////////////////////////////////////////////////
							goto Play;
					}else
						goto Err;
				break;
			case '3':
				v_s = ".\\voice\\v" + ch + "3.tw";
				if (pDoc->GetData_checked_3( ch.Left(1),ch.Right(1) ,'3') == '1')
						{
							Faxlb = 1000 + i * 10 + 3;//表示
							ms_fax = pDoc->GetData_Fax_3(ch.Left(1),ch.Right(1),'3');
				//////////////////记录查询该信息的人数///////////////////
					pDoc->ms_cx_num = pDoc->GetData_cx_num_1('3');
					pDoc->ms_tele_no = "3";
				/////////////////////////////////////////////////
							goto Play;
					}else
						goto Err;
				break;
			case '4':
				v_s = ".\\voice\\v" + ch + "4.tw";
				if (pDoc->GetData_checked_3( ch.Left(1),ch.Right(1) ,'4') == '1')
						{
							Faxlb = 1000 + i * 10 + 4;//表示
							ms_fax = pDoc->GetData_Fax_3(ch.Left(1),ch.Right(1),'4');
				//////////////////记录查询该信息的人数///////////////////
					pDoc->ms_cx_num = pDoc->GetData_cx_num_1('4');
					pDoc->ms_tele_no = "4";
				/////////////////////////////////////////////////
							goto Play;
					}else
						goto Err;
				break;
			case '5':
				v_s = ".\\voice\\v" + ch + "5.tw";
				if (pDoc->GetData_checked_3( ch.Left(1),ch.Right(1) ,'5') == '1')
						{
							Faxlb = 1000 + i * 10 + 5;//表示
							ms_fax = pDoc->GetData_Fax_3(ch.Left(1),ch.Right(1),'5');
				//////////////////记录查询该信息的人数///////////////////
					pDoc->ms_cx_num = pDoc->GetData_cx_num_1('5');
					pDoc->ms_tele_no = "5";
				/////////////////////////////////////////////////
							goto Play;
					}else
						goto Err;
				break;
			case '6':
				v_s = ".\\voice\\v" + ch + "6.tw";
				if (pDoc->GetData_checked_3( ch.Left(1),ch.Right(1) ,'6') == '1')
						{
							Faxlb = 1000 + i * 10 + 6;//表示
							ms_fax = pDoc->GetData_Fax_3(ch.Left(1),ch.Right(1),'6');
				//////////////////记录查询该信息的人数///////////////////
					pDoc->ms_cx_num = pDoc->GetData_cx_num_1('6');
					pDoc->ms_tele_no = "6";
				/////////////////////////////////////////////////
							goto Play;
					}else
						goto Err;
				break;
			case '7':
				v_s = ".\\voice\\v" + ch + "7.tw";
				if (pDoc->GetData_checked_3( ch.Left(1),ch.Right(1) ,'7') == '1')
						{
							Faxlb = 1000 + i * 10 + 7;//表示
							ms_fax = pDoc->GetData_Fax_3(ch.Left(1),ch.Right(1),'7');
				//////////////////记录查询该信息的人数///////////////////
					pDoc->ms_cx_num = pDoc->GetData_cx_num_1('7');
					pDoc->ms_tele_no = "7";
				/////////////////////////////////////////////////
							goto Play;
					}else
						goto Err;
				break;
			case '8':
				v_s = ".\\voice\\v" + ch + "8.tw";
				if (pDoc->GetData_checked_3( ch.Left(1),ch.Right(1) ,'8') == '1')
						{
							Faxlb = 1000 + i * 10 + 8;//表示
							ms_fax = pDoc->GetData_Fax_3(ch.Left(1),ch.Right(1),'8');
				//////////////////记录查询该信息的人数///////////////////
					pDoc->ms_cx_num = pDoc->GetData_cx_num_1('8');
					pDoc->ms_tele_no = "8";
				/////////////////////////////////////////////
							goto Play;
					}else
						goto Err;
				break;
			case '9':
				v_s = ".\\voice\\v" + ch + "9.tw";
				if (pDoc->GetData_checked_3( ch.Left(1),ch.Right(1) ,'9') == '1')
						{
							Faxlb = 1000 + i * 10 + 9;//表示
							ms_fax = pDoc->GetData_Fax_3(ch.Left(1),ch.Right(1),'9');
				//////////////////记录查询该信息的人数///////////////////
					pDoc->ms_cx_num = pDoc->GetData_cx_num_1('9');
					pDoc->ms_tele_no = "9";
				/////////////////////////////////////////////////
							goto Play;
					}else
						goto Err;
				break;
			case '*':
				v_s = ".\\voice\\v" + ch.Left(1) + ".tw";
				char buf[20];
				sprintf(buf,"%s",ch.Left(1));
				i = atoi(buf);
				m_curr_Tele_no = i;
				sprintf(v_c,"%s",v_s);
				TV_SetVoicei(CN_PUBLIC,v_c);
				pCh->nWS = WS_PLAYING_1;
				pCh->strSentence += CN_PUBLIC;	
				pCh->strSentence += CN_RETURN;
				GetListCtrl().SetItemText(pCh->nChNo,2,"播放第一层" + ch.Left(1) +"提示");
				pCh->bOnPlay = TRUE;
				TV_PlaySentence(pCh->nChNo,(unsigned char *)(LPCSTR)pCh->strSentence);
				return;
		}
	/////////////////////////////////////////////
	if (nChar == '0'|| nChar == '1' || nChar == '2'|| nChar == '3'|| nChar == '4'|| nChar == '5'|| nChar == '6'|| nChar == '7'|| nChar == '8'|| nChar == '9')
	{
	Play:sprintf(v_c,"%s",v_s);
		TV_SetVoicei(CN_PUBLIC,v_c);
		pCh->nWS = WS_VOICE_PUBLIC_3;
		GetListCtrl().SetItemText(pCh->nChNo,2,ls_decr + "内容");
		pCh->strSentence = "";
		pCh->strSentence = CN_PUBLIC;
		pCh->strSentence += CN_RETURN;			
		pCh->bOnPlay = TRUE;
		///////////////////////////////
			pCh->Tsws = "cx_num";
			pDoc->ms_one = ch.Left(1);
			pDoc->ms_two = ch.Right(1);
			GetDocument()->AddToTaskList(pCh);
		///////////////////////////////
		TV_PlaySentence(pCh->nChNo,(unsigned char *)(LPCSTR)pCh->strSentence);
		return;
	}
		Err:	pCh->strSentence = "";
				pCh->strSentence += CN_ERR;
				pCh->strSentence += CN_PUBLIC;
				GetListCtrl().SetItemText(pCh->nChNo,2,"提示输入错误,重新选择");
				pCh->nPlayCount = -1;
				TV_PlaySentence(pCh->nChNo,(unsigned char *)(LPCSTR)pCh->strSentence);
				pCh->bOnPlay = TRUE;
	/////////////////////////////////////////////


}

void CSbcxView::aj_chck(CH_STRUCT *pCh)//在投诉时,接受表示案件类型的键号
{
	if(ChHangUp(pCh)) return;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?