以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XML在语音技术中的应用 』   (http://bbs.xml.org.cn/list.asp?boardid=47)
----  一步步实现OpenVXI (三)  (http://bbs.xml.org.cn/dispbbs.asp?boardid=47&rootid=&id=36098)


--  作者:zhu_ruixian
--  发布时间:7/26/2006 11:03:00 PM

--  一步步实现OpenVXI (三)
四.编译OpenVXI
编译inet
这个工程也按以前的步骤做就行。不过由于文件很多,改起来很繁琐。而且warning特别多,有点让人难以忍受。比较常见的警告如下:
..\myOpenVXI\inet\SBinetChannel.cpp(1117): warning C4061: 枚举“VXIinet_RESULT_BUFFER_TOO_SMALL”的 switch 中的枚举项“VXIinetResult”没有被 case 标签显式处理
OpenVXI的代码中还有一个错误,在sockstream.cpp的131行。
e:\work\myOpenVXI\inet\sockstream.cpp(131): error C2039: “Create” : 不是“SWIutilLogger”的成员。
SWIutilLogger中的确没有定义这个函数,需要自己补充上去,定义一个函数框架,然后在函数中调用构造函数即可。链接的时候需要加上下面的库文件。//后面是注释。
..\bin\value.lib     
..\bin\trd.lib
ws2_32.lib     //socket的库文件
wininet.lib     //用到VC网络相关的函数
..\bin\libeay32.lib
version.lib   //GetFileVersioninfo要用到
..\bin\ssleay32.lib
如果编译没问题,就可以生成了。这时候仍然有很多 Warning警告,大概有184处。
大部分是:warning C4061: 枚举“VXIinet_RESULT_SYSTEM_ERROR”的 switch 中的枚举项“VXIinetResult”没有被 case 标签显式处理。
还有就是:warning C4267: “return” : 从“size_t”转换到“unsigned int”,可能丢失数据 不过后面的VXI和VXIClient工程warning更多。现在已经完成了三分之二了。
编译jsi
首先建立工程,然后把OpenVXI中jsi下的文件放进工程。然后SpiderMonkey-1.5rc4\src下面有很多头文件,也把他们都放到工程 jsi目录下.然后编译更改头文件。步骤和以前的工程一样。这个实现很简单,最后用到的
库文件如下:
..\bin\js32.lib
..\bin\value.lib
..\bin\trd.lib
编译VXI
首先建立工程,然后把OpenVXI中VXI下的文件放进工程,步骤和以前的工程一样。只不过中间要使用到xerces,头文件的位置要放到编译器可以找到的地方,然后就是把库文件加入工程。也没有特别需要注意的地方。
编译VXI,最后编译通过时,大概有539个warning.
编译VXIClient
最后一个步骤。完成之后,我们就可以运行VXIclient了,然后在这个基础上上实现OpenVXI提供的接口。步骤和以前一样。
VXIClient.cpp的第1717行有个错误。ConvertInterpreterResult (0);改为
ConvertInterpreterResult (VXIinterp_RESULT_SUCCESS);
第1746行  return VXIlog_RESULT_NON_FATAL_ERROR;改为
return VXIplatform_RESULT_NON_FATAL_ERROR;
第1756行 return VXIlog_RESULT_FAILURE;改为
return VXIplatform_RESULT_FAILURE;
编译通过以后,就可以运行了。到DOS下面到bin目录,输入VXIclient.exe
E:\work\myOpenVXI\bin>VXIclient.exe

Command-line arguments :
[-v ] [-version] [-url vxmlDocURL] [-channels nbChannels] [-config configFile]
[-calls maxCalls] [-delay nbSeconds] [-sbinet]
To show version specifiy either -v or -version
To run multiple channels, set nbChannels to desired number
To take unlimited calls, set maxCalls to -1
To simulate delay between call, set nbSeconds to desired seconds
-sbinet used by Vocalocity only to indicate sbinet is passed to OSR

***ERROR***: Required argument -url is missing!

E:\work\myOpenVXI\bin>


上面就是运行结果。
E:\work\myOpenVXI\bin>VXIclient.exe -config SBclient.cfg -url http://127.0.0.1:8
080 -calls 1

Command-line arguments :
[-v ] [-version] [-url vxmlDocURL] [-channels nbChannels] [-config configFile]
[-calls maxCalls] [-delay nbSeconds] [-sbinet]
To show version specifiy either -v or -version
To run multiple channels, set nbChannels to desired number
To take unlimited calls, set maxCalls to -1
To simulate delay between call, set nbSeconds to desired seconds
-sbinet used by Vocalocity only to indicate sbinet is passed to OSR


===========================================================
vxmlDocURL: http://127.0.0.1:8080
configFile: SBclient.cfg
nbChannels: 1, maxCalls: 1, nbSeconds: 0
===========================================================

Channel 0: Waiting for Call 1
Jul 26 22:53:28.04|856|0|60001|testClient::ChannelThread|About to call VXIplatfo
rmWaitForCall
Jul 26 22:53:28.06|856|0|60001|testClient::ChannelThread|In a Call
Channel 0: In a Call
Jul 26 22:53:33.35|856|0|SEVERE|my.SBinet|217|SBinet: Open failed (internal erro
r)|URL=http://127.0.0.1:8080
Jul 26 22:53:33.35|856|0|SEVERE|my.SBinet|204|SBinet: Open error|URL=http://127.
0.0.1:8080|rc=2
Jul 26 22:53:33.35|856|0|8000|my.vxi|DocumentParser::FetchBuffer - could not ope
n URL: http://127.0.0.1:8080
Jul 26 22:53:33.35|856|0|8000|my.vxi|DocumentParser::FetchDocument - exiting wit
h error result 2
Jul 26 22:53:33.37|856|0|CRITICAL|my.vxi|203|VXIinterpreterRun: Unable to open U
RI = "???".|URL=http://127.0.0.1:8080
Jul 26 22:53:33.37|856|0|8001|my.vxi|Default error handler:  error.badfetch ,  h
ttp://127.0.0.1:8080
Jul 26 22:53:33.40|856|0|60001|testClient::ChannelThread|NULL result
Jul 26 22:53:33.40|856|0|60001|testClient::ChannelThread|Call Terminated
Channel 0: Call Terminated
Successfully exiting

E:\work\myOpenVXI\bin>

 这样OpenVXI基本就完成了。




--  作者:cqh87
--  发布时间:8/16/2010 4:25:00 PM

--  
谢谢了
--  作者:liuliang9767
--  发布时间:10/25/2010 1:44:00 PM

--  
http://www.taocaibang.com/job.php?mod=view&jid=65082
数码公社互动运营专员
ss
搜狐公司
公司类型:外资(欧美) 公司规模:500人以上 ss
发布时间 :2010-10-16 工作年限 :不限 工作方式 :全职 薪金待遇 :面议 性别要求 :不限 学历要求 :本科 招聘人数 :2 到期时间 :2010-11-15 户口要求 :无要求

W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms