We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Not getting menuchoice in result

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
dstevenstn
Posts: 12
Joined: Thu Feb 14, 2013 12:06 pm

Not getting menuchoice in result

Post by dstevenstn »

I am not getting the menuchoice back in the postback to the call listed below. I have been able to get this fine with other calls, but in this case the menuchoice field is empty. Can you please help?


Thu 14 Feb 2013 11:44:46 AM EST:

Call Start Event: ANII 6153300095 DNIS outbound VURL http://us.popproxy.plumgroup.com/plumvp/startpage.php
DocumentParser::FetchDocument()
Fetching Document: http://us.popproxy.plumgroup.com/plumvp/startpage.php
DocumentParser::FetchDocument(http://us.popproxy.plumgroup.com/plumvp/startpage.php)
Cache Miss: http://us.popproxy.plumgroup.com/plumvp/startpage.php
Attempting to fetch http://us.popproxy.plumgroup.com/plumvp/startpage.php
Click here to view saved VoiceXML script
Entering form = '$_internalName_105658' form item = '$_internalName_105659'
VXI::var_element(name="sessionID" expr = "session.id")
Fetching Document: startpage.php
DocumentParser::FetchDocument(startpage.php)
Cache Miss: http://us.popproxy.plumgroup.com/plumvp ... 1360855964
Attempting to fetch http://us.popproxy.plumgroup.com/plumvp ... 1360855964
Click here to view saved VoiceXML script
Entering form = '$_internalName_105661' form item = '$_internalName_105662'
VXI::var_element(name="callee_type" expr = "'voice'")
VXI::var_element(name="phone_number" expr = "'6153300095'")
VXI::var_element(name="call_id" expr = "'16067231'")
VXI::var_element(name="message_reference" expr = "'34'")
VXI::var_element(name="call_parameters" expr = "''")
VXI::var_element(name="campaign_parameters" expr = "''")
Fetching Document: https://plumivr_dev.posibill.com/ivrstart.aspx
DocumentParser::FetchDocument(https://plumivr_dev.posibill.com/ivrstart.aspx)
Posted form data is URL encoded
Attempting to fetch https://plumivr_dev.posibill.com/ivrstart.aspx


Thu 14 Feb 2013 11:44:47 AM EST:

Click here to view saved VoiceXML script
GrammarManager::CreateGrammarFromString(application/x-jsgf):
---------
<?xml version='1.0'?>
<grammar xml:lang="en-us" mode="dtmf">
1|2
</grammar>
---------
Entering form = 'mainmenu' form item = 'menuchoice'
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF VOICE"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak><voice name="julia"><speak> Smile Chad, You have an appointment with Ree Jensen on Tuesday, November 08, 2011 at 8:00 AM. Send a "1" to confirm, "2" to reschedule.XYZ Cardiology </speak></voice></speak>
---------
VXI::field_element - activating grammars for form = 'mainmenu' formitem = 'menuchoice'
VXI::do_recognition()
PromptManager::Play()
Newly queued prompts are now being played


Thu 14 Feb 2013 11:44:58 AM EST:

dtmf input: 1
Found grammar match
hypothesis #0: 1 (0.9990)
bargein set to true
INPUTMODES set to "DTMF VOICE"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak><voice name="julia"><speak> Thank you for confirming. </speak></voice></speak>
---------
Newly queued prompts are now being played


Thu 14 Feb 2013 11:45:00 AM EST:

Fetching Document: http://plumivr_dev.posibill.com//ivrresult.aspx?IVRID=34
DocumentParser::FetchDocument(http://plumivr_dev.posibill.com//ivrresult.aspx?IVRID=34)
Posted form data is multipart encoded
Attempting to fetch http://plumivr_dev.posibill.com//ivrresult.aspx?IVRID=34


Thu 14 Feb 2013 11:45:01 AM EST:

Click here to view saved VoiceXML script
Entering form = '$_internalName_105864' form item = '$_internalName_105865'
received event: connection.disconnect.hangup:
VXI::exit_element()
Call End Event
Ending session
Ending Session On Channel 88

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

Re: Not getting menuchoice in result

Post by support »

Hi,

Can you also post your code for this main menu, and also list step by step how to recreate this problem?

Thanks,
Plum Support

dstevenstn
Posts: 12
Joined: Thu Feb 14, 2013 12:06 pm

Re: Not getting menuchoice in result

Post by dstevenstn »

support wrote:Hi,

Can you also post your code for this main menu, and also list step by step how to recreate this problem?

Thanks,
Plum Support
See the vXML below. The call gets sent out and made. The person recieves the call and confirms with a 1 on the keypad. Correct response is recieved. The ivrresult.aspx gets called however the menuchoice parameter is empty. I was able to test the functionality both in our test environment and with a dummy call in the production environment.
Thanks.


XML <?xml version="1.0"?> <vxml version="2.0"> <form id="mainmenu"> <field name="menuchoice"><grammar type="application/x-jsgf" mode="dtmf"> 1|2</grammar><prompt> <voice name="julia"> Smile Chad, You have an appointment with Ree Jensen on Tuesday, November 08, 2011 at 8:00 AM. Send a "1" to confirm, "2" to reschedule.XYZ Cardiology </voice></prompt>
<filled><if cond="menuchoice=='1'"> <prompt> <voice name="julia"> Thank you for confirming. </voice></prompt> <submit next="http://plumivr_dev.posibill.com//ivrresult.aspx?IVRID=34" namelist="menuchoice" method="post" enctype="multipart/form-data"/>
<elseif cond="menuchoice=='2'" /> <prompt> <voice name="julia"> Please call our office to reschedule. </voice></prompt> <submit next="http://plumivr_dev.posibill.com//ivrresult.aspx?IVRID=34" namelist="menuchoice" method="post" enctype="multipart/form-data"/> </if></filled> </field> </form> </vxml>

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

Re: Not getting menuchoice in result

Post by support »

The reason menuchoice isn't being properly POSTed to ivrresult.aspx is because you are sending it as binary data. When you specify the <submit> enctype as "multipart/form-data", you are saying that menuchoice is binary data.

However, menuchoice is either 1 or 2, so you should send it as the default "application/x-www-form-urlencoded". For more info on the <submit> tag, please take a look here: http://www.plumvoice.com/docs/dev/voicexml:tags:submit

dstevenstn
Posts: 12
Joined: Thu Feb 14, 2013 12:06 pm

Re: Not getting menuchoice in result

Post by dstevenstn »

Interesting that wasn't an issue in testing, however I tried both of the following as well with no data posted back (one using default, the other explicit). Do I have it wrong?

XML <?xml version="1.0"?> <vxml version="2.0"> <form id="mainmenu"> <field name="menuchoice"><grammar type="application/x-jsgf" mode="dtmf"> 1|2
</grammar><prompt> <voice name="julia"> Smile Chad, You have an appointment with Ree Jensen on Tuesday, November 08, 2011 at 8:00 AM. Send a "1" to confirm, "2" to reschedule.XYZ Cardiology </voice></prompt>
<filled><if cond="menuchoice=='1'"> <prompt> <voice name="julia"> Thank you for confirming. </voice></prompt> <submit next="http://plumivr_dev.posibill.com//ivrresult.aspx?IVRID=34" namelist="menuchoice" method="post" enctype="application/x-www-form-urlencoded"/> <elseif cond="menuchoice=='2'" /> <prompt> <voice name="julia"> Please call our office to reschedule. </voice></prompt> <submit next="http://plumivr_dev.posibill.com//ivrresult.aspx?IVRID=34" namelist="menuchoice" method="post" enctype="application/x-www-form-urlencoded"/>
</if></filled> </field> </form> </vxml>

XML <?xml version="1.0"?> <vxml version="2.0">
<form id="mainmenu"> <field name="menuchoice"><grammar type="application/x-jsgf" mode="dtmf">
1|2</grammar><prompt> <voice name="julia"> Smile Chad, You have an appointment with Ree Jensen on Tuesday, November 08, 2011 at 8:00 AM. Send a "1" to confirm, "2" to reschedule.XYZ Cardiology </voice></prompt>
<filled><if cond="menuchoice=='1'"> <prompt> <voice name="julia"> Thank you for confirming. </voice></prompt> <submit next="http://plumivr_dev.posibill.com//ivrresult.aspx?IVRID=34" namelist="menuchoice" method="post" /> <elseif cond="menuchoice=='2'" /> <prompt> <voice name="julia"> Please call our office to reschedule. </voice></prompt> <submit next="http://plumivr_dev.posibill.com//ivrresult.aspx?IVRID=34" namelist="menuchoice" method="post" /> </if></filled> </field> </form> </vxml>

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

Re: Not getting menuchoice in result

Post by support »

menuchoice is sending correctly when you POST it as the default enctype or "application/x-www-form-urlencoded". How are you receiving menuchoice? We don't support .ASPX as we're a PHP shop here, but here is an example of how to receive POST variables in PHP:

Your application submitting to our test.php instead of your .ASPX:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0"> 
  <form id="mainmenu">
    <field name="menuchoice">
      <grammar type="application/x-jsgf" mode="dtmf">1|2</grammar>
      <prompt><voice name="julia">
	Smile Chad, You have an appointment with Ree Jensen on Tuesday, November 08, 2011 at 8:00 AM. 
	Send a "1" to confirm, "2" to reschedule.XYZ Cardiology
      </voice></prompt> 

      <filled>
	<if cond="menuchoice=='1'">
	  <prompt> <voice name="julia"> Thank you for confirming. </voice></prompt>
	  <submit next="test.php" namelist="menuchoice" method="post"/> 
	<elseif cond="menuchoice=='2'"/> 
	  <prompt><voice name="julia"> Please call our office to reschedule. </voice></prompt>
	  <submit next="test.php" namelist="menuchoice" method="post"/> 
	</if>
      </filled> 
    </field> 
  </form>
</vxml>
test.php

Code: Select all

<?php 
header('Content-type: text/xml'); 

if ( isset($_POST['menuchoice']) ) { 
  $menuchoice = $_POST['menuchoice']; 
}

echo "<?xml version=\"1.0\"?>\n"; 
?>

<vxml version="2.0"> 
  <form>
    <block>
      <prompt>You entered <?= $menuchoice ?> </prompt>
      <goto next="test.php"/>
    </block>
  </form>
</vxml>
As you can see, the POST is being handled by PHP, not by the VXML. So your ASP .NET is responsible for handling the POST.

dstevenstn
Posts: 12
Joined: Thu Feb 14, 2013 12:06 pm

Re: Not getting menuchoice in result

Post by dstevenstn »

Correct, I am handling the post variables, I have looped through and displayed every variable that has been posted to the page. Unfortunately I am not seeing menuchoice at all for this call. I am getting the duration, the callid and other posted variables at the end of the call, but in the post when the selection has been made I am getting no post variables.

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

Re: Not getting menuchoice in result

Post by support »

Sorry, we're unclear as to how you want your application to work. Can you share your code where you are POSTing all of your variables, including menuchoice, duration, callid, etc?

You said you are POSTing all your other variables at the end of your call, but we're assuming the sample code you shared before is not the end of your call. If you want to access menuchoice along with all your other variables at the same time, you need to POST menuchoice at the same time as all your other variables.

dstevenstn
Posts: 12
Joined: Thu Feb 14, 2013 12:06 pm

Re: Not getting menuchoice in result

Post by dstevenstn »

support wrote:Sorry, we're unclear as to how you want your application to work. Can you share your code where you are POSTing all of your variables, including menuchoice, duration, callid, etc?

You said you are POSTing all your other variables at the end of your call, but we're assuming the sample code you shared before is not the end of your call. If you want to access menuchoice along with all your other variables at the same time, you need to POST menuchoice at the same time as all your other variables.
I found a workaround, as best I can tell there was an IIS setup issue at the client site.

Post Reply