Page 1 of 1

error.grammar.inlined

Posted: Tue Jul 14, 2009 9:40 am
by amitkhosla
Hi,
I have written a Vxml file which runs fine on one server whose TTS is AT&T Nuance 1.4 and fails in another server whose TTS is Nuance RealSpeak 4 and gives "error.grammar.inlined" error .

My Vxml Looks like this :

<?xml version="1.0"?>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<vxml version="2.0" application="<s:url action='root'/>">
<property name="inputmodes" value="voice"/>
<property name="confidencelevel" value="0.25"/>
<form id="doctors_list_frm">
<property name="timeout" value="15s"/>
<field name="contactNumber">
<grammar type="application/x-jsgf" mode="voice">
(
<c:forEach items="${doctors}" var="doctor" varStatus="index1">
<c:out value="${doctor.providerName}"/>
{<c:out value="${doctor.providerPhone}"/>} |
</c:forEach>
repeat {repeat} |
main {welcomemenu}
)
</grammar>
<prompt bargein="true">
Please say the doctors name to call.
<c:forEach items="${doctors}" var="doctor" varStatus="index1">
Doctor <c:out value="${doctor.providerName}"/>
address <c:out value="${doctor.providerAddress}"/>,
phone number <c:out value="${doctor.providerPhone}"/>
</c:forEach>
Please say repeat to repeat the list.
Please say main to return to the main menu.

</prompt>
<filled>
<if cond="contactNumber=='repeat'">
<clear namelist="contactNumber"/>
<reprompt/>
<elseif cond="contactNumber=='welcomemenu'" />
<prompt>Returning to the main menu.</prompt>
<submit next="<s:url action='welcome'/>"/>
</if>
</filled>

<noinput>
I did not hear your response. Please speak louder or try holding the phone closer to
your mouth.

<reprompt/>
</noinput>
<nomatch>
Sorry, I can not understand you. Try speaking a little slower and more clearly.
<reprompt/>
</nomatch>
</field>

<!-- transfer to doctors's phone number -->
<transfer name="connectingDoctor" destexpr="'tel:+1' + contactNumber" connecttimeout="120s" bridge="true">
<prompt>
Now calling
<prosody volume="100.0" rate="medium"><say-as type="telephone">
<value expr="contactNumber"/>
</say-as>.
</prosody>
<prosody volume="100.0" rate="default"/>
</prompt>
</transfer>
</form>
</vxml>

any help regarding this is appreciated.

Regards,

Posted: Tue Jul 14, 2009 10:18 am
by amitkhosla
Hi ,
I found whats the actual problem ,
I am getting Doctors names to be said in this Vxml.
one of the Doctors Name is "JAMES E O'MALLEY MD " this name contails a special character. because of which the xml gives error.
Now i get the Doctors name at run time, so how can i handle such kind of special characters, in this particular case its APOSTROPHE - S <'>

Invalid IVR code within script

Posted: Tue Jul 14, 2009 10:18 am
by support
Hi,

Could you please provide us with just the VXML code that you are using to produce this IVR issue?

We noticed certain lines in your IVR code such as this:

Code: Select all

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
which is not VXML.

This would help us in trying to reproduce your IVR error.

Regards,
Plum Support

Posted: Tue Jul 14, 2009 11:09 am
by amitkhosla
Hi ,
I found whats the actual problem ,
I am getting Doctors names to be said in this Vxml.
one of the Doctors Name is "JAMES E O'MALLEY MD " this name contails a special character. because of which the xml gives error.
Now i get the Doctors name at run time, so how can i handle such kind of special characters, in this particular case its APOSTROPHE - S <'>

Incorrect IVR code

Posted: Tue Jul 14, 2009 12:39 pm
by support
Hi,

Yes, the cause of your error.grammar.inlined error was a result of the apostrophe in your IVR code. So, for example, an IVR grammar like this:

Code: Select all

<grammar type="application/x-jsgf" mode="voice">
(
James O'Malley |
repeat {repeat} |
main {welcomemenu}
)
</grammar>
would cause an error.grammar.inlined message.

To fix this IVR error, you should place quotation marks around it. For an IVR example:

Code: Select all

<grammar type="application/x-jsgf" mode="voice">
(
"James O'Malley" |
repeat {repeat} |
main {welcomemenu}
)
</grammar>
Regards,
Plum Support

Posted: Fri Jul 17, 2009 3:21 pm
by amitkhosla
support wrote:Hi,

Yes, the cause of your error.grammar.inlined error was a result of the apostrophe in your code. So, for example, a grammar like this:

Code: Select all

<grammar type="application/x-jsgf" mode="voice">
(
James O'Malley |
repeat {repeat} |
main {welcomemenu}
)
</grammar>
would cause an error.grammar.inlined message.

To fix this error, you should place quotation marks around it. For example:

Code: Select all

<grammar type="application/x-jsgf" mode="voice">
(
"James O'Malley" |
repeat {repeat} |
main {welcomemenu}
)
</grammar>
Regards,
Plum Support
Hi ,
thanks for that quick help. Now is there a way to handle "&" in Vxml ?

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
<form>
	<block>
		<prompt>
			Hello, "James'O merry & harry potter" 
	    </prompt>
	    <disconnect/>
    </block>
</form>
</vxml>

Corrected IVR code

Posted: Fri Jul 17, 2009 3:27 pm
by support
Hi,

You would have to change your IVR code to the following:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
<form>
   <block>
      <prompt>
         Hello, "James'O merry & harry potter"
       </prompt>
       <disconnect/>
    </block>
</form>
</vxml> 
Hope this helps.

Regards,
Plum Support