vxi-discuss



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: bug in osOpenHttpUrl()



I disagree, the goto tag SHOULD work for ? and & (it works for ? with my patch right now, but not &)
 
http://www.blah.com/index.jsp?lang=spanish&client=bob  IS a valid URI and the spec says that next is a URI
 
I think my patch will send the # to the webserver, but it shouldn't affect what is happening in the code.
 
I shouldn't have to create JavaScript variables just to do a submit with a namelist
 
and I do HAVE to access a grammar with ? and &'s because with what I am working on, other things can affect the grammar besides one person on a phone.
 
 
 -----Original Message-----
From: vxi-discuss@metronomicon.com [mailto:vxi-discuss@metronomicon.com]On Behalf Of Jean-Michel Reghem
Sent: Friday, August 10, 2001 10:17 AM
To: vxi-discuss@metronomicon.com
Subject: RE: bug in osOpenHttpUrl()

Jean-Michel Reghem Úcrivait ( Friday 8/10/01 12:48 PM ) dans le message ci-dessous:
---
OK ... there are no bug ;-)) it works without your patch
there is maybe a bug in the grammar tag to fetch some particular tag with extra information, but for goto and submit, it works...
the voiceXML reference say nothing about extra uri in grammar tag...

For goto, it's normal it doesn't work with ?and &... because to submit some variable, you have to use submit instead of goto...
(see comment in openVXI code for goto_element:
/*
 * This is just like submit except:
 *  -No namelist
 *  -Can transition to internal item
 */

Goto works only with #, and it's normal openVXI don't request anchor to my apache server...
maybe it download all the document, but keep in buffer the anchor to go to the good element...

i try with this document (test15.vxml)

<?xml version="1.0" encoding="iso-8859-1"?>
<vxml version="1.0" application="appdoc.vxml">
   <property name="bargein" value="true"/>
   <form id="form0">
      <grammar src="gastro_city.lxd" type="x-earfsg"/>
      <property name="timeout" value="16666"/>
      <initial name="bypass_initial">
        <prompt bargein="true" timeout="125ms">
                Dans quel ville et quel type de restaurant recherchez-vous?
        </prompt>
        <nomatch count="1">
                Le monsieur te demande ce que tu veux manger et o¨!
        </nomatch>
        <nomatch count="2">
                okÚ, t'es lourd, je vais poser les questions une Ó une
                <assign name="bypass_initial" expr="true"/>
                <reprompt/>
        </nomatch>
        <noinput count="1">
                LÓ, tu n'as rien dit, coco.
                <reprompt/>
        </noinput>
        <noinput count="2">
                okÚ, t'es lourd, je vais poser les questions une Ó une
                <assign name="bypass_initial" expr="true"/>
                <reprompt/>
        </noinput>
      </initial>

      <field name="field0" slot="city">
        
         <prompt>Dans quel ville voulez-vous manger quelque chose?</prompt>
      </field>
      <field name="field1" slot="gastro">
         <property name="bargein" value="false"/>
         <prompt timeout="125">Quelle cuisine recherchez-vous?</prompt>
      </field>
      <filled mode="all" namelist="field0 field1">
         <prompt>
            Vous avez choisi un restaurant
            <value expr="field1"/>
            Ó
            <value expr="field0"/>
         </prompt>
         <prompt>
                Les confidence level sont <value expr="field0$.confidence"/> et <value expr="field1$.confidence"/>.
         </prompt>
        
        <goto next="test16.vxml#form2"/>
      </filled>
   </form>
</vxml>

here is test16.vxml

<?xml version="1.0" encoding="iso-8859-1"?>
<vxml version="1.0" application="appdoc.vxml">
   <form id="form0">
      <block>
      <prompt>Hello, je suis le form 0</prompt>
      <exit/>
      </block>
   </form>
   <form id="form1">
      <block>
      <prompt>Hello, je suis le form 1</prompt>
      <exit/>
      </block>
   </form>
   <form id="form2">
      <block>
      <prompt>Hello, je suis le form 2</prompt>
      <exit/>
      </block>
   </form>
</vxml>


When he process the tag goto, openVXI just download all test16.vxml (see my connect log form apache:

192.168.1.10 - - [10/Aug/2001:15:50:52 +0200] "GET /vxml/test15.vxml HTTP/1.1" 200 1839
192.168.1.10 - - [10/Aug/2001:15:50:52 +0200] "GET /vxml/appdoc.vxml HTTP/1.1" 304 -
192.168.1.10 - - [10/Aug/2001:15:50:52 +0200] "GET /vxml/gastro_city.lxd HTTP/1.1" 304 -
192.168.1.10 - - [10/Aug/2001:15:51:05 +0200] "GET /vxml/test16.vxml HTTP/1.1" 200 489

But, he go directly to form2 and say: "Hello, je suis le form2"


Then, i try submit, to submit something to my php interpretor...
first i try this with GET method:
<submit next="test16.vxml?lang=fr&machin=bidule"/> ... and i got an error...

in fact, you don't have to built yourself the extra string...
i try this:

<submit next="http://bubble/vxml/test16.vxml" namelist="field0 field1"/>

and it's working ... see my apache log:

192.168.1.10 - - [10/Aug/2001:15:21:50 +0200] "GET /vxml/test16.vxml?field0=Namur&field1=franšais HTTP/1.1" 404 329

--> openVXI built itself the extra information with ?, = and &...
it's not like html where you have to construct yourself the http request... it with the namelist tag...

if you use post instead of get...
192.168.1.10 - - [10/Aug/2001:16:05:12 +0200] "POST /vxml/test16.vxml HTTP/1.1" 405 353

And it works...(normally, pair name/value are embedded in http request with post, not in url...)


Thus, normally you don't have to patch ...
i don't know you have to access grammar with extra element...
instead of this you can do a submit to get a new document with an inline grammar for your wish...
or ask to php, asp or cgi script to build a grammar file you download after in your new document...

Could you test the submit and goto element to see if you patch don't create disfunction for these tag?

CU

Jean-Michel



John Kerwin Úcrivait ( Wednesday 8/1/01 06:49 PM ) dans le message ci-dessous:
---
Yes, it's true it don't work for goto tag...
i try this
<goto next="http://bubble/vxml/test16.vxml?lang=fr"/>

i get bad fetch (it's normal) but in my appache access log, i get http://bubble/vxml/test16.vxml and not http://bubble/vxml/test16.vxml?lang=fr

i try this:

<goto next="http://bubble/vxml/test16.vxml#lang"/>
idem than http://bubble/vxml/test16.vxml?lang=fr

i try this
<goto next="http://bubble/vxml/test16.vxml?lang=fr&truc=machin"/>
i got an error: VXI abort and return NULL
--> thus there is an error with &

i try this
<goto expr="'http://bubble/vxml/test16.vxml' + '?lang=fr' + '&truc=machin'"/>

and i got the same problem ;-))


Well it was a lot easier to fix then I thought:

i'm going to try you patch ... but (see further in the code...)


There are two parts to the fix

Part I (one change).  Concatenate the "extra information" to the end of the
querystring

  queryStringStr[0] = 0;
  addQueryStringToUrl( queryStringStr, URL_EXTRA_LENGTH, queryObj );
  printf("queryStringStr = %s\n",queryStringStr);

becomes
  queryStringStr[0] = 0;
  addQueryStringToUrl( queryStringStr, URL_EXTRA_LENGTH, queryObj );
  // change 1 or 1 -  this might not be totally correct.  Does not work
  // with anchors (i.e. grammar.jsp#dog), but why would you have these?


because anchors are important in link and goto tag ...
in voiceXML 1.0, you have to use anchors to go to a specified dialog in other document (or in the same document...)

like this:
<goto expr="(type==true) ? 'utilities.vxml#confirm' : 'utilities.vxml#bye' />


Is somebody has a solution to manage ? (and & ) and also  anchors # ???

thank you

  if (VXIstrlen(comp->lpszExtraInfo)>0 && comp->lpszExtraInfo[0]=='?')
  {
        if(VXIstrlen(queryStringStr)>0) // if not first, put in '&'
          VXIstrcat(queryStringStr,"&");
        VXIstrcat(queryStringStr,comp->lpszExtraInfo+1); // skip the '?'
  }
  printf("queryStringStr = %s\n",queryStringStr);




Part II (two changes). Use the extra data (there might NOT be a queryObj
even though there is "extra information")

  if(fetchMethod && (VXIstrcmp(fetchMethod, URL_METHOD_POST) == 0)){
    strcpy(path,comp->lpszUrlPath);
    if(queryObj)
      extra_data = queryStringStr;
    cacheFlag = URL_DO_NOT_CACHE;
  }
  else{
    if(cacheFlag == URL_DO_NOT_CACHE)
      cacheFlag = URL_DO_NOT_CACHE;
    strcpy(path,comp->lpszUrlPath);
    if(queryObj && (VXIstrlen(queryStringStr) > 0)){
      strcat(path,"?");
      strcat(path, queryStringStr);
    }
  }

becomes:
  if(fetchMethod && (VXIstrcmp(fetchMethod, URL_METHOD_POST) == 0)){
    strcpy(path,comp->lpszUrlPath);
    // CHANGE 1 OF 2
    //if(queryObj)
      extra_data = queryStringStr;
    cacheFlag = URL_DO_NOT_CACHE;
  }
  else{
    if(cacheFlag == URL_DO_NOT_CACHE)
      cacheFlag = URL_DO_NOT_CACHE;
    strcpy(path,comp->lpszUrlPath);
    // CHANGE 2 OF 2
    if(/*queryObj && */(VXIstrlen(queryStringStr) > 0)){
      strcat(path,"?");
      strcat(path, queryStringStr);
    }
  }

-----Original Message-----
From: John Kerwin [mailto:johnkerwin2001@yahoo.com]
Sent: Wednesday, August 01, 2001 6:15 PM
To: vxi-discuss@metronomicon.com
Subject: bug in osOpenHttpUrl()


osOpenHttpUrl() ignores the "extra" information that is in the url.

extra, as defined by microsoft's InternetCrackURL is
"extra information (for example, ?something or #something)"


so if I have a grammar

<grammar src="http://yahoo.com?spanish=t"/>  I only get <grammar
src="http://yahoo.com"/>

Anyone have a fix for this before I go and do it myself?


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
---
---



This page is maintained by Alan W Black (awb@cs.cmu.edu)
speechinfo.org is hosted on a machine donated by VA Linux Systems
VA Linux Systems