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

Another <goto eval="stuff"> problem

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
ej
Posts: 12
Joined: Fri Jun 18, 2004 7:54 pm

Another <goto eval="stuff"> problem

Post by ej »

I have a basic outbound app working, but I'm running into an error that I don't quite understand (and without outbound tools, session, and error logs working, I can't really see what the problem is).

I am trying to get a DTMF response back into my DB. The bit that seems to be causing trouble is my eval expression:

Code: Select all

    <var name="ob_id" expr="1" />

... (other stuff snipped)

    <filled>
      <if cond="response==1">
        <goto next="#alarm_info"/>
      <elseif cond="response==9"/>
        <goto eval="'vxml/outbound_ack.php?ob_id=' + ob_id + '&ack=1'"/>
      </if>
    </filled>
If I change that to this (where #bye is a reference to a valid form), the call proceeds without error.

Code: Select all

    <filled>
      <if cond="response==1">
        <goto next="#alarm_info"/>
      <elseif cond="response==9"/>
        <!--
        <goto eval="'vxml/outbound_ack.php?ob_id=' + ob_id + '&ack=1'"/>
        -->
        <goto next="#bye"/>
      </if>
    </filled>
If I just call my script, constructing the get parameters on the URL the same way StartVXMLURL would call it, I get back a chunk of VXML that InternetExplorer (Version 6.0.2800.1106) seems to parse correctly. This makes me feel good because I saw where it was not parsing correctly before and made some changes such that it did. So, I feel fairly confident that I have valid VXML - what's the problem with the eval value?


Thanks,
-ej

ej
Posts: 12
Joined: Fri Jun 18, 2004 7:54 pm

Post by ej »

DOH! I see the problem - needs to be expr, not eval.
I thought I copied that code from the VXML Tutorial? Did you recently correct an error there, or am I just imagining that?
It would have been useful to be able to just delete this post, but I guess I can't.

ej
Posts: 12
Joined: Fri Jun 18, 2004 7:54 pm

Post by ej »

:roll: Actually, I guess I still have some sort of problem here that I can't see. So, I changed eval to expr and my initial call script now loads and the call is placed without error. The functional part to go to the next script is like this (as above):

Code: Select all

    <var name="ob_id" expr="9" /> 

    <filled>
      <if cond="response==1">
        <goto next="#alarm_info"/>
      <elseif cond="response==9"/>
        <goto expr="'vxml/outbound_ack.php?ob_id=' + ob_id + '&ack=1'"/>
      </if>
    </filled>
However, after hitting 9, I then get an error. (Note that 1 works as expected, and 9 previously worked to jump to a prompt within the same document.)

If put my URL into your validator like so:
It says there were no errors encountered and the VXML that is generated if I just put that URL into my browser is this:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">

<form>
  <block>
    <prompt bargein="false">
    Thank you for choosing WellKeeper.
    Goodbye.
    </prompt>
  </block>
</form>

</vxml>
There doesn't seem to be much that can go wrong here, but I'm not seeing the problem. Anybody have any ideas what's wrong here :?: When can I expect a functional error log :?:

Thanks,
-ej[/code]

ej
Posts: 12
Joined: Fri Jun 18, 2004 7:54 pm

Post by ej »

:( NEVERMIND - I finally found it.

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

IVR issues due to misusing eval attribute of goto tag

Post by support »

The IVR problems you are experiencing are related to the fact that you are misusing the eval attribute of the <goto> tag.

As you have stated you are doing the following:

Code: Select all

<var name="ob_id" expr="1" />

... (other stuff snipped)

    <filled>
      <if cond="response==1">
        <goto next="#alarm_info"/>
      <elseif cond="response==9"/>
        <goto eval="'vxml/outbound_ack.php?ob_id=' + ob_id + '&ack=1'"/>
      </if>
    </filled>
However, this is not an appropriate way to submit information to a dynamic script, you should instead be using the <submit> tag:

Code: Select all

<var name="ob_id" expr="1" />

... (other stuff snipped)

    <filled>
      <if cond="response==1">
        <goto next="#alarm_info"/>
      <elseif cond="response==9"/>
        <var name="ack" expr='1'/>
        <submit next="vxml/outbound_ack.php" method="get" namelist="ob_id ack"/>
      </if>
    </filled>
The problem you are experiencing is related to the fact that goto expr is designed to allow dynamic fully qualified urls or direct linking to dynamic pages. The IVR platform is not attempting to fetch:
http://example.com/vxml/outbound_ack.php?ob_id=9&ack=1

For your expression relative to you current page the IVR platform instead tries to fetch:
http://example.com/vxml/vxml/outbound_a ... id=9&ack=1

Regarding not being able to get last call IVR logs, this feature has been around for approximately 1 week, however you have to make sure you are using the new IVR outbound account provided by your sales rep.

Hope This Helps!
The Plum Support Team :)
Last edited by support on Thu Feb 25, 2010 4:45 pm, edited 3 times in total.

ej
Posts: 12
Joined: Fri Jun 18, 2004 7:54 pm

Post by ej »

I now see the problem concerning the relative URL, thanks for helping me see that. But I'm not clear on why the way I was trying to use the expr (not eval) attribute is a misuse? I can see that the submit tag is designed for just this, and is perhaps handier, but your own VXML Tutorial (section 3.2) gives a similar example of using the expr attribute in almost the same way:

Code: Select all

<form>
  <field name="formid">
  <grammar>1|2</grammar>
     <prompt>
        Enter the form ID.
     </prompt>
     <filled>
       <goto expr="'#form'+formid"/>
     </filled>
  </field>
</form>
Is it not essentially the same thing? (The expr way does work, by the way. :wink: ) I don't see any abuse of expr in the way that I did it - it's just building a dynamic string which is the next URL to jump to. What's wrong with that?

So, regarding the logs issue, part of the problem was my own misunderstanding. My account rep had mailed me the new account info before, and I had been logging into hosting.plumgroup.com rather than murrow since first receiving that, but I was still initiating outbound calls under my old account name and wasn't aware that this was a problem because outbound calls were still being placed (and the PIN number was the same for both accounts). I changed my outbound script to use the new account name and I now see "Outbound Statistics" and "Last 10 Completed Calls" info updated,
HOWEVER...
:!: I still see no log information under either the "Session Logs" page or the "Error Logs" page :!:


:?: Am I still doing something wrong here?

Thanks,
-ej

Post Reply