" /> Genesys Google ASR integration - Genesys CTI User Forum

Author Topic: Genesys Google ASR integration  (Read 7815 times)

Offline gen_den

  • Full Member
  • ***
  • Posts: 176
  • Karma: 0
Genesys Google ASR integration
« on: March 15, 2020, 06:31:52 AM »
Advertisement
Hi Experts,

I have to do a POC for Genesys - Google ASR .
I wanted to know if it's mandatory to have  Genesys Intelligent Automation to be installed and integrated.

Also ASR voice XML can be created in Composer or I need to write VoiceXML manually for ASR ?

Thanks

Offline hsujdik

  • Hero Member
  • *****
  • Posts: 541
  • Karma: 30
Re: Genesys Google ASR integration
« Reply #1 on: March 15, 2020, 06:07:49 PM »
The vxml will be generated automatically by GIA 

Genesys says that GIA is mandatory

Offline gen_den

  • Full Member
  • ***
  • Posts: 176
  • Karma: 0
Re: Genesys Google ASR integration
« Reply #2 on: March 16, 2020, 05:27:47 AM »
Hi,

Thanks for the response. :)
So I should then follow the deployment guide of GIA


Offline hsujdik

  • Hero Member
  • *****
  • Posts: 541
  • Karma: 30
Re: Genesys Google ASR integration
« Reply #3 on: March 17, 2020, 12:30:23 AM »
Just to spare you from a little headache, there are two things that aren't on the deployment procedures for that integration:

- The configuration "DialogEngine.Provider" on GIA must be set to "SlotBucket"
- On MCP, the option "[asr].defaultengine" must be set to "nativegsr"

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Genesys Google ASR integration
« Reply #4 on: March 17, 2020, 05:41:28 PM »
You can do this also at VXML level


[quote]
[font=verdana, arial, helvetica, sans-serif] On MCP, the option "[asr].defaultengine" must be set to "nativegsr"[/font]
[/quote]



I am testing with 2 ASR engines and no GIA involved. Just to check how would I have to handle the VXML and grammars

Offline gen_den

  • Full Member
  • ***
  • Posts: 176
  • Karma: 0
Re: Genesys Google ASR integration
« Reply #5 on: March 20, 2020, 06:48:18 AM »
Guys,

I was able to integrate Google ASR and TTS with MCP using VXML , without GIA.
I tested with test  vxml provided in Genesys document and it was fine :).

followed below document :

https://docs.genesys.com/Documentation/GVP/9.0.x/GDG/CGCGC#PGSR

However I am also trying to figure out how can i create custom VXML , grammar etc. Whatever i tried so far is failing.
I am not Pro in writing VXML.

if anyone have created any VXML which I refer for Google ASR , TTS would be helpful :)

Thanks

Offline gen_den

  • Full Member
  • ***
  • Posts: 176
  • Karma: 0
Re: Genesys Google ASR integration
« Reply #6 on: March 21, 2020, 04:14:55 PM »
Guys,

I created custom  VXML and it works like a charm :). You need to incorporate below text in your VXML in order to make it work:

In VoiceXML, Google Speech-to-Text can be triggered by setting the com.genesyslab.asrengine VoiceXML property and src attribute in the <grammar> tag to match the values provisioned in the GRPC Resource Access Point:

<property name="com.genesyslab.asrengine" value="nativegsr"/>
<grammar mode="voice" xml:lang="en-US" src="builtin:grammar/transcribe" />


Do let me know if anyone needs any other info :)

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Genesys Google ASR integration
« Reply #7 on: March 21, 2020, 05:53:41 PM »
Nice [emoji41] well done
Can you share a snippet of your code?

Enviado de meu SM-N9600 usando o Tapatalk


Offline gen_den

  • Full Member
  • ***
  • Posts: 176
  • Karma: 0
Re: Genesys Google ASR integration
« Reply #8 on: March 22, 2020, 07:32:43 AM »
<?xml version="1.0" encoding="utf-8"?>
<vxml version="2.1" xml:lang="en-US"
xmlns="http://www.w3.org/2001/vxml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gvp="http://www.genesyslab.com/2006/vxml21-extension" application="../src/ComposerRoot.vxml">


<!-- VXML code generated by Composer 8.1.530.17 -->
<!-- Diagram created by Composer: Composer 8.1.530.17 -->
<!-- Project version: 8.1.530.17 -->
<!-- Diagram version: 1.0 CreatedOn:  -->
<!-- Application Author:  -->
<!-- Release Mode: false -->

<!-- Global Scripts includes -->
<script src="../include/common.js" />
<script src="../include/ctic.js" />
<script src="../include/json.js" />
<script src="../include/DataAccess.js" />

<!-- Global Vars declarations -->
<script>
var AppState = new Object();
AppState.System = new Object();
AppState.System.RetainInputTypeVariableDefaultValue = false;
AppState.CallUUID = session.connection.uuid;
AppState.ANI = getANI();
AppState.DNIS = getDNIS();
AppState.USE_LCASE_USERDATAKEY = initSystemTypeVariable('USE_LCASE_USERDATAKEY',0);
 
  if (session.connection.protocol.sip.headers != undefined &amp;&amp;
    session.connection.protocol.sip.headers['x-genesys-gvp-session-id']){
AppState.GVPSessionID = session.connection.protocol.sip.headers['x-genesys-gvp-session-id'];
} else {
AppState.GVPSessionID = 'undefined';
}
 

AppState.APP_ASR_LANGUAGE = initSystemTypeVariable('APP_ASR_LANGUAGE','en-US');
AppState.APP_LANGUAGE = initSystemTypeVariable('APP_LANGUAGE','en-US');
AppState.APP_OPM = initSystemTypeVariable('APP_OPM',eval('('+session.connection.protocol.sip.requesturi['parameters']+')'));
AppState.COMPOSER_WSSTUBBING = initSystemTypeVariable('COMPOSER_WSSTUBBING','0');
AppState.EnableFCR = initSystemTypeVariable('EnableFCR',true);
AppState.EnableReports = initSystemTypeVariable('EnableReports',false);
AppState.EnableSNMP = initSystemTypeVariable('EnableSNMP',false);
AppState.GRAMMARFILEDIR = initSystemTypeVariable('GRAMMARFILEDIR','../Resources/Grammars');
AppState.LAST_EVENT_ELEMENT = initSystemTypeVariable('LAST_EVENT_ELEMENT','undefined');
AppState.LAST_EVENT_LINE = initSystemTypeVariable('LAST_EVENT_LINE','undefined');
AppState.LAST_EVENT_MSG = initSystemTypeVariable('LAST_EVENT_MSG','undefined');
AppState.LAST_EVENT_NAME = initSystemTypeVariable('LAST_EVENT_NAME','undefined');
AppState.LAST_EVENT_URL = initSystemTypeVariable('LAST_EVENT_URL','undefined');
AppState.OCS_Record = initSystemTypeVariable('OCS_Record',getCallflowOCSRecord());
AppState.OCS_RecordURI = initSystemTypeVariable('OCS_RecordURI',getCallflowRecordURI());
AppState.OCS_URI = initSystemTypeVariable('OCS_URI',getCallflowOCSURI());
AppState.PREV_APP_ASR_LANGUAGE = initSystemTypeVariable('PREV_APP_ASR_LANGUAGE','undefined');
AppState.PREV_APP_LANGUAGE = initSystemTypeVariable('PREV_APP_LANGUAGE','undefined');
AppState.SCRIPTSDIR = initSystemTypeVariable('SCRIPTSDIR','../Scripts');
AppState.varSpeech = undefined;
AppState.VOXFILEDIR = initSystemTypeVariable('VOXFILEDIR','../Resources/Prompts');
</script>


<!-- Global Scripts -->
<script srcexpr="AppState.VOXFILEDIR + '/PromptSwitch.js'" />
<script srcexpr="AppState.VOXFILEDIR + '/de-DE/de-DE.js'" />
<script srcexpr="AppState.VOXFILEDIR + '/en-US/en-US.js'" />
<script>var f = new Format();</script>


<script srcexpr="AppState.VOXFILEDIR + '/de-DE/customprompts.js'" />
<script srcexpr="AppState.VOXFILEDIR + '/en-US/customprompts.js'" />


<!-- Global Properties declarations -->
<property name="com.genesyslab.logtoasr" value="false" /> 
<property name="com.genesyslab.loglevel" value="5" />
[b]<property name="com.genesyslab.asrengine" value="nativegsr"/>[/b]

<!-- Metadata information -->
<meta name="com.genesyslab.studio.resourcePath" content="/Callflows/TOBI_gmr.callflow"/>

<!-- Global links -->
<form>
<block>
<log expr="'Running TOBI_gmr workflow.'"/>
<log expr="'Code Generated by Composer: 8.1.530.17.'"/>
<log expr="'Diagram created/upgraded by Composer: Composer 8.1.530.17.'"/>
<log expr="'Project version: 8.1.530.17.'"/>
<log expr="'Diagram version: 1.0 CreatedOn: .'"/>
<goto next="#Entry1" />
</block>
</form>
<!-- This is the Entry block -->
<form id="Entry1">
<block name="Entry">
<goto next="#Prompt1" />
</block>
</form>

<!-- This is the Exit block -->
<form id="Exit1">
<block>
<var name="varSpeech" expr="AppState.varSpeech"/>
<exit namelist="varSpeech"/>
  </block>
</form>

<!-- This is the Prompt block -->
<form id="Prompt1">
       
               
        <script srcexpr="AppState.VOXFILEDIR + '/PromptSwitch.js'" />
        <script srcexpr="AppState.VOXFILEDIR + '/' + 'de-DE' + '/' + 'de-DE' + '.js'" />
        <block>
        <script>
            AppState.PREV_APP_LANGUAGE = AppState.APP_LANGUAGE;
            AppState.PREV_APP_ASR_LANGUAGE = AppState.APP_ASR_LANGUAGE;
            AppState.APP_LANGUAGE = 'de-DE';
            AppState.APP_ASR_LANGUAGE = 'de-DE';
        </script>
        </block>
       
       
    <block name="Prompt1P0">
  <prompt bargein="true"  gvp:langexpr="AppState.APP_LANGUAGE">
Willkommen bei Vodafone. wie kann ich dir helfen?
    </prompt>
</block>
    <block>
        <script>resetLanguage()</script>
    <goto next="#Input1" />
    </block>
</form>

<!-- This is the Input block -->
<form id="Input1">
<property name="inputmodes" value="voice" />
<property name="bargein" value="true" />
<block name="Input1P0">
  <prompt gvp:langexpr="AppState.APP_LANGUAGE">
    </prompt>
</block>


<field name="Input1Field" slot="Input1">
  [b]<grammar mode="voice" xml:lang="de-DE" src="builtin:grammar/transcribe" />[/b]
 
<property name="interdigittimeout" value="3s"/>
<property name="termchar" value="#" />
<property name="timeout" value="10s"/>
</field>
    <filled mode="all" namelist="Input1Field">
    <assign name="AppState.varSpeech" expr="Input1Field" />
    <goto next="#Exit1" />
    </filled>
<catch event="noinput" count="1">
  <throw event="com.genesyslab.composer.toomanynoinputs" message="exceeded the number of noinput retries" />
  </catch>
<catch event="nomatch" count="1">
  <throw event="com.genesyslab.composer.toomanynomatches" message="exceeded the number of nomatch retries" />
  </catch>
</form>

</vxml>

Offline gen_den

  • Full Member
  • ***
  • Posts: 176
  • Karma: 0
Re: Genesys Google ASR integration
« Reply #9 on: March 22, 2020, 07:34:49 AM »
The requirement was for German language de-DE locale.

Hope it helps..
Feel free to message me if you need more details :)

Offline hsujdik

  • Hero Member
  • *****
  • Posts: 541
  • Karma: 30
Re: Genesys Google ASR integration
« Reply #10 on: August 31, 2020, 02:49:35 PM »
Hi, gen_den... do you happen to have the configuration needed for the Resource Access Point for integration with Google Speech Engines? It seems they have been removed from Genesys' documentation

Offline gen_den

  • Full Member
  • ***
  • Posts: 176
  • Karma: 0
Re: Genesys Google ASR integration
« Reply #11 on: August 31, 2020, 03:27:12 PM »
hey,

I was able to do the integration successfully. Please do let me know if you need any help.
I Have the documentation too which have the steps.

Thanks

Offline hsujdik

  • Hero Member
  • *****
  • Posts: 541
  • Karma: 30
Re: Genesys Google ASR integration
« Reply #12 on: August 31, 2020, 03:32:45 PM »
Nice. Can you share it?

Specifically, I'm looking for the options on the Resource Access Points. I remember that an option that contains a key to use Google API needs to be created, but I don't remember the option name and it is not present on the .APD or .XML templates.

If you have the list of options, along with any documentation, that would be great. It seems that it has been removed from the official GVP docs.

Offline kirkie

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: Genesys Google ASR integration
« Reply #13 on: October 06, 2020, 06:23:20 AM »
Hi gen_den

Is it possible that you share it?
Thanks in advanced.
Greetings

Offline msd86911

  • Newbie
  • *
  • Posts: 20
  • Karma: 4
Re: Genesys Google ASR integration
« Reply #14 on: October 12, 2020, 06:20:24 PM »
It was a cheap move from Genesys to remove the Documentation but it wasn't my first time so here you go.
To enable Google TTS and ASR with Genesys you need to do the following:
[list]
[li]Download and install the latest MCP available from Genesys.[/li]
[li]Install it on server with full access to Google APIs (could be DMZ Server).[/li]
[li]Get Google credential json file for the client with TTS and ASR API access.[/li]
[li]Adjust new MCP options with attached configuration.[/li]
[li]Create 2 new applications, one for ASR VP_MCP_GRPC_ASR_900 and one for TTS VP_MCP_GRPC_TTS_900 then import options attached respectively (Template should exist in new MCP install folder).[/li]
[li]Add 2 new applications to MCP connection tab.[/li]
[li]In composer entry block add global properties
[b]com.genesyslab.ttsengine=GTTS[/b]
[b]com.genesyslab.tts.name=[i]<Your TTS Name, Could be a variable>[/i][/b]
[b]com.genesyslab.asrengine=nativegsr[/b][/li]
[li]For TTS, In any prompt block add text with interpret-As set to Text[/li]
[li]For ASR use custom vxml block attached.[/li]
[/list]
[u]Please note, this is only for testing and you need a voice bot license for production implementation.
[/u]
[b]VP_MCP_GRPC_TTS_900.cfg[/b]
[provision]
vrm.client.resource.name=GTTS
vrm.client.resource.proxy=
vrm.client.resource.type=TTS
vrm.client.resource.uri=texttospeech.googleapis.com
vrm.client.TransportProtocol=GRPC
[b]VP_MCP_GRPC_ASR_900.cfg[/b]
[provision]
vrm.client.audio.codec=mulaw
vrm.client.audio.samplerate=8000
vrm.client.grammar.expected=builtin:grammar/transcribe
vrm.client.resource.name=nativegsr
vrm.client.resource.proxy=
vrm.client.resource.type=ASR
vrm.client.resource.uri=speech.googleapis.com
vrm.client.TransportProtocol=GRPC
[b]MCP_Options.cfg[/b]
[asr]
load_once_per_call=1

[mpc]
mpc.asr.codec=pcma telephone-event

[vrm]
client.grpc.credential=[i]<Location of your credential.json>[/i]
client.modules=MRCPV1 MRCPV2 MRCP_DTMFRECOGNIZER GRPC
client.grpc.dll=$InstallationRoot$/bin/libgrpcclient.dll
client.grpc.init_worker_threads=5
client.grpc.sslroots=$InstallationRoot$/config/grpc_roots.pem

[b]Custom VXML Block.vxml[/b]
[code] <block>
<prompt bargein="true"  gvp:langexpr="AppState.APP_LANGUAGE">
<value expr="YOUR PROMPT" />
</prompt>
</block>
<field name="GoogleASRCustomFieldEN">
<grammar mode="voice" xml:lang="en-US" src="builtin:grammar/transcribe" />
<filled>
<prompt>
You said <value expr="GoogleASRCustomFieldEN" />.
</prompt>
<assign name="AppState.var_output" expr="GoogleASRCustomFieldEN" />
</filled>
</field>
<block>
<throw event="next_block" messageexpr="AppState.var_output"></throw>
</block>
<catch event="maxspeechtimeout" count="1">
<prompt bargein="true" gvp:langexpr="AppState.APP_LANGUAGE">
Data received too long, max is 15 seconds.
  </prompt>
  </catch>
  <catch event="maxspeechtimeout" count="2">
<prompt bargein="true" gvp:langexpr="AppState.APP_LANGUAGE">
Data received too long, max is 15 seconds.
  </prompt>
  </catch>
<catch event="noinput" count="1">
<prompt bargein="true" gvp:langexpr="AppState.APP_LANGUAGE">
Sorry I didn't get that.
  </prompt>
  </catch>

<catch event="noinput" count="2">
<prompt bargein="true" gvp:langexpr="AppState.APP_LANGUAGE">
Sorry I didn't get that.
  </prompt>
  </catch>
<catch event="nomatch" count="1">
<prompt bargein="true" gvp:langexpr="AppState.APP_LANGUAGE">
Nothing matched
  </prompt>
  </catch>

<catch event="nomatch" count="2">
<prompt bargein="true" gvp:langexpr="AppState.APP_LANGUAGE">
Nothing Matched
  </prompt>
  </catch>
<catch event="noinput" count="3">
  <throw event="com.genesyslab.composer.toomanynoinputs" message="exceeded the number of noinput retries" />
  </catch>
<catch event="nomatch" count="3">
  <throw event="com.genesyslab.composer.toomanynomatches" message="exceeded the number of nomatch retries" />
  </catch>
  <catch event="maxspeechtimeout" count="3">
  <throw event="com.genesyslab.composer.toomanynomatches" message="exceeded the number of maxspeechtimeout retries" />
  </catch>[/code]