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.
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)
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: