Hi,
It seems you're confusing POST and GET. POST doesn't show up in the query string, it's included in the body of the message only. GET parameters are query string parameters, but to access those you use $_GET and you would also have to alter your subdialog to remove method="post" or set method="get" (this is default behavior and not necessary though). Hopefully that clears that up. We have tested the code samples we have posted above and they do work on our web servers.
Regards,
Plum Support
We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics
SMS question
Re: SMS question
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com
Re: SMS question
Hi,
Let's take a step back for a minute and cut the SMS out of the equation. You should try running these scripts on your server to determine if the issue is a server setting or a code issue.
Save the following two files in a publicly accessible web directory:
start.vxml
smsscript.php
Set your application url to point at the start.vxml script and then give it a call.
All you should hear is 'Test' and then the call should disconnect.
In your hosting account, navigate to Call Logs -> Recent Calls and click the 'view log' link for the call you just completed.
You should see two highlighted green items in your log like such:
These values represent the GET and POST arrays submitted to smsscript.php from start.vxml. If you see the same as the above, your server is configured correctly and you are receiving POST parameters and that eliminates the possibility this is a server issue. If you do not see a POST array, as above, you'll likely need to check your apache/nginx configuration, as POST may not be supported.
If all of this works, there is one possibility for what's going wrong and that's that when you call the subdialog and pass the callID parameter, you're not setting the correct method attribute. You subdialog's method attribute must match the POST/GET array you are accessing in smsscript.php.
If you are utilizing $_POST in smsscript.php to access the callID parameter, you'll need to set the method to post:
If you are utilizing $_GET in smsscript.php to access the callID parameter, you'll need to set the method to get:
Hopefully that helps.
Regards,
Plum Support
Let's take a step back for a minute and cut the SMS out of the equation. You should try running these scripts on your server to determine if the issue is a server setting or a code issue.
Save the following two files in a publicly accessible web directory:
start.vxml
Code: Select all
<?xml version="1.0"?>
<vxml version="2.1">
<var name="callID" expr="session.telephone.ani"/>
<form>
<subdialog namelist="callID" src="smsscript.php" method="post"/>
<block>
Test
</block>
</form>
</vxml>
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<form>
<block>
<log><?= var_export($_GET, true); ?></log>
<log><?= var_export($_POST, true); ?></log>
<return namelist=""/>
</block>
</form>
</vxml>
All you should hear is 'Test' and then the call should disconnect.
In your hosting account, navigate to Call Logs -> Recent Calls and click the 'view log' link for the call you just completed.
You should see two highlighted green items in your log like such:
Code: Select all
LOCAL: array ( )
LOCAL: array ( 'callID' => '6177123000', )
If all of this works, there is one possibility for what's going wrong and that's that when you call the subdialog and pass the callID parameter, you're not setting the correct method attribute. You subdialog's method attribute must match the POST/GET array you are accessing in smsscript.php.
If you are utilizing $_POST in smsscript.php to access the callID parameter, you'll need to set the method to post:
Code: Select all
<subdialog namelist="callID" src="smsscript.php" method="post"/>
Code: Select all
<subdialog namelist="callID" src="smsscript.php" method="get"/>
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com