2015-11-28 5 views
6

Я новичок в voiceXML, и я пытаюсь использовать evolution.voxeo.com для запуска простых XML-кодов. Согласно their website, мы можем размещать записанный звук в многочастном формате. Итак, вот мой XML-код, который отлично работает без элемента записи. Но когда я добавляю элемент записи, я получаю ошибку. Тот факт, что я получаю ошибку, странно, потому что я получаю фактический аудиофайл на своем компьютере.voiceXML в evolution.voxeo.com, получая странную ошибку

00089  6c51 02:55:21 AM  (http://65.29.170.122/, 1): Content is not allowed in prolog. 
00090  6c51 02:55:21 AM  Exception: error.semantic XML parse error(s) occurred in: http://65.29.170.122/ (http://65.29.170.122/, 1): Content is not allowed in prolog. Dialog stack trace: State (Dialog) URL (Document) -------------- ------------------------------ ___state1 http://webhosting.voxeo.net/196324/www/favorite_color.vxml?session.callerid=dcdac2bd-fa98-4c20-9d8e-69b3080a04fd&session.accountid=196324&session.sessionid=a28b97484d31d027e5bc03b1295d6c51&session.parentsessionid=f75bf363646a3e7a993789c7915829f3&session.virtualplatform=Staging-DTMF&session.calledid=9991483369 
00091  6c51 02:55:21 AM  =========================== An error occurred while executing the following dialog. Initial URL1: http://webhosting.voxeo.net/196324/www/favorite_color.vxml Initial URL2: null Initial URL3: null Current URL: http://webhosting.voxeo.net/196324/www/favorite_color.vxml?session.callerid=dcdac2bd-fa98-4c20-9d8e-69b3080a04fd&session.accountid=196324&session.sessionid=a28b97484d31d027e5bc03b1295d6c51&session.parentsessionid=f75bf363646a3e7a993789c7915829f3&session.virtualplatform=Staging-DTMF&session.calledid=9991483369 Calling Number (ANI): dcdac2bd-fa98-4c20-9d8e-69b3080a04fd Called Number (DNIS): 9991483369 Redirecting Number (RDNIS): "" State: ___state1 VoiceXML Browser Version: 14.0.80.83348 Date/Time: 2015/11/28 2:55:21.497 VoiceException: error.badfetch Could not compile document: http://65.29.170.122/ Dialog stack trace: State (Dialog) URL (Document) -------------- ------------------------------ ___state1 http://webhosting.voxeo.net/196324/www/favorite_color.vxml?session.callerid=dcdac2bd-fa98-4c20-9d8e-69b3080a04fd&session.accountid=196324&session.sessionid=a28b97484d31d027e5bc03b1295d6c51&session.parentsessionid=f75bf363646a3e7a993789c7915829f3&session.virtualplatform=Staging-DTMF&session.calledid=9991483369 
00092  6c51 02:55:21 AM  TTS: Sorry, that content has an internal error. 
00108  6c51 02:55:24 AM  ccxmlResult=event$.values=new Object();event$.values['errorReason']="Could not compile document: http://65.29.170.122/"; 
00109  29f3 02:55:24 AM  event: DIALOG.EXIT dialog="session.dialogs['6fc2a6164b0409492ec0eb817de5d3ae']" values="new Object()" _OOB="1" _sessionid="0" _vxmlsessionid="a28b97484d31d027e5bc03b1295d6c51" conferenceid=" undefined" connectionid="309bcf33edd83917d745b2fa78113e26" delay="0s" dialogid="6fc2a6164b0409492ec0eb817de5d3ae" eventid="cdff861c55a237ae925bf56c8aa94791" eventsource="6fc2a6164b0409492ec0eb817de5d3ae" eventsourcetype="dialog" hints="" name="dialog.exit" namelist="" sendid="sendid" target="f75bf363646a3e7a993789c7915829f3" targettype="ccxml" 
00110  29f3 02:55:24 AM  matched transition at line 64 (start, dialog.exit,) @ eventhandler (, statevar) 
00111  29f3 02:55:24 AM  log: dialog failed to start! Reason=Could not compile document: http://65.29.170.122/ 
00112  6c51 02:55:24 AM  
00113  29f3 02:55:24 AM  event: DIALOG.STARTED dialog="session.dialogs['179d220aeec29f81f359f95572050990']" conferenceid=" undefined" connectionid="309bcf33edd83917d745b2fa78113e26" dialogid="179d220aeec29f81f359f95572050990" eventid="e715debbda2732f83734a89d3f53ef24" eventsource="179d220aeec29f81f359f95572050990" eventsourcetype="dialog" name="dialog.started" 
00114  29f3 02:55:24 AM  warning: event was not handled 
00115  29f3 02:55:29 AM  Call Summary: status=success direction=in calledid=9991483369 callerid=dcdac2bd-fa98-4c20-9d8e-69b3080a04fd start=2015.11.28.02.55.13.257 end=2015.11.28.02.55.29.580 duration=16322 
00116  29f3 02:55:29 AM  
00117  29f3 02:55:29 AM  event: DIALOG.EXIT dialog="session.dialogs['179d220aeec29f81f359f95572050990']" values=" undefined" conferenceid=" undefined" connectionid="309bcf33edd83917d745b2fa78113e26" dialogid="179d220aeec29f81f359f95572050990" eventid="97edfbadf5c5298f682e96fc2ddb5685" eventsource="179d220aeec29f81f359f95572050990" eventsourcetype="dialog" name="dialog.exit" 
00118  29f3 02:55:29 AM  matched transition at line 134 (vxmlerror, dialog.exit,) @ eventhandler (, statevar) 
00119  29f3 02:55:29 AM  action: EXIT _linenumber="135" expr=" undefined" namelist="" 
00121  29f3 02:55:29 AM  SESSION_END: sessionStartTime=1448679313224241 sessionEndTime=1448679329584292 sessionLength=16360 sessionID=f75bf363646a3e7a993789c7915829f3 parentSessionID=0 accountID=196324 appID=514278 

favorite_color.vxml

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN" "http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd"> 
<vxml xmlns="http://www.w3.org/2001/vxml" xmlns:bevocal="http://www.bevocal.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"> 
    <form scope="dialog"> 
     <record name="name" maxtime="5s" dtmfterm="true" beep="true"> 
      <grammar src="colors.grammar#Names"/> 
      <prompt>Whats your name?</prompt> 
      <filled> 
       <if cond="name=='amir'"> 
        <prompt>Hello <value expr="name" /> ! 
        </prompt> 
       </if> 
       <submit next="http://65.29.170.122/" method="post" enctype="multipart/form-data" /> 
      </filled> 
     </record> 
     <field name="color" modal="false"> 
      <grammar src="colors.grammar#Colors"/> 
      <prompt>Whats your favorite color?</prompt> 
      <filled> 
       <if cond="color=='blue'"> 
        <prompt>Wrong!</prompt> 
        <disconnect /> 
        <else /> 
        <prompt> 
         <value expr="color" /> 
        is fine. Good-bye. 
        </prompt> 
       </if> 
      </filled> 
     </field> 
    </form> 
</vxml> 

colors.grammar

Colors [ red green yellow blue white black ] 
Names [ amir uwm ] 

Вот Node.js/express.js/multer код, который я использую, чтобы получить записанный файл

var express = require("express"); 
var bodyParser = require("body-parser"); 
var fs = require("fs"); 
var multer = require("multer"); 
var app = express(); 
app.set("view engine", "jade"); 
app.set("views", __dirname + "/views"); 
app.post("/", multer({ 
    dest: "./uploads/", 
    rename: function (fieldname, filename) { 
     return hashCode(filename); 
    } 
})); 
app.use(bodyParser.json()); 
app.use(bodyParser.urlencoded({ 
    extended: true 
})); 

app.get("/", function (req, res) { 
    res.sendStatus(200); 
}); 

app.post("/", function (req, res) { 
    res.sendStatus(200); 
}); 

app.listen(80, function(){ 
    console.log("listening ..."); 
}); 

function hashCode(str) { 
    var hash = 0; 
    if (str.length == 0) return hash; 
    for (i = 0; i < str.length; i++) { 
     char = str.charCodeAt(i); 
     hash = ((hash << 5) - hash) + char; 
     hash = hash & hash; 
    } 
    return hash >= 0 ? hash : -1 * hash; 
} 

Вот экраны горячий моего компьютера enter image description here

+0

Я прочитал документацию и написал все коды выше примерно через 2 часа, но я застрял в этой ошибке в течение 2 дней. Так что любая помощь была бы замечательной. – Apha

ответ

2

http-ответ на submit должен быть следующим материалом VoiceXML для обработки. Я не заметил ничего в вашем контенте, который предложил ответ VoiceXML, и ошибка связана с невозможностью обработать следующий документ.

Смежные вопросы