Page 1 of 1

multiple voice/language when answering a call

Posted: Wed Dec 29, 2010 2:44 am
by sasa
Hi,

I'm trying to have the call answered and speak in english, then spanish then french. However it generates 500error whenever i have the 2nd <speak> tag in the xml.

it didnt work like this

Code: Select all

<vxml version = "2.0" ><property name="inputmodes" value="dtmf"/><property name="interdigittimeout" value="5s"/><form id="getInput"><field name="pin" type="digits?minlength=1;maxlength=15"><prompt><voice name="Tom">Please, enter your pin now.</voice><speak xml:lang="es-MX"><voice name="Javier">Hola!  Para el espagñol, por favor, pulse dos.<break/><break/></voice></speak>[b]<speak xml:lang="fr-CA">[/b]<voice name="Julie">Pour continuer en français, presser trois</speak></voice></prompt></field><noinput>We did not receive your request<reprompt/></noinput><noinput count="3">Sorry, I can't hear you, please try you call again later. Goodbye.<disconnect/></noinput><block><submit namelist="session.telephone.ani pin session.telephone.dnis session.id" next="vxml_plum.pl"/></block></form></vxml>
it worked like this

Code: Select all

<vxml version = "2.0" ><property name="inputmodes" value="dtmf"/><property name="interdigittimeout" value="5s"/><form id="getInput"><field name="pin" type="digits?minlength=1;maxlength=15"><prompt><voice name="Tom">Please, enter your pin now.</voice><speak xml:lang="es-MX"><voice name="Javier">Hola!  Para el espagñol, por favor, pulse dos.<break/><break/></voice></speak><voice name="Julie">Pour continuer en français, presser trois</voice></prompt></field><noinput>We did not receive your request<reprompt/></noinput><noinput count="3">Sorry, I can't hear you, please try you call again later. Goodbye.<disconnect/></noinput><block><submit namelist="session.telephone.ani pin session.telephone.dnis session.id" next="vxml_plum.pl"/></block></form></vxml>
any idea what is wrong in my code?
http://www.plumvoice.com/docs/dev/voicexml:tags:speak
http://www.plumvoice.com/docs/dev/voicexml:tags:voice

i tried
<voice xml:lang="fr_fr"> and
<speak xml:lang="fr-CA">

thank you
sasa

Re: multiple voice/language when answering a call

Posted: Wed Dec 29, 2010 9:08 am
by support
Hi sasa,

The only issue we could find with your code was that you had your </speak> and </voice> tags backwards here:

Code: Select all

<speak xml:lang="fr-CA">
	<voice name="Julie">
	  Pour continuer en français, presser trois
      </speak>
        </voice>
The correct code looks like this:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version = "2.0" >
<property name="inputmodes" value="dtmf"/>
<property name="interdigittimeout" value="5s"/>
<form id="getInput">
  <field name="pin" type="digits?minlength=1;maxlength=15">
    <prompt>
      <voice name="Tom">
	Please, enter your pin now.
      </voice>
      <speak xml:lang="es-MX">
	<voice name="Javier">
	  Hola!  Para el espagñol, por favor, pulse dos.
	  <break/><break/>
	</voice>
      </speak>
      <speak xml:lang="fr-CA">
	<voice name="Julie">
	  Pour continuer en français, presser trois
	</voice>
      </speak>
    </prompt>
  </field>
  <noinput>
    We did not receive your request
    <reprompt/>
  </noinput>
  <noinput count="3">
    Sorry, I can't hear you, please try you call again later. Goodbye.
    <disconnect/>
  </noinput>
  <block>
    <submit namelist="session.telephone.ani pin session.telephone.dnis session.id" next="vxml_plum.pl"/>
  </block>
</form>
</vxml>
We tested the above code and it worked, please let us know if you have any problems.

Regards,
Plum Support