Speech recognition google.cloud on asterisk

Hello to all.
i am working on google.platform speech recognition on asterisk for an IVR whose objective is to provide information on the covid through speech recognition instead of dialing. the first script googletts. agi script for text-to-speech is working normally but i have configured the second API for speech-to-text as it should, the speech-recog.agi script(link:link:GitHub - zaf/asterisk-speech-recog: Speech recognition script for Asterisk that uses google's speech engine.) is running but i have no speech recognition. i don’t understand anything. i don’t know if someone can help me.
by the way, i have activated the speech-recognition api on google.cloud.platform and i have created an api key that i use with a billing account.
here is the content of my extensions.conf file and the settings of the speech-reco.agi script

**extensions.conf
[internal]
exten => 015158000,1,Answer()
exten => 015158000,n,Set(WELCOME_MSG=“Bienvenue sur notre ligne d’information COVID-19.”)
exten => 015158000,n,AGI(googletts.agi,“${WELCOME_MSG} Veuillez choisir une option en prononçant le numéro correspondant.”,“fr-FR”)
exten => 015158000,n,Wait(1)
exten => 015158000,n,AGI(speech-recog.agi,fr-FR,10,3)
exten => 015158000,n,Set(option=${RECOG_RESULT})

; Vérification de l’option choisie
exten => 015158000,n,GotoIf($[${option}=${OPTIONS}]?continue,1)

; Option invalide
exten => 015158000,n,Set(INVALID_OPTION_MSG=“Je n’ai pas compris votre choix. Veuillez réessayer.”)
exten => 015158000,n,AGI(googletts.agi,“${INVALID_OPTION_MSG} ${WELCOME_MSG}”,“fr-FR”)
exten => 015158000,n,Goto(internal,015158000,1)

; Traitement de l’option choisie
[continue]
exten => 1,1,Goto(vaccine,1)
exten => 015158000,n,Goto(prevention,1)
exten => 015158000,n,Goto(treatment,1)

; Information sur le vaccin
[vaccine]
exten => 1,1,AGI(googletts.agi,“Le vaccin contre la COVID-19 est un moyen important de prévenir la maladie. Les vaccins contre la COVID-19 fonctionnent en enseignant au système immunitaire comment reconnaître et combattre le virus responsable de la COVID-19.”,“fr-FR”)
exten => 015158000,n,Goto(internal,015158000,1)

; Conseils de prévention
[prevention]
exten => 1,1,AGI(googletts.agi,“Pour vous protéger contre la COVID-19, vous devez pratiquer une bonne hygiène des mains, porter un masque facial lorsque vous êtes en public et maintenir une distance physique avec les autres. Évitez les rassemblements en personne et restez à la maison si vous êtes malade.”,“fr-FR”)
exten => 015158000,n,Goto(internal,015158000,1)

; Traitement de la COVID-19
[treatment]
exten => 1,1,AGI(googletts.agi,"Il n’existe actuellement aucun médicament spécifique approuvé pour traiter la COVID-19. Cependant, les personnes atteintes de la COVID-19 peuvent recevoir des soins de soutien pour soulager leurs symptômes. ",“fr-FR”)
exten => 015158000,n,Goto(internal,015158000,1)

***speech-recog.agi

-----------------------------

User defined parameters:

-----------------------------

Speech API key

my $key = “my API key”;

Default language

my $language = “fr-FR”;

Default max silence timeout

my $timeout = 2;

Absolute Recording timeout

my $abs_timeout = -1;

Default interrupt key

my $intkey = “#”;

Input audio sample rate

Leave blank to auto-detect

my $samplerate = “”;

Profanity filter

my $pro_filter = “false”;

Verbose debugging messages

my $debug = 0;

-----------------------------

You should learn the basis of asterisk, for instance this

exten => 015158000,n,GotoIf($[${option}=${OPTIONS}]?continue,1)

ask to go to extension continue priority 1 in internal context which doesn’t exist.

Same for [continue] and [vaccine] second and third line will never be executed in those context

Similarly, this line can never be reached. It is equivalent to

exten => 015158000,2,Goto(prevention,1)

but there is no priority 1 for extension 015158000 in the continue context. Similarly elsewhere.

Could you also, please mark up dialplan as preformatted text, as the quotation marks as shown on the forum won’t actually work.

here is the user I use in an internal context (PJSIP.conf file)
[3000]
type=auth
username=3000
password=emiemi34
auth_type=userpass

[3000]
type=aor
max_contacts=2
qualify_frequency=60

[3000]
type=endpoint
context=internal
auth=3000
aors=3000
disallow=all
allow=ulaw,alaw
transport=SIMPLETRANS

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.