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

SERIOUS error.badfetch

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
d.benjamin
Posts: 2
Joined: Tue Jul 23, 2013 11:17 pm

SERIOUS error.badfetch

Post by d.benjamin »

I get a 'serious error badfetch' on every call. My vxml executes and then reads the error into a caller's ear. I've tried every combination of <data> and <submit> tags, but the errors keep occurring when the data is sent to my server. I thought the problem was that I was using <submit>, but my script didn't return XML when requested, so I modified it to use the <data> tag. That didn't help. Now, I've re-written my script to echo back headers, DOCTYPE declarations, and XML, to no avail. I've got it now returning the most minimum quantity of XML, hoping it will be valid. Still no dice. I definitely need help diagnosing this. I'm stumped.

Incidentally, the back-end works flawlessly, posting call metadata and DTMF input to my handler, which, in turn parses it and inserts it into my SQL db reliably, both for actual calls, as well as simulations with my browser. It complains alot, but gets the job done. As a stop-gap, I was considering simply using the call termination to trigger the post (thus not exposing users to my error messages), but feel it's better to actually fix the problem.

Code: Select all

 (... executes great up to this point... ) <data name="datafetch" src="http://www.mysite.com/ivr/pin_handler.php" namelist="pin callback_phone cid session_id dnis" method="post"/>
        <prompt bargein="false" timeout="6000">
        Sending information to server now. <value expr="datafetch"/>
        </prompt>
        <disconnect/>
        </block>
        <catch event="connection.disconnect">
        <submit next="http://www.mysite.com/ivr/pin_handler.php" namelist="pin callback_phone cid session_id dnis" method="post" enctype="multipart/form-data"/>
        </catch>
     </form>
</vxml>
Here's the XML generated by my php script:

Code: Select all

<vxml version="2.1">
<form>
<prompt name="end" bargein="true">Thank you. Goodbye.</prompt>
</form>
</vxml>
And the call logs...

Code: Select all

errno: 205 uri http://www.mysite.com/ivr/pin_handler.php
received event: error.badfetch: 
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>
      A serious error of type </speak>
---------
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>error.badfetch</speak>
---------
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak> has occurred.  Exiting. </speak>
---------
VXI::exit_element()
starting playback: bargein=true, inputmodes="dtmf"
Newly queued prompts are now being played

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

Re: SERIOUS error.badfetch

Post by support »

Hi d.benjamin,

1. When you say your back-end works flawlessly, do you mean you use http://www.mysite.com/ivr/pin_handler.php (whatever that's a placeholder for) at earlier points of your call flow without issue?

2. What did you mean by "it complains a lot"? Please tell us the specific error messages.

3. What exactly does pin_handler.php return? Is it VXML, JSON, or something else?

4. What is the second code example? Is it pin_handler.php?

5. Are you expecting to send binary data to pin_handler.php?

Regards,
Plum Support

d.benjamin
Posts: 2
Joined: Tue Jul 23, 2013 11:17 pm

Re: SERIOUS error.badfetch

Post by d.benjamin »

1. No, Plumvoice won't read my XML. Rather, what I meant by "working flawlessly" is parts unrelated to Plumvoice. What's working is my own script's processing of the POST data sent, including two user-keyed DTMF strings, session.id, session.telephone.ani & session.telephone.dnis. My script catches the info, but I seem to be unable to return valid XML that Plumvoice will read. The moment my VXML script reaches the <submit> or <data> tag, and I get error.badfetch.

2. Serious Error of type error.badfetch. I heard a semantic error at one point, but that hasn't repeated.

3. pin_handler.php returns VXML, per the below example of what the script echoes, but only because I'm under the impression that it has to.

4. Yes. That's the code echoed by pin_handler.php (repeated below more completely).

5. Yes. I'll need to send binary data. Ultimately (once I can make the simple stuff work, I plan to <record> and submit the files along with the other POST data. Ideally, it would be nice if the same script could handle it, but if it's better to use a different one, I can do that. Is that what you're getting at?

Incidentally, the error noted below isn't accurate, since the name attribute IS set for the <form> mentioned. Unless I'm missing something.

-- Daniel

Here's pin_handler.php (first two lines are echoed from the PHP section of the file, if that matters).

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE vxml PUBLIC "-//W3C//DTD VOICEXML 2.1//EN" "http://www.w3.org/TR/2007/REC-voicexml21-20070619/vxml.dtd">
<vxml version="2.1">
    <block name="final">
        <prompt name="end" bargein="true">
        Thank you. Goodbye.
        </prompt>
    </block>
</vxml>         

Here's the error log:

Code: Select all

Thu 25 Jul 2013 10:54:07 PM EDT:
Call Start Event: ANII 9419625605 DNIS 3999 VURL http://us.popproxy.plumgroup.com/plumvp/demo.php
DocumentParser::FetchDocument()
Fetching Document: http://us.popproxy.plumgroup.com/plumvp/demo.php
DocumentParser::FetchDocument(http://us.popproxy.plumgroup.com/plumvp/demo.php)
Cache Miss: http://us.popproxy.plumgroup.com/plumvp/demo.php
Attempting to fetch http://us.popproxy.plumgroup.com/plumvp/demo.php
Loading Builtin grammar: builtin:grammar/digits
Loading Builtin grammar: builtin:dtmf/digits
Entering form = '$_internalName_1661680' form item = 'ext'
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF VOICE"
Cache Hit: http://us.popproxy.plumgroup.com/plumvp/audio/demo.wav
Audio segment from the URL audio/demo.wav added to prompt queue
VXI::field_element - activating grammars for form = '$_internalName_1661680' formitem = 'ext'
VXI::do_recognition()
PromptManager::Play()
starting playback: bargein=true, inputmodes="dtmf speech"
Newly queued prompts are now being played

Thu 25 Jul 2013 10:54:12 PM EDT:
dtmf input: 1168
Found grammar match
hypothesis #0: 1168 (0.9990)
VXI::var_element(name="session_id" expr = "session.id")
VXI::var_element(name="dnis" expr = "session.telephone.dnis")
Fetching Document: demo.php
DocumentParser::FetchDocument(demo.php)
Posted form data is URL encoded
Attempting to fetch http://us.popproxy.plumgroup.com/plumvp/demo.php
Entering form = '$_internalName_1661684' form item = '$_internalName_1661685'
Fetching Document: scratchpad.php/d.benjamin%40eshlepper.com/Test+2+%28pin_handler.php+redirects+to+local+file+end.xml%29
DocumentParser::FetchDocument(scratchpad.php/d.benjamin%40eshlepper.com/Test+2+%28pin_handler.php+redirects+to+local+file+end.xml%29)
Cache Miss: http://us.popproxy.plumgroup.com/plumvp/scratchpad.php/d.benjamin%40eshlepper.com/Test+2+%28pin_handler.php+redirects+to+local+file+end.xml%29
Attempting to fetch http://us.popproxy.plumgroup.com/plumvp/scratchpad.php/d.benjamin%40eshlepper.com/Test+2+%28pin_handler.php+redirects+to+local+file+end.xml%29

Thu 25 Jul 2013 10:54:13 PM EDT:
Loading Builtin grammar: builtin:dtmf/digits?length=12
Loading Builtin grammar: builtin:dtmf/phone
Entering form = '$_internalName_1661687' form item = 'pin'
VXI::queue_prompts()
bargein set to false
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>
                Thank you for calling. Please enter the pin code from your mail piece.
            </speak>
---------
starting playback: bargein=false, inputmodes="dtmf"
Newly queued prompts are now being played
VXI::field_element - activating grammars for form = '$_internalName_1661687' formitem = 'pin'
VXI::do_recognition()
PromptManager::Play()

Thu 25 Jul 2013 10:54:26 PM EDT:
dtmf input: 103201000715
Found grammar match
hypothesis #0: 103201000715 (0.9990)
Entering form = '$_internalName_1661687' form item = 'callback_phone'
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>
                   Please enter a good callback number for our representative to reach you.
           </speak>
---------
VXI::field_element - activating grammars for form = '$_internalName_1661687' formitem = 'callback_phone'
VXI::do_recognition()
PromptManager::Play()
starting playback: bargein=true, inputmodes="dtmf"
Newly queued prompts are now being played

Thu 25 Jul 2013 10:54:33 PM EDT:
dtmf input: 8
received event: nomatch: 
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>
                   That's not a valid phone number. Be sure to enter a full 10 digits phone number now. Please try again. 
                   </speak>
---------
Entering form = '$_internalName_1661687' form item = 'callback_phone'
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>
                   Please enter a good callback number for our representative to reach you.
           </speak>
---------
VXI::field_element - activating grammars for form = '$_internalName_1661687' formitem = 'callback_phone'
VXI::do_recognition()
PromptManager::Play()
starting playback: bargein=true, inputmodes="dtmf"
Newly queued prompts are now being played

Thu 25 Jul 2013 10:54:39 PM EDT:
dtmf input: 34562365
received event: nomatch: 
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>
                   That's not a valid phone number. Be sure to enter a full 10 digits phone number now. Please try again. 
                   </speak>
---------
Entering form = '$_internalName_1661687' form item = 'callback_phone'
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>
                   Please enter a good callback number for our representative to reach you.
           </speak>
---------
VXI::field_element - activating grammars for form = '$_internalName_1661687' formitem = 'callback_phone'
VXI::do_recognition()
PromptManager::Play()
starting playback: bargein=true, inputmodes="dtmf"
Newly queued prompts are now being played

Thu 25 Jul 2013 10:55:01 PM EDT:
dtmf input: 3107895632
Found grammar match
hypothesis #0: 3107895632 (0.9990)
Entering form = '$_internalName_1661687' form item = '$_internalName_1661688'
VXI::var_element(name="session_id" expr = "")
VXI::assign_element(name="session_id" expr = "session.id")
VXI::var_element(name="cid" expr = "")
VXI::assign_element(name="cid" expr = "session.telephone.ani")
VXI::var_element(name="dnis" expr = "")
VXI::assign_element(name="dnis" expr = "session.telephone.dnis")
Fetching Document: http://www.mysite.com/ivr/pin_handler.php
DocumentParser::FetchDocument(http://www.mysite.com/ivr/pin_handler.php)
Posted form data is URL encoded
Attempting to fetch http://www.mysite.com/ivr/pin_handler.php
[b][color=#FF0000]DocumentParser::FetchDocument - Parse error in file "http://www.mysite.com/ivr/pin_handler.php", line 5, column 22 - Attribute 'name' is not declared for element 'prompt'
errno: 205 uri http://www.mysite.com/ivr/pin_handler.php
received event: error.badfetch: [/color][/b]
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>
      A serious error of type </speak>
---------
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak>error.badfetch</speak>
---------
bargein set to true
INPUTMODES set to "DTMF"
Audio segment added to prompt queue from TTS application/synthesis+ssml for:
---------
<?xml version='1.0'?><speak> has occurred.  Exiting. </speak>
---------
VXI::exit_element()
starting playback: bargein=true, inputmodes="dtmf"
Newly queued prompts are now being played

Thu 25 Jul 2013 10:55:07 PM EDT:
Call End Event
Ending session
Ending Session On Channel 2
Last edited by d.benjamin on Fri Jul 26, 2013 1:18 pm, edited 1 time in total.

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

Re: SERIOUS error.badfetch

Post by support »

Hi,

The reason you are seeing this error within your call log:

Attempting to fetch http://www.mysite.com/ivr/pin_handler.php
DocumentParser::FetchDocument - Parse error in file "http://www.mysite.com/ivr/pin_handler.php", line 5, column 22 - Attribute 'name' is not declared for element 'prompt'
errno: 205 uri http://www.mysite.com/ivr/pin_handler.php

is because there is no "name" attribute for the <prompt> tag, as documented here: http://www.plumvoice.com/docs/dev/voicexml:tags:prompt

Also, looking at pin_handler.php, please note that you will need to add a <form> tag within the <vxml> tags and outside of your <block> tags.

Regards,
Plum Support

Post Reply