| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- // stdafx.h : 标准系统包含文件的包含文件,
- // 或是经常使用但不常更改的
- // 特定于项目的包含文件
- #pragma once
- #ifndef _SECURE_ATL
- #define _SECURE_ATL 1
- #endif
- #ifndef VC_EXTRALEAN
- #define VC_EXTRALEAN // 从 Windows 头中排除极少使用的资料
- #endif
- #include "targetver.h"
- #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 某些 CString 构造函数将是显式的
- // 关闭 MFC 对某些常见但经常可放心忽略的警告消息的隐藏
- #define _AFX_ALL_WARNINGS
- #include <afxwin.h> // MFC 核心组件和标准组件
- #include <afxext.h> // MFC 扩展
- #include <afxdisp.h> // MFC 自动化类
- #ifndef _AFX_NO_OLE_SUPPORT
- #include <afxdtctl.h> // MFC 对 Internet Explorer 4 公共控件的支持
- #endif
- #ifndef _AFX_NO_AFXCMN_SUPPORT
- #include <afxcmn.h> // MFC 对 Windows 公共控件的支持
- #endif // _AFX_NO_AFXCMN_SUPPORT
- #include <afxcontrolbars.h> // 功能区和控件条的 MFC 支持
- #include <afxsock.h> // MFC 套接字扩展
- //#define ISNEEDMYD // 是否需要满意度 不需要时屏蔽该宏定义
- //#define _USE_EHANGCOM //针对不同交换机
- //#define _USE_IPO
- #define _USE_FS
- #include "../Public/GlobalDef/CommonTypeDef.h" // 通用类型定义
- #include "../Public/GlobalDef/DevInfoInc.h" // 设备相关类型定义
- #include "../public/GlobalDef/DevLinkInc.h" // 底层设备连接接口定义
- #ifdef _USE_EHANGCOM
- #include "../eHangCom/DeviceLink.h"
- #pragma comment(lib, "eHangCom.lib")
- #endif
- #ifdef _USE_IPO
- #include "../IPO/DeviceLink.h"
- #pragma comment(lib, "IPO.lib")
- #endif
- #ifdef _USE_FS
- #include "../FsLink/DeviceLink.h"
- #pragma comment(lib, "FsLink.lib")
- #endif
- #define OTL_ORA11G_R2
- #include "CtiDataDef.h"
- #include "Logger.h" // 日志接口定义
- #include "DBCtrl.h" // 数据库接口定义
- #include "Inc/CallDetailInc.h" // 统计相关类型定义
- #include "..\wsClient\NetInterface.h"
- #include "..\pdu\PduEntity.h"
- #include "..\pdu\PduDataFormat.h"
- //#define _VERSION_EHANG
- #include <regex>
- #include <string>
- #include <json/json.h>
- #pragma comment(lib,"jsoncpp_static.lib")
- typedef struct tagAsrInfo {
- std::string callId; // 通话唯一标识Id
- std::string reference; // 录音唯一标识
- std::string agentId; // 坐席ID
- std::string calledId; // 被叫号码
- std::int64_t callStartTime; // 开始呼叫时间
- std::string callerId; // 主叫号码
- std::string state; // 当前状态 呼叫中calling
- std::string direction; // 呼叫方向:CallIn呼入 CallOut呼出
- std::string vocDirect; // 角色标识:User用户 Agent坐席
- std::int64_t createTime; // 创建时间
- std::string audioCode; // 编码格式 pcm8k16b
- std::int64_t sentenceBeginTime;// 本句开始时间(相对时间)相对于callStartTime的偏移时间
- std::string transSentenceText; // 转写结果
- std::int32_t transSentenceIndex;// 句子编号
- std::int64_t transSentenceTime; // 本句结束时间(相对时间) 相对于callStartTime的偏移时间
- tagAsrInfo() {
- this->callId = "";
- this->reference = "";
- this->agentId = "";
- this->calledId = "";
- this->callStartTime = 0;
- this->callerId = "";
- //this->state = "";
- this->state = "calling";
- this->direction = "";
- this->vocDirect = "";
- this->createTime = 0;
- //this->audioCode = "";
- this->audioCode = "pcm8k16b";
- this->sentenceBeginTime = 0;
- this->transSentenceText = "";
- this->transSentenceIndex = 0;
- this->transSentenceTime = 0;
- }
- tagAsrInfo(std::string str) {
- JSONCPP_STRING err;
- Json::Value root;
- Json::CharReaderBuilder builder;
- const std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
- if (!reader->parse(str.c_str(), str.c_str() + str.length(), &root, &err))
- {
- return;
- }
- this->callId = root["callId"].asString();
- this->reference = root["reference"].asString();
- this->agentId = root["agentId"].asString();
- this->calledId = root["calledId"].asString();
- this->callStartTime = root["callStartTime"].asInt64();
- this->callerId = root["callerId"].asString();
- //this->state = root["state"].asString();
- this->state = "calling";
- this->direction = root["direction"].asString();
- this->vocDirect = root["vocDirect"].asString();
- this->createTime = root["createTime"].asInt64();
- //this->audioCode = root["audioCode"].asString();
- this->audioCode = "pcm8k16b";
- this->sentenceBeginTime = root["sentenceBeginTime"].asInt64();
- this->transSentenceText = root["transSentenceText"].asString();
- this->transSentenceIndex = root["transSentenceIndex"].asInt();
- this->transSentenceTime = root["transSentenceTime"].asInt64();
- }
- tagAsrInfo(std::string callId, std::string agentId, std::string calledId, std::string callerId, std::string direction, std::string vocDirect) {
- this->callId = callId;
- this->reference = "";
- this->agentId = agentId;
- this->calledId = calledId;
- this->callStartTime = 0;
- this->callerId = callerId;
- this->state = "";
- this->direction = direction;
- this->vocDirect = vocDirect;
- this->createTime = 0;
- this->audioCode = "";
- this->sentenceBeginTime = 0;
- this->transSentenceText = "";
- this->transSentenceIndex = 0;
- this->transSentenceTime = 0;
- }
- tagAsrInfo& operator>>(std::string& str) {
- Json::Value root;
- Json::StreamWriterBuilder builder;
- const std::unique_ptr<Json::StreamWriter> writer(builder.newStreamWriter());
- root["callId"] = this->callId;
- root["reference"] = this->reference;
- root["agentId"] = this->agentId;
- root["calledId"] = this->calledId;
- root["callStartTime"] = this->callStartTime;
- root["callerId"] = this->callerId;
- root["state"] = this->state;
- root["direction"] = this->direction;
- root["vocDirect"] = this->vocDirect;
- root["createTime"] = this->createTime;
- root["audioCode"] = this->audioCode;
- root["sentenceBeginTime"] = this->sentenceBeginTime;
- root["transSentenceText"] = this->transSentenceText;
- root["transSentenceIndex"] = this->transSentenceIndex;
- root["transSentenceTime"] = this->transSentenceTime;
- str = Json::writeString(builder, root);
- return *this;
- }
- tagAsrInfo& operator<<(const char* str) {
- JSONCPP_STRING err;
- Json::Value root;
- Json::CharReaderBuilder builder;
- const std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
- if (!reader->parse(str, str + strlen(str), &root, &err))
- {
- return *this;
- }
- this->callId = root["callId"].asString();
- this->reference = root["reference"].asString();
- this->agentId = root["agentId"].asString();
- this->calledId = root["calledId"].asString();
- this->callStartTime = root["callStartTime"].asInt64();
- this->callerId = root["callerId"].asString();
- //this->state = root["state"].asString();
- this->state = "calling";
- this->direction = root["direction"].asString();
- this->vocDirect = root["vocDirect"].asString();
- this->createTime = root["createTime"].asInt64();
- //this->audioCode = root["audioCode"].asString();
- this->audioCode = "pcm8k16b";
- this->sentenceBeginTime = root["sentenceBeginTime"].asInt64();
- this->transSentenceText = root["transSentenceText"].asString();
- this->transSentenceIndex = root["transSentenceIndex"].asInt();
- this->transSentenceTime = root["transSentenceTime"].asInt64();
- return *this;
- }
- tagAsrInfo& operator<<(std::string& str) {
- JSONCPP_STRING err;
- Json::Value root;
- Json::CharReaderBuilder builder;
- const std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
- if (!reader->parse(str.c_str(), str.c_str() + str.length(), &root, &err))
- {
- return *this;
- }
- this->callId = root["callId"].asString();
- this->reference = root["reference"].asString();
- this->agentId = root["agentId"].asString();
- this->calledId = root["calledId"].asString();
- this->callStartTime = root["callStartTime"].asInt64();
- this->callerId = root["callerId"].asString();
- //this->state = root["state"].asString();
- this->state = "calling";
- this->direction = root["direction"].asString();
- this->vocDirect = root["vocDirect"].asString();
- this->createTime = root["createTime"].asInt64();
- //this->audioCode = root["audioCode"].asString();
- this->audioCode = "pcm8k16b";
- this->sentenceBeginTime = root["sentenceBeginTime"].asInt64();
- this->transSentenceText = root["transSentenceText"].asString();
- this->transSentenceIndex = root["transSentenceIndex"].asInt();
- this->transSentenceTime = root["transSentenceTime"].asInt64();
- return *this;
- }
- tagAsrInfo& operator=(const tagAsrInfo& a) {
- this->callId = a.callId;
- this->reference = a.reference;
- this->agentId = a.agentId;
- this->calledId = a.calledId;
- this->callStartTime = a.callStartTime;
- this->callerId = a.callerId;
- this->state = a.state;
- this->direction = a.direction;
- this->vocDirect = a.vocDirect;
- this->createTime = a.createTime;
- this->audioCode = a.audioCode;
- this->sentenceBeginTime = a.sentenceBeginTime;
- this->transSentenceText = a.transSentenceText;
- this->transSentenceIndex = a.transSentenceIndex;
- this->transSentenceTime = a.transSentenceTime;
- return *this;
- }
- }AsrInfo;
- //获取13位时间戳
- int64_t GetUnixTime();
- #ifdef _UNICODE
- #if defined _M_IX86
- #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
- #elif defined _M_X64
- #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
- #else
- #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
- #endif
- #endif
|