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

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: SMS question

Post by support »

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

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: SMS question

Post by support »

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

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>
smsscript.php

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

Code: Select all

LOCAL: array ( )
LOCAL: array ( 'callID' => '6177123000', )
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:

Code: Select all

<subdialog namelist="callID" src="smsscript.php" method="post"/>
If you are utilizing $_GET in smsscript.php to access the callID parameter, you'll need to set the method to get:

Code: Select all

<subdialog namelist="callID" src="smsscript.php" method="get"/>
Hopefully that helps.
Regards,
Plum Support

Post Reply