drt41563 2016-03-29 01:15
浏览 36
已采纳

VoiceXML <submit>标记在php上抛出编译错误

Long time lurker, first time asker. This task seems relatively straightforward: create a VoiceXML doc that will trigger a script to change a text document to then run a game via verbal commands.

Relevant VoiceXML:

<!--Encoding details-->
<?xml version="1.0" encoding="UTF-8" ?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml"> 

<if cond="command =='t1 go'">
   <submit next="tank.php?command=t1%20go" method="get" namelist="command"/>
</if>

There are 5 conditions total below the initial one in if/else tags. When the phone # is called it asks you to give your command, it correctly goes to the conditional branch and then states that the tank.php document "can't be compiled" and disconnects. The trick is that the text file has indeed been changed by this verbal command and the php compiles/runs fine. When I take out the 'submit' tag, the document throws no errors. For whatever reason this 'compilation error' from the php seems to be causing the voiceXML form to prematurely disconnect.

Complete php document:

<?php
    $myfile = fopen("gismoCommand.txt", "w") or die("Unable to open file!");
    $command = $_GET["command"];
    fwrite($myfile, $command);
    fclose($myfile);
?>

I've been working on this specific issue for 5 hours. Your suggestion could save my sanity.

  • 写回答

2条回答 默认 最新

  • dtng25909 2016-03-29 02:48
    关注

    Resolution!

    Voxeo (the service I'm using) offers a more thorough debugger than the vocal commands. Thank God.

    It threw me stuff like this (the exact content isn't important)

    TTS: Sorry, that content has an internal error.
    RTSP MESSAGE(o): ANNOUNCE rtsp://localhost:9974/synthesizer/ RTSP/1.0 Cseq: 11 Session: b5bdeff3d79236676847995d294d3445-9468 Content-Type: application/mrcp Content-Length: 649 SPEAK 946796007 MRCP/1.0 Kill-On-Barge-In: true Voice-Name: Allison-EnglishUS Speech-Language: en-us Vendor-Specific-Parameters: Voxeo-Resource="en-us.TTS.fc808afe12384bcb90415baee30fc0d7.Staging-Loquendo;plugin=vxttsloq7;speechLanguage=en-us;voiceName=Allison-EnglishUS;type=loquendo";Voxeo-Playback-Mode=VXML;Voxeo-Community-ID=f25af74e6f994e15ae7214ca83a2fcd9;Voxeo-Virtual-Platform=Staging-Loquendo;Voxeo-Site-ID=fc808afe12384bcb90415baee30fc0d7 Content-Type: application/synthesis+ssml Content-Length: 129 <?xml version="1.0" encoding="UTF-8"?> <speak version="1.0" xml:lang="en-us"> Sorry, that content has an internal error. </speak>
    

    What is important is that this error wasn't showing up in Postman or through PHP errors because as I expected, the php itself wasn't the problem but the way that the vxml interpreted it was. Throwing 'vxml' tags around the php script (keeping the .php ending) and the program is 100% happy and I spent almost 9 hours struggling to find a two line change.

    Hope this can help someone else, cheers!

    New PHP:

    <vxml version="2.0">
    <?php
        $myfile = fopen("gismoCommand.txt", "w") or die("Unable to open file!");
        $command = $_GET["command"];
        fwrite($myfile, $command);
        fclose($myfile);
    ?>
    </vxml>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!