Designing International Cisco Unified CCX VoiceXML Applications

The Cisco Unified CCX Voice Browser can generate TTS prompts and recognize speech in selected languages. In addition, the Voice Browser localizes built-in grammars such as date and time. The script automatically activates the grammar for specific languages based on the language context of the call.

For a list of built-in grammar support, see Built-in Type Implementation, of Appendix B, “VoiceXML Implementation for Cisco Voice Browser.”

You can select a language for an application in one of several ways:
  • Configure the language of the application in the Cisco Unified CCX Administration web interface. This method is the most convenient for applications that use a single language. (For more information on language configuration, see the Cisco Unified Contact Center Express Administration and Operations Guide.)

  • Use the Set Contact Info in the Cisco Unified CCX script before invoking the Voice Browser step, in order to make language information available to the script.

  • Use the xml:lang attribute on the <vxml>, <grammar>, or <prompt> element. With this method, scripts can use multiple languages.

    • To specify the language for a VoiceXML document, use the xml:lang attribute in the <vxml> element.

    • To specify the language for individual prompt or grammar, set the xml:lang attribute in the <prompt> or <grammar> element.

      The following examples illustrate the use of the xml:lang attribute.

      Example, mainmenu.vxml is a main menu that requests users to select the language, prompting users in both English and Spanish. The xml:lang attributes in the <prompt> elements specify the language to use for each prompt.

      <?xml version="1.0" encoding="UTF-8"?>
      <vxml xmlns="http://www.w3.org/2001/vxml" version="2.0">
      <form>
      <field name="language">
      <!-- read in English -->       
         <prompt xml:lang="en">
       For English, press 1.
          </prompt>
              <!-- read in Spanish -->
                 <prompt xml:lang="es-MX">
                 Para Español, oprima 2.
                    </prompt>
                    <grammar xml:lang="en-US" type="application/srgs+xml
                    version="1.0" mode="dtmf"> 
                        <rule id="choice" >
                        <one-of>
                        <item>1</item>
                        <item>2</item>
                        </one-of>
                          </rule>
                        </grammar>
                    <filled>
               <if cond="language=='1'">
            <goto next="info_en.vxml"/>
          <elseif cond="language=='2'"/>
        <goto next="info_es.vxml"/>
         </if>
        </filled>
       </field>
      </form>
      </vxml>

      In Example, if the user selects Spanish, the script executes the document info_es.vxml. The xml:lang attribute of the <vxml> element specifies the Spanish language for the entire document.

      Example info_es.vxml

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <vxml xmlns="http://www.w3.org/2001/vxml"version="2.0 "xml:lang="es-M>
      <form>
      <field name="q">
      <prompt>
      ¿Desea escuchar las noticias o el tiempo?
      </prompt>
      <grammar xml type="application/srgs+xml
      version="1.0" mode="voice">
      <rule id="choice" >
      <one-of>
      <item>las noticias</item>
      <item>el tiempo</item>
      </one-of>
      </rule>
      </grammar>
      <filled>
      <submit next=”getInfo.jsp”/>
      </filled>
      </field>
      </form>
      </vxml>
      Note

      When you create non-English XML files, you must accurately set the character encoding. XML uses Unicode (UTF-8) by default, but you can use other encoding methods. For example, many Western European language text editors use ISO-8859-1 (latin-1) encoding by default. In this case, you must set the encoding attribute of the XML declaration correctly, as shown in the example above.

      Although you may specify xml:lang in <grammar>, note that Cisco Unified CCX does not support recognition of multiple languages at the same time. If the <grammar> elements specify conflicting languages, the last one specified will take precedence.

      See Using VXML to Implement a Language Not Available in Cisco Unified CCX, page for further information.