2015-11-28 40 views
6

Ben voiceXML'de yeni ve basit XML kodları çalıştırmak için evolution.voxeo.com kullanmaya çalışıyorum. their website'a göre, kaydedilen sesi çok parçalı formatta yayınlayabiliriz. Yani burada benim XML kodum, kayıt elemanı olmadan iyi çalışıyor. Ancak kayıt elemanını eklediğimde hata alıyorum. Hata alıyorum gerçektir, çünkü bilgisayarımda gerçek ses dosyasını alıyorum.voiceXML, evolution.voxeo.com, garip bir hata alıyorum

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

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

olduğunu node.js ben kaydedilen dosyayı almak için kullanıyorum/express.js/multer kod

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; 
} 

İşte ekranlar Bilgisayarımın sıcaklığı enter image description here

+0

Dokümantasyonu okudum ve yukarıdaki kodları yaklaşık 2 saat içinde yazdım, ancak bu hatada 2 gün boyunca takılıyorum. Yani herhangi bir yardım harika olurdu. – Apha

cevap

2

Gönderilen http yanıtı, işlenecek bir sonraki VoiceXML içeriği olmalıdır. İçeriğinizde bir VoiceXML yanıtı öneren ve bir sonraki belgenin işlenememesiyle ilgili bir hata olduğunu fark etmedim.